Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoReplacedTextureElement.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : R. ALBOU (Sep 2003)
22**=======================================================================*/
23
24#ifndef _SO_REPLACED_TEXTURE_ELEMENT_
25#define _SO_REPLACED_TEXTURE_ELEMENT_
26
54#include <Inventor/STL/vector>
55
56#ifdef _MSC_VER
57#pragma warning( push )
58#pragma warning(disable:4251)
59#endif
60
62
64
65 public:
66
70 virtual void print(FILE *fp) const;
71
76 virtual void push(SoState *state) ;
77
78private:
79
81 virtual void commonInit();
82
86 virtual SbBool matches(const SoElement* elt) const;
87
92 virtual SoElement* copyMatchInfo() const;
93
94 private:
95 // Initializes the SoReplacedTextureElement class
96 static void initClass();
97 static void exitClass();
98
99private:
100 // Overrides SoElement::getElement() to set the nodeId of the current
101 // texture unit in the element instance before returning it.
102 // static SoElement *getElement(SoState *state, int stackIndex, SoNode *node) ;
103 static SoElement *getElement(SoState *state, SoType type, int stackIndex, SoNode *node) ;
104
108 template<typename T>
109 static T *getElement(SoState *state, int stackIndex, SoNode *node)
110 {
111 return static_cast<T*>(getElement(state, T::getClassTypeId(), stackIndex, node));
112 }
113
114 // Destructor
116
117 // Sets the id of the given node of the current texture unit
118 void setNodeId(SoState *state, const SoNode *node);
119
120 // return the nodeId for the given texture unit
121 uint64_t& getNodeId(const int unit) const;
122
123private:
124 // This stores the list of node id's as pointers associated to
125 // each texture unit.
126 typedef std::vector<uint64_t> SoNodeIdList;
127 mutable SoNodeIdList m_nodeIdList;
128};
129
130#ifdef _MSC_VER
131#pragma warning( pop )
132#endif
133
134#endif /* _SO_REPLACED_TEXTURE_ELEMENT_ */
135
136
#define SoEXTENDER_Documented
#define SO_ELEMENT_ABSTRACT_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...
virtual void push(SoState *state)
Pushes the element, copying values from previous element in state.
virtual void print(FILE *fp) const
Prints element (for debugging).
Traversal state.
Definition SoState.h:74
Stores runtime type information.
Definition SoType.h:98
int SbBool
Boolean type.
Definition SbBase.h:87