Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PoMesh3D.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_MESH3D_
25#define _PO_MESH3D_
26
27#include <Inventor/fields/SoSFShort.h>
28#include <Inventor/nodes/SoIndexedLineSet.h>
29
30#include <MeshViz/3Ddata/PoMesh.h>
31#include <MeshViz/3Ddata/PbCell.h> // to define SbBoolVector
32
33class SoMFVec3f;
34
35class PiMeshSkin;
36class PbMesh3D;
39class PbIndexedMesh3D;
42class PbGrid3D;
43class SoNormal;
44
53class PoMesh3D : public PoMesh {
54
55 SO_KIT_HEADER(PoMesh3D) ;
56
57
58 public:
59
60
61
65 void setMesh(PbMesh3D *mesh);
66
70 const PbMesh3D * getMesh() const;
71
72 /*----------------------------------------------------------------------------*/
73 private:
74 static void initClass() ;
75 static void exitClass() ;
76
77 void indexedMeshLevelSurfShapeIndices(PbIndexedMesh3D *mesh, int surfOrientation=1,
78 const float *per_cell_value=NULL);
79 void tetrahedronMeshLevelSurfShapeIndices(PbTetrahedronMesh3D *mesh, int surfOrientation=1,
80 const float *per_cell_value=NULL) ;
81 void hexahedronMeshLevelSurfShapeIndices(PbHexahedronMesh3D *mesh, int surfOrientation=1,
82 const float *percell_value=NULL) ;
83 virtual void addOptQuadrangle(int num_quad, int *quad_nodes, int cell_index);
84
85 virtual const float *getIsosurfDataSet() { return NULL; }
86 virtual float getIsosurfValue() const { return 0; }
87 virtual int getSurfOrientation() { return 1; }
88
89 int addSurfPoint (int nod_ind1, int nod_ind2, int32_t &point_index);
90 void computeCrossPointCoord(int index, const float *x, const float *y, const float *z, const float *v,
91 int n0, int n1, float d0, float d1);
92
96 virtual size_t getMemorySize();
97 size_t getHashTableMemorySize();
98
102 int getNumIsoCells() {
103 return m_numIsoCells;
104 }
105
106 void newIsoCell() {
107 m_numIsoCells++;
108 }
109 void clearIsoCells() {
110 m_numIsoCells = 0;
111 }
112
113 private:
114 PoMesh3D() ;
115 // Constructor
116
117 virtual ~PoMesh3D() ;
118 // Destructor
119
120 virtual void basicObjectChange(PbBase *basicObj);
121 virtual void preRebuild();
122
123 void crossPlaneAndQuadrangle(const float *x, const float *y, const float *z, const float *v,
124 const int32_t *quad_nodes, const int32_t *quad_ind, float xn,float yn,float zn,
125 float dist_plane_orig, SbBool &intersect,int32_t *point_ind);
126 void getParalCartGrid3DCrossContour(PbParalCartesianGrid3D *mesh, const float *nod_values,
127 float xn, float yn, float zn, float dist_to_origin,
128 SoIndexedLineSet *indexed_line_set, SoCoordinate3 *coordinate);
129 void getRegularGrid3DCrossContour(PbRegularCartesianGrid3D *mesh, const float *nod_values,
130 float xn, float yn, float zn, float dist_to_origin,
131 SoIndexedLineSet *indexed_line_set, SoCoordinate3 *coordinate);
132
133 virtual void initOptQuadrangleList();
134 virtual void addLevelSurfOptQuadrangle();
135
136
137 void makeCrossContour(float dist_to_origin, float xn, float yn, float zn,
138 const float *x, const float *y, const float *z, const float *nod_values,
139 SoGroup *local_group);
140 void initSurfPointList();
141
142
143 void updateSurfaceShapeBindings(SbBool strip_set_used=FALSE);
144
145 void meshLevelSurf(const PbMesh3D *mesh);
146
147 void updateLevelSurfTopology(const float *values, float &isovalue);
148 void updateLevelSurfCoord(const float *values, float isovalue);
149 void updateLevelSurfColors(const float *values, float isovalue);
150 void updateLevelSurfTextures();
151 void updateLevelSurfContouring();
152 void updateLevelSurfPointValues(std::vector< float > &point_values);
153
154 virtual int getIsosurfDataSetId() const { return -1; }
155 virtual int getIsosurfDataSetIndex() const { return -1; }
156 virtual SbVec3f getOverallNormal() const { return SbVec3f(0,0,0); }
157
158 const PbMesh3D *m_mesh3D; // mesh used by all derived Po classes
159
160 mutable PiMeshSkin *m_skin; // reference to the skin contained in the cache of skin
161
162 SbBool m_useStripSet;
163
164 mutable int m_numIsoCells; // number of cells touched by the isosurface
165 /*----------------------------------------------------------------------------*/
166
167 private:
168 SbBoolVector *m_nodeSign; // m_nodeSign[i] is true if the value at i-th node is > isovalue
169
170 PbMesh3D *m_mesh3DSet; // mesh set by the setMesh method
171 void checkOrientation(SoMFVec3f *coords, SoMFInt32 *coordIndex, SbVec3f *normal);
172
173 {
174 int index;
175 int alloc_indirect;
176 int num_indirect;
177 int *indirect_index;
178 } Tdirect;
179
180 {
181 int n1,n2; // node id of this edge
182 float r; // ratio used for interpolation of value or color
183 } Tedge_interpol;
184
185 Tedge_interpol *TTabEdgeInterpol;
186 int TAllocEdgeInterpol;
187 int TNumEdgeInterpol;
188
189 int TAllocTabDirect;
190 Tdirect *TabDirect;
191
192} ;
193
194/*----------------------------------------------------------------------------*/
195
196#endif /* _PO_MESH3D_ */
197
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract class for all b...
Definition PbBase.h:49
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract grid...
Definition PbGrid3D.h:44
<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 volu...
Definition PbMesh3D.h:51
<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
void setMesh(PbMesh3D *mesh)
Defines the current volume mesh.
const PbMesh3D * getMesh() const
Gets the current volume mesh.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Base class for all mesh ...
Definition PoMesh.h:110
3D vector class.
Definition SbVec.h:932
Coordinate point node.
Base class for all group nodes.
Definition SoGroup.h:122
Indexed polyline shape node.
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
Node that defines surface normals for shapes.
Definition SoNormal.h:101
int SbBool
Boolean type.
Definition SbBase.h:87