Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
PbQuadrangleCell.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
25#ifndef _PB_QUADRANGLECELL_
26#define _PB_QUADRANGLECELL_
27
28#include <MeshViz/3Ddata/PbCell.h>
29
30class PbMesh;
31
53class PbQuadrangleCell : public PbCell {
54
55
56 public:
57
61 PbQuadrangleCell(const PbMesh *owner_mesh) ;
62
67
72
77
81 virtual float getLongestEdgeLength() const;
82
86 virtual float getVolume() const { return 0.0; }
87
91 virtual float getArea() const;
92
97 virtual void getNodesIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
98
103 virtual void getNodesIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
104
110 virtual void getNodesLocalIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
111
117 virtual void getNodesLocalIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
118
123 virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const;
124
128 virtual void getWeight(const SbVec3f &pcoord, float *weight) const;
129
134 void getDerivs(const SbVec3f &pcoord, float *derivs) const;
135
136 /*----------------------------------------------------------------------------*/
137 private:
143 SbBool set(int index, int *node_ids, const float *x, const float *y);
144
150 SbBool set(int index, int *node_ids, const float *x, const float *y, const float *z);
151
157 SbBool set(int index, int *node_ids, float x_min, float y_min, float x_max, float y_max, const float *z);
158
159 virtual const int* getNodesLocalIndexOfEdge(int edge) const {
160 return c_edgeNodes[edge];
161 }
162
163 // Prints a formatted version of the quadrangle to the given file pointer
164 void print(FILE *fp) const;
165
166 /*----------------------------------------------------------------------------*/
167
168 private:
169 virtual unsigned char getIsosurfCaseId(SbBoolVector &nodes_sign) const;
170
171 private:
172
173 void copy(const PbQuadrangleCell &cell) ;
174 void destroy();
175 int locatePointOnXY(const SbVec3f &coord, const SbVec3f &proj_coord, float tolerance, SbVec3f &pcoord, int indx, int indy) const;
176 SbVec3f m_normal;
177 SbBool m_2DCell;
178 static int c_edgeNodes[4][2];
179};
180
181
182inline unsigned char
183PbQuadrangleCell::getIsosurfCaseId(SbBoolVector &) const
184{
185 return 0;
186}
187
188/*---------------------------------------------------------------------------*/
189
190#endif /* _PB_QUADRANGLECELL_ */
191
192
193
194
195
196
197
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 quadrangle cel...
PbQuadrangleCell(const PbMesh *owner_mesh)
Constructor of a default simple 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.
void getDerivs(const SbVec3f &pcoord, float *derivs) const
Gets the derivs of a point defined by its parametric coordinates.
PbQuadrangleCell & operator=(const PbQuadrangleCell &cell)
Assignment operator.
PbQuadrangleCell(const PbQuadrangleCell &cell)
Copy constructor.
virtual float getLongestEdgeLength() const
Gets the length of the longest edge of the cell.
~PbQuadrangleCell()
Destructor.
virtual void getNodesLocalIndexOfFacet(int facet, PbArrayOfInt &nodes_index) const
Gets the array of node index that belongs to a given facet of this cell.
virtual float getArea() const
Gets the area of a cell.
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.
virtual float getVolume() const
Returns always 0.
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.
virtual void getWeight(const SbVec3f &pcoord, float *weight) const
Gets the 4 weights of a point defined by its parametric coordinates.
virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const
Returns 1 if the point is inside the cell, 0 otherwise.
3D vector class.
Definition SbVec.h:932
int SbBool
Boolean type.
Definition SbBase.h:87