Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoMultipleInstanceElement.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2018 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : David Beilloin (Aug 2013)
22**=======================================================================*/
23#if !defined _SO_MULTIPLE_INSTANCE_ELEMENT_H_
24#define _SO_MULTIPLE_INSTANCE_ELEMENT_H_
25
26#include <Inventor/elements/SoReplacedElement.h>
27#include <Inventor/SbMatrix.h>
28
30
31
44{
45 SO_ELEMENT_HEADER(SoMultipleInstanceElement);
46
47public:
49 static void set(SoState* state, SoNode* node, SoMultipleInstance* instanceproperty);
50
52 static unsigned int getNumInstances(SoState* state);
53
56
59
61 static unsigned int getNumBatches(SoState * state);
62
63private:
65 static void initClass();
66
68 static void exitClass();
69
71 inline const SbMatrix& getInstanceModelMatrix () const { return m_oivInstanceModelMatrix; }
72 inline unsigned int getNumInstances() const { return m_numInstances; }
73 inline unsigned int getNumInstancedBatches() const { return m_numBatches; }
74 inline unsigned int getCurrentBatchNumber() const { return m_currentBatchNum; }
75 inline int32_t getNeedParamsBits() const { return m_needParamsBits; }
76
78 inline void setCurrentBatchNumber( uint32_t currentBatchNum ) { m_currentBatchNum = currentBatchNum; }
79 inline void setNeedParamsBits( int32_t needParamsBits ) { m_needParamsBits = needParamsBits; }
80
81private:
83 virtual void init(SoState* state);
84
86 virtual SoElement *copyMatchInfo() const;
87
89 virtual SbBool matches(const SoElement* elt) const;
90
91private:
92 SoMultipleInstance* m_shapeInstanceProperty;
93
94 SbMatrix m_oivInstanceModelMatrix;
95
96 unsigned int m_numInstances;
97 unsigned int m_numBatches;
98 unsigned int m_currentBatchNum;
99
100 int32_t m_needParamsBits;
101};
102
103
104#endif // _SO_MULTIPLE_INSTANCE_ELEMENT_H_
105
4x4 matrix class.
Definition SbMatrix.h:309
Abstract base class for all state elements.
Definition SoElement.h:102
Stores current MultiInstance info.
static SoMultipleInstance * get(SoState *state)
Returns the current element in the state.
static unsigned int getNumInstances(SoState *state)
Returns the number of shape instance requests in the state.
static unsigned int getNumBatches(SoState *state)
Return the number of batches.
static SoMultipleInstance * getDefault()
returns the default element value.
static void set(SoState *state, SoNode *node, SoMultipleInstance *instanceproperty)
Sets the current multiple instance node.
Group node that renders multiple instances of its children.
Abstract base class for all database nodes.
Definition SoNode.h:145
Abstract base class for each state element whose value is replaced whenever it is set.
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87