Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SoMFUniformShaderParameter.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-2023 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef _SO_MF_UNIFORM_SHADER_PARAMETER_
25#define _SO_MF_UNIFORM_SHADER_PARAMETER_
26
27#include <Inventor/fields/SoSubField.h>
28#include <Inventor/nodes/SoShaderParameter.h>
29
72
73 SO_MFIELD_REQUIRED_HEADER(SoMFUniformShaderParameter);
74 SO_MFIELD_CONSTRUCTOR_HEADER(SoMFUniformShaderParameter);
76 SO_MFIELD_SETVALUESPOINTER_HEADER(SoUniformShaderParameter *);
77
84
90 void insertShaderParameter(SoUniformShaderParameter *shaderParameter, int newUniformShaderParameterIndex);
91
97
101 int findShaderParameter(const SoUniformShaderParameter *shaderParameter) const;
102
107
112
119 void removeShaderParameter(int index);
120
128
135
142
147 void replaceShaderParameter(int index, SoUniformShaderParameter *newUniformShaderParameter);
148
152 void replaceShaderParameter(SoUniformShaderParameter *oldUniformShaderParameter,
153 SoUniformShaderParameter *newUniformShaderParameter)
154 { replaceShaderParameter(findShaderParameter(oldUniformShaderParameter), newUniformShaderParameter); }
155
167
170
171 private:
172 static void initClass();
173 static void exitClass();
174
175 // Update a copied field to use the copy of each uniform shader parameter if there is one
176 virtual void fixCopy(SbBool copyConnections);
177
178 // Override this to also check the stored uniform shader parameters
179 virtual SbBool referencesCopy() const;
180
181private:
182 // Override this to maintain write-references in uniform shader parameters
183 virtual void countWriteRefs(SoOutput *out) const;
184
185 // Changes value in field without doing other notification stuff.
186 // Keeps track of references and auditors.
187 void setVal(int index, SoUniformShaderParameter *newValue);
188
192 static bool hasGivenName(SbString name, const SoShaderParameter* param);
193
194 SoUniformShaderParameter** m_oldValues;
195 int m_oldNum;
196};
197
198#endif /* _SO_MF_UNIFORM_SHADER_PARAMETER_ */
199
Class for smart character strings.
Definition SbString.h:202
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Multiple-value f...
void replaceShaderParameter(SoUniformShaderParameter *oldUniformShaderParameter, SoUniformShaderParameter *newUniformShaderParameter)
Replaces first instance of given uniform shader parameter with new uniform shader parameter.
void removeShaderParameter(int index)
Removes uniform shader parameter with given index from group.
SoUniformShaderParameter * getShaderParameter(int index) const
Returns the n'th uniform shader parameter node.
int getNumShaderParameters() const
Returns number of uniform shader parameters.
void removeShaderParameter(const SbString &name)
Removes first instance of given uniform shader parameter with given name from group.
void removeShaderParameter(SoUniformShaderParameter *shaderParameter)
Removes first instance of given uniform shader parameter from group.
void replaceShaderParameter(int index, SoUniformShaderParameter *newUniformShaderParameter)
Replaces uniform shader parameter with given index with new uniform shader parameter.
void addShaderParameter(SoUniformShaderParameter *shaderParameter)
Adds a uniform shader parameter as last one in group.
void finishEditing()
Indicates that batch edits have finished.
SoUniformShaderParameter ** startEditing()
Returns a pointer to the internally maintained array that can be modified.
void insertShaderParameter(SoUniformShaderParameter *shaderParameter, int newUniformShaderParameterIndex)
Adds a uniform shader parameter so that it becomes the one with the given index.
void removeAllShaderParameters()
Removes all uniform shader parameters from group.
int findShaderParameter(const SoUniformShaderParameter *shaderParameter) const
Finds index of given uniform shader parameter within group.
SoUniformShaderParameter * findUniformParameterByName(const SbString &name)
Find the first parameter with the given name.
Base class for all multiple-valued fields.
Definition SoMField.h:134
Used to write Open Inventor data files.
Definition SoOutput.h:186
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Abstract base cl...
int SbBool
Boolean type.
Definition SbBase.h:87