Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
PbIndexedMesh2D.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-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_INDEXEDMESH2D_
25#define _PB_INDEXEDMESH2D_
26
27#include <Inventor/STL/vector>
28
30class PiContouring;
31class PiEdgeList;
32class PiEdge;
34class PbTriangleCell;
35
64class PbIndexedMesh2D : public PbMesh2D {
65
66
67 public:
68
69
70
74 PbIndexedMesh2D(SbBool is_data_duplicate=TRUE);
75
80
85 PbIndexedMesh2D(int num_nodes, const float *x_nod, const float *y_nod,
86 int num_cells, const int *cell_index, const int *cell_type,
87 SbBool is_data_duplicate=TRUE) ;
88
93 PbIndexedMesh2D(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
94 int num_cells, const int *cell_index, const int *cell_type,
95 SbBool is_data_duplicate=TRUE) ;
96
101
106
110 friend int operator ==(const PbIndexedMesh2D &m1, const PbIndexedMesh2D &m2);
111
115 friend int operator !=(const PbIndexedMesh2D &m1, const PbIndexedMesh2D &m2)
116 { return !(m1 == m2); }
117
121 void setGeometry(int num_nodes, const float *x_nod, const float *y_nod,
122 int num_cells, const int *cell_index, const int *cell_type);
123
127 void setGeometry(int num_nodes, const float *x_nod, const float *y_nod, const float *z_nod,
128 int num_cells, const int *cell_index, const int *cell_type);
129
135 void getGeometry(int &numNode, const float* &x_nod, const float* &y_nod, const float* &z_nod,
136 int &num_cells, const int32_t *&cell_index, const int32_t *&cell_type) const ;
137
143 void getGeometry(int &numNode, const float* &x_nod, const float* &y_nod,
144 int &num_cells, const int32_t *&cell_index, const int32_t *&cell_type) const ;
145
151 void getNodes(int &num_nodes, const float* &x_nod, const float* &y_nod, const float* &z_nod) const;
152
158 void getNodes(int &num_nodes, const float* &x_nod, const float* &y_nod) const;
159
163 virtual SbVec3f getNodeCoord(int nod_index) const;
164
168 virtual void getNodeOwnerCellsInd(int nod_index, PbArrayOfInt &owner_cells) const;
169
175 virtual const PbCell *getCell(int cell_index) const;
176
194
195
196
205 virtual void setElemOrientation(ElemOrientation cell_orient);
206
207 /*----------------------------------------------------------------------------*/
208
209
210 private:
211
212 void meshLines(PoMeshLines *_PoMeshLines) const;
213 void meshFilled(PoMeshFilled *_PoMeshFilled) const;
214 void meshContouring(PiContouring *_PiContouring, const float *z) const;
215 void mesh2DVec(PoMesh2DVec *mesh_vec) const ;
216 SbBool isEmpty() const;
217
218 void print(FILE *fp) const;
219
220 ElemOrientation getElemOrientation() const;
221 const SbBool * getOrientFlags() const;
222 virtual SbVec3f getFirstCellNormal() const;
223
224 void getNodesCoord(const float *z, SoMFVec3f &vertices) const;
225
226 virtual void getLimitIndices(PbArrayOfInt &nodesIndex, PbArrayOfInt &limitSizes) const;
227
228 private:
229 PbIndexedMesh2D(int num_z, const float *z, SbBool is_data_duplicate=TRUE);
230
231 virtual const PbCell* findContainingCellProtected(const SbVec3f &point, float tolerance, SbVec3f &pcoord, PbArrayOfInt &test_cell) const;
232 void updateCellBoundingBox() const;
233 virtual void updateOwnerCellsList() const;
234 virtual void deleteOwnerCellsList() const;
235 void updateBoundingBox() const;
236
237 ElemOrientation elemOrientation;
238 SbBool *elemOrientFlags;
239 int allocNodes;
240 float *xNodes, *yNodes;
241 int32_t allocElemIndex, *elemIndex, elemIndexSize;
242 int32_t allocElem, *elemType;
243 // set vertices coordinates of an indexed mesh
244 void setVertices(int num_nodes, const float *x_nod, const float *y_nod);
245
246 mutable std::vector<PbArrayOfInt> m_ownerCellsList;
247
248 private:
249
250 void constructDefaultMesh();
251 void constructXYGeometry(int num_nodes, const float *x_nod, const float *y_nod,
252 int num_cells, const int *cell_index, const int *cell_type,
253 SbBool is_data_duplicate);
254 void setXYGeometry(int num_nodes, const float *xNode, const float *yNode,
255 int num_cells, const int *cell_index, const int *cell_type);
256
257 void copy(const PbIndexedMesh2D &mesh) ;
258 void destroy();
259
260 PbQuadrangleCell *m_quadrangle;
261 PbTriangleCell *m_triangle;
262} ;
263
264/*---------------------------------------------------------------------------*/
265
266#endif /* _PB_INDEXEDMESH2D_ */
267
268
269
270
271
272
273
#define TRUE
Possible value of SbBool.
Definition SbBase.h:77
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 a surface mesh o...
friend int operator==(const PbIndexedMesh2D &m1, const PbIndexedMesh2D &m2)
Equality comparison operator.
void setGeometry(int num_nodes, const float *x_nod, const float *y_nod, int num_cells, const int *cell_index, const int *cell_type)
Sets a new 2D geometry.
void getNodes(int &num_nodes, const float *&x_nod, const float *&y_nod, const float *&z_nod) const
Gets the mesh nodes coordinates (x,y,z coordinates)
void getGeometry(int &numNode, const float *&x_nod, const float *&y_nod, const float *&z_nod, int &num_cells, const int32_t *&cell_index, const int32_t *&cell_type) const
Gets the current mesh geometry (x, y and z nodes coordinates).
ElemOrientation
Cell orientation for visualization of 2D surface mesh.
@ ORIENTATION_ZNEG
Cell is oriented with a normal = (0,0,-1)
@ ORIENTATION_ZPOS
Cell is oriented with a normal = (0,0,1)
@ ORIENTATION_AS_IS
The cell orientation is kept.
virtual const PbCell * getCell(int cell_index) const
Gets the cell which index is cell_index.
PbIndexedMesh2D(int num_nodes, const float *x_nod, const float *y_nod, int num_cells, const int *cell_index, const int *cell_type, SbBool is_data_duplicate=TRUE)
Constructor of a 2D surface mesh.
PbIndexedMesh2D(SbBool is_data_duplicate=TRUE)
Constructor of a default simple mesh.
PbIndexedMesh2D & operator=(const PbIndexedMesh2D &mesh)
Assignment operator.
PbIndexedMesh2D(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 surface mesh.
virtual void setElemOrientation(ElemOrientation cell_orient)
Changes orientation of cells during visualization of 2D surface mesh.
friend int operator!=(const PbIndexedMesh2D &m1, const PbIndexedMesh2D &m2)
Inequality comparison operator.
void getGeometry(int &numNode, const float *&x_nod, const float *&y_nod, int &num_cells, const int32_t *&cell_index, const int32_t *&cell_type) const
Gets the current mesh geometry (x, y nodes coordinates).
~PbIndexedMesh2D()
Destructor.
PbIndexedMesh2D(const PbIndexedMesh2D &mesh)
Copy constructor.
virtual SbVec3f getNodeCoord(int nod_index) const
Gets the coordinates of a node.
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 3D geometry.
void getNodes(int &num_nodes, const float *&x_nod, const float *&y_nod) const
Gets the mesh nodes coordinates (only x,y coordinates)
virtual void getNodeOwnerCellsInd(int nod_index, PbArrayOfInt &owner_cells) const
Gets the list of index of cells that own the node "nod_index".
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract surf...
Definition PbMesh2D.h:54
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a quadrangle cel...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a triangle cell ...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of vector...
Definition PoMesh2DVec.h:97
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Filled representation of...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of the ed...
Definition PoMeshLines.h:65
3D vector class.
Definition SbVec.h:932
Multiple-value field containing any number of three-dimensional vectors.
Definition SoMFVec3f.h:181
int SbBool
Boolean type.
Definition SbBase.h:87