Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoTexture3EnabledElement.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_TEXTURE3_ENABLED_ELEMENT
22#define _SO_TEXTURE3_ENABLED_ELEMENT
23
24#include <Inventor/elements/SoReplacedTextureElement.h>
25
53{
54
55 SO_ELEMENT_HEADER( SoTexture3EnabledElement );
56
57public:
63 static void set( SoState* state, SbBool value, SoNode* node = NULL );
64
69 static SbBool get( SoState* state, int unit = 0 );
70
74 static SbBool getDefault() { return FALSE; }
75
80 virtual void push( SoState* state );
81
85 virtual void pop( SoState* state, const SoElement* prevTopElement );
86
90 static void disableForShapeCache( SoState* state, int unit, bool disable );
91
95 static bool isDisabledForShapeCache( SoState* state, int unit );
96
97private:
98 // Initializes the SoTexture3EnabledElement class
99 static void initClass();
100 static void exitClass();
101
103
104private:
105
107 virtual void commonInit();
108
110 virtual void init( SoState* state );
111
112 // return texture enbale flag for the given texture unit
113 SbBool& getTexEnable( const int unit ) const;
114
115 // This stores the enable flag for each texture unit
116 typedef std::vector<SbBool> SbBoolList;
117 mutable SbBoolList m_enableList;
118
119 // Indicates for each texture init if this texture will be disable in shape cache system
120 mutable std::vector<int> m_textureDisableForShapeCache;
121};
122
123#endif /* _SO_TEXTURE3_ENABLED_ELEMENT */
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...
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 ...
virtual void push(SoState *state)
Overrides push() so we can remember previous elements value and avoid making GL calls if this element...
static SbBool getDefault()
By default there is not texture.
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 ...
static void set(SoState *state, SbBool value, SoNode *node=NULL)
Used by Texture3ImageElement, set to TRUE when a non-null image is set, set to FALSE when there is no...
static SbBool get(SoState *state, int unit=0)
Used by shapes to figure out if they need to send texture coordinates.
int SbBool
Boolean type.
Definition SbBase.h:87