MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 00006 00007 00008 #ifndef _SO_MF_SHADER_OBJECT_ 00009 #define _SO_MF_SHADER_OBJECT_ 00010 00011 #include "SoShaderSystem.h" 00012 #include <Inventor/fields/SoSubField.h> 00013 00014 class SoShaderObject; 00015 class SoNode; 00016 00018 class INVENTOR_SHADER_API SoMFShaderObject : public SoMField 00019 { 00020 typedef SoMField inherited; 00021 00022 SO_MFIELD_HEADER(SoMFShaderObject, SoShaderObject *, SoShaderObject *); 00023 00024 public: 00025 00027 void addShader(SoShaderObject *shader); 00028 00030 void insertShader(SoShaderObject *shader, int newShaderIndex); 00031 00033 SoShaderObject *getShader(int index) const; 00034 00036 SoNodeList getShaderList() const; 00037 00039 int findShader(const SoShaderObject *shader) const; 00040 00042 int getNumShaders() const; 00043 00045 void removeShader(int index); 00046 00048 void removeShader(SoShaderObject *shader) { 00049 removeShader(findShader(shader)); 00050 } 00051 00053 void removeAllShaders(); 00054 00056 void replaceShader(int index, SoShaderObject *newShader); 00057 00059 void replaceShader(SoShaderObject *oldShader, SoShaderObject *newShader) { 00060 replaceShader(findShader(oldShader), newShader); 00061 } 00062 00063 SoINTERNAL public: 00064 00066 static void initClass(); 00067 00069 virtual void fixCopy(SbBool copyConnections); 00070 00072 virtual SbBool referencesCopy() const; 00073 00074 private: 00075 00077 virtual void countWriteRefs(SoOutput *out) const; 00078 00081 void setVal(int index, SoShaderObject *newValue); 00082 }; 00083 00084 #endif // _SO_MF_SHADER_OBJECT_