00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef _OSGLIGHT_H_
00041 #define _OSGLIGHT_H_
00042 #ifdef __sgi
00043 #pragma once
00044 #endif
00045
00046 #include <OSGConfig.h>
00047 #include <OSGLightBase.h>
00048 #include <OSGNodePtr.h>
00049 #include <OSGAction.h>
00050 #include <OSGLightChunk.h>
00051
00052 OSG_BEGIN_NAMESPACE
00053
00058 class OSG_SYSTEMLIB_DLLMAPPING Light : public LightBase
00059 {
00060
00061 public:
00062
00063
00067 void setAmbient ( Real32 rRed,
00068 Real32 rGreen,
00069 Real32 rBlue,
00070 Real32 rAlpha);
00071 void setDiffuse ( Real32 rRed,
00072 Real32 rGreen,
00073 Real32 rBlue,
00074 Real32 rAlpha);
00075 void setSpecular( Real32 rRed,
00076 Real32 rGreen,
00077 Real32 rBlue,
00078 Real32 rAlpha);
00079
00080 void setAmbient (const Color4f &col);
00081 void setDiffuse (const Color4f &col);
00082 void setSpecular(const Color4f &col);
00083
00084 enum
00085 {
00086 CAST_SHADOW_AUTO = 0,
00087 CAST_SHADOW_ON = 1,
00088 CAST_SHADOW_OFF = 2
00089 };
00090
00092
00096 LightChunkPtr getChunk (void);
00097 virtual void makeChunk(void);
00098
00100
00104 virtual void changed(BitVector whichField,
00105 UInt32 origin );
00106
00108
00112 virtual void dump( UInt32 uiIndent = 0,
00113 const BitVector bvFlags = 0) const;
00114
00116
00117 protected:
00118
00119 typedef LightBase Inherited;
00120
00121 LightChunkPtr _pChunk;
00122
00123
00127 Light(void);
00128 Light(const Light &source);
00129
00131
00135 virtual ~Light(void);
00136
00138
00142
00143 Action::ResultE drawEnter (Action *action);
00144 Action::ResultE drawLeave (Action *action);
00145
00146
00147 Action::ResultE renderEnter(Action *action);
00148 Action::ResultE renderLeave(Action *action);
00149
00151
00152 private:
00153
00154 friend class FieldContainer;
00155 friend class LightBase;
00156
00157 static void initMethod( void );
00158
00160 void operator =(const Light &source);
00161 };
00162
00163 OSG_END_NAMESPACE
00164
00165 #include <OSGLightBase.inl>
00166 #include <OSGLight.inl>
00167
00168 #define OSGLIGHT_HEADER_CVSID "@(#)$Id: $"
00169
00170 #endif