Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
PoPolarLogAxis.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_POLAR_LOG_AXIS_
25#define _PO_POLAR_LOG_AXIS_
26
31
33
103
105
106 /* Define fields for new parts */
107 SO_KIT_CATALOG_ENTRY_HEADER(decadeTextSep) ;
108 SO_KIT_CATALOG_ENTRY_HEADER(decadeTextApp) ;
109 SO_KIT_CATALOG_ENTRY_HEADER(decadeText) ;
110
111
112 public:
113
127
149
183
184
185
186 /* Fields */
187
193
201
207
213
219
226
227 /* Methods */
228
233
237 PoPolarLogAxis(float offset, float startRadius, float endRadius, float theta,
239 const unsigned short *decadeList = NULL, short numDecade = 0) ;
240
244 virtual void rebuild() ;
245
251 void getLogGrad(unsigned short &numDecade, unsigned short decadeList[8],
253 SbString &decadeFontName, float &decadeFontSize) const ;
254
255 /*----------------------------------------------------------------------------*/
256
257
258 private:
259 static void initClass() ;
260 static void exitClass() ;
261
262 struct Decade {
263 DecadeRep rep ;
264 DecadeListDef listDef ;
265 int *gradList ;
266 size_t number ;
267 SbString fontName ;
268 float fontSize ;
269 } ;
270
271 private:
272 struct PolLogAxisAttr {
273 TenPowGradRep tenPowerRep ;
274 Decade decadeGrad ;
275 } ;
276 // Polar log axis attr
277
278 // Methods
279 // Destructor
280 virtual ~PoPolarLogAxis() ;
281 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
282 virtual void setDefaultOnNonWritingFields() ;
283
284 // Save all axis attributes which can be modified by MeshViz.
285 virtual void saveAxisAttr() ;
286
287 private:
288 // Init method
290 const unsigned short *decadeList = NULL, short numDecade = 0) ;
291
292 // Build polar log graduations - The graduations (main grad and decades grad)
293 // are built under the nodes mainGroup and secondaryGroup.
294 void buildLogGrad(const std::vector<float> &mainGradX, std::vector<float> &secdGradX,
295 size_t numDecades, int *decades, int firstDecInd,
296 SoGroup *mainGroup, SoGroup *secondaryGroup) ;
297
298 // Compute polar log grad font size
299 void computeLogGradFontSize(size_t numMainGrad, const char **main_str,
300 const char **main_ten_pow_str, size_t numSecdGrad,
301 const char **secd_str, const char **secd_ten_pow_str,
302 float min_grad_dist, SbBool main_grad_pres_auto,
303 float &main_font_size, float &secd_font_size) ;
304
305 // Computed logarithmic axis attributes
306 PolLogAxisAttr polLogAxisAttr ;
307
308 // Sensors
309 FieldSensorList fieldSensorList ;
310
311 // List of fields defined in this class
312 SoFieldList fieldList ;
313
314} ;
315
316/*----------------------------------------------------------------------------*/
317
318#endif /* _PO_POLAR_LOG_AXIS_ */
319
#define FALSE
Possible value of SbBool.
Definition SbBase.h:75
static void init()
#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> Abstract class for polar...
Definition PoPolarAxis.h:43
SoSFFloat theta
Rotation angle of the axis in radians.
Definition PoPolarAxis.h:98
SoSFFloat endRadius
Radius at the end of the axis.
Definition PoPolarAxis.h:93
SoSFFloat offset
Offset for the axis.
Definition PoPolarAxis.h:83
SoSFFloat startRadius
Radius at the start of the axis.
Definition PoPolarAxis.h:88
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Class to build a logarit...
virtual void rebuild()
Forces node-kit rebuilding.
SoSFFloat decadeFontSize
Decade graduations font size.
void getLogGrad(unsigned short &numDecade, unsigned short decadeList[8], TenPowGradRep &tenPowerRep, DecadeRep &decadeRep, SbString &decadeFontName, float &decadeFontSize) const
Returns the current logarithmic graduations attributes (those computed can be different from the asso...
SoMFUShort decadeList
Specifies if the list of decade graduations is given by the user or is automatically computed.
SoSFEnum decadeRep
Defines the representation of the decade graduations between two power of ten graduations.
DecadeRep
Type of presentation of the axis decades.
@ DECADE_DIGIT
Decade graduations are displayed using a digit from 2 to 9
@ DECADE_AUTO
giving the multiple of the power of ten.
@ DECADE_DECIMAL
Decade graduations are displayed in decimals.
@ DECADE_AS_TEN_POWER
Decade graduations are displayed as power of ten graduations.
@ DECADE_NONE
No decade graduations are displayed.
TenPowGradRep
Type of presentation of the power of ten.
@ TEN_POWER_POW10
The graduations are specified in powers of ten.
@ TEN_POWER_DECIMAL
The graduations are specified in decimals.
@ TEN_POWER_AUTO
The graduations are specified in powers of ten or in decimals,.
DecadeListDef
Decade list computed automatically or given by the user.
@ DECADE_LIST_AUTO
The list of decade graduations is automatically computed.
@ DECADE_LIST_NON_AUTO
The list of decade graduations is given by the user.
PoPolarLogAxis()
Default constructor.
SoSFEnum tenPowerRep
Defines the representation of power of ten graduations.
SoSFEnum decadeListDef
List of graduations between two power of ten graduations (decade graduations).
PoPolarLogAxis(float offset, float startRadius, float endRadius, float theta, DecadeListDef decadeListDef=DECADE_LIST_AUTO, const unsigned short *decadeList=NULL, short numDecade=0)
Constructor.
SoSFString decadeFontName
Decade font name.
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
Multiple-value field containing any number of unsigned short integers.
Definition SoMFUShort.h:89
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a floating-point value.
Definition SoSFFloat.h:78
Field containing a string.
Definition SoSFString.h:117
int SbBool
Boolean type.
Definition SbBase.h:87