Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
PbPixelCell.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_PIXELCELL_
25#define _PB_PIXELCELL_
26
27#include <MeshViz/3Ddata/PbCell.h>
28
29class PbMesh;
30
51class PbPixelCell : public PbCell {
52
53
54 public:
55
59 PbPixelCell(const PbMesh *owner_mesh) ;
60
65
70
75
79 float getLongestEdgeLength() const;
80
85
90 void getBounds(float &xmin,float &ymin, float &zmin,
91 float &xmax,float &ymax, float &zmax) const;
92
97
101 float getVolume() const { return 0.0;}
102
106 float getArea() const { return m_dx*m_dy;}
107
112 virtual void getNodesIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
113
118 virtual void getNodesIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
119
125 virtual void getNodesLocalIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
126
132 virtual void getNodesLocalIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
133
138 virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const;
139
143 virtual void getWeight(const SbVec3f &pcoord, float *weight) const;
144
152 float getValue(const SbVec3f &pcoord, const float *s) const;
153
161 SbVec3f getValue(const SbVec3f &pcoord, const SbVec3f *v) const;
162
163 /*----------------------------------------------------------------------------*/
164 private:
169 SbBool set(int index, int *node_ids,
170 float x_min, float y_min,
171 float x_max, float y_max);
172
173 void print(FILE *fp) const;
174 // Prints a formatted version of the pixel to the given file pointer
175
176 virtual const int* getNodesLocalIndexOfEdge(int edge) const {
177 return c_edgeNodes[edge];
178 }
179
180 /*----------------------------------------------------------------------------*/
181
182 private:
183 virtual unsigned char getIsosurfCaseId(SbBoolVector &nodes_sign) const;
184
185 private:
186
187 void copy(const PbPixelCell &cell) ;
188 void destroy();
189
190 float m_xmin,m_ymin, m_xmax,m_ymax, m_dx,m_dy;
191
192 static int c_edgeNodes[4][2];
193};
194
195
196inline unsigned char
197PbPixelCell::getIsosurfCaseId(SbBoolVector &) const
198{
199 return 0;
200}
201
202/*---------------------------------------------------------------------------*/
203
204#endif /* _PB_PIXELCELL_ */
205
206
207
208
209
210
211
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 mesh...
Definition PbMesh.h:84
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a pixel cell of ...
Definition PbPixelCell.h:51
float getArea() const
Gets the area of a cell.
PbPixelCell(const PbPixelCell &cell)
Copy constructor.
virtual void getWeight(const SbVec3f &pcoord, float *weight) const
Gets the 4 weights of a point defined by its parametric coordinates.
float getLongestEdgeLength() const
Gets the length of the longest edge of the cell.
virtual void getNodesIndexOfEdge(int edge, PbArrayOfInt &nodes_index) const
Gets the array of 2 index mesh's nodes that belongs to a given edge of this cell.
PbPixelCell & operator=(const PbPixelCell &cell)
Assignment operator.
virtual void getNodesIndexOfFacet(int facet, PbArrayOfInt &nodes_index) const
Gets the array of index mesh's nodes that belongs to a given facet of this cell.
float getValue(const SbVec3f &pcoord, const float *s) const
Get the scalar value of a point in the cell.
void getBounds(float &xmin, float &ymin, float &zmin, float &xmax, float &ymax, float &zmax) const
Gets the cell's bounds.
virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const
Returns 1 if the point is inside the cell, 0 otherwise.
~PbPixelCell()
Destructor.
SbBox3f getBoundingBox() const
Gets the cell's bounding box.
PbPixelCell(const PbMesh *owner_mesh)
Constructor of a default simple cell.
SbVec3f getCenter() const
Gets the cell's geometric center.
virtual void getNodesLocalIndexOfEdge(int edge, PbArrayOfInt &nodes_index) const
Gets the array of 2 nodes index that belongs to a given edge of this cell.
SbVec3f getValue(const SbVec3f &pcoord, const SbVec3f *v) const
Get the vector value of a point in the cell.
float getVolume() const
Returns always 0.
virtual void getNodesLocalIndexOfFacet(int facet, PbArrayOfInt &nodes_index) const
Gets the array of node index that belongs to a given facet of this cell.
3D box class.
Definition SbBox.h:649
3D vector class.
Definition SbVec.h:932
int SbBool
Boolean type.
Definition SbBase.h:87