// ============================================================================
// $Id: mapinfo.h,v 1.1 2003/02/20 18:30:49 havran Exp $
//
// mapinfo.h
//
// Class: CMapPointInfo 
//
// Licence and usage conditions in November 2003:
// This file can be used and modified only with written permission of
// Vlastimil Havran, Pohodli 27, 57001 Litomysl, the Czech Republic.
// This library is granted to be used by Polina Kondratieva within
// her MPI HIWI job working on BRDFLIB library. The usage condition
// may change in the next version of the library. At the moment,
// the library development is supported by Max-Planck-Institut for
// Informatik, Stuhlsatzenhausweg 85, 66123 Saarbruecken Germany
// See WWW: http://www.mpi-sb.mpg.de
// REPLACEMENT_STRING
//
// Initial coding by Vlastimil Havran, December 1999.
//
// Given to BRDFLIB project for the Polina Kondratieva's
// HIWI JOB assignment in November 2003.
// ============================================================================

#ifndef __MAPINFO_H__
#define __MAPINFO_H__

// BRDFLIB headers
#include "configh.h"
#include "mappibas.h"
#include "vector3.h"

// standard headers
//#include <cfloat>

__BEGIN_BRDFLIB_HEADER

// type for index for indexed textures
typedef float TIndex;
// type for time
typedef float TTime;

// --------------------------------------------------------------------------
// This class includes information which are necessary for access 
// to the texture values
// --------------------------------------------------------------------------
class CMapPointInfo 
{
public:
  // constructor
  CMapPointInfo():
    dimType(CMappingBase::EE_None), coord(0.0f),
    time(0.0f), d(0.0f), index(0.0f), safp(0.0) { }

  CMapPointInfo(CMappingBase::EDimType newDimType, float coorxyz = 0.0):
    dimType(newDimType), coord(coorxyz), time(0.0f), d(0.0f), index(0.0f),
    safp(0.0) { }

  // sets this info unused
  void Init() {dimType = CMappingBase::EE_None;}

  // returns if the mapInfo was set or it is unused
  bool IsSet() { return dimType != CMappingBase::EE_None; }

  // each mapping from 3D space to mapping coordinate space sets this variable
  // according to its own type (1D/2D/3D).
  CMappingBase::EDimType dimType;

  // for which parameter this mapping was set if set.
  CMappingBase::EParamType paramType;

  // coords of texture in 3D space
  CVector3D coord;

  // specifes time
  TTime  time;

  // specifes length of ray from the original ray source,
  // it is used for antialiasing
  float  d;

  // this value is used for indexed textures 
  // index determines which texture will be accessed
  TIndex index;

  // estimate of surface area in object space
  // for a single pixel footprint
  float  safp;
};

__END_BRDFLIB_HEADER

#endif // __MAPINFO_H__

