00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _SO_TEXTURE_COMBINER_ELEMENT
00026 #define _SO_TEXTURE_COMBINER_ELEMENT
00027
00028 #include <Inventor/elements/SoReplacedTextureElement.h>
00029 #include <Inventor/SbVec.h>
00030 #include <Inventor/STL/vector>
00031
00044 SoEXTENDER_Documented class SoTextureCombinerElement : public SoReplacedTextureElement {
00045
00046 SO_ELEMENT_HEADER(SoTextureCombinerElement);
00047
00048 public:
00049
00054 static void set(SoState *state, SoNode *node,
00055 int _combineRGB, int _combineAlpha,
00056 int _source0RGB, int _source1RGB, int _source2RGB,
00057 int _source0Alpha, int _source1Alpha, int _source2Alpha,
00058 int _operand0RGB, int _operand1RGB, int _operand2RGB,
00059 int _operand0Alpha, int _operand1Alpha, int _operand2Alpha,
00060 float _scaleRGB, float _scaleAlpha,
00061 const SbVec4f &constantColor);
00062
00067 virtual void push(SoState *state);
00068
00069 private:
00070
00072 virtual void commonInit();
00073
00075 virtual void init(SoState *state);
00076
00077 private:
00078
00079 static void initClass();
00080 static void exitClass();
00081
00082 private:
00083
00084 virtual void setElt(int _combineRGB, int _combineAlpha,
00085 int _source0RGB, int _source1RGB, int _source2RGB,
00086 int _source0Alpha, int _source1Alpha, int _source2Alpha,
00087 int _operand0RGB, int _operand1RGB, int _operand2RGB,
00088 int _operand0Alpha, int _operand1Alpha, int _operand2Alpha,
00089 float _scaleRGB, float _scaleAlpha,
00090 const SbVec4f &_constantColor, int unit=0);
00091
00092 virtual ~SoTextureCombinerElement();
00093
00094 struct SoTexCombineData {
00095 SoTexCombineData()
00096 :combineRGB(0),combineAlpha(0),
00097 source0RGB(0),source1RGB(0),source2RGB(0),
00098 source0Alpha(0),source1Alpha(0),source2Alpha(0),
00099 operand0RGB(0),operand1RGB(0),operand2RGB(0),
00100 operand0Alpha(0),operand1Alpha(0),operand2Alpha(0),
00101 scaleRGB(0),scaleAlpha(0),constantColor(0,0,0,0)
00102 {};
00103
00104 SoTexCombineData& operator=(const SoTexCombineData &data)
00105 {
00106 combineRGB =data.combineRGB;
00107 combineAlpha = data.combineAlpha;
00108 source0RGB =data.source0RGB;
00109 source1RGB =data.source1RGB;
00110 source2RGB =data.source2RGB;
00111 source0Alpha =data.source0Alpha;
00112 source1Alpha =data.source1Alpha;
00113 source2Alpha =data.source2Alpha;
00114 operand0RGB =data.operand0RGB;
00115 operand1RGB =data.operand1RGB;
00116 operand2RGB =data.operand2RGB;
00117 operand0Alpha =data.operand0Alpha;
00118 operand1Alpha =data.operand1Alpha;
00119 operand2Alpha =data.operand2Alpha;
00120 scaleRGB =data.scaleRGB;
00121 scaleAlpha =data.scaleAlpha;
00122 constantColor =data.constantColor;
00123 return *this ;
00124 }
00125
00126
00127 int combineRGB;
00128 int combineAlpha;
00129 int source0RGB;
00130 int source1RGB;
00131 int source2RGB;
00132 int source0Alpha;
00133 int source1Alpha;
00134 int source2Alpha;
00135 int operand0RGB;
00136 int operand1RGB;
00137 int operand2RGB;
00138 int operand0Alpha;
00139 int operand1Alpha;
00140 int operand2Alpha;
00141 float scaleRGB;
00142 float scaleAlpha;
00143 SbVec4f constantColor;
00144
00145 } ;
00146
00147 SoTexCombineData& getCombinerData(const size_t unit) const;
00148
00149 private:
00150 mutable std::vector<SoTexCombineData> m_texCombineData;
00151 };
00152
00153 #endif
00154
00155