00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if !defined _SO_MULTIPLE_INSTANCE_ELEMENT_H_
00024 #define _SO_MULTIPLE_INSTANCE_ELEMENT_H_
00025
00026 #include <Inventor/elements/SoReplacedElement.h>
00027 #include <Inventor/SbMatrix.h>
00028
00029 class SoMultipleInstance;
00030
00031
00043 class SoMultipleInstanceElement : public SoReplacedElement
00044 {
00045 SO_ELEMENT_HEADER(SoMultipleInstanceElement);
00046
00047 public:
00049 static void set(SoState* state, SoNode* node, SoMultipleInstance* instanceproperty);
00050
00052 static unsigned int getNumInstances(SoState* state);
00053
00055 static SoMultipleInstance* get(SoState* state);
00056
00058 static SoMultipleInstance* getDefault();
00059
00061 static unsigned int getNumBatches(SoState * state);
00062
00063 private:
00065 static void initClass();
00066
00068 static void exitClass();
00069
00071 inline const SbMatrix& getInstanceModelMatrix () const { return m_oivInstanceModelMatrix; }
00072 inline unsigned int getNumInstances() const { return m_numInstances; }
00073 inline unsigned int getNumInstancedBatches() const { return m_numBatches; }
00074 inline unsigned int getCurrentBatchNumber() const { return m_currentBatchNum; }
00075 inline int32_t getNeedParamsBits() const { return m_needParamsBits; }
00076
00078 inline void setCurrentBatchNumber( uint32_t currentBatchNum ) { m_currentBatchNum = currentBatchNum; }
00079 inline void setNeedParamsBits( int32_t needParamsBits ) { m_needParamsBits = needParamsBits; }
00080
00081 private:
00083 virtual void init(SoState* state);
00084
00086 virtual SoElement *copyMatchInfo() const;
00087
00089 virtual SbBool matches(const SoElement* elt) const;
00090
00091 private:
00092 SoMultipleInstance* m_shapeInstanceProperty;
00093
00094 SbMatrix m_oivInstanceModelMatrix;
00095
00096 unsigned int m_numInstances;
00097 unsigned int m_numBatches;
00098 unsigned int m_currentBatchNum;
00099
00100 int32_t m_needParamsBits;
00101 };
00102
00103
00104 #endif // _SO_MULTIPLE_INSTANCE_ELEMENT_H_
00105
00106