Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoEnvironmentElement.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2019 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : R. ALBOU (Feb 1997)
22**=======================================================================*/
23
24#ifndef _SO_ENVIRONMENT_ELEMENT_
25#define _SO_ENVIRONMENT_ELEMENT_
26/* include files */
27#include <Inventor/elements/SoReplacedElement.h>
28#include <Inventor/SbColor.h>
29
30/*----------------------------------------------------------------------------*/
42SoEXTENDER_Documented class SoEnvironmentElement : public SoReplacedElement {
43 SO_ELEMENT_HEADER(SoEnvironmentElement) ;
44
45 public:
46
58
78
82 static void set(SoState *state, SoNode *node, const EnvironmentParameters& envParams) ;
83
87 static void get(SoState *state, EnvironmentParameters& envParams) ;
88
92 static float getAmbientIntensity(SoState *state) ;
93
97 static const SbColor& getAmbientColor(SoState *state) ;
98
102 static const SbVec3f& getLightAttenuation(SoState *state) ;
103
107 static const SbBool& getAmbientOcclusion(SoState *state);
108
109 // Push copies the values from the previous element
110 virtual void push(SoState *state) ;
111
112private:
113
115 virtual void init(SoState *state);
116
118 virtual SbBool matches(const SoElement* elt) const;
119
121 virtual SoElement* copyMatchInfo() const;
122
123 private:
124
125 // Initializes the SoEnvironmentElement class
126 static void initClass() ;
127 static void exitClass() ;
128
129private:
130 float m_ambientIntensity ;
131 SbColor m_ambientColor ;
132 SbVec3f m_attenuation ;
133 SbBool m_ambientOcclusion;
134 FogType m_fogType ;
135 SbColor m_fogColor ;
136 float m_fogStart ;
137 float m_fogVisibility ;
138
139 virtual void setElt(const EnvironmentParameters& envParams) ;
140
141 virtual ~SoEnvironmentElement() ;
142
143} ;
144
145/*----------------------------------------------------------------------------*/
146
147#endif // _SO_ENVIRONMENT_ELEMENT_
148
149
Color vector class.
Definition SbColor.h:82
3D vector class.
Definition SbVec.h:932
Abstract base class for all state elements.
Definition SoElement.h:102
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Stores the curre...
static float getAmbientIntensity(SoState *state)
Gets the ambient intensity.
virtual void push(SoState *state)
Pushes element.
static void set(SoState *state, SoNode *node, const EnvironmentParameters &envParams)
Sets the current environment in the state.
static void get(SoState *state, EnvironmentParameters &envParams)
Gets the current environment in the state.
static const SbColor & getAmbientColor(SoState *state)
Gets the ambient color.
static const SbVec3f & getLightAttenuation(SoState *state)
Gets the light attenuation.
static const SbBool & getAmbientOcclusion(SoState *state)
Gets the ambient occlusion state (TRUE : activated, otherwise deactivated)
Abstract base class for all database nodes.
Definition SoNode.h:145
Abstract base class for each state element whose value is replaced whenever it is set.
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87
EnvironmentParameters packages all the different environment parameters.