// -*- C++ -*-
#ifndef RILIGHTOBJECT_H
#define RILIGHTOBJECT_H
/* Copyright 1998 
 * Mon Sep 28 11:21:55 1998  Brian Smits  (bes@phoenix.cs.utah.edu)
 * 
 * RiLightObject.H
 * 
 *	
 * 
 * $Id: RiLightObject.H,v 1.1 1998/10/30 22:07:53 bes Exp $ 
 * 
 */
#ifndef RICOMMON_H
#include <RiCommon.H>
#endif

#ifndef RIMATERIAL_H
#include <RiMaterial.H>
#endif

#ifndef RIVECTOR2_H
#include <RiVector2.H>
#endif




class RiLightObject;
/***************************************************************
CLASS
    RiLightRegion
     Encapsulates the notion of a sample on a RiLightObject.

DESCRIPTION
     This class represents a sample on an RiLightObject.  The sample consists of all
     data needed by an RiMaterial (such as position, area, normal, UV's) as well as the irradiance
     that could hit the interested sample.

****************************************************************/

class RiLightRegion : public RiMaterialRegion {
  public:
				// GROUP: Constructors and assignment
				//// Default Constructor
    RiLightRegion();
				// GROUP: Accessors
				//// Get the Irradiance of the RiLightRegion.  This is the Irradiance
				// in the direction of the interested sample (Needs to be weighted by
				// the form factor, we need to do this for sampling reasons)
    RiSpectrum   GetIrradiance() const;
				////  Set the irradiance of the LightRegion
    void SetIrradiance(RiSpectrum irrad);
				////  Should (or is it possible) visibility be checked;
    bool	 GetCheckVisibility() const;
				////  Should (or is it possible) visibility be checked;
    void	 SetCheckVisibility(bool v);

  private:
				////
    RiSpectrum irrad;
				////
    bool checkVis;
};



/***************************************************************
CLASS
    RiLightObject
     <one line summary> 

DESCRIPTION
     <Detailed description with any warnings>

****************************************************************/

class RiLightObject {
  public:
				// GROUP: Constructors and assignment
				//// Destructor  Do nothing
    virtual ~RiLightObject() {}
				// GROUP: Members
				//// Fills in the data in sample, and returns the Form Factor weight
				//   for the sample to the interestedSample.  interestedSample is used to 
				//   direct the object so that it will hopefully pick a point visible to
				//   the intersted point, reducing variance.  Form Factor weight is
				//   FFdi,dx / p(x)  where p(x) is often the return value from GetSample
				//   The actual light arriving at interestedSample is the FFweight *
				//   the GetIrradiance() of the sample.
    virtual RiReal GetFormFactorSample(RiLightRegion &sample, const RiMaterialRegion &interestedSample, 
				       const RiVector2 &uv) = 0;
  private:
};


#endif /* RILIGHTOBJECT_H */

