// -*- C++ -*-
#ifndef RISUNSKYOBJECT_H
#define RISUNSKYOBJECT_H
/* Copyright 1998 
 * Mon Apr 19 14:23:42 1999  Brian Smits  (bes@phoenix.cs.utah.edu)
 * 
 * RiSunSkyObject.H
 * 
 *	
 * 
 * $Id: RiSunSkyObject.H,v 1.2 1999/10/01 18:26:47 bes Exp $ 
 * 
 */
#ifndef RICOMMON_H
#include <RiCommon.H>
#endif

#ifndef RILIGHTOBJECT_H
#include <RiLightObject.H>
#endif

#ifndef RIBACKGROUND_H
#include <RiBackground.H>
#endif

#ifndef RIMEDIA_H
#include <RiMedia.H>
#endif


#ifndef RISUNSKY_H
#include <RiSunSky.H>
#endif

#ifndef RIONB3_H
#include <RiONB3.H>
#endif



/***************************************************************
CLASS
    RiSunSkyObject
     Both a light (sun) and a background (sky)

DESCRIPTION
     <Detailed description with any warnings>

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

class RiSunSkyObject : public RiLightObject, public RiBackground, public RiMedia {
  public:
				// GROUP: Constructors and assignment
				//// Constructs an RiSunSkyObject based on
				// [in] lat Latitude (0-360)
				// [in] long Longitude (-90,90) south to north
				// [in] sm  Standard Meridian
				// [in] jd  Julian Day (1-365)
				// [in] tod Time Of Day (0.0,23.99) 14.25 = 2:15PM
				// [in] turb  Turbidity (1.0,30+) 2-6 are most useful for clear days.
    RiSunSkyObject(RiReal lat, RiReal longi, int sm, int jd, RiReal tOfDay,
		   RiReal turb,bool initAtmEffects = true, bool checkVis = true);
				////
    void SetNorthAndUp(const RiVector3 &n,const RiVector3 &up);
				// GROUP: RiLightObject
				//// 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);
				// GROUP: RiBackground
				////  Sky color in a specific direction
    virtual RiSpectrum GetValue( const RiVector3 &direction ) const;
				// GROUP: RiMedia
				////  Determines the effect of the medium/media on the amount of light
				//    that makes it to receiver (origin)
    virtual RiSpectrum GetMediaEffects(const RiVector3 &origin, const RiVector3 distPnt, RiSpectrum &distantRad) const;
  private:
    ////Copy Constructor (Unimplemented)
    RiSunSkyObject(const RiSunSkyObject &);
    //// Assignment (Unimplemented)
    RiSunSkyObject &operator=(const RiSunSkyObject &);
				////
    RiSunSky    sunSky;
				////
    RiONB3      toSunSky;
				////
    bool	checkVis;
				////
    RiUnitVector3 direction;

};


#endif /* RISUNSKYOBJECT_H */

