Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoDataSetElement.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-2024 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : P. ESTRADE (Feb 2000)
22** Modified by : J. HUMMEL to collect multiple volume data node (Apr 2005)
23**=======================================================================*/
24
25
26#ifndef _SO_DATA_SET_ELEMENT_
27#define _SO_DATA_SET_ELEMENT_
28
29#include <Inventor/nodes/SoShaderParameter.h>
30#include <Inventor/elements/SoReplacedElement.h>
31#include <Inventor/SbBox.h>
32#include <Inventor/SbLinear.h>
33#include <Inventor/STL/vector>
34#include <Inventor/STL/set>
35#include <Inventor/STL/map>
36
37#include <LDM/SoLDM.h>
38
39#ifdef _MSC_VER
40#pragma warning( push )
41#pragma warning(disable:4251)
42#endif
43
44class SoDataSet;
45class SoNode;
46class SoLDMTileManager;
47class SoState;
48class SoDataSetId;
50class SoLDMMediator;
51
52//wrapper
57
58 SO_ELEMENT_HEADER( SoDataSetElement );
59
60public:
61
63 virtual void push(SoState *state);
64
65 // Sets the current volume data attributes in the state
66 static void set(SoState* state, SoNode *node, SoDataSet *datasetNode);
67 static void set(SoState *state, SoNode *node,
68 SoDataSet *datasetNode, const SbMatrix &matrix );
69
70 //Get the current list of volume data stored in the state
71 static void get(SoState* state, std::vector<SoDataSet*>&);
72
73 static void get(SoState* state, SoDataSet*& ds);
74
75 static void get(SoState* state, SoLDM::DataSetIdPairList& dataSetIdPairList);
76
77 // Returns current model matrix from the state, sets given flag to TRUE
78 // if matrix is known to be identity
79 static const SbMatrix &get(SoState *state, SoDataSet*&, SbBool &isIdent );
80
81 // Default values
83
84private:
85
87 virtual void init(SoState* state);
88
92 virtual SbBool matches(const SoElement* elt) const;
93
95 virtual SoElement* copyMatchInfo() const;
96
97private:
98 typedef std::pair<SoDataSet*, const SoDataSetId*> DataSetPtrIdPair;
99
100 // Initializes the SoDataSet class
101 static void initClass();
102 static void exitClass();
103
104 static void reset(SoState*);
105
107 static bool isDoingMultiData(SoState* state);
108
110 static bool isDoingCpuComposition(SoState* state);
111
113 template<typename T>
114 static std::pair<T*, int> getLastOfType(SoState* state, bool derived)
115 {
116 SoLDM::DataSetIdPair p = getLastOfType(state, T::getClassTypeId(), derived);
117 return std::make_pair(static_cast<T*>(p.first), p.second);
118 }
119
120 //get the current tile manager stored in the state
121
122 static void get( SoState* state, SoLDMTileManager*& );
123
125 static void getGroupedDataSets(SoState* state, std::vector<SoLDM::DataSetIdPairList>& dataSets);
126
128 static void getDataSetGroup(SoState* state, SoLDM::DataSetIdPairList& pairList, SoLDMMediator* mediator);
129
131 static const SbMatrix& getDataSetModelMatrix(SoState* state, const SoLDM::DataSetIdPair& idPair, SbBool& isIdent);
132
134 static void setMasterId(SoState* state, int dataSetId);
135
137 static void setMasterIdPair(SoState* state, const SoLDM::DataSetIdPair& idPair);
138
140 static const SoLDM::DataSetIdPair& getMasterIdPair(SoState* state);
141
143 static const SoLDM::DataSetIdPair& getInternalMasterIdPair(SoState* state);
144
146 static int getFirstDataSetId(const SoLDM::DataSetIdPairList& idPairList, int dataSetId);
147
149 static const SoLDM::DataSetIdPair getLastDataSetWithId(SoState* state, int id);
150
151private:
152 typedef std::set<const SoDataSetId*> DataSetIdSet;
153 typedef std::map<SoDataSet*, DataSetIdSet> DataSetIdMap;
154 typedef std::vector<DataSetPtrIdPair> DataSetPtrIdPairVec;
155 typedef std::map<SoLDM::DataSetIdPair, SbMatrix> ModelMatrixMap;
156
157 virtual void setElt( SoState* state, SoDataSet* ds );
158 virtual void setElt( SoState* state, SoDataSet* ds, const SbMatrix &matrix );
159
160 virtual ~SoDataSetElement() ;
161
162private:
167 static SoLDM::DataSetIdPair getLastOfType(SoState* state, SoType type, bool derived);
168
169 //List of volume data and their ids
170 DataSetPtrIdPairVec m_dataSetIdPairList;
171 ModelMatrixMap m_modelMatrices;
172
173 SbMatrix m_modelMatrix;
174 SbBool m_isModelIdentity;
175 SoLDM::DataSetIdPair m_datasetNode;
176 SoLDM::DataSetIdPair m_masterPair;
177 static bool s_forceOIV6Behavior;
178 std::vector<uint64_t> m_nodeIds;
179};
180
181#ifdef _MSC_VER
182#pragma warning( pop )
183#endif
184
185#endif // _SO_DATA_SET_ELEMENT_
186
187
4x4 matrix class.
Definition SbMatrix.h:309
virtual void push(SoState *state)
Overrides push() method to copy values from next instance in the stack.
static void get(SoState *state, std::vector< SoDataSet * > &)
static void set(SoState *state, SoNode *node, SoDataSet *datasetNode, const SbMatrix &matrix)
static void get(SoState *state, SoDataSet *&ds)
static void getDefault(SoLDM::DataSetIdPair &)
static void get(SoState *state, SoLDM::DataSetIdPairList &dataSetIdPairList)
static const SbMatrix & get(SoState *state, SoDataSet *&, SbBool &isIdent)
static void set(SoState *state, SoNode *node, SoDataSet *datasetNode)
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data set...
Definition SoDataSet.h:139
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Property...
Abstract base class for all state elements.
Definition SoElement.h:102
Renders a scene graph using Open Inventor's Render Engine.
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
Stores runtime type information.
Definition SoType.h:98
int SbBool
Boolean type.
Definition SbBase.h:87
std::pair< SoDataSet *, int > DataSetIdPair
Pair containing an SoDataset and its dataSetId.
Definition SoLDM.h:71
std::vector< DataSetIdPair > DataSetIdPairList
List of DataSetIdPair.
Definition SoLDM.h:76