Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
PbParalCartesianGrid3D.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_PARALCARTESIANGRID3D_
25#define _PB_PARALCARTESIANGRID3D_
26
28class PbVoxelCell;
29
50
51
52 public:
53
58
63
68 PbParalCartesianGrid3D(int num_x, int num_y, int num_z, const float *xnod, const float *ynod, const float *znod, SbBool isDataDuplicate=TRUE) ;
69
74
79
84
89 { return !(m1 == m2); }
90
91 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const;
92
106 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord) const;
107
114 virtual const PbCell *getCell(int cell_index) const;
115
119 virtual SbVec3f getNodeCoord(int nod_index) const;
120
124 virtual SbVec3f getNodeCoord(int i, int j, int k) const {return SbVec3f(x[i],y[j],z[k]);};
125
129 virtual float getVolume() const { return fabs((x[numX-1]-x[0])*(y[numY-1]-y[0])*(z[numZ-1]-z[0])); }
130
131
138 void setCoordinates(const float *xnod, const float *ynod, const float *znod);
139
149 void getCoordinates(const float* &xnod, const float* &ynod, const float* &znod,
150 int &num_x, int &num_y, int &num_z) const {
151 xnod = x; num_x = numX;
152 ynod = y; num_y = numY;
153 znod = z; num_z = numZ;
154 }
155
156 private:
157
158 // get the length of the longest edge of the mesh
159 float getLongestEdgeLength();
160
161 void meshCrossSection(PoMeshCrossSection *cross_section) const;
162 void meshCrossContour(PoMeshCrossContour *cross_contour) const ;
163 void meshSkeleton(PoMeshSkeleton *skeleton, const float *nod_values,
164 float *x_cont, float *y_cont,float *z_cont) const;
165 void mesh3DVec(PoMesh3DVec *mesh_vec) const ;
166 SbBool isCrossSectionOptimal() const { return TRUE; }
167
168 void print(FILE *fp) const;
169
170 // get a cell, but this cell has'nt coordinate specified
171 virtual const PbCell *getTopoCell(int cell_index) const;
172
173 private:
174 void updateCellBoundingBox() const;
175 void setXYZGeometry(int num_x, int num_y, int num_z, const float *xa, const float *ya, const float *za);
176 void getXYZGeometry(const float* &xa, const float* &ya, const float* &za) const;
177 virtual void grid3DSkin(PoMeshSkin *_PoMeshSkin) const;
178
179 private:
180 float *x, *y, *z;
181
182 void updateBoundingBox() const;
183 void copy(const PbParalCartesianGrid3D &mesh) ;
184 void destroy();
185
186 mutable PbVoxelCell *m_voxel;
187} ;
188
189/*---------------------------------------------------------------------------*/
190
191#endif /* _PB_PARALCARTESIANGRID3D_ */
192
193
194
195
196
197
198
#define TRUE
Possible value of SbBool.
Definition SbBase.h:77
<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 an abstract cell...
Definition PbCell.h:49
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a parallel carte...
PbParalCartesianGrid3D(const PbParalCartesianGrid3D &)
Copy constructor.
PbParalCartesianGrid3D(SbBool isDataDuplicate=TRUE)
Constructor of a default simple mesh.
virtual SbVec3f getNodeCoord(int nod_index) const
Gets the coordinates of a node.
PbParalCartesianGrid3D & operator=(const PbParalCartesianGrid3D &mesh)
Assignment operator.
virtual float getVolume() const
Gets the volume of the mesh.
virtual const PbCell * findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const
friend int operator!=(const PbParalCartesianGrid3D &m1, const PbParalCartesianGrid3D &m2)
Inequality comparison operator.
~PbParalCartesianGrid3D()
Destructor.
friend int operator==(const PbParalCartesianGrid3D &m1, const PbParalCartesianGrid3D &m2)
Equality comparison operator.
virtual const PbCell * findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord) const
Find the mesh's cell that contains the point.
void getCoordinates(const float *&xnod, const float *&ynod, const float *&znod, int &num_x, int &num_y, int &num_z) const
Get the current coordinates of the nodes of this mesh.
virtual const PbCell * getCell(int cell_index) const
Gets the cell which index is cell_index.
virtual SbVec3f getNodeCoord(int i, int j, int k) const
Gets the coordinates of a node defined by its i,j,k indices on the grid.
PbParalCartesianGrid3D(int num_x, int num_y, int num_z, const float *xnod, const float *ynod, const float *znod, SbBool isDataDuplicate=TRUE)
Constructor of a 3D parallel grid mesh.
void setCoordinates(const float *xnod, const float *ynod, const float *znod)
Set new node coordinates without modifying the mesh topology.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a voxel cell of ...
Definition PbVoxelCell.h:63
<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