// PhBMedium.H: PhBMedium nodes.

// This file has been generated using nodegen 0.5a.
// Restrict manual editing to the sections delimited by
// . the comments "utility includes" and "end of utility includes"
// . the comments "utility members" and "end of utility members"

#ifndef _PhBMedium_H_
#define _PhBMedium_H_

#include "xrml.H"

// utility includes
#include "complex.H"
#include "PhBSpectrum.H"
#include "vector.H"
// end of utility includes

namespace xrml {
#define PhBMediumTypeId 	"PhBMedium"
extern bool IsPhBMedium(SFNode*);

class PhBMedium: public virtual SFNode {
public:
  //
  virtual int major_version(void), minor_version(void);
  virtual bool is_leaf_class(void);
  
  PhBMedium();
  
  //
  virtual void     	render(void);
  
  // utility members
  virtual complex get_indexOfRefraction(void)
  {
    return complex(1.,0.);
  }

  // returns whether or not the medium is a light source
  virtual bool isLightSource(void)
    {
      Warning(NULL, "%s::isLightSource() not yet implemented", typeId);
      return false;
    }

  // returns whether or not the medium scatters incident 
  // light
  virtual bool isScatterer(void)
    {
      Warning(NULL, "%s::isScatterer() not yet implemented", typeId);
      return false;
    }

  virtual bool isTextured(void)
  {
    Warning(NULL, "%s::isTextured() not yet implemented", typeId);
    return false;
  }

  virtual Spectrum evaluateBSDF(const Vec3& point, 
				const Vec3& texco, const Vec3& texco3d,
				const Vec3& inDir,
				const Vec3& outDir,
				const Spectrum& inSpec,
				const complex& indexIn,
				const complex& indexOut,
				int modes, 
				float *pdf)
  {
    return Spectrum(0.);
  }

  virtual Vec3 sampleBSDF(const Vec3& point, 
			  const Vec3& texco, const Vec3& texco3d,
			  const Vec3& inDir,
			  const Spectrum& inSpec,
			  const complex& indexIn,
			  const complex& indexOut,
			  float xi1, float xi2, 
			  int modes,
			  Spectrum *value, float *pdf)
  {
    return Vec3(0., 0., 1.);
  }

  virtual Spectrum albedo(const Vec3& point, 
			  const Vec3& texco, const Vec3& texco3d,
			  const Vec3& inDir,
			  const complex& indexIn,
			  const complex& indexOut,
			  int modes)
  {
    return Spectrum(0.);
  }
  
protected:
  inline void util_init(void) { }
  inline void util_clone(const PhBMedium& src) { }
  inline void util_destruct(void) { }
};

// end of utility members
} // namespace xrml
#endif /*_PhBMedium_H_*/
