Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PoMeshCrossSection.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-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24#ifndef _PO_MESHCROSSSECTION_
25#define _PO_MESHCROSSSECTION_
26
27#include <MeshViz/3Ddata/PoMesh3D.h>
28#include <Inventor/fields/SoSFPlane.h>
29
30#include <Inventor/STL/vector>
31
32#ifdef _WIN32
33#pragma warning(push)
34#pragma warning(disable:4251)
35#endif
36
37class PbIndexedMesh3D;
43class PbMesh;
44
45class SoMFInt32;
46class SoMFVec3f;
47class SoCoordinate3;
48class SoMaterial;
49
88
89 SO_KIT_HEADER(PoMeshCrossSection) ;
90
91 // Define fields for new parts
92 SO_KIT_CATALOG_ENTRY_HEADER(groupCrossSection) ;
93
94
95 public:
96
101
105 virtual void rebuild() ;
106
111
112
133
156 { m_crossMethod = method; }
157 /*----------------------------------------------------------------------------*/
158 private:
159 static void initClass() ;
160 static void exitClass() ;
161
162 void indexedMeshCrossSection(PbIndexedMesh3D *mesh) ;
163 void tetrahedronMeshCrossSection(PbTetrahedronMesh3D *mesh) ;
164 void hexahedronMeshCrossSection(PbHexahedronMesh3D *mesh) ;
165 void cartGrid3DCrossSection(PbCartesianGrid3D *mesh);
166 void paralCartGrid3DCrossSection(PbParalCartesianGrid3D *mesh);
167 void regularGrid3DCrossSection(PbRegularCartesianGrid3D *mesh);
168
169 const float *getIsosurfDataSet();
170 float getIsosurfValue() const;
171
175 virtual size_t getMemorySize();
176
177 private:
178 // Destructor
179 virtual ~PoMeshCrossSection() ;
180 virtual void setDefaultOnNonWritingFields();
181 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
182 virtual void addElementsAllCaches() ;
183 virtual void preRebuild();
184
185 virtual int getIsosurfDataSetId() const;
186 virtual SbVec3f getOverallNormal() const;
187
188 /*----------------------------------------------------------------------------*/
189 private:
190
191 FieldSensorList m_fieldSensorList ;
192 // Sensors
193
194 SoFieldList m_fieldList ;
195 // List of fields defined in this class
196
197 SoCoordinate3 *crossSectionCoord;
198
199 void orientPolygon(std::vector< int > &coordIndex, int start_ind, float xn, float yn, float zn);
200
201 void crossPlaneAndTetrahedron(int cell_index, const float *x,const float *y, const float *z, const float *v, const int *tetra_nodes,
202 float xn,float yn,float zn, float dist_plane_orig,
203 int &num_cross_pt, SbBool at_vertex=TRUE);
204 void crossPlaneAndPyramid(int cell_index, const float *x,const float *y, const float *z, const float *v, const int *pyra_nodes,
205 float xn,float yn,float zn, float dist_plane_orig,
206 int &num_cross_pt, SbBool at_vertex=TRUE);
207 void crossPlaneAndPentahedron(int cell_index, const float *x,const float *y, const float *z, const float *v, const int *penta_nodes,
208 float xn,float yn,float zn, float dist_plane_orig,
209 int &num_cross_pt, SbBool at_vertex=TRUE);
210 void crossPlaneAndHexahedron(int cell_index, const float *x,const float *y, const float *z, const float *v,
211 const int *hexa_nodes, const int *hexa_ind,
212 float xn,float yn,float zn, float dist_plane_orig,
213 int &num_cross_pt, SbBool at_vertex=TRUE);
214 SbBool isFaceAlreadyFound(int num_new_points, int nb_pt_inters, int pt_inters_sorted[4]);
215
216 void tetrahedronMeshCrossSectionInhColr(PbTetrahedronMesh3D *mesh, const float *v, SbBool at_vertex=TRUE) ;
217 void tetrahedronMeshCrossSectionMapColr(PbTetrahedronMesh3D *mesh, const float *v) ;
218 void tetrahedronMeshCrossSectionContColr(PbTetrahedronMesh3D *mesh, const float *v) ;
219 void tetrahedronMeshCrossSectionTexContColr(PbTetrahedronMesh3D *mesh, const float *v) ;
220 void tetrahedronMeshCrossSectionPerCellColr(PbTetrahedronMesh3D *mesh, const float *v) ;
221
222 void hexahedronMeshCrossSectionInhColr(PbHexahedronMesh3D *mesh, const float *v, SbBool at_vertex=TRUE);
223 void hexahedronMeshCrossSectionMapColr(PbHexahedronMesh3D *mesh, const float *v) ;
224 void hexahedronMeshCrossSectionContColr(PbHexahedronMesh3D *mesh, const float *v) ;
225 void hexahedronMeshCrossSectionTexContColr(PbHexahedronMesh3D *mesh, const float *v) ;
226 void hexahedronMeshCrossSectionPerCellColr(PbHexahedronMesh3D *mesh, const float *v) ;
227
228 void indexedMeshCrossSectionInhColr(PbIndexedMesh3D *mesh, const float *v, SbBool at_vertex=TRUE) ;
229 void indexedMeshCrossSectionMapColr(PbIndexedMesh3D *mesh, const float *v) ;
230 void indexedMeshCrossSectionContColr(PbIndexedMesh3D *mesh, const float *v) ;
231 void indexedMeshCrossSectionTexContColr(PbIndexedMesh3D *mesh, const float *v) ;
232 void indexedMeshCrossSectionPerCellColr(PbIndexedMesh3D *mesh, const float *v) ;
233
234 void cartGrid3DCrossSectionInhColr(PbCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
235 void cartGrid3DCrossSectionMapColr(PbCartesianGrid3D *mesh, const float *v);
236 void cartGrid3DCrossSectionContColr(PbCartesianGrid3D *mesh, const float *v);
237 void cartGrid3DCrossSectionTexContColr(PbCartesianGrid3D *mesh, const float *v);
238 void cartGrid3DCrossSectionPerCellColr(PbCartesianGrid3D *mesh, const float *v);
239
240 void paralCartGrid3DXCrossSectionInhColr(PbParalCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
241 void paralCartGrid3DYCrossSectionInhColr(PbParalCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
242 void paralCartGrid3DZCrossSectionInhColr(PbParalCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
243 void paralCartGrid3DCrossSectionInhColr(PbParalCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
244 void paralCartGrid3DCrossSectionMapColr(PbParalCartesianGrid3D *mesh, const float *v);
245 void paralCartGrid3DCrossSectionContColr(PbParalCartesianGrid3D *mesh, const float *v);
246 void paralCartGrid3DCrossSectionTexContColr(PbParalCartesianGrid3D *mesh, const float *v);
247 void paralCartGrid3DCrossSectionPerCellColr(PbParalCartesianGrid3D *mesh, const float *v);
248
249 void regularGrid3DXCrossSectionInhColr(PbRegularCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
250 void regularGrid3DYCrossSectionInhColr(PbRegularCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
251 void regularGrid3DZCrossSectionInhColr(PbRegularCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
252 void regularGrid3DCrossSectionInhColr(PbRegularCartesianGrid3D *mesh, const float *v, SbBool at_vertex=TRUE);
253 void regularGrid3DCrossSectionMapColr(PbRegularCartesianGrid3D *mesh, const float *v);
254 void regularGrid3DCrossSectionContColr(PbRegularCartesianGrid3D *mesh, const float *v);
255 void regularGrid3DCrossSectionTexContColr(PbRegularCartesianGrid3D *mesh, const float *v);
256 void regularGrid3DCrossSectionPerCellColr(PbRegularCartesianGrid3D *mesh, const float *v);
257
258 int m_allocElementFaces,m_numElementFaces;
259 int (*m_elementFaces)[5];
260
261 SbBool m_distNodes2PlaneUpdated;
262 std::vector<float> m_distNodes2Plane;
263 int m_distNodes2PlaneId; // state id of the data set (m_distNodes2Plane)
264 float m_crossValue;
265
266 SbVec3f m_lastPlaneNormal;
267 SbBool m_crossMethod;
268
269} ;
270
271/*----------------------------------------------------------------------------*/
272
273#define P_PLANE_EPS 0.0001
274
275#ifdef _WIN32
276#pragma warning(pop)
277#endif
278
279#endif /* _PO_MESHCROSSSECTION _ */
280
281
282
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a cartesian grid...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a mesh of hexahe...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a volume mesh of...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract mesh...
Definition PbMesh.h:84
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a parallel carte...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a regular cartes...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a mesh of tetrah...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Base class for all volum...
Definition PoMesh3D.h:53
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of cross ...
SoSFPlane plane
Position of the cross section.
CrossSectionMethod
Specifies the method used to compute intersections.
@ INTERSECTION
The cross section is computed by doing classic intersections Be careful, this method doesn't support ...
@ DEFAULT
Depending on the mesh type the cross section is computed either like an isosurface or by doing classi...
@ ISOSURFACE
The cross section is computed like an isosurface.
virtual void rebuild()
Forces node-kit rebuilding.
void setCrossSectionMethod(CrossSectionMethod method=DEFAULT)
Specifies the method used to build this shape.
PoMeshCrossSection()
Constructor.
3D vector class.
Definition SbVec.h:932
Coordinate point node.
Maintains a list of pointers to fields.
Definition SoFieldList.h:72
Multiple-value field containing any number of int32_t integers.
Definition SoMFInt32.h:88
Multiple-value field containing any number of three-dimensional vectors.
Definition SoMFVec3f.h:181
Surface material definition node.
Definition SoMaterial.h:173
Field containing a plane equation.
Definition SoSFPlane.h:82
int SbBool
Boolean type.
Definition SbBase.h:87