Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
PoMesh3DVec.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 _PO_MESH3DVEC_
25#define _PO_MESH3DVEC_
26
27#include <Inventor/SbLinear.h>
28#include <MeshViz/3Ddata/PoMesh3D.h>
29
30class PiArrow;
31class PbIndexedMesh3D;
37
95class PoMesh3DVec : public PoMesh3D {
96
97 SO_KIT_HEADER(PoMesh3DVec) ;
98
99 /* Define fields for new parts */
100 SO_KIT_CATALOG_ENTRY_HEADER(bodySep);
101 SO_KIT_CATALOG_ENTRY_HEADER(bodyApp);
102 SO_KIT_CATALOG_ENTRY_HEADER(bodyGroup);
103
104 SO_KIT_CATALOG_ENTRY_HEADER(startArrowSep);
105 SO_KIT_CATALOG_ENTRY_HEADER(startArrowApp);
106 SO_KIT_CATALOG_ENTRY_HEADER(startArrowGroup);
107
108 SO_KIT_CATALOG_ENTRY_HEADER(endArrowSep);
109 SO_KIT_CATALOG_ENTRY_HEADER(endArrowApp);
110 SO_KIT_CATALOG_ENTRY_HEADER(endArrowGroup);
111
112
113 public:
114
119
123 virtual void rebuild() ;
124
134
135
136
145
146
147
155
156
157
165
166
167
184
185
186
194
195
196
205
206
207
208 /* Fields */
209
215
225
231
237
238
239
240 /* Body representation */
241
247
254
259
269
274
293
294
295
296 /* Start arrow representation */
297
303
312
317
322
340
341
342
343 /* End arrow representation */
344
350
359
364
369
387
388 /*----------------------------------------------------------------------------*/
389 private:
390 static void initClass() ;
391 static void exitClass() ;
392
393 void indexedMesh3DVec(PbIndexedMesh3D *mesh) ;
394 void tetrahedronMesh3DVec(PbTetrahedronMesh3D *mesh) ;
395 void hexahedronMesh3DVec(PbHexahedronMesh3D *mesh) ;
396 void cartGrid3DVec(PbCartesianGrid3D *mesh) ;
397 void paralCartGrid3DVec(PbParalCartesianGrid3D *mesh) ;
398 void regularGrid3DVec(PbRegularCartesianGrid3D *mesh) ;
399
400 private:
401 virtual ~PoMesh3DVec() ;
402 // Destructor
403
404 // Methods
405 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
406 virtual void setDefaultOnNonWritingFields();
407 virtual void addElementsAllCaches() ;
408 virtual void preRebuild();
409
410 void addVector(const SbVec3f &orig, const SbVec3f &vec);
411 void startVectorField();
412 void finishVectorField();
413
414 SoGroup *m_bodyGroupNode, *m_startArrowGroupNode, *m_endArrowGroupNode;
415
416 PiArrow *m_arrow;
417 const float *m_scalarDataSet;
418 int m_vecIndexToDraw, m_vecIndex;
419
420 int m_allocVecPoints, m_allocModuleColr, m_allocScalarColr,
421 m_allocModuleTransparencies, m_allocScalarTransparencies,
422 m_numVecP, m_numVec;
423 float (*m_vecPoints)[3];
424 float (*m_moduleColr)[3];
425 float (*m_scalarColr)[3];
426 float *m_moduleTransparencies, *m_scalarTransparencies;
427
428 /*----------------------------------------------------------------------------*/
429 private:
430
431 void drawVectorLine(int nod_index);
432
433 void drawVectorLineScalarColr(int nod_index);
434 void drawVectorLineScalarTranspColr(int nod_index);
435
436 void drawVectorLineModuleColr(int nod_index);
437 void drawVectorLineModuleTranspColr(int nod_index);
438
439 void drawVectorLineScalarModuleColr(int nod_index);
440 void drawVectorLineScalarModuleTranspColr(int nod_index);
441
442 void drawVectorElaborated(int nod_index);
443
444 void finishQuickVectorField();
445 void finishElaboratedVectorField();
446 void buildVectorFieldBodies();
447 void buildVectorFieldStartArrow();
448 void buildVectorFieldEndArrow();
449
450 void (PoMesh3DVec::*drawVector)(int nod_index);
451 void (PoMesh3DVec::*finishVectorFieldPtr)();
452
453 // Sensors
454 FieldSensorList m_fieldSensorList ;
455
456 // List of fields defined in this class
457 SoFieldList m_fieldList ;
458
459 SbVec3f m_arrowPoints[2];
460 float m_vecLength, m_arrowLength;
461
462 ArrowColoringType m_bodyColoringType, m_startArrowColoringType, m_endArrowColoringType;
463} ;
464
465/*----------------------------------------------------------------------------*/
466
467#endif /* _PO_MESH3DVEC_ */
468
469
470
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a cartesian grid...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a mesh of hexahe...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a volume mesh of...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a parallel carte...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a regular cartes...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a mesh of tetrah...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Base class for all volum...
Definition PoMesh3D.h:53
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of vector...
Definition PoMesh3DVec.h:95
SoSFInt32 density
Vector field density filter.
SoSFEnum bodyRadiusType
Defines type of method to compute the cylinder's radius.
ArrowHeightType
Type of height of an arrow.
SoSFEnum bodyColoringType
coloring method of the body.
BodyLengthType
Type of body lenght.
SoSFEnum bodyShape
Type of shape (no body, line, cylinder) used to draw the body.
SoSFEnum eliminationStatus
If eliminationStatus = TOO_SMALL, the vectors which module is lower than minLength are not drawn.
SoSFEnum startArrowHeightType
Defines the type of method to compute the arrow height.
SoSFFloat startArrowRadiusFactor
The start-arrow's radius is start-arrow's height * startArrowRadiusFactor.
SoSFFloat startArrowHeightFactor
Height (or Height multiplicative factor) of the arrow shape.
SoSFFloat bodyRadiusFactor
Radius (or radius multiplicative factor) of the cylinder.
SoSFEnum endArrowHeightType
Defines the type of method to compute the arrow height.
SoSFEnum startArrowColoringType
Coloring method of the start shape.
SoSFFloat bodyLengthFactor
Length (or length multiplicative factor) of the body shape.
SoSFFloat maxLength
Maximum length of the vector to be drawn.
SoSFEnum endArrowColoringType
Coloring method of the end shape.
BodyRadiusType
Type of body radius.
SoSFEnum bodyLengthType
If bodyLengthType = CONSTANT_LENGTH, each vector has the same body length = bodyLengthFactor .
PoMesh3DVec()
Constructor.
EliminationStatus
Type of vector elimination.
SoSFEnum endArrowShape
Type of shape to be drawn at the end point of the body.
ArrowColoringType
Type of arrow coloring.
ArrowShape
Type of arrow shape.
SoSFEnum startArrowShape
Type of shape to be drawn at the start point of the body.
BodyShape
Type of body shape.
SoSFFloat endArrowHeightFactor
Height (or Height multiplicative factor) of the arrow shape.
virtual void rebuild()
Forces node-kit rebuilding.
SoSFFloat endArrowRadiusFactor
The end-arrow's radius is end-arrow's height * endArrowRadiusFactor.
SoSFFloat minLength
Minimum length of the vector to be drawn.
3D vector class.
Definition SbVec.h:932
Maintains a list of pointers to fields.
Definition SoFieldList.h:72
Base class for all group nodes.
Definition SoGroup.h:122
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a int32_t integer.
Definition SoSFInt32.h:80
int SbBool
Boolean type.
Definition SbBase.h:87