00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _SO_MF_INSTANCE_PARAMETER_
00025 #define _SO_MF_INSTANCE_PARAMETER_
00026
00027 #include <Inventor/fields/SoSubField.h>
00028 #include <Inventor/nodes/SoInstanceParameter.h>
00029
00030
00054 class SoMFInstanceParameter : public SoMField {
00055
00056 SO_MFIELD_REQUIRED_HEADER(SoMFInstanceParameter);
00057 SO_MFIELD_CONSTRUCTOR_HEADER(SoMFInstanceParameter);
00058 SO_MFIELD_VALUE_HEADER(SoMFInstanceParameter, SoInstanceParameter *, SoInstanceParameter *);
00059 SO_MFIELD_SETVALUESPOINTER_HEADER(SoInstanceParameter *);
00060
00061 public:
00065 SoInstanceParameter* findParameterByName(const SbString& name) const;
00066
00074 SoInstanceParameter* setColors( SbColor* values,
00075 size_t nbValues,
00076 uint32_t divisor = 1,
00077 SoMemoryObject::CopyPolicy policy = SoMemoryObject::NO_COPY );
00078
00086 SoInstanceParameter* setTransparencies( float* values,
00087 size_t nbValues,
00088 uint32_t divisor = 1,
00089 SoMemoryObject::CopyPolicy policy = SoMemoryObject::NO_COPY );
00090
00099 SoInstanceParameter* setScales( SbVec3f* values,
00100 size_t nbValues,
00101 uint32_t divisor = 1,
00102 SoMemoryObject::CopyPolicy policy = SoMemoryObject::NO_COPY );
00103
00111 SoInstanceParameter* setRotations( SbVec4f* values,
00112 size_t nbValues,
00113 uint32_t divisor = 1,
00114 SoMemoryObject::CopyPolicy policy = SoMemoryObject::NO_COPY );
00115
00123 SoInstanceParameter* setRotations( SbRotation* values,
00124 size_t nbValues,
00125 uint32_t divisor = 1,
00126 SoMemoryObject::CopyPolicy policy = SoMemoryObject::NO_COPY );
00127
00135 SoInstanceParameter* setVisibilities( int32_t* values,
00136 size_t nbValues,
00137 uint32_t divisor = 1,
00138 SoMemoryObject::CopyPolicy policy = SoMemoryObject::NO_COPY );
00139
00147 SoInstanceParameter* setTranslations( SbVec3f* values,
00148 size_t nbValues,
00149 uint32_t divisor = 1,
00150 SoMemoryObject::CopyPolicy policy = SoMemoryObject::NO_COPY );
00151
00156 bool removeParameterByName(const SbString& name);
00157
00168 SoInstanceParameter** startEditing();
00169
00171 void finishEditing();
00172
00173 private:
00174 static void initClass();
00175 static void exitClass();
00176
00177
00178 virtual void fixCopy(SbBool copyConnections);
00179
00180
00181 virtual SbBool referencesCopy() const;
00182
00183 private:
00184
00185 virtual void countWriteRefs(SoOutput *out) const;
00186
00187
00188
00189 void setVal(int index, SoInstanceParameter *newValue);
00190
00194 static bool hasGivenName(SbString name, const SoShaderParameter* param);
00195
00196 SoInstanceParameter** m_oldValues;
00197 int m_oldNum;
00198 };
00199
00200
00201 #endif
00202