PhotonTracing.h

Go to the documentation of this file.
00001 /* $Id:$ */
00002 
00003 #ifndef __PHOTON_TRACING_H
00004 #define __PHOTON_TRACING_H
00005 
00006 #include <gra/reflection/PathTracing.h>
00007 #include <esg/energy/PhotonMap.h>
00008 #include <gra/scene/Scene.h>
00009 
00010 /*
00011  * Traces photon from its first point of impact. Energy of photon falled on
00012  * diffuse surface is stored in the scene for later photon maps creation.
00013  */
00014 
00015 using namespace esg;
00016 
00017 namespace gra {
00018 
00019 class GRA_EXPORT PhotonTracing : public PathTracing {
00020 protected:
00021             void _store_photon (PointEnv&, bool);
00022     virtual void _illuminate   (PointEnv&, unsigned, bool, Color3f&);
00023     
00024 public:
00025     PhotonTracing (Intersector * i = NULL,
00026                    unsigned      d = 1,   /* Max depth of recursion */
00027                    float         w = .001 /* Minimal photon energy  */)
00028         : PathTracing(NULL, Color3f(0.,0.,0.), i, d, w, REFR_AIR, 1) {}
00029 
00030     /*
00031      * Required input parametters:
00032      *   PointEnv.intersection()    = first impact point of the photon (PoI)
00033      *   PointEnv.visitableObject() = object with PoI
00034      *   PointEnv.normal()          = surface normal at PoI
00035      *   PointEnv.energy()          = power of photon
00036      *   PointEnv.viewerDir()       = direction to the photon emission location
00037      *  [PointEnv.trMat             = possible transformation ]
00038      */
00039     virtual Color3f* illuminatePoint(PointEnv & /* point of interest */);
00040 };
00041     
00042 } // namespace
00043 
00044 #endif // __PHOTON_TRACING_H

Generated on Tue Nov 21 15:11:42 2006 for gra by  doxygen 1.4.6