Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
MoMeshDetail.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 : Martial Bonaventure (Nov 2010)
22**=======================================================================*/
23
24
25#ifndef _MO_MESHDETAIL_
26#define _MO_MESHDETAIL_
27
28#include <Inventor/details/SoSubDetail.h>
29#include <Inventor/STL/vector>
30
31#include <MeshVizXLM/mapping/MoMeshVizDataMapping.h>
32#include <MeshVizXLM/mesh/data/MiTypedDataSet.h>
33
34class MiMesh;
35
36class MoFaceDetail;
37class MoLineDetail;
38
39#ifdef _WIN32
40#pragma warning(push)
41#pragma warning(disable:4251)
42#endif
43
45//
46// Class: MoMeshDetail
47//
48// Detail information about a mesh.
49//
50//
52
74class MESHVIZXLM_DMAP_API MoMeshDetail : public SoDetail {
75
76 SO_DETAIL_HEADER(MoMeshDetail);
77
78 public:
86 virtual ~MoMeshDetail();
87
88 /*
89 * Returns the type of the mesh
90 */
91 MeshType getMeshType() const { return m_meshType; }
92
93 /*
94 * Returns the mesh
95 */
96 const MiMesh* getMesh() const { return m_mesh; }
97
98 /*
99 * Returns the first associated color scalarset, NULL if none.
100 */
102
103 /*
104 * Returns the list of associated color scalarsets, empty if none.
105 */
106 const std::vector<const MiScalardSet*>& getColorScalarSets() const { return m_colorScalarsets; }
107
108 // Returns an instance that is a copy of this instance. The caller
109 // is responsible for deleting the copy when done.
110 virtual MoMeshDetail * copy() const;
111
112 private:
113 MoMeshDetail(const MiMesh* mesh, MeshType meshType);
114
115 // set the associated scalarsets
116 void setColorScalarSets( const std::vector<const MiScalardSet*>& colorScalarsets );
117 // creates a new specialized face detail from the generic given one.
118 // returns either a MoFaceDetailI, MoFaceDetailIj or a MoFaceDetailIjk depending on
119 // the mesh type stored in this.
120 MoFaceDetail* specilizeFaceDetail(const MoFaceDetail* faceDetail) const;
121 // creates a new specialized line detail from the generic given one.
122 // returns either a MoLineDetailI, MoLineDetailIj or a MoLineDetailIjk depending on
123 // the mesh type stored in this.
124 MoLineDetail* specilizeLineDetail(const MoLineDetail* lineDetail) const;
125
126 private:
127 static void initClass();
128 static void exitClass();
129
130 // temporary methods that convert a flat id into I/J/K indices until
131 // the MeXTopologyI is proprely implementated in all extractors for IJK meshes
132 void computeIj(size_t id, size_t& i, size_t &j) const ;
133 void computeIjk(size_t id, size_t& i, size_t &j, size_t &k) const;
134
135private:
136
137 MeshType m_meshType;
138 const MiMesh* m_mesh;
139 std::vector<const MiScalardSet*> m_colorScalarsets;
140
141};
142
143#ifdef _WIN32
144#pragma warning(pop)
145#endif
146
147#endif /* _MO_MESHDETAIL_ */
148
<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> Generic typed data set i...
Stores detail information about vertex-based shapes made of faces.
Stores detail information about vertex-based shapes made of line segments.
Stores detail information about a mesh.
const std::vector< const MiScalardSet * > & getColorScalarSets() const
const MiMesh * getMesh() const
virtual MoMeshDetail * copy() const
Returns an instance that is a copy of this instance.
virtual ~MoMeshDetail()
Destructor.
MoMeshDetail()
Constructor.
const MiScalardSet * getColorScalarSet() const
MeshType getMeshType() const
Base class for describing detail information about a shape node.
Definition SoDetail.h:99
MeshType
All supported mesh types.