Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
PoMultipleHistogram.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_MULTIPLE_HISTOGRAM_
25#define _PO_MULTIPLE_HISTOGRAM_
26
27#include <MeshViz/graph/PoHistogram.h>
28
29#include <Inventor/fields/SoMFString.h>
30#include <Inventor/fields/SoSFString.h>
31#include <Inventor/fields/SoMFFloat.h>
32#include <Inventor/fields/SoSFFloat.h>
33#include <Inventor/fields/SoSFUShort.h>
34#include <Inventor/fields/SoSFEnum.h>
35
106
107 SO_KIT_HEADER(PoMultipleHistogram) ;
108
109 /* Define fields for new parts */
110 SO_KIT_CATALOG_ENTRY_HEADER(sumTextSep) ;
111 SO_KIT_CATALOG_ENTRY_HEADER(sumTextApp) ;
112 SO_KIT_CATALOG_ENTRY_HEADER(sumText) ;
113
114
115 public:
116
127
128
129
147
148
149
150 /* Fields */
151
156
161
166
171
176
181
188
194
200
206
212
219
226
227
228
229 /* Methods */
230
235 { init(TRUE, SbVec2f(0.,0.), 1., X, 0, 0, NULL, NULL, NULL) ; }
236
241 PoMultipleHistogram(const SbVec2f &_start, float _end, PoHistogram::Type _type,
242 int _numRows, int _numColumns, const float *_value,
243 const char **_rowName, const char **_columnName)
244 { init(FALSE, _start, _end, _type, _numRows, _numColumns, _value, _rowName,
245 _columnName) ; }
246
251 PoMultipleHistogram(const SbVec2f &_start, float _end, PoHistogram::Type _type,
252 int _numRows, int _numColumns, const float **_value,
253 const char **_rowName, const char **_columnName) ;
254
258 virtual void rebuild() ;
259
260 /*----------------------------------------------------------------------------*/
261 private:
262 static void initClass() ;
263 static void exitClass() ;
264
265 struct SumAttr {
266 Position position ;
267 TextPath path ;
268 float fontSize ;
269 SbString fontName ;
270 } ;
271
272 private:
273 struct MultHistogAttr {
274 SumAttr sum ;
275 } ;
276
277 MultHistogAttr m_multHistogAttr ;
278
279 // Methods
280 // Destructor
281 virtual ~PoMultipleHistogram() ;
282 virtual void setDefaultOnNonWritingFields() ;
283 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
284
285 virtual void setDefaultAttr() ;
286
287 // Color the bars
288 void colorBars(SoGroup *group) ;
289
290 private:
291 // Init method
292 void init(SbBool isDefault, const SbVec2f &_start, float _end,
293 Type _type, int _numRows, int _numColumns, const float *_value,
294 const char **_rowName, const char **_columnName) ;
295
296 // Build X or Y Histogram
297 void buildXJuxtaposedHistog() ;
298 void buildYJuxtaposedHistog() ;
299
300 void buildXAccumulatedHistog() ;
301 void buildYAccumulatedHistog() ;
302
303 void buildXPercentageHistog() ;
304 void buildYPercentageHistog() ;
305
306 // Sensors
307 FieldSensorList m_fieldSensorList ;
308
309 // List of fields defined in this class
310 SoFieldList m_fieldList ;
311
312} ;
313
314/*----------------------------------------------------------------------------*/
315
316#endif /* _PO_MULTIPLE_HISTOGRAM_ */
317
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Abstract class for histo...
Definition PoHistogram.h:72
Position
Type of positions relative to a histogram bar.
TextPath
Type of text path.
Type
Type of orientation of the histogram's bars.
Definition PoHistogram.h:97
@ X
Histogram bars are perpendicular to X-Axis.
<a href="IconLegend.html"><img src="extMV.gif" alt="MeshViz" border="0"></a> Class to build a multipl...
@ COLUMN_ROW
Histogram shows columns in function of rows.
@ ROW_COLUMN
Histogram shows rows in function of columns.
PoMultipleHistogram(const SbVec2f &_start, float _end, PoHistogram::Type _type, int _numRows, int _numColumns, const float *_value, const char **_rowName, const char **_columnName)
Constructor.
PoMultipleHistogram()
Default constructor.
SoSFEnum sumVisibility
Bars sums visibility.
SoSFEnum sumPath
Writing path of bars sums.
SoSFUShort numRows
Number of rows of the matrix of values.
SoSFEnum representation
Representation type of the multiple histogram.
SoSFEnum sumPosition
Position of sums in relation to bars.
SoMFString columnName
List of numColumns names of the columns.
SoMFString rowName
List of numRows names of the rows.
SoSFFloat barHeight
This field is used only for percentage histogram representation (representation = PERCENTAGE) and i...
PoMultipleHistogram(const SbVec2f &_start, float _end, PoHistogram::Type _type, int _numRows, int _numColumns, const float **_value, const char **_rowName, const char **_columnName)
Constructor.
virtual void rebuild()
Forces node-kit rebuilding.
SoSFString sumFontName
Font name of bars sums.
SoSFEnum histogPath
Indicates that the histogram shows rows as a function of columns, or columns as a function of rows.
SoMFFloat value
Matrix of values.
Representation
Type of presentation of multiple histogram.
@ JUXTAPOSED
Histogram bars are juxtaposed.
@ ACCUMULATED
Histogram bars are accumulated.
@ PERCENTAGE
Histogram bars are percentage.
SoSFUShort numColumns
Number of columns of the matrix of values.
SoSFFloat sumFontSize
Font size of bars sums.
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 floating point values.
Definition SoMFFloat.h:90
Multiple-value field containing any number of strings.
Definition SoMFString.h:116
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 an unsigned short integer.
Definition SoSFUShort.h:79
int SbBool
Boolean type.
Definition SbBase.h:87