Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoTextureCombinerElement.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24
25#ifndef _SO_TEXTURE_COMBINER_ELEMENT
26#define _SO_TEXTURE_COMBINER_ELEMENT
27
28#include <Inventor/elements/SoReplacedTextureElement.h>
29#include <Inventor/SbVec.h>
30#include <Inventor/STL/vector>
31
44SoEXTENDER_Documented class SoTextureCombinerElement : public SoReplacedTextureElement {
45
46 SO_ELEMENT_HEADER(SoTextureCombinerElement);
47
48 public:
49
54 static void set(SoState *state, SoNode *node,
55 int _combineRGB, int _combineAlpha,
56 int _source0RGB, int _source1RGB, int _source2RGB,
57 int _source0Alpha, int _source1Alpha, int _source2Alpha,
58 int _operand0RGB, int _operand1RGB, int _operand2RGB,
59 int _operand0Alpha, int _operand1Alpha, int _operand2Alpha,
60 float _scaleRGB, float _scaleAlpha,
61 const SbVec4f &constantColor);
62
67 virtual void push(SoState *state);
68
69private:
70
72 virtual void commonInit();
73
75 virtual void init(SoState *state);
76
77 private:
78 // Initializes the SoTextureCombinerElement class
79 static void initClass();
80 static void exitClass();
81
82 private:
83 // Virtual set methods that subclasses can override.
84 virtual void setElt(int _combineRGB, int _combineAlpha,
85 int _source0RGB, int _source1RGB, int _source2RGB,
86 int _source0Alpha, int _source1Alpha, int _source2Alpha,
87 int _operand0RGB, int _operand1RGB, int _operand2RGB,
88 int _operand0Alpha, int _operand1Alpha, int _operand2Alpha,
89 float _scaleRGB, float _scaleAlpha,
90 const SbVec4f &_constantColor, int unit=0);
91
93
94 struct SoTexCombineData {
95 SoTexCombineData()
96 :combineRGB(0),combineAlpha(0),
97 source0RGB(0),source1RGB(0),source2RGB(0),
98 source0Alpha(0),source1Alpha(0),source2Alpha(0),
99 operand0RGB(0),operand1RGB(0),operand2RGB(0),
100 operand0Alpha(0),operand1Alpha(0),operand2Alpha(0),
101 scaleRGB(0),scaleAlpha(0),constantColor(0,0,0,0)
102 {};
103
104 SoTexCombineData& operator=(const SoTexCombineData &data)
105 {
106 combineRGB =data.combineRGB;
107 combineAlpha = data.combineAlpha;
108 source0RGB =data.source0RGB;
109 source1RGB =data.source1RGB;
110 source2RGB =data.source2RGB;
111 source0Alpha =data.source0Alpha;
112 source1Alpha =data.source1Alpha;
113 source2Alpha =data.source2Alpha;
114 operand0RGB =data.operand0RGB;
115 operand1RGB =data.operand1RGB;
116 operand2RGB =data.operand2RGB;
117 operand0Alpha =data.operand0Alpha;
118 operand1Alpha =data.operand1Alpha;
119 operand2Alpha =data.operand2Alpha;
120 scaleRGB =data.scaleRGB;
121 scaleAlpha =data.scaleAlpha;
122 constantColor =data.constantColor;
123 return *this ;
124 }
125
126 //members
127 int combineRGB;
128 int combineAlpha;
129 int source0RGB;
130 int source1RGB;
131 int source2RGB;
132 int source0Alpha;
133 int source1Alpha;
134 int source2Alpha;
135 int operand0RGB;
136 int operand1RGB;
137 int operand2RGB;
138 int operand0Alpha;
139 int operand1Alpha;
140 int operand2Alpha;
141 float scaleRGB;
142 float scaleAlpha;
143 SbVec4f constantColor;
144
145 } ;
146
147 SoTexCombineData& getCombinerData(const size_t unit) const;
148
149private:
150 mutable std::vector<SoTexCombineData> m_texCombineData;
151};
152
153#endif /* _SO_TEXTURE_COMBINER_ELEMENT */
154
4D vector class.
Definition SbVec.h:2214
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> Stores the curre...
static void set(SoState *state, SoNode *node, int _combineRGB, int _combineAlpha, int _source0RGB, int _source1RGB, int _source2RGB, int _source0Alpha, int _source1Alpha, int _source2Alpha, int _operand0RGB, int _operand1RGB, int _operand2RGB, int _operand0Alpha, int _operand1Alpha, int _operand2Alpha, float _scaleRGB, float _scaleAlpha, const SbVec4f &constantColor)
Sets the current texture combiner parameters in the state.
virtual void push(SoState *state)
Push copies the values from the previous element, so set doesn't have to set them if they are set AS_...