Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoTextureCubeMapEnabledElement.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-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19 =================================================================================*/
20
21#ifndef _SO_TEXTURE_CUBEMAP_ENABLED_ELEMENT
22#define _SO_TEXTURE_CUBEMAP_ENABLED_ELEMENT
23
24#include <Inventor/elements/SoReplacedTextureElement.h>
25#include <Inventor/STL/vector>
26
51{
52
53 SO_ELEMENT_HEADER( SoTextureCubeMapEnabledElement );
54
55public:
61 static void set( SoState* state, SbBool value, SoNode* node = NULL );
62
67 static SbBool get( SoState* state, int unit = 0 );
68
72 static SbBool getDefault() { return FALSE; }
73
78 virtual void push( SoState* state );
79
83 virtual void pop( SoState* state, const SoElement* prevTopElement );
84
88 static void disableForShapeCache( SoState* state, int unit, bool disable );
89
93 static bool isDisabledForShapeCache( SoState* state, int unit );
94
95private:
96 // Initializes the SoTextureCubeMapEnabledElement class
97 static void initClass();
98 static void exitClass();
99
101
102private:
103
107 virtual void commonInit();
108
110 virtual void init( SoState* state );
111
112 // Indicates for each texture unit if the textureCubeMap is enabled.
113 bool getEnableFlag(const size_t unit) const;
114
115private:
116
117 // Indicates for each texture unit if texturing is enabled.
118 mutable std::vector<SbBool> m_enable;
119
120 // Indicates for each texture init if this texture will be disable in shape cache system
121 mutable std::vector<int> m_textureDisableForShapeCache;
122};
123
124#endif /* _SO_TEXTURE_CUBEMAP_ENABLED_ELEMENT */
125
126
Abstract base class for all state elements.
Definition SoElement.h:102
Abstract base class for all database nodes.
Definition SoNode.h:145
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
Traversal state.
Definition SoState.h:74
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Enables/disables...
static void set(SoState *state, SbBool value, SoNode *node=NULL)
Used by GLTextureImageElement, set to TRUE when a non-null image is set, set to FALSE when there is n...
virtual void pop(SoState *state, const SoElement *prevTopElement)
Overrides pop() method so side effects can occur in GL.
static void disableForShapeCache(SoState *state, int unit, bool disable)
Specify that a texture unit is not used by any shape, so we don't have to invalidate cache when this ...
static SbBool getDefault()
By default there is no texture.
static SbBool get(SoState *state, int unit=0)
Used by shapes to figure out if they need to send texture coordinates.
virtual void push(SoState *state)
Overrides push() so we can remember previous elements value and avoid making GL calls if this element...
static bool isDisabledForShapeCache(SoState *state, int unit)
Return if that texture unit is not used by any shape, so we don't have to invalidate cache when this ...
int SbBool
Boolean type.
Definition SbBase.h:87