ParallelEmittance.h

Go to the documentation of this file.
00001 /* $Id:$ */
00002 
00003 #ifndef __PARALLEL_EMITTANCE_H
00004 #define __PARALLEL_EMITTANCE_H
00005 
00006 #include <esg/emittance/Emittance.h>
00007 
00008 /*
00009  * Emittance of parallel beam at infinity.
00010  */
00011 
00012 namespace esg {
00013 
00014 class ParallelEmittance : public Emittance {
00015 protected:
00016     virtual void _duplicate_attributes (const Emittance& src) {
00017         Emittance::_duplicate_attributes(src);
00018     }
00019 
00020     ParallelEmittance () {}
00021 
00022 public:
00023     ParallelEmittance (const Vector3&  dir,
00024                        const Color3f&  inten = Color3f(1,1,1))
00025         : Emittance(Vector3(0,0,0), false, dir, true, inten) {}
00026 
00027     virtual Emittance* clone () const {
00028         ParallelEmittance * pRet = new ParallelEmittance();
00029         pRet->_duplicate_attributes(*this);
00030         return pRet;
00031     }
00032 
00033     virtual bool intensity (const Vector3&   /* view point */,
00034                             Color3f&       c /* intensity  */) const
00035     {
00036         c.set(_intensity);
00037         return true;
00038     }
00039 
00040     virtual bool intensity (const Vector3&   /* emittance direction */,
00041                             float            /* emittance distance  */,
00042                             Color3f&       c /* intensity           */) const
00043     {
00044         c.set(_intensity);
00045         return true;
00046     }
00047     
00048     virtual bool stochasticEmission (Vector3& d)
00049     {
00050         d.set(_direction);
00051         return true;
00052     }
00053 };
00054     
00055 }; // namespace
00056 
00057 #endif //__PARALLEL_EMITTANCE_H

Generated on Wed Jun 28 12:24:28 2006 for esg by  doxygen 1.4.6