Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PbWedgeCell.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_WEDGECELL_
25#define _PB_WEDGECELL_
26
27#include <MeshViz/3Ddata/PbCell.h>
28
29#ifdef USE_IOSTREAM
30# include <iostream>
31#endif
32
33class PbMesh;
34class PiMarchingCase;
35
69class PbWedgeCell : public PbCell {
70
71
72 public:
73
77 PbWedgeCell(const PbMesh *owner_mesh) ;
78
83
88
93
97 virtual float getLongestEdgeLength() const;
98
102 virtual float getVolume() const;
103
107 virtual float getArea() const { return 0.0;}
108
113 virtual void getNodesIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
114
119 virtual void getNodesIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
120
126 virtual void getNodesLocalIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
127
133 virtual void getNodesLocalIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
134
139 virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const;
140
144 virtual void getWeight(const SbVec3f &pcoord, float *weight) const;
145
150 void getDerivs(const SbVec3f &pcoord, float *weight) const;
151
152 /*----------------------------------------------------------------------------*/
153 private:
157 SbBool set(int index, int *node_ids, float *x, float *y, float *z);
158
159 void print(FILE *fp) const;
160 // Prints a formatted version of the wedge to the given file pointer
161
163 virtual int getOrdering() const;
164
165 virtual const int* getNodesLocalIndexOfEdge(int edge) const {
166 return c_edgeNodes[edge];
167 }
168
169 PiMarchingCase* getMCcase(unsigned char mc_case) const {
170 return c_MarchingLookup[mc_case];
171 }
172
173#ifdef USE_IOSTREAM
174 friend std::ostream& operator << (std::ostream& s, PbWedgeCell &cell);
175#endif
176
177 static SbBool init();
178 static void finish();
179 /*----------------------------------------------------------------------------*/
180
181 private:
182 virtual unsigned char getIsosurfCaseId(SbBoolVector &nodes_sign) const;
183
184 private:
185
186 void copy(const PbWedgeCell &cell) ;
187 void destroy();
188
189 static PiMarchingCase* addMC(PiMarchingCase *mcase);
190 static PiMarchingCase* addMCBoth(PiMarchingCase *mcase);
191
192 static int c_edgeNodes[9][2];
193 static PiMarchingCase* c_MarchingLookup[64];
194 static SbBool c_isInit;
195 static int c_count;
196};
197
198/*---------------------------------------------------------------------------*/
199
200#endif /* _PB_WEDGECELL_ */
201
202
203
204
205
206
207
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 wedge cell of ...
Definition PbWedgeCell.h:69
~PbWedgeCell()
Destructor.
virtual void getNodesIndexOfFacet(int facet, PbArrayOfInt &nodes_index) const
Returns the array of index mesh's nodes that belong to a given facet of this cell.
virtual float getVolume() const
Returns the volume of the cell.
virtual void getNodesIndexOfEdge(int edge, PbArrayOfInt &nodes_index) const
Returns the array of the 2 index mesh's nodes that belong to a given edge of this cell.
virtual void getWeight(const SbVec3f &pcoord, float *weight) const
Returns the 6 weights of a point defined by its parametric coordinates.
PbWedgeCell(const PbMesh *owner_mesh)
Constructor of a default simple cell.
virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const
Returns 1 if the point is inside the cell, 0 otherwise.
PbWedgeCell & operator=(const PbWedgeCell &cell)
Assignment operator.
virtual void getNodesLocalIndexOfEdge(int edge, PbArrayOfInt &nodes_index) const
Returns the array of the 2 node indices that belong to a given edge of this cell.
virtual float getArea() const
Always returns 0.
PbWedgeCell(const PbWedgeCell &cell)
Copy constructor.
virtual void getNodesLocalIndexOfFacet(int facet, PbArrayOfInt &nodes_index) const
Returns the array of node indices that belong to a given facet of this cell.
void getDerivs(const SbVec3f &pcoord, float *weight) const
Returns the derivs of a point defined by its parametric coordinates.
virtual float getLongestEdgeLength() const
Returns the length of the longest edge of the cell.
3D vector class.
Definition SbVec.h:932
int SbBool
Boolean type.
Definition SbBase.h:87