00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_ENVIRONMENT_ELEMENT_
00025 #define _SO_ENVIRONMENT_ELEMENT_
00026
00027 #include <Inventor/elements/SoReplacedElement.h>
00028 #include <Inventor/SbColor.h>
00029
00030
00042 SoEXTENDER_Documented class SoEnvironmentElement : public SoReplacedElement {
00043 SO_ELEMENT_HEADER(SoEnvironmentElement) ;
00044
00045 public:
00046
00048 enum FogType {
00050 NONE,
00052 HAZE,
00054 FOG,
00056 SMOKE
00057 } ;
00058
00066 struct EnvironmentParameters {
00067 EnvironmentParameters();
00068 EnvironmentParameters(float ambientIntensity, SbColor ambientColor, SbVec3f attenuation,
00069 FogType fogType, SbColor fogColor, float fogStart, float fogVisibility);
00070
00071 float ambientIntensity;
00072 SbColor ambientColor;
00073 SbVec3f attenuation;
00074 FogType fogType;
00075 SbColor fogColor;
00076 float fogStart;
00077 float fogVisibility;
00078 };
00079
00080
00081 #if 1 SoDEPRECATED
00086 static void set(SoState *state, SoNode *node,
00087 float ambientIntensity, const SbColor &ambientColor,
00088 const SbVec3f attenuation, FogType fogType, const
00089 SbColor fogColor, float fogVisibility);
00090 SoDEPRECATED
00095 static void get(SoState *state, float &ambientIntensity,
00096 SbColor &ambientColor, SbVec3f &attenuation,
00097 FogType &fogType, SbColor &fogColor, float &fogVisibility);
00098 SoDEPRECATED
00103 static void getDefault(float &ambientIntensity, SbColor &ambientColor, SbVec3f &attenuation,
00104 FogType &fogType, SbColor &fogColor, float &fogVisibility);
00105 #endif
00110 static void set(SoState *state, SoNode *node, const EnvironmentParameters& envParams) ;
00111
00115 static void get(SoState *state, EnvironmentParameters& envParams) ;
00116
00120 static float getAmbientIntensity(SoState *state) ;
00124 static const SbColor& getAmbientColor(SoState *state) ;
00128 static const SbVec3f& getLightAttenuation(SoState *state) ;
00129
00130
00131
00132 virtual void push(SoState *state) ;
00133
00134 private:
00135
00137 virtual void init(SoState *state);
00138
00140 virtual SbBool matches(const SoElement* elt) const;
00141
00143 virtual SoElement* copyMatchInfo() const;
00144
00145 private:
00146
00147
00148 static void initClass() ;
00149 static void exitClass() ;
00150
00151 private:
00152 float m_ambientIntensity ;
00153 SbColor m_ambientColor ;
00154 SbVec3f m_attenuation ;
00155 FogType m_fogType ;
00156 SbColor m_fogColor ;
00157 float m_fogStart ;
00158 float m_fogVisibility ;
00159
00160 #if 1
00161 virtual void setElt(float ambientIntensity, const SbColor &ambientColor,
00162 const SbVec3f attenuation, FogType fogType, const
00163 SbColor fogColor, float fogVisibility);
00164 #endif
00166 virtual void setElt(const EnvironmentParameters& envParams) ;
00167
00168 virtual ~SoEnvironmentElement() ;
00169
00170 } ;
00171
00172
00173
00174 #endif // _SO_ENVIRONMENT_ELEMENT_
00175
00176
00177