Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
MoMeshCellShape.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**=======================================================================*/
23#ifndef _MO_MESHCELLSHAPES_
24#define _MO_MESHCELLSHAPES_
25
26#include <MeshVizXLM/MbVec3.h>
27
29
36
37#ifdef _WIN32
38#pragma warning(push)
39#pragma warning(disable:4251)
40#endif
41
44
45class MdMeshRepresentation;
46
48class MiTopologyI;
49class MiGeometryI;
50
51class MxDefaultStreamStringSet;
52
108
110
111 public:
112
117
123
134
141
147
153
164
175
177
189
190#if 1 SoDEPRECATED
193#endif
195#if 1 SoDEPRECATED
199SoDEPRECATED
202
203#endif
205 /*----------------------------------------------------------------------------*/
206 private:
207 static void initClass() ;
208 static void exitClass() ;
209
210 private:
211 virtual void doExtract(SoAction *action);
212
213 private:
214 template <MeshType _meshType> friend class MdLineCellExtract;
215
216 void clear();
217
218 template<typename _Tuple> std::vector<_Tuple>& buildIndexList();
219
220 std::vector<size_t>& buildIndexListI();
221 std::vector<size_t> m_indexListI;
222 std::vector<MiCellExtractIj::couple>& buildIndexListIj();
223 std::vector<MiCellExtractIj::couple> m_indexListIj;
224 std::vector<MiCellExtractIjk::triplet>& buildIndexListIjk();
225 std::vector<MiCellExtractIjk::triplet> m_indexListIjk;
226
227 template< MeshType _meshType>
228 void doExtract(SoState * state,const MiMesh* mesh);
229
230 const MiStringSetI* getCellNamesI(SoState* state, bool &isCellNamesModified);
231 const MiStringSetIj* getCellNamesIj(SoState* state, bool &isCellNamesModified);
232 const MiStringSetIjk* getCellNamesIjk(SoState* state, bool &isCellNamesModified);
233 const MiStringSetI* getNodeNamesI(SoState* state, bool &isNodeNamesModified);
234
235 size_t m_timeStampOfLastCellNames;
236 size_t m_timeStampOfLastNodeNames;
237
238 class DisplayName
239 {
240 public:
241 DisplayName() {}
242 DisplayName(std::string name,const MbVec3d& pos) : m_name(name), m_pos(pos) {}
243 std::string m_name; // Name of the cell
244 MbVec3d m_pos; // Where to display the name
245 bool operator==(const DisplayName& c1) const {return m_name == c1.m_name && m_pos ==c1.m_pos;}
246 };
247 std::vector<DisplayName> m_cellNames;
248 std::vector<DisplayName> m_nodeNames;
249
250 template <typename _Iterator, typename _Topology, typename _Tuple>
251 void getDisplayCellList(const _Topology& topology, std::vector<_Tuple>& indexList, std::vector<_Tuple>& cellIds);
252
253 void buildDisplayNamesListI(SoState* state, const MiMeshUnstructuredI& mesh, const MiCellFilterI* cellFilter);
254 void buildDisplayNamesListIj(SoState* state, const MiTopologyIj& topology, const MiGeometryI& geometry, const MiCellFilterIj* cellFilter);
255 void buildDisplayNamesListIjk(SoState* state, const MiVolumeMeshHexahedronIjk& mesh, const MiCellFilterIjk* cellFilter, bool displayNodes = true);
256
257 void displayNames(std::vector<DisplayName>& newDisplayNames, std::vector<DisplayName>& currentDisplayNames, SoSeparator*& nameSep);
258
259 SoSeparator* m_nodeNamesSep;
260 SoSeparator* m_cellNamesSep;
261
262 class CellFilter : public MiCellFilterI, public MiCellFilterIj, public MiCellFilterIjk
263 {
264 public:
265 CellFilter();
266 bool acceptCell(size_t cellIndex) const;
267 bool acceptCell(size_t i, size_t j) const;
268 bool acceptCell(size_t i, size_t j, size_t k) const;
269 size_t getTimeStamp() const;
270 void set(std::vector<size_t>& exclusionListI, const MiCellFilterI* userCellFilter);
271 void set(std::vector<MiCellExtractIj::couple>& exclusionListIj, const MiCellFilterIj* userCellFilter);
272 void set(std::vector<MiCellExtractIjk::triplet>& exclusionListIjk, const MiCellFilterIjk* userCellFilter);
273 private:
274 template < typename _vectorT > void copy( _vectorT& exclusionListI, _vectorT& newListI);
275 std::vector<size_t> m_exclusionListI;
276 std::vector<MiCellExtractIj::couple> m_exclusionListIj;
277 std::vector<MiCellExtractIjk::triplet> m_exclusionListIjk;
278 const MiCellFilterI* m_userCellFilterI;
279 const MiCellFilterIj* m_userCellFilterIj;
280 const MiCellFilterIjk* m_userCellFilterIjk;
281 const MiCellFilter* m_currentCellFilter;
282 mutable size_t m_userTS;
283 mutable size_t m_timeStamp;
284 };
285 CellFilter m_excludedCellFilter;
286
287 static MxDefaultStreamStringSet* s_streamStringSet;
288} ;
289
290template <>
291inline std::vector<size_t>& MoMeshCellShape::buildIndexList()
292{
293 return buildIndexListI();
294}
295
296template <>
297inline std::vector<MiCellExtractIj::couple>& MoMeshCellShape::buildIndexList()
298{
299 return buildIndexListIj();
300}
301
302template <>
303inline std::vector<MiCellExtractIjk::triplet>& MoMeshCellShape::buildIndexList()
304{
305 return buildIndexListIjk();
306}
307
308
309#ifdef _WIN32
310#pragma warning(pop)
311#endif
312
313#endif /* _MO_MESHCELLSHAPES_ */
314
315
316
#define MESHVIZXLM_DMAP_API
void clear()
void set(int32_t numNormals, const SbVec3f *normals, const SoNormalBindingElement::Binding binding, const int startIndex=0)
int operator==(const className &f) const
Returns TRUE if otherField is of the same type and has the same value as this field.
#define SO_NODE_HEADER(className)
Definition SoSubNode.h:151
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Cell extractor for hexah...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Cell extractor for struc...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Cell extractor for struc...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Cell extractor for unstr...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Interface class defining...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Interface class defining...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Interface class defining...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Interface class defining...
<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> Generic data set interfa...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic geometry interfa...
Definition MiGeometryI.h:39
<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> I Unstructured mesh abst...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> List of cells interface.
Definition MiTopologyI.h:46
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> List of structured surfa...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> IJK Hexahedron volume me...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Rendering node that disp...
const MiCellExtractIj * getIjExtractor()
SoSFBool showNodeName
When set to TRUE, the node's names are displayed near the cell.
SoDEPRECATED const MiCellExtractIjk * getRegularExtractor()
const MiCellExtractUnstructured * getUnstructuredExtractor()
Get extractor for reuse outside this node.
SoSFFloat offset
Field representing the distance to shift the display of node names away from the node coordinates.
const MiCellExtractIjk * getIjkExtractor()
SoSFBool relativeOffset
When set to TRUE, the distance between the node and the name to display is relative to the size of th...
SoSFFloat factor
Field representing the factor to resize extracted cells.
SoMFInt32 cellIndices
Field representing the list of cells given by their index in the mesh.
MoMeshCellShape()
Constructor.
SoSFBool showCellName
When set to TRUE, the cell's name is displayed near the cell.
SoDEPRECATED const MiCellExtractHexahedronIjk * getUnstructuredIjkExtractor()
SoSFBool inclusiveList
When set to TRUE, the cellIndices field will represent the list of cells to display and the list of c...
SoDEPRECATED const MiCellExtractIj * getSurfaceRegularExtractor()
const MiCellExtractHexahedronIjk * getHexahedronIjkExtractor()
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract base class for ...
Abstract base class for all actions.
Definition SoAction.h:132
Multiple-value field containing any number of int32_t integers.
Definition SoMFInt32.h:88
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing a floating-point value.
Definition SoSFFloat.h:78
Group node that saves and restores traversal state.
Traversal state.
Definition SoState.h:74