Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
MoMeshAnnotatedIsoline.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-2017 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23#ifndef _MO_MESHANNOTATEDISOLINE_
24#define _MO_MESHANNOTATEDISOLINE_
25
26#include <MeshVizXLM/MbVec3.h>
27#include <MeshVizXLM/extractors/MiExtractorCallback.h>
28
29#include <MeshVizXLM/mapping/nodes/MoMeshIsoline.h>
30
31#include <Inventor/STL/vector>
32
33#ifdef _WIN32
34#pragma warning(push)
35#pragma warning(disable:4251)
36#endif
37
40class MiGeometryI;
41class SoAnnoText3;
42class SoText2;
43class SoGroup;
45class SoTextProperty;
46
47class MxExtractorCallback;
48
97class MESHVIZXLM_DMAP_API MoMeshAnnotatedIsoline : public MoMeshIsoline {
98
99 SO_NODE_HEADER(MoMeshAnnotatedIsoline) ;
100
101 public:
102
107
113
121
131
141
147
153
161
167
173
179
185
190
191 /*----------------------------------------------------------------------------*/
192 private:
193 static void initClass() ;
194 static void exitClass() ;
195
196 private:
197 virtual void doExtract(SoAction * action);
198
199 private:
200 virtual ~MoMeshAnnotatedIsoline() ;
201 void annotateLines(SoAction * action,const std::vector<const MeXLineMeshUnstructured*>& lines, const MiMesh* inputMesh);
202
203 MxExtractorCallback* m_redrawCallback;
204
205 class ChordalDistance
206 {
207 public:
208 std::vector< double > m_distances;
209 SbBox3f m_bbox;
210 size_t m_startCellIndex;
211 };
212
213 void computeChordalDistances(const MeXLineTopologyExplicitI& topo,const MiGeometryI& geom, std::vector< ChordalDistance >& chordalDistancesArray);
214 void addAnnot(MbVec3d& pos, std::string& str, MbVec3d& baseVector, float width, float height);
215 void getStringSize(SoAction * action, const std::string& str, float &width, float &height, SbBox3f& bbox);
216 std::string computeString(SoAction * action,float isovalue,float& width,float& height,SbBox3f& annotBbox);
217 std::vector<double>::iterator computeAnnotPos(ChordalDistance& chordalDistances, const std::vector<double>::iterator& beg, const std::vector<double>::iterator& end,
218 double value,const MeXLineTopologyExplicitI& topo,const MiGeometryI& geom,MbVec3d& pos,MbVec3d& baseVector);
219 void initSceneGraph(double diag);
220
221 void clear();
222
223 SoSeparator* m_sepAnnot;
224 SoGroup* m_bboxGroup;
225 SoAnnoText3* m_bboxText;
226 SoText2* m_bboxText2;
227 SoFont* m_font;
228 SoGetBoundingBoxAction* m_bboxAction;
229 SoTextProperty* m_textProp;
230} ;
231
232#ifdef _WIN32
233#pragma warning(pop)
234#endif
235
236#endif /* _MO_MESHANNOTATEDISOLINE_ */
237
238
239
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Extracted unstructured l...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> List of extracted line c...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract base class for ...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Generic geometry interfa...
Definition MiGeometryI.h:39
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract mesh interface.
Definition MiMesh.h:62
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Rendering node that disp...
SoSFColor borderColor
Color used for the annotation background border.
MoMeshAnnotatedIsoline()
Constructor.
SoSFFloat fontSize
Font size of annotation text in mesh coordinates units.
void setExtractorCallback(MiExtractorCallback *extractorCallback)
Set the extraction callback which will be called each time an extraction is performed.
SoSFBool isText2D
If TRUE, draw text using a SoText2D primitive (bitmapped text).
SoSFBool isVisible
Contour line annotation visibility.
SoSFColor backgroundColor
Color used for the annotation background Default is gray = SbColor(0.3,0.3,0.3)
AnnotPath
Path of annotation text.
@ HORIZONTAL_PATH
Annotations are horizontal.
@ TANGENTIAL_PATH
Annotations are tangential to the contour lines.
SoSFVec3f upVector
Annotation text up vector.
SoSFColor color
Color used for the annotation text Default is white = SbColor(1,1,1)
SoSFEnum path
Annotation path.
SoSFFloat gap
Curvilinear distance between two annotations of the same contour line.
SoSFBool isBackground
Defines if the annotations are framed by a background.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Rendering node that disp...
3D box class.
Definition SbBox.h:649
Abstract base class for all actions.
Definition SoAction.h:132
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Annotation text ...
Node that defines font name, size, and type for text.
Definition SoFont.h:303
Computes bounding box of a scene.
Base class for all group nodes.
Definition SoGroup.h:122
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an RGB color.
Definition SoSFColor.h:82
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a three-dimensional vector.
Definition SoSFVec3f.h:80
Group node that saves and restores traversal state.
Screen-aligned 2D text shape node.
Definition SoText2.h:194
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Text property no...