Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PbRegularCartesianGrid2D.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_REGULARCARTESIANGRID2D_
25#define _PB_REGULARCARTESIANGRID2D_
26
27#include <MeshViz/3Ddata/PbGrid2D.h>
28
29class PiContouring;
30class PoMeshLines;
31class PoMeshFilled;
32class PoMeshSides;
33class PbPixelCell;
35
58
59
60 public:
61
65 PbRegularCartesianGrid2D(SbBool isDataDuplicate=TRUE) ;
66
71
76 PbRegularCartesianGrid2D(int num_x,int num_y, float x_min,float y_min, float x_max,float y_max, SbBool isDataDuplicate=TRUE) ;
77
82 PbRegularCartesianGrid2D(int num_x,int num_y, float x_min,float y_min, float x_max,float y_max, const float *z,
83 SbBool isDataDuplicate=TRUE) ;
84
88 PbRegularCartesianGrid2D(int num_x,int num_y,
89 const PbRegularCartesianGrid2D &other_mesh);
90
95
100
105
110 { return !(m1 == m2); }
111
115 void setGeometry(int num_x,int num_y, float x_min,float y_min, float x_max,float y_max);
116
120 void setGeometry(int num_x,int num_y, float x_min,float y_min, float x_max,float y_max, const float *z);
121
126 void getGeometry(int &num_x,int &num_y, float &x_min,float &y_min, float &x_max,float &y_max) const;
127
133 void getGeometry(int &num_x,int &num_y, float &x_min,float &y_min, float &x_max,float &y_max, const float *&z) const;
134
135 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const;
136
150 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord) const;
151
158 virtual const PbCell *getCell(int cell_index) const;
159
163 virtual SbVec3f getNodeCoord(int nod_index) const;
164
168 virtual SbVec3f getNodeCoord(int i, int j) const;
169
173 virtual float getArea() const;
174
175
176 private:
177 void meshLines(PoMeshLines *_PoMeshLines) const;
178 void meshFilled(PoMeshFilled *_PoMeshFilled) const;
179 void meshSides(PoMeshSides *_PoMeshSides) const;
180 void meshContouring(PiContouring *_PiContouring, const float *z) const;
181 void mesh2DVec(PoMesh2DVec *mesh_vec) const ;
182 void getLimits(PoMesh2D *_PoMesh2D, Ppoint_list_list3 &limit) const;
183
184 void getNodesCoord(const float *z, SoMFVec3f &vertices) const;
185 virtual SbBool hasSidesNormals() const;
186 virtual void getSidesNormals(SbVec3f *&normals,
187 const PbArrayOfInt &limitSizes) const;
188
189 void print(FILE *fp) const;
190
191 private:
192 void constructXYGeometry(float x_min,float y_min, float x_max,float y_max, SbBool is_data_duplicate);
193 void setXYGeometry(int numX, int numY, const float *x, const float *y);
194 void getXYGeometry(const float* &x, const float* &y) const;
195
196 private:
197 float m_x[2], m_y[2];
198 float m_xmin, m_xmax, m_dx;
199 float m_ymin, m_ymax, m_dy;
200
201 void updateBoundingBox() const;
202 void copy(const PbRegularCartesianGrid2D &mesh) ;
203 void destroy();
204
205 mutable PbPixelCell *m_pixel;
206 mutable PbQuadrangleCell *m_quadrangle;
207} ;
208
209/*---------------------------------------------------------------------------*/
210
211inline void
212PbRegularCartesianGrid2D::getGeometry(int &num_x,int &num_y, float &x_min,float &y_min, float &x_max,float &y_max) const
213{
214 num_x = numX; x_min = m_xmin; x_max = m_xmax;
215 num_y = numY; y_min = m_ymin; y_max = m_ymax;
216}
217
218inline void
219PbRegularCartesianGrid2D::getGeometry(int &num_x,int &num_y, float &x_min,float &y_min, float &x_max,float &y_max, const float *&zn) const
220{
221 num_x = numX; x_min = m_xmin; x_max = m_xmax;
222 num_y = numY; y_min = m_ymin; y_max = m_ymax;
223 zn = m_zCoord;
224}
225
226#endif /* _PB_REGULARCARTESIANGRID2D_ */
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 abstract grid...
Definition PbGrid2D.h:43
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a pixel cell of ...
Definition PbPixelCell.h:51
<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 regular cartes...
void setGeometry(int num_x, int num_y, float x_min, float y_min, float x_max, float y_max, const float *z)
Defines a new 3D geometry.
virtual float getArea() const
Gets the area of the mesh.
virtual SbVec3f getNodeCoord(int nod_index) const
Gets the coordinates of a node defined by its index.
friend int operator!=(const PbRegularCartesianGrid2D &m1, const PbRegularCartesianGrid2D &m2)
Inequality comparison operator.
virtual const PbCell * findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord) const
Find the mesh's cell that contains the point.
virtual const PbCell * getCell(int cell_index) const
Gets the cell which index is cell_index.
PbRegularCartesianGrid2D & operator=(const PbRegularCartesianGrid2D &mesh)
Assignment operator.
void getGeometry(int &num_x, int &num_y, float &x_min, float &y_min, float &x_max, float &y_max) const
Gets the mesh 2D geometry.
virtual SbVec3f getNodeCoord(int i, int j) const
Gets the coordinates of a node defined by its i,j indices on the grid.
virtual const PbCell * findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const
PbRegularCartesianGrid2D(int num_x, int num_y, float x_min, float y_min, float x_max, float y_max, const float *z, SbBool isDataDuplicate=TRUE)
Constructor of a 3D regular grid mesh.
~PbRegularCartesianGrid2D()
Destructor.
void setGeometry(int num_x, int num_y, float x_min, float y_min, float x_max, float y_max)
Defines a new 2D geometry.
PbRegularCartesianGrid2D(const PbRegularCartesianGrid2D &mesh)
Copy constructor.
friend int operator==(const PbRegularCartesianGrid2D &m1, const PbRegularCartesianGrid2D &m2)
Equality comparison operator.
PbRegularCartesianGrid2D(int num_x, int num_y, const PbRegularCartesianGrid2D &other_mesh)
Constructor of a regular grid mesh, by refining the given other_mesh.
PbRegularCartesianGrid2D(int num_x, int num_y, float x_min, float y_min, float x_max, float y_max, SbBool isDataDuplicate=TRUE)
Constructor of a 2D regular grid mesh.
PbRegularCartesianGrid2D(SbBool isDataDuplicate=TRUE)
Constructor of a default simple mesh.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Base class for all surfa...
Definition PoMesh2D.h:53
<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
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Class to build the sides...
Definition PoMeshSides.h:72
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