Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
PbTetrahedronCell.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_TETRAHEDRONCELL_
25#define _PB_TETRAHEDRONCELL_
26
27#include <MeshViz/3Ddata/PbCell.h>
28
29#ifdef USE_IOSTREAM
30# include <iostream>
31#endif
32
33class PiMatrix3;
34class PbMesh;
35class PiMarchingCase;
36
70class PbTetrahedronCell : public PbCell {
71
72
73 public:
74
78 PbTetrahedronCell(const PbMesh *owner_mesh) ;
79
84
89
94
98 virtual float getLongestEdgeLength() const;
99
103 virtual float getVolume() const;
104
108 virtual float getArea() const { return 0.0;}
109
114 virtual void getNodesIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
115
120 virtual void getNodesIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
121
127 virtual void getNodesLocalIndexOfEdge (int edge, PbArrayOfInt &nodes_index) const;
128
134 virtual void getNodesLocalIndexOfFacet (int facet, PbArrayOfInt &nodes_index) const;
135
140 virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const;
141
145 virtual void getWeight(const SbVec3f &pcoord, float *weight) const;
146
147 /*----------------------------------------------------------------------------*/
148 private:
154 SbBool set(int index, int *node_ids, float *x, float *y, float *z);
155
156 void print(FILE *fp) const;
157 // Prints a formatted version of the tetrahedron to the given file pointer
158
160 virtual int getOrdering() const;
161
162 virtual const int* getNodesLocalIndexOfEdge(int edge) const {
163 return c_edgeNodes[edge];
164 }
165
166 PiMarchingCase* getMCcase(unsigned char mc_case) const {
167 return c_MarchingLookup[mc_case];
168 }
169
170#ifdef USE_IOSTREAM
171 friend std::ostream& operator << (std::ostream& s, PbTetrahedronCell &cell);
172#endif
173
174 static SbBool init();
175 static void finish();
176 /*----------------------------------------------------------------------------*/
177
178 private:
179 virtual unsigned char getIsosurfCaseId(SbBoolVector &nodes_sign) const;
180
181 private:
182
183 void copy(const PbTetrahedronCell &cell) ;
184 void destroy();
185
186 static PiMarchingCase* addMC(PiMarchingCase *mcase);
187 static PiMarchingCase* addMCBoth(PiMarchingCase *mcase);
188
189 mutable PiMatrix3 *m_coordToPcoordMatrix;
190 mutable SbVec3f m_translatePcoord;
191 mutable SbBool m_pcoordTransfoUpdated;
192
193 mutable SbBool m_isValid;
194
195 static int c_edgeNodes[6][2];
196 static PiMarchingCase* c_MarchingLookup[16];
197 static SbBool c_isInit;
198 static int c_count;
199};
200
201/*---------------------------------------------------------------------------*/
202
203#endif /* _PB_TETRAHEDRONCELL_ */
204
205
206
207
208
209
210
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 an tetrahedron c...
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 getVolume() const
Gets the volume of the cell.
~PbTetrahedronCell()
Destructor.
virtual float getArea() const
Returns always 0.
virtual void getWeight(const SbVec3f &pcoord, float *weight) const
Gets the 4 weights of a point defined by its parametric coordinates.
virtual float getLongestEdgeLength() const
Gets the length of the longest edge of the cell.
PbTetrahedronCell(const PbTetrahedronCell &cell)
Copy constructor.
PbTetrahedronCell & operator=(const PbTetrahedronCell &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.
virtual int locatePoint(const SbVec3f &coord, float tolerance, SbVec3f &pcoord) const
Returns 1 if the point is inside the cell, 0 otherwise.
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.
PbTetrahedronCell(const PbMesh *owner_mesh)
Constructor of a default simple 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.
3D vector class.
Definition SbVec.h:932
int SbBool
Boolean type.
Definition SbBase.h:87