Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
PoMesh2DVec.h
Go to the documentation of this file.
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_MESH2DVEC_
25#define _PO_MESH2DVEC_
26
27#include <Inventor/SbLinear.h>
29
30class PiArrow;
32class PbGrid2D;
33class PbIndexedMesh2D;
34class PbMesh2D;
37class PbPolarGrid2D;
38
97class PoMesh2DVec : public PoMesh2D {
98
100
101 /* Define fields for new parts */
105
106 SO_KIT_CATALOG_ENTRY_HEADER(startArrowSep);
107 SO_KIT_CATALOG_ENTRY_HEADER(startArrowApp);
108 SO_KIT_CATALOG_ENTRY_HEADER(startArrowGroup);
109
110 SO_KIT_CATALOG_ENTRY_HEADER(endArrowSep);
111 SO_KIT_CATALOG_ENTRY_HEADER(endArrowApp);
112 SO_KIT_CATALOG_ENTRY_HEADER(endArrowGroup);
113
114
115 public:
116
121
125 virtual void rebuild() ;
126
136
137
138
147
148
149
157
158
159
167
168
169
186
187
188
196
197
198
207
208
209
210 /* Fields */
211
217
227
233
239
240
241
242 /* Body representation */
243
249
256
261
271
276
295
296
297
298 /* Start arrow representation */
299
305
314
319
324
342
343
344
345 /* End arrow representation */
346
352
361
366
371
389
390 /*----------------------------------------------------------------------------*/
391 private:
392 static void initClass() ;
393 static void exitClass() ;
394
395 void indexedMesh2DVec(PbIndexedMesh2D *mesh) ;
396 void cartGrid2DVec(PbCartesianGrid2D *mesh) ;
397 void paralCartGrid2DVec(PbParalCartesianGrid2D *mesh) ;
398 void regularCartGrid2DVec(PbRegularCartesianGrid2D *mesh) ;
399 void polarGrid2DVec(PbPolarGrid2D *mesh) ;
400
401 private:
402 virtual ~PoMesh2DVec() ;
403 // Destructor
404
405 // Methods
406 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
407 virtual void setDefaultOnNonWritingFields();
408 virtual void addElementsAllCaches() ;
409 virtual void preRebuild();
410
411 void addVector(const SbVec3f &orig, const SbVec3f &vec);
412 void startVectorField();
413 void finishVectorField();
414
415 SoGroup *m_bodyGroupNode, *m_startArrowGroupNode, *m_endArrowGroupNode;
416
417 PiArrow *m_arrow;
418 const float *m_scalarDataSet;
419 int m_vecIndexToDraw, m_vecIndex;
420
421 int m_allocVecPoints, m_allocModuleColr, m_allocScalarColr,
422 m_allocModuleTransparencies, m_allocScalarTransparencies,
423 m_numVecP, m_numVec;
424 float (*m_vecPoints)[3];
425 float (*m_moduleColr)[3];
426 float (*m_scalarColr)[3];
427 float *m_moduleTransparencies, *m_scalarTransparencies;
428
429 /*----------------------------------------------------------------------------*/
430 private:
431
432 void drawVectorLine(int nod_index);
433
434 void drawVectorLineScalarColr(int nod_index);
435 void drawVectorLineScalarTranspColr(int nod_index);
436
437 void drawVectorLineModuleColr(int nod_index);
438 void drawVectorLineModuleTranspColr(int nod_index);
439
440 void drawVectorLineScalarModuleColr(int nod_index);
441 void drawVectorLineScalarModuleTranspColr(int nod_index);
442
443 void drawVectorElaborated(int nod_index);
444
445 void finishQuickVectorField();
446 void finishElaboratedVectorField();
447 void buildVectorFieldBodies();
448 void buildVectorFieldStartArrow();
449 void buildVectorFieldEndArrow();
450
451 void (PoMesh2DVec::*drawVector)(int nod_index);
452 void (PoMesh2DVec::*finishVectorFieldPtr)();
453
454 // Sensors
455 FieldSensorList m_fieldSensorList ;
456
457 // List of fields defined in this class
458 SoFieldList m_fieldList ;
459
460 SbVec3f m_arrowPoints[2];
461 float m_vecLength, m_arrowLength;
462
463 ArrowColoringType m_bodyColoringType, m_startArrowColoringType, m_endArrowColoringType;
464} ;
465
466/*----------------------------------------------------------------------------*/
467
468#endif /* _PO_MESH2DVEC_ */
469
470
471
#define FALSE
Possible value of SbBool.
Definition SbBase.h:75
#define SO_KIT_CATALOG_ENTRY_HEADER(partName)
Definition SoSubKit.h:107
#define SO_KIT_HEADER(className)
Definition SoSubKit.h:91
<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 an abstract grid...
Definition PbGrid2D.h:43
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines a surface mesh o...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Defines an abstract surf...
Definition PbMesh2D.h:54
<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 polar grid sur...
<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> Base class for all surfa...
Definition PoMesh2D.h:53
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Representation of vector...
Definition PoMesh2DVec.h:97
SoSFEnum endArrowShape
Type of shape to be drawn at the end point of the body.
SoSFEnum startArrowShape
Type of shape to be drawn at the start point of the body.
SoSFEnum startArrowColoringType
Coloring method of the start shape.
SoSFFloat endArrowRadiusFactor
The end-arrow's radius is end-arrow's height * endArrowRadiusFactor.
virtual void rebuild()
Forces node-kit rebuilding.
SoSFEnum bodyRadiusType
Defines type of method to compute the cylinder's radius.
SoSFEnum eliminationStatus
If eliminationStatus = TOO_SMALL, the vectors which module is lower than minLength are not drawn.
BodyLengthType
Type of body lenght.
SoSFFloat startArrowHeightFactor
Height (or Height multiplicative factor) of the arrow shape.
ArrowColoringType
Type of arrow coloring.
SoSFEnum endArrowHeightType
Defines the type of method to compute the arrow height.
SoSFFloat endArrowHeightFactor
Height (or Height multiplicative factor) of the arrow shape.
EliminationStatus
Type of vector elimination.
ArrowShape
Type of arrow shape.
SoSFEnum startArrowHeightType
Defines the type of method to compute the arrow height.
SoSFEnum endArrowColoringType
Coloring method of the end shape.
SoSFFloat bodyLengthFactor
Length (or length multiplicative factor) of the body shape.
BodyRadiusType
Type of body radius.
ArrowHeightType
Type of height of an arrow.
PoMesh2DVec()
Constructor.
SoSFInt32 density
Vector field density filter.
SoSFEnum bodyColoringType
coloring method of the body.
SoSFEnum bodyShape
Type of shape (no body, line, cylinder) used to draw the body.
SoSFFloat bodyRadiusFactor
Radius (or radius multiplicative factor) of the cylinder.
SoSFFloat startArrowRadiusFactor
The start-arrow's radius is start-arrow's height * startArrowRadiusFactor.
SoSFFloat minLength
Minimum length of the vector to be drawn.
SoSFEnum bodyLengthType
If bodyLengthType = CONSTANT_LENGTH, each vector has the same body length = bodyLengthFactor .
BodyShape
Type of body shape.
SoSFFloat maxLength
Maximum 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