Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoTextureEnabledElement.h
Go to the documentation of this file.
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_ENABLED_ELEMENT
22#define _SO_TEXTURE_ENABLED_ELEMENT
23
25#include <Inventor/STL/vector>
26
55{
56
58
59public:
65 static void set( SoState* state, SbBool value, SoNode *node = NULL );
66
71 static SbBool get( SoState* state, int unit = 0 );
72
76 static SbBool getDefault() { return FALSE; }
77
82 virtual void push( SoState* state );
83
87 virtual void pop( SoState* state, const SoElement* prevTopElement );
88
92 static void disableForShapeCache( SoState* state, int unit, bool disable );
93
97 static bool isDisabledForShapeCache( SoState* state, int unit );
98
99private:
100 // Initializes the SoTextureEnabledElement class
101 static void initClass();
102 static void exitClass();
103
104 virtual ~SoTextureEnabledElement();
105
106private:
107
109 virtual void commonInit();
110
112 virtual void init( SoState* state );
113
114 bool isEnabled( int unit ) const;
115
116 void setEnabled( int unit, bool enabled );
117
118 typedef std::vector<bool> SoTextureUnitEnabledList;
119
120 // Indicates for each texture unit if texturing is enabled.
121 mutable SoTextureUnitEnabledList m_isEnabled;
122
123 // Indicates for each texture init if this texture will be disable in shape cache system
124 mutable std::vector<int> m_textureDisableForShapeCache;
125};
126
127#endif /* _SO_TEXTURE_ENABLED_ELEMENT */
#define FALSE
Possible value of SbBool.
Definition SbBase.h:75
virtual void disable(QWidget *w, XtEventHandler f, XtPointer data)
static void init()
#define SO_ELEMENT_HEADER(className)
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
Enables/disables textures.
virtual void pop(SoState *state, const SoElement *prevTopElement)
Overrides pop() method so side effects can occur in GL.
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...
static SbBool get(SoState *state, int unit=0)
Used by shapes to figure out if they need to send texture coordinates.
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 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 ...
virtual void push(SoState *state)
Overrides push() so we can remember previous element's value and avoid making GL calls if this elemen...
static SbBool getDefault()
By default there is no texture.
int SbBool
Boolean type.
Definition SbBase.h:87