Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
PoAngularAxis.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_ANGULAR_AXIS_
25#define _PO_ANGULAR_AXIS_
26
27#include <MeshViz/graph/PoAxis.h>
28
29#include <Inventor/fields/SoSFEnum.h>
30#include <Inventor/fields/SoSFFloat.h>
31
32#define PATH_HOR PATH_RIGHT
33#define PATH_RADIAL PATH_LEFT
34#define PATH_TANGENT PATH_UP
35
36#define GRAD_INSIDE GRAD_ABOVE
37#define GRAD_OUTSIDE GRAD_BELOW
38
54class PoAngularAxis : public PoAxis {
55
56 SO_KIT_HEADER(PoAngularAxis) ;
57
58
59 public:
60
78
79
80
81 /* Fields */
82
88
93
98
103
110
116
117
118
119 /* Methods */
120
125
129 PoAngularAxis(float _offset, float _startAngle, float _endAngle, float _radius,
130 float _angleStep)
131 { init(_offset, _startAngle, _endAngle, _radius, _angleStep) ; }
132
136 virtual void rebuild() ;
137
142 float getAngleStep() const ;
143
144 /*----------------------------------------------------------------------------*/
145
146
147 private:
148 static void initClass() ;
149 static void exitClass() ;
150
151 private:
152 struct AngularAxisAttr {
153 float angleStep ;
154 float startAngle ;
155 } ;
156 // Angular axis attr
157
158 // Methods
159 // Destructor
161 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
162 virtual void setDefaultOnNonWritingFields() ;
163
164 // Save all axis attributes which can be modified by MeshViz.
165 virtual void saveAxisAttr() ;
166
167 private:
168 // Compute limit coordinate for display graduation
169 virtual void computeGradLimit(float sAngle, float eAngle,
170 float &smAngle, float &emAngle) ;
171
172 // Compute tick length
173 virtual void computeAngularTickLen(size_t numGrad, float theta,
174 float &mainTickLen, float &secdTickLen) ;
175
176 // Set Default attributes
177 virtual void setDefaultAttr(Plane plane = XY) ;
178
179 // Build arrow - The arrow is built under the node "group"
180 virtual void buildArrow(float radius, float angle, SoGroup *group) ;
181
182 // Build title - The title is built under the node "group"
183 void buildTitle(float start_angle, float theta, SoGroup *group) ;
184
185 // Build tick - The ticks are built under the node "group"
186 virtual void buildTick(const std::vector<float>& gradAngleList,
187 float tickLen, SoGroup *group) ;
188
189 // Build grid lines - The grid lines are built under the node "group"
190 virtual void buildGridLines(const std::vector<float>& gradAngleList,
191 SoGroup *group) ;
192
193 // Compute the step
194 void computeGradStep(float _radius, float theta, float &step) ;
195
196 // Compute grad list str
197 void computeGradListStr(float theta_m, float start_angle_m, float s_angle_m,
198 float angle_step, size_t &num_grad, std::vector<float>& grad_angle_list,
199 char **grad_str) ;
200
201 // Build graduations - The graduations are built under the node "group"
202 // (used only by generalised, linear and polar linear axis)
203 virtual void buildGrads(const std::vector<float>& gradAngleList,
204 const char **gradStr, SoGroup *group) ;
205
206 // Draw an angular text in polar coordinate
207 void drawAngularText(PiText *text, TextPath path, GradPosition pos,
208 float rad, float angle, const SbString& str) ;
209
210 // Init method
211 void init(float offset, float startAngle, float endAngle, float radius,
212 float angleStep) ;
213
214 // Computed axis attributes
215 AngularAxisAttr angularAxisAttr ;
216
217 // Sensors
218 FieldSensorList fieldSensorList ;
219
220 // List of fields defined in this class
221 SoFieldList fieldList ;
222
223} ;
224
225/*----------------------------------------------------------------------------*/
226
227#endif /* _PO_ANGULAR_AXIS_ */
228
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Class to build an angula...
PoAngularAxis()
Default constructor.
SoSFFloat startAngle
Angle in radians of the origin of the axis.
SoSFFloat endAngle
Angle in radians of the end of the axis.
SoSFFloat radius
Radius of the axis.
SoSFFloat offset
Offset for the axis in radians.
PoAngularAxis(float _offset, float _startAngle, float _endAngle, float _radius, float _angleStep)
Constructor.
SoSFEnum gradFit
This flag indicates if the first graduation is rounded or not.
float getAngleStep() const
Returns the current angle step (the step computed can be different from the associated field).
virtual void rebuild()
Forces node-kit rebuilding.
SoSFFloat angleStep
Angular distance in radians between two graduations.
GradFit
Enumerations.
@ GRAD_FIT
The first graduation is rounded.
@ GRAD_UNFIT
The first graduation is not rounded.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract class for axis ...
Definition PoAxis.h:58
GradPosition
Graduation position type.
Definition PoAxis.h:155
TextPath
Text path type.
Definition PoAxis.h:127
Class for smart character strings.
Definition SbString.h:202
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
int SbBool
Boolean type.
Definition SbBase.h:87