Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
MoMeshRepresentation.h
Go to the documentation of this file.
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-2020 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22** Modified by : M. Bonaventure (Avr 2010)
23**=======================================================================*/
24#ifndef _MO_MESHREPRESENTATION_
25#define _MO_MESHREPRESENTATION_
26
33
34class MiMesh;
36class MiTessellator;
37
38class MoMeshDetail;
39
40class SoRayPickAction;
41
42class MdMeshRepresentation;
43class MdMeshCache;
44class MxAttributesManager;
45class MdProfilingTool;
46
86
88
89 public:
90
99
106
112 virtual void setExtractorCallback(MiExtractorCallback* extractorCallback);
113SoDEPRECATED
115 virtual void setExtractorCallback(MiExtractorCallback& extractorCallback);
116
117 /*----------------------------------------------------------------------------*/
118 private:
119
120 static void initClass() ;
121 static void exitClass() ;
122
123 size_t getTimeStamp() const;
124
125 // computes the extract of the given data set.
126 virtual const MiScalardSet* extractScalarSet(const MiScalardSet* SO_UNUSED_PARAM(scalarSet));
127
131 bool isUsingTessellator() const;
132
133 private:
134 virtual void rayPick(SoRayPickAction *action);
135 virtual void doExtract(SoAction *action) = 0;
136 virtual void doAction(SoAction *action);
137
138 // Method used to return the extracted mesh computed by the representation used by MoMesh::connectFrom()
139 const MiMesh* getExtractedMesh(MeshType& meshType);
140
141 // computes the extract of the data set corresponding to the given index in the state list from the current representation's extractor.
142 virtual const MiScalardSetI* extractScalarSetI(SoState * SO_UNUSED_PARAM(state),size_t SO_UNUSED_PARAM(scalarSetId));
143 virtual const MiScalardSetIj* extractScalarSetIj(SoState * SO_UNUSED_PARAM(state),size_t SO_UNUSED_PARAM(scalarSetId));
144
145 // computes the extract of the data set corresponding to the given index in the state list from the current representation's extractor.
146 virtual const MiVec3dSetI* extractVec3SetI(SoState * SO_UNUSED_PARAM(state),size_t SO_UNUSED_PARAM(vec3SetId));
147 virtual const MiVec3dSetIj* extractVec3SetIj(SoState * SO_UNUSED_PARAM(state),size_t SO_UNUSED_PARAM(vec3SetId));
148
149 private:
151 virtual ~MoMeshRepresentation() ;
152
153 friend class MdUndefinedMeshRepresentation;
154 template<typename _ExtractorT> friend class MdMeshRepresentationFor;
155 template <typename _MdExtractorT> friend class MdMeshMultiLinesRepresentation;
156 template<typename _MdExtractorT> friend class MdExtractionThread;
157
158 const MiMesh* getMeshFromState(SoState* state, MeshType& meshType);
159 MiTessellator* getTessellatorFromState(SoState* state, bool ignoreCache = false);
160 template <typename _MeshInterface>
161 std::vector<const MiScalardSet*> getColorSetFromState(SoState* state);
162
163 virtual void clear();
164
165 MdMeshRepresentation* m_nodeImpl;
166 MiExtractorCallback* m_extractorCallback;
167
168private:
169 // Parallel field sensor
170 SoFieldSensor m_parallelFieldSensor;
171 static void parallelFieldSensorCB(void* data, SoSensor* sensor);
172 // detail storing the current mesh and the color scalarset
173 MoMeshDetail* m_meshDetail;
174 // Internal mechanism to retrieve the attributes for the extractions
175 MxAttributesManager* m_attributesManager;
176 // time stamp is updated when creating a new the representation meshcache
177 size_t m_timeStamp;
178 // set to true if the extractor is currentlty using a Tessellator
179 bool m_usingTessellator;
180 // Mesh cache
181 MdMeshCache* m_meshCache;
182
183 MdProfilingTool* m_profiling;
184
185};
186
187#endif /* _MO_MESHREPRESENTATION_ */
188
189
190
virtual const MeXScalardSetI & extractScalarSet(const MiScalardSetI &inputSet)=0
Extracts a scalar set from the input mesh.
#define MESHVIZXLM_DMAP_API
void clear()
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic data set interfa...
Definition MiDataSetI.h:40
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic data set interfa...
Definition MiDataSetIj.h:41
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract base class for ...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract mesh interface.
Definition MiMesh.h:62
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract tessellator int...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic typed data set i...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract base class for ...
Stores detail information about a mesh.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract base class for ...
virtual void setExtractorCallback(MiExtractorCallback *extractorCallback)
Set the extraction callback which will be called each time an extraction is performed.
SoSFBool parallel
If TRUE, the node tries to launch the extraction in parallel if this is supported by the associated e...
virtual SoDEPRECATED void setExtractorCallback(MiExtractorCallback &extractorCallback)
SoSFInt32 colorScalarSetId
Field representing the scalar set node to be used to map colors onto the representation.
Abstract base class for all actions.
Definition SoAction.h:132
Sensor class that can be attached to Open Inventor fields.
Intersects objects with a ray cast into scene.
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing a int32_t integer.
Definition SoSFInt32.h:80
Abstract base class for Open Inventor sensors.
Definition SoSensor.h:97
Traversal state.
Definition SoState.h:74
MeshType
All supported mesh types.