Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
PbMesh1D.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_MESH1D_
25#define _PB_MESH1D_
26
27#include <MeshViz/3Ddata/PbMesh.h>
28
29class PoChart ;
30class SoMaterial ;
31class SoState ;
32
42class PbMesh1D : public PbMesh {
43
44
45 public:
46
50 virtual float getVolume() const { return 0.0;}
51
55 virtual float getArea() const { return 0.0 ;}
56
60 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const;
61
65 virtual const PbCell* findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord) const;
66
70 virtual const PbCell *getCell(int cell_index) const;
71
72 virtual void getAdjacentCellsIndByNode(int cell_index, PbArrayOfInt &adjacent_cells) const;
73
74 virtual void getAdjacentCellsIndByFacet(int cell_index, PbArrayOfInt &adjacent_cells) const;
75
76 virtual void getNodeOwnerCellsInd(int nod_index, PbArrayOfInt &owner_cells) const;
77
81 virtual void getNodesOwnerCellsInd(const PbArrayOfInt &nod_indices, PbArrayOfInt &owner_cells) const;
82
86 PbMesh1D& operator=(const PbMesh1D &mesh) ;
87
88 /*----------------------------------------------------------------------------*/
89 private:
90 virtual void print(FILE *fp) const;
91
92 // Retrieves the geometry of the mesh1D
93 // A color is retrieved for each vertex of the geometry.
94 // The indices of the source points (if the curve is smoothed for
95 // instance) can be retreived.
96 virtual void getXYGeometry(const PoChart *chartRep,
97 const SoState *state,
98 int &size,
99 float* &x,
100 float* &y,
101 SoMaterial* &matPerVertex,
102 SbBool isIndexSourceNeeded,
103 int* &indexSource) const;
104
105 // Retrieves the filtered (according to the current mesh 1D filter)
106 // geometry of the mesh1D.
107 // A color is retrieved for each vertex of the geometry.
108 // For filters which need an interpolation (PoPeriodFilter/PoCoordinateListFilter)
109 virtual void getFilteredXYGeometry(const PoChart *chartRep,
110 const SoState *state,
111 int &size,
112 float* &x,
113 float* &y,
114 SoMaterial* &matPerVertex) const ;
115
116 virtual void getFilteredXYGeometry(const PoChart *chartRep,
117 const SoState *state,
118 int &size,
119 float* &x,
120 float* &y,
121 SoMaterial* &matPerVertex,
122 float *&vset1) const ;
123
124 virtual void getFilteredXYGeometry(const PoChart *chartRep,
125 const SoState *state,
126 int &size,
127 float* &x,
128 float* &y,
129 SoMaterial* &matPerVertex,
130 float *&vset1,
131 float *&vset2) const ;
132
133 // Retrieves the geometry of the mesh1D adding points corresponding
134 // to the intersection between the geometry and a vertical or horizontal
135 // threshold.
136 // A color is retrieved for each vertex of the geometry.
137 // The indices of the source points (if the curve is smoothed for
138 // instance) can be retreived.
139 void getGeometryInterThreshold(const PoChart *chartRep,
140 const SoState *state,
141 SbBool isVertOrient, float threshold,
142 int &sizeTmp, float* &xTmp, float* &yTmp,
143 SoMaterial* &matTmp, SbBool isIndexSourceNeeded,
144 int* &indexSource, int &numInters, int* &indexInters) const ;
145
146 virtual float getXCoord(int nodeIndex) const=0 ;
147
148 private:
149 PbMesh1D() ;
150 // Constructor.
151
152 PbMesh1D(const PbMesh1D &_mesh) ;
153 // Contructor per copy.
154
155 virtual void updateCellBoundingBox() const;
156 virtual const PbCell* findContainingCellProtected(const SbVec3f &point, float tolerance,
157 SbVec3f &pcoord, PbArrayOfInt &test_cell) const;
158
159 int m_size ;
160
161 private:
162 void copy(const PbMesh1D &other_mesh) ;
163
164 static void setMaterialInterVertex(const float *x, const float *y, int startIndex,
165 int num, SoMaterial *matPerVertex) ;
166
167 static void setMaterialAtVertex(const SoMaterial *matSrc, const float *colValSet,
168 int srcIndex, int index, SoMaterial *matPerVertex) ;
169
170 static void interpolateMaterial(SoMaterial *srcMat, int startIndexSrc, int endIndexSrc,
171 float value, SoMaterial *dstMat, int indexDst) ;
172
173 static SbBool isBBoxCurveThresholdInter(const SbBox2f &bboxCurve, SbBool isVertOrient,
174 float threshold) ;
175} ;
176
177inline const PbCell*
178PbMesh1D::findContainingCell(const SbVec3f &, float , SbVec3f &, const PbCell *) const
179{ return NULL ; }
180
181inline const PbCell*
183{ return NULL ; }
184
185inline const PbCell *
187{ return NULL ; }
188
189inline const PbCell*
190PbMesh1D::findContainingCellProtected(const SbVec3f &, float, SbVec3f &, PbArrayOfInt &) const
191{ return NULL ; }
192
193
194/*---------------------------------------------------------------------------*/
195
196#endif /* _PB_MESH1D_ */
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 mono...
Definition PbMesh1D.h:42
virtual void getAdjacentCellsIndByNode(int cell_index, PbArrayOfInt &adjacent_cells) const
Gets the list of indices of cells that are adjacent (by a node) to cell_index.
virtual const PbCell * findContainingCell(const SbVec3f &point, float tolerance, SbVec3f &pcoord, const PbCell *adjacent_cell) const
Returns always NULL.
Definition PbMesh1D.h:178
virtual void getAdjacentCellsIndByFacet(int cell_index, PbArrayOfInt &adjacent_cells) const
Gets the list of indices of cells that are adjacent (by a facet) to cell_index.
virtual const PbCell * getCell(int cell_index) const
Returns always NULL.
Definition PbMesh1D.h:186
virtual void getNodesOwnerCellsInd(const PbArrayOfInt &nod_indices, PbArrayOfInt &owner_cells) const
Returns always an empty list of index.
virtual void getNodeOwnerCellsInd(int nod_index, PbArrayOfInt &owner_cells) const
Gets the list of indices of cells that own the node "nod_index".
virtual float getArea() const
Returns always 0.
Definition PbMesh1D.h:55
virtual float getVolume() const
Returns always 0.
Definition PbMesh1D.h:50
PbMesh1D & operator=(const PbMesh1D &mesh)
Assignment operator.
<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> Abstract base class for ...
Definition PoChart.h:44
2D box class.
Definition SbBox.h:1798
3D vector class.
Definition SbVec.h:932
Surface material definition node.
Definition SoMaterial.h:173
Traversal state.
Definition SoState.h:74
int SbBool
Boolean type.
Definition SbBase.h:87