Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
PbCartesianGrid3D.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_CARTESIANGRID3D_
25#define _PB_CARTESIANGRID3D_
26
28
30
47
48
49 public:
50
54 PbCartesianGrid3D(SbBool is_data_duplicated=TRUE) ;
55
60
64 PbCartesianGrid3D(int num_x, int num_y, int num_z, const float *xnod, const float *ynod, const float *znod,
65 SbBool is_data_duplicated=TRUE) ;
66
71
76
80 friend int operator ==(const PbCartesianGrid3D &m1, const PbCartesianGrid3D &m2);
81
85 friend int operator !=(const PbCartesianGrid3D &m1, const PbCartesianGrid3D &m2)
86 { return !(m1 == m2); }
87
94 void setCoordinates(const float *xnod, const float *ynod, const float *znod);
95
106 void getCoordinates(const float* &xnod, const float* &ynod, const float* &znod,
107 int &size_xnod, int &size_ynod, int &size_znod) const {
108 xnod = x[0][0];
109 ynod = y[0][0];
110 znod = z[0][0];
111 size_xnod = size_ynod = size_znod = numMeshNodes;
112 }
113
118 void getGeometry(int &num_x, int &num_y, int &num_z, const float*** &xa, const float*** &ya, const float*** &za) const;
119
121
128 virtual const PbCell *getCell(int cell_index) const;
129
133 virtual SbVec3f getNodeCoord(int nod_index) const;
134
138 SbVec3f getNodeCoord(int i, int j, int k) const {return SbVec3f(x[i][j][k],y[i][j][k],z[i][j][k]);};
139
140 /*----------------------------------------------------------------------------*/
141
142
143 private:
144
145 float getLongestEdgeLength();
146 // Gets the length of the longest edge of the mesh
147
148 void meshCrossSection(PoMeshCrossSection *cross_section) const;
149 void meshCrossContour(PoMeshCrossContour *cross_contour) const ;
150 void meshSkeleton(PoMeshSkeleton *skeleton, const float *nod_values,
151 float *x_cont, float *y_cont,float *z_cont) const;
152 void mesh3DVec(PoMesh3DVec *mesh_vec) const ;
153 void print(FILE *fp) const;
154
155 // get a cell, but this cell has'nt coordinate specified
156 virtual const PbCell *getTopoCell(int cell_index) const;
157
158 private:
159 PbCartesianGrid3D(int num_x, int num_y, int num_z, SbBool is_data_duplicate=TRUE) ;
160 void updateCellBoundingBox() const;
161 void setXYZGeometry(int num_x, int num_y, int num_z, const float *x, const float *y, const float *z);
162 void getXYZGeometry(const float* &x, const float* &y, const float* &z) const;
163 virtual void grid3DSkin(PoMeshSkin *_PoMeshSkin) const;
164
165 private:
166 void updateBoundingBox() const;
167
168 float ***x, ***y, ***z;
169
170 void copy(const PbCartesianGrid3D &mesh) ;
171 void destroy();
172
173 mutable PbHexahedronCell *m_hexahedron;
174
175} ;
176
177/*---------------------------------------------------------------------------*/
178
179#endif /* _PB_CARTESIANGRID3D_ */
180
181
182
183
184
185
186
#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...
PbCartesianGrid3D & operator=(const PbCartesianGrid3D &mesh)
Assignment operator.
friend int operator!=(const PbCartesianGrid3D &m1, const PbCartesianGrid3D &m2)
Inequality comparison operator.
virtual const PbCell * getCell(int cell_index) const
Gets the cell which index is cell_index.
PbCartesianGrid3D(int num_x, int num_y, int num_z, const float *xnod, const float *ynod, const float *znod, SbBool is_data_duplicated=TRUE)
Constructor of a volume mesh.
virtual SbVec3f getNodeCoord(int nod_index) const
Gets the coordinates of a node defined by its index.
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.
PbCartesianGrid3D(SbBool is_data_duplicated=TRUE)
Constructor.
PbCartesianGrid3D(const PbCartesianGrid3D &)
Copy constructor.
friend int operator==(const PbCartesianGrid3D &m1, const PbCartesianGrid3D &m2)
Equality comparison operator.
~PbCartesianGrid3D()
Destructor.
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.
void setCoordinates(const float *xnod, const float *ynod, const float *znod)
Set new node coordinates without modifying the mesh topology.
void getGeometry(int &num_x, int &num_y, int &num_z, const float ***&xa, const float ***&ya, const float ***&za) const
Gets the mesh geometry.
<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 abstract grid...
Definition PbGrid3D.h:44
void getGeometry(int &num_x, int &num_y, int &num_z, const float *&x, const float *&y, const float *&z) const
Gets the mesh geometry.
<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> 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