00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : David Beilloin (Aug 2013) 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 getNumInstance(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 const SbMatrix& getInstanceModelMatrix () const { return m_oivInstanceModelMatrix; } 00072 00074 bool getInstanceUseMaterialColor() const { return m_oivInstanceUseMaterialColor; } 00075 00076 private: 00078 virtual void init(SoState* state); 00079 00081 virtual SoElement *copyMatchInfo() const; 00082 00084 virtual SbBool matches(const SoElement* elt) const; 00085 00086 private: 00087 SoMultipleInstance* m_shapeInstanceProperty; 00088 unsigned int m_numInstances; 00089 unsigned int m_numBatches; 00090 SbMatrix m_oivInstanceModelMatrix; 00091 bool m_oivInstanceUseMaterialColor; 00092 }; 00093 00094 00095 #endif // _SO_MULTIPLE_INSTANCE_ELEMENT_H_ 00096 00097