00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _PO_MULTIPLE_HISTOGRAM_
00025 #define _PO_MULTIPLE_HISTOGRAM_
00026
00027 #include <MeshViz/graph/PoHistogram.h>
00028
00029 #include <Inventor/fields/SoMFString.h>
00030 #include <Inventor/fields/SoSFString.h>
00031 #include <Inventor/fields/SoMFFloat.h>
00032 #include <Inventor/fields/SoSFFloat.h>
00033 #include <Inventor/fields/SoSFUShort.h>
00034 #include <Inventor/fields/SoSFEnum.h>
00035
00105 class PoMultipleHistogram : public PoHistogram {
00106
00107 SO_KIT_HEADER(PoMultipleHistogram) ;
00108
00109
00110 SO_KIT_CATALOG_ENTRY_HEADER(sumTextSep) ;
00111 SO_KIT_CATALOG_ENTRY_HEADER(sumTextApp) ;
00112 SO_KIT_CATALOG_ENTRY_HEADER(sumText) ;
00113
00114
00115 public:
00116
00117 enum HistogPath {
00121 ROW_COLUMN,
00125 COLUMN_ROW
00126 } ;
00127
00128
00129
00133 enum Representation {
00137 JUXTAPOSED,
00141 ACCUMULATED,
00145 PERCENTAGE
00146 } ;
00147
00148
00149
00150
00151
00155 SoSFUShort numRows ;
00156
00160 SoSFUShort numColumns ;
00161
00165 SoMFFloat value ;
00166
00170 SoMFString rowName ;
00171
00175 SoMFString columnName ;
00176
00180 SoSFEnum representation ;
00181
00187 SoSFFloat barHeight ;
00188
00193 SoSFEnum histogPath ;
00194
00199 SoSFEnum sumVisibility ;
00200
00205 SoSFEnum sumPosition ;
00206
00211 SoSFEnum sumPath ;
00212
00218 SoSFFloat sumFontSize ;
00219
00225 SoSFString sumFontName ;
00226
00227
00228
00229
00230
00234 PoMultipleHistogram()
00235 { init(TRUE, SbVec2f(0.,0.), 1., X, 0, 0, NULL, NULL, NULL) ; }
00236
00241 PoMultipleHistogram(const SbVec2f &_start, float _end, PoHistogram::Type _type,
00242 int _numRows, int _numColumns, const float *_value,
00243 const char **_rowName, const char **_columnName)
00244 { init(FALSE, _start, _end, _type, _numRows, _numColumns, _value, _rowName,
00245 _columnName) ; }
00246
00251 PoMultipleHistogram(const SbVec2f &_start, float _end, PoHistogram::Type _type,
00252 int _numRows, int _numColumns, const float **_value,
00253 const char **_rowName, const char **_columnName) ;
00254
00258 virtual void rebuild() ;
00259
00260
00261 private:
00262 static void initClass() ;
00263 static void exitClass() ;
00264
00265 struct SumAttr {
00266 Position position ;
00267 TextPath path ;
00268 float fontSize ;
00269 SbString fontName ;
00270 } ;
00271
00272 private:
00273 struct MultHistogAttr {
00274 SumAttr sum ;
00275 } ;
00276
00277 MultHistogAttr m_multHistogAttr ;
00278
00279
00280
00281 virtual ~PoMultipleHistogram() ;
00282 virtual void setDefaultOnNonWritingFields() ;
00283 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
00284
00285 virtual void setDefaultAttr() ;
00286
00287
00288 void colorBars(SoGroup *group) ;
00289
00290 private:
00291
00292 void init(SbBool isDefault, const SbVec2f &_start, float _end,
00293 Type _type, int _numRows, int _numColumns, const float *_value,
00294 const char **_rowName, const char **_columnName) ;
00295
00296
00297 void buildXJuxtaposedHistog() ;
00298 void buildYJuxtaposedHistog() ;
00299
00300 void buildXAccumulatedHistog() ;
00301 void buildYAccumulatedHistog() ;
00302
00303 void buildXPercentageHistog() ;
00304 void buildYPercentageHistog() ;
00305
00306
00307 FieldSensorList m_fieldSensorList ;
00308
00309
00310 SoFieldList m_fieldList ;
00311
00312 } ;
00313
00314
00315
00316 #endif
00317
00318