Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
PbCartesianGrid2D.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_CARTESIANGRID2D_
25#define _PB_CARTESIANGRID2D_
26
28
29class PiContouring;
31
49
50
51 public:
52
56 PbCartesianGrid2D(SbBool is_data_duplicated=TRUE) ;
57
62
67 PbCartesianGrid2D(int num_x, int num_y, const float *x, const float *y, SbBool is_data_duplicated=TRUE) ;
68
73 PbCartesianGrid2D(int num_x, int num_y, const float *x, const float *y, const float *z, SbBool is_data_duplicated=TRUE) ;
74
79
84
88 friend int operator ==(const PbCartesianGrid2D &m1, const PbCartesianGrid2D &m2);
89
93 friend int operator !=(const PbCartesianGrid2D &m1, const PbCartesianGrid2D &m2)
94 { return !(m1 == m2); }
95
100 void getGeometry(int &num_x, int &num_y, const float** &xa, const float** &ya) const;
101
107 void getGeometry(int &num_x, int &num_y, const float** &xa, const float** &ya, const float**&za) const;
108
110
117 virtual const PbCell *getCell(int cell_index) const;
118
122 virtual SbVec3f getNodeCoord(int nod_index) const;
123
127 virtual SbVec3f getNodeCoord(int i, int j) const;
128
129 /*----------------------------------------------------------------------------*/
130
131
132 private:
133
134 void meshLines(PoMeshLines *_PoMeshLines) const;
135 void meshFilled(PoMeshFilled *_PoMeshFilled) const;
136 void meshContouring(PiContouring *_PiContouring, const float *z) const;
137 void mesh2DVec(PoMesh2DVec *mesh_vec) const ;
138
139 void getNodesCoord(const float *z, SoMFVec3f &vertices) const;
140
141 void print(FILE *fp) const;
142
143 private:
144 virtual const PbCell* findContainingCellProtected(const SbVec3f &point, float tolerance, SbVec3f &pcoord, PbArrayOfInt &test_cell) const;
145 PbCartesianGrid2D(int num_x, int num_y, SbBool is_data_duplicate=TRUE) ;
146 PbCartesianGrid2D(int num_x, int num_y, const float *z, SbBool is_data_duplicate=TRUE) ;
147 void setXYGeometry(int num_x, int num_y, const float *x, const float *y);
148 void getXYGeometry(const float* &x, const float* &y) const;
149
150 private:
151 float **x, **y;
152
153 void updateBoundingBox() const;
154 void copy(const PbCartesianGrid2D &mesh) ;
155 void destroy();
156 void constructXYGeometry(const float *xn, const float *yn, SbBool is_data_duplicate);
157
158 mutable PbQuadrangleCell *m_quadrangle;
159} ;
160
161/*---------------------------------------------------------------------------*/
162
163#endif /* _PB_CARTESIANGRID2D_ */
164
165
166
167
168
169
170
#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 a cartesian grid...
friend int operator!=(const PbCartesianGrid2D &m1, const PbCartesianGrid2D &m2)
Inequality comparison operator.
PbCartesianGrid2D & operator=(const PbCartesianGrid2D &mesh)
Assignment operator.
PbCartesianGrid2D(const PbCartesianGrid2D &)
Copy constructor.
PbCartesianGrid2D(SbBool is_data_duplicated=TRUE)
Constructor of a default simple mesh.
void getGeometry(int &num_x, int &num_y, const float **&xa, const float **&ya, const float **&za) const
Gets the mesh 3D geometry.
~PbCartesianGrid2D()
Destructor.
virtual SbVec3f getNodeCoord(int i, int j) const
Gets the coordinates of a node defined by its i,j indices on the grid.
void getGeometry(int &num_x, int &num_y, const float **&xa, const float **&ya) const
Gets the mesh 2D geometry.
PbCartesianGrid2D(int num_x, int num_y, const float *x, const float *y, SbBool is_data_duplicated=TRUE)
Constructor of a 2D surface mesh.
virtual SbVec3f getNodeCoord(int nod_index) const
Gets the coordinates of a node defined by its index on the grid.
virtual const PbCell * getCell(int cell_index) const
Gets the cell which index is cell_index.
friend int operator==(const PbCartesianGrid2D &m1, const PbCartesianGrid2D &m2)
Equality comparison operator.
PbCartesianGrid2D(int num_x, int num_y, const float *x, const float *y, const float *z, SbBool is_data_duplicated=TRUE)
Constructor of a 3D surface mesh.
<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
void getGeometry(int &num_x, int &num_y, const float *&x, const float *&y) const
Gets the mesh 2D geometry.
<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> 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