Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PoHistogram.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_HISTOGRAM_
25#define _PO_HISTOGRAM_
26
27#include <MeshViz/graph/PoGraphMaster.h>
28
29#include <Inventor/fields/SoSFVec2f.h>
30#include <Inventor/fields/SoSFEnum.h>
31#include <Inventor/fields/SoSFFloat.h>
32#include <Inventor/fields/SoMFColor.h>
33#include <Inventor/fields/SoSFBool.h>
34#include <Inventor/fields/SoSFString.h>
35
36
37class PbMiscTextAttr ;
38class PbDataMapping ;
40
41class PiText ;
42
72class PoHistogram : public PoGraphMaster {
73
74 SO_KIT_HEADER(PoHistogram) ;
75
76 /* Define fields for new parts */
77 SO_KIT_CATALOG_ENTRY_HEADER(transform) ;
78
79 SO_KIT_CATALOG_ENTRY_HEADER(barSep) ;
80 SO_KIT_CATALOG_ENTRY_HEADER(barApp) ;
81 SO_KIT_CATALOG_ENTRY_HEADER(bar) ;
82
83 SO_KIT_CATALOG_ENTRY_HEADER(valueTextSep) ;
84 SO_KIT_CATALOG_ENTRY_HEADER(valueTextApp) ;
85 SO_KIT_CATALOG_ENTRY_HEADER(valueText) ;
86
87 SO_KIT_CATALOG_ENTRY_HEADER(nameTextSep) ;
88 SO_KIT_CATALOG_ENTRY_HEADER(nameTextApp) ;
89 SO_KIT_CATALOG_ENTRY_HEADER(nameText) ;
90
91
92 public:
93
97 enum Type {
105 Y
106 } ;
107
153
167
193
207
221
222
223
224
225
226 /* Fields */
227
232
237
243
250
258
259 /* Attribute of values */
260
265
270
276
284
291
296
301
302 /* Attribute of bar names */
303
308
313
319
326
333
339
349
350
351
352
353
354 /* Methods */
355
363
368
376 void setDataMapping(PbDataMapping *dataMapping) ;
377
383
392
398 private:
399 static void initClass() ;
400 static void exitClass() ;
401
402 struct ValueAttr {
403 Position position ;
404 TextPath path ;
405 float fontSize ;
406 SbString fontName ;
407 } ;
408
409 struct NameAttr {
410 Position position ;
411 TextPath path ;
412 float fontSize ;
413 SbString fontName ;
414 } ;
415
416 private:
417 struct HistogAttr {
418 ValueAttr value ;
419 NameAttr name ;
420 float scaleFactor ;
421 } ;
422
423 HistogAttr m_histogAttr ;
424
425 // Methods
426 virtual void setDefaultOnNonWritingFields() ;
427 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
428
429 // Manage the connection with PbBase objects
430 virtual void basicObjectChange(PbBase *basicObj) ;
431
432 virtual void setDefaultAttr() ;
433 virtual void colorBars(SoGroup *group) ;
434
435 // Constructor
436 PoHistogram() ;
437
438 // Destructor
439 virtual ~PoHistogram() ;
440
441 // Compute a reference point from a rectangle,
442 // a position type relative to this one and the
443 // fontSize.
444 static void computeTextPos(const SbVec2f *rectangle, Position textPos, float
445 fontSize, SbVec2f &pointText) ;
446
447 // Compute text alignment for a position type and a path
448 static void computeTextAlignPath(Position textPos, TextPath path, PiText *text) ;
449
450 // Overloaded methods
451 virtual void addElementsAllCaches() ;
452 virtual void preRebuild() ;
453
454 private:
455 // Miscellaneous text attribute
456 PbMiscTextAttr *m_miscTextAttr, *m_defaultMiscTextAttr ;
457
458 // Data Mapping
459 PbDataMapping *m_dataMap ;
460
461 // Numeric display format
462 PbNumericDisplayFormat *m_numericDisplayFormat, *m_defaultNumericDisplayFormat ;
463
464 // Sensors
465 FieldSensorList m_fieldSensorList ;
466
467 // List of fields defined in this class
468 SoFieldList m_fieldList ;
469
470} ;
471
472/*----------------------------------------------------------------------------*/
473
474#endif /* _PO_HISTOGRAM_ */
475
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract class for all b...
Definition PbBase.h:49
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract class for data ...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Class to define a numeri...
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Class to define a numeri...
<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> Abstract class for histo...
Definition PoHistogram.h:72
BarSpaceType
Type of spacing between bars.
@ REL_SPACE
Relative histogram bar spacing.
@ FIXED_SPACE
Fixed histogram bar spacing.
SoSFString valueAddString
String to be concatenated.
SoSFEnum valuePosition
Values position in relation to histogram bars.
SoSFString valueFontName
Font name of values.
SoSFFloat end
Define the end point of the histogram.
void setDataMapping(PbDataMapping *dataMapping)
Sets a reference to a PbDataMapping object to the association color-value for coloring the bars.
SoSFEnum namePath
Bars names path.
SoSFEnum valueVisibility
Values visibility.
SoSFString nameFontName
Font name of bars names.
Visibility
Type of visibility.
@ VISIBILITY_OFF
Invisible.
@ VISIBILITY_ON
Visible.
SoSFBool valueAddStringVisibility
Visibility of the string concatenated to the values.
void setFormat(PbNumericDisplayFormat *format)
Sets a reference to a PbNumericDisplayFormat object for the numerical display format of values of the...
const PbDataMapping * getDataMapping() const
Gets a reference to a PbDataMapping object to the association color-value for coloring the bars.
const PbMiscTextAttr * getMiscTextAttr() const
Gets a reference to a PbMiscTextAttr for miscellaneous text attributes.
SoSFFloat nameFontSize
Font size of bars names.
Position
Type of positions relative to a histogram bar.
@ POS_TOP_IN
At the top inside the bar.
@ POS_BOTTOM_OUT
At the bottom outside the bar.
@ POS_LEFT_OUT
At the left outside the bar.
@ POS_RIGHT_OUT
At the right outside the bar.
@ POS_DEPEND
Depends on the type of histogram.
@ POS_BOTTOM_IN
At the bottom inside the bar.
@ POS_TOP_OUT
At the top outside the bar.
@ POS_CENTER
Centered in the bar.
@ POS_RIGHT_IN
At the right inside the bar.
@ POS_LEFT_IN
At the left inside the bar.
SoSFFloat barSpaceValue
Spacing value.
TextPath
Type of text path.
@ PATH_DOWN
Writing from top to bottom.
@ PATH_LEFT
Writing from right to left.
@ PATH_DEPEND
Depends on the type of histogram.
@ PATH_UP
Writing from bottom to top.
@ PATH_RIGHT
Writing from left to right.
SoSFEnum nameVisibility
Bars names visibility.
SoSFEnum coloring
Specifies how the histogram bars are colored.
SoSFEnum namePosition
Bars names position in relation to histograms bars.
const PbNumericDisplayFormat * getFormat() const
Gets a reference to a PbNumericDisplayFormat object for the numerical display format of values of the...
void setMiscTextAttr(PbMiscTextAttr *textAttr)
Sets a reference to a PbMiscTextAttr for miscellaneous text attributes.
Type
Type of orientation of the histogram's bars.
Definition PoHistogram.h:97
@ Y
Histogram bars are perpendicular to Y-Axis.
@ X
Histogram bars are perpendicular to X-Axis.
SoSFEnum type
Defines if the histogram is an X histogram (bars are perpendicular to the X- axis) or a Y histogram (...
SoSFVec2f start
Define the start point of the histogram.
SoMFColor color
Color list for the histogram bars.
SoSFFloat valueFontSize
Font size of values.
Coloring
Type of coloration of the bars.
@ COLOR_LIST
Histogram bars are colored by a list of colors.
@ DATA_MAPPING
Histogram bars are colored by data mapping.
SoSFEnum barSpaceType
Type of bar spacing.
SoSFEnum valuePath
Values path.
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:76
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 RGB colors stored as three floats.
Definition SoMFColor.h:98
Field containing a single Boolean value.
Definition SoSFBool.h:79
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
Field containing a two-dimensional vector.
Definition SoSFVec2f.h:78
int SbBool
Boolean type.
Definition SbBase.h:87