Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PbIndexedMesh3D.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 _PB_INDEXEDMESH3D_
25#define _PB_INDEXEDMESH3D_
26
27#include <MeshViz/3Ddata/PbMesh3D.h>
28
31class PbWedgeCell;
32class PbPyramidCell;
33
63class PbIndexedMesh3D : public PbMesh3D {
64
65
66 public:
67
68
69
73 PbIndexedMesh3D(SbBool is_data_duplicate=TRUE);
74
79
84 PbIndexedMesh3D(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
85 int num_cells, const int *cell_index, const int *cell_type,
86 SbBool is_data_duplicate=TRUE) ;
87
92
97
101 friend int operator ==(const PbIndexedMesh3D &m1, const PbIndexedMesh3D &m2);
102
106 friend int operator !=(const PbIndexedMesh3D &m1, const PbIndexedMesh3D &m2)
107 { return !(m1 == m2); }
108
112 void setGeometry(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
113 int num_cells, const int *cell_index, const int *cell_type);
114
121 void setCoordinates(const float *x_nod, const float *y_nod, const float *z_nod);
122
132 void getCoordinates(const float* &xnod, const float* &ynod, const float* &znod,
133 int &size_xnod, int &size_ynod, int &size_znod) const {
134 xnod = xNodes;
135 ynod = yNodes;
136 znod = zNodes;
137 size_xnod = size_ynod = size_znod = numMeshNodes;
138 }
139
145 void getGeometry(int &num_nodes, const float* &x_nod, const float* &y_nod, const float* &z_nod,
146 int &num_cells, const int *&cell_index, const int *&cell_type) const ;
147
153 void getNodes(int &num_nodes, const float* &x_nod, const float* &y_nod, const float* &z_nod) const;
154
158 virtual SbVec3f getNodeCoord(int nod_index) const { return SbVec3f(xNodes[nod_index],yNodes[nod_index],zNodes[nod_index]);};
159
163 virtual void getNodeOwnerCellsInd(int nod_index, PbArrayOfInt &owner_cells) const;
164
171 virtual const PbCell *getCell(int cell_index) const;
172
173
174 private:
175
176 // get the length of the longest edge of the mesh
177 float getLongestEdgeLength();
178
179 void meshSkin(PoMeshSkin *mesh_skin) const ;
180 void meshSkinFilter(PoMeshSkin *_PoMeshSkin,const PoCellFilter* cellFilter) const; // will be removed
181 void meshCrossSection(PoMeshCrossSection *cross_section) const;
182 void meshCrossContour(PoMeshCrossContour *cross_contour) const;
183 void meshSkeleton(PoMeshSkeleton *skeleton, const float *nod_values,
184 float *x_cont, float *y_cont,float *z_cont) const;
185 void mesh3DVec(PoMesh3DVec *mesh_vec) const ;
186 SbBool isEmpty() const;
187 void print(FILE *fp) const;
188
189 // get a cell, but this cell has'nt coordinate specified
190 virtual const PbCell *getTopoCell(int cell_index) const;
191
192 private:
193 void updateCellBoundingBox() const;
194 virtual void updateOwnerCellsList() const;
195 virtual void deleteOwnerCellsList() const;
196 void updateBoundingBox() const;
197
198 int allocNodes;
199 float *xNodes, *yNodes, *zNodes;
200 int allocElemIndex, *elemIndex, elemIndexSize;
201 int allocElem, *elemType;
202 // set vertices coordinates of a indexed mesh
203 void setVertices(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod);
204
205 mutable PbArrayOfInt *m_ownerCellsList;
206
207 // list of the first index of each cell of this mesh
208 mutable PbArrayOfInt m_firstIndexOfCell;
209
210 private:
211 void copy(const PbIndexedMesh3D &mesh) ;
212 void destroy();
213 PbHexahedronCell *m_hexahedron;
214 PbTetrahedronCell *m_tetrahedron;
215 PbWedgeCell *m_wedge;
216 PbPyramidCell *m_pyramid;
217} ;
218
219
220inline void
221PbIndexedMesh3D::meshSkinFilter(PoMeshSkin *,const PoCellFilter* ) const
222{}
223
224/*---------------------------------------------------------------------------*/
225
226#endif /* _PB_INDEXEDMESH3D_ */
227
228
229
230
231
232
233
DTEXT Dynamic array of int .
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract cell...
Definition PbCell.h:49
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an hexahedron ce...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a volume mesh of...
PbIndexedMesh3D & operator=(const PbIndexedMesh3D &mesh)
Assignment operator.
~PbIndexedMesh3D()
Destructor.
void setCoordinates(const float *x_nod, const float *y_nod, const float *z_nod)
Set new node coordinates without modifying the mesh topology.
friend int operator==(const PbIndexedMesh3D &m1, const PbIndexedMesh3D &m2)
Equality comparison operator.
PbIndexedMesh3D(SbBool is_data_duplicate=TRUE)
Constructor of a default simple mesh.
virtual SbVec3f getNodeCoord(int nod_index) const
Gets the coordinates of a node.
void getNodes(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod) const
Gets the mesh nodes coordinate arrays.
void getGeometry(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod, int &num_cells, const int *&cell_index, const int *&cell_type) const
Gets the current mesh geometry.
virtual void getNodeOwnerCellsInd(int nod_index, PbArrayOfInt &owner_cells) const
Gets the list of index of cells that own the node "nod_index".
friend int operator!=(const PbIndexedMesh3D &m1, const PbIndexedMesh3D &m2)
Inequality comparison operator.
void getCoordinates(const float *&xnod, const float *&ynod, const float *&znod, int &size_xnod, int &size_ynod, int &size_znod) const
Get the current coordinates of the nodes of this mesh.
PbIndexedMesh3D(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod, int num_cells, const int *cell_index, const int *cell_type, SbBool is_data_duplicate=TRUE)
Constructor of a 3D volume mesh.
virtual const PbCell * getCell(int cell_index) const
Gets the cell which index is cell_index.
PbIndexedMesh3D(const PbIndexedMesh3D &mesh)
Copy constructor.
void setGeometry(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod, int num_cells, const int *cell_index, const int *cell_type)
Sets a new geometry.
<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 pyramid cell o...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an tetrahedron c...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a wedge cell of ...
Definition PbWedgeCell.h:69
<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> Representation of vector...
Definition PoMesh3DVec.h:95
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of cross-...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of cross ...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of the sk...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of the me...
Definition PoMeshSkin.h:61
3D vector class.
Definition SbVec.h:932
int SbBool
Boolean type.
Definition SbBase.h:87