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_CURVE_
00025 #define _PO_CURVE_
00026
00027 #include <MeshViz/graph/PoGraphMaster.h>
00028
00029 #include <Inventor/fields/SoSFEnum.h>
00030 #include <Inventor/fields/SoSFBool.h>
00031 #include <Inventor/fields/SoSFFloat.h>
00032 #include <Inventor/fields/SoMFFloat.h>
00033 #include <Inventor/fields/SoSFInt32.h>
00034 #include <Inventor/fields/SoMFInt32.h>
00035 #include <Inventor/fields/SoMFVec2f.h>
00036 #include <Inventor/fields/SoSFString.h>
00037
00038
00077 class PoCurve : public PoGraphMaster {
00078
00079 SO_KIT_HEADER(PoCurve) ;
00080
00081
00082 SO_KIT_CATALOG_ENTRY_HEADER(curveFillingSep) ;
00083 SO_KIT_CATALOG_ENTRY_HEADER(curveFillingApp) ;
00084 SO_KIT_CATALOG_ENTRY_HEADER(curveFilling) ;
00085
00086 SO_KIT_CATALOG_ENTRY_HEADER(curvePointSep) ;
00087 SO_KIT_CATALOG_ENTRY_HEADER(curvePointApp) ;
00088 SO_KIT_CATALOG_ENTRY_HEADER(curvePoint) ;
00089
00090 SO_KIT_CATALOG_ENTRY_HEADER(markerSep) ;
00091 SO_KIT_CATALOG_ENTRY_HEADER(markerApp) ;
00092 SO_KIT_CATALOG_ENTRY_HEADER(marker) ;
00093
00094 SO_KIT_CATALOG_ENTRY_HEADER(raisePointSep) ;
00095 SO_KIT_CATALOG_ENTRY_HEADER(raisePointApp) ;
00096 SO_KIT_CATALOG_ENTRY_HEADER(raisePoint) ;
00097
00098
00099 public:
00100
00104 enum FilterType {
00108 INACTIVE,
00112 ALL_POINTS,
00116 INDEX_PERIOD,
00120 INDEX_LIST,
00124 X_PERIOD,
00128 X_LIST
00129 } ;
00130
00131
00132
00136 enum CurveRep {
00140 CURVE_NONE,
00144 CURVE_POLYLINE,
00148 CURVE_SMOOTH,
00152 CURVE_STAIRS_X,
00156 CURVE_STAIRS_Y,
00160 CURVE_HISTO_X,
00164 CURVE_HISTO_Y,
00168 CURVE_STAIRS_2X,
00172 CURVE_STAIRS_2Y
00173 } ;
00174
00175
00176
00177
00178
00179
00180
00184 SoMFVec2f point ;
00185
00189 SoSFEnum curveRep ;
00190
00194 SoSFBool isCurveFilled ;
00195
00199 SoSFFloat fillingThreshold ;
00200
00206 SoSFEnum markerFilterType ;
00207
00212 SoSFInt32 markerIndexPeriod ;
00213
00218 SoMFInt32 markerIndexList ;
00219
00224 SoSFFloat markerXPeriod ;
00225
00230 SoMFFloat markerXList ;
00231
00241 SoSFString markerString ;
00242
00248 SoSFEnum raiseFilterType ;
00249
00254 SoSFInt32 raiseIndexPeriod ;
00255
00260 SoMFInt32 raiseIndexList ;
00261
00266 SoSFFloat raiseXPeriod ;
00267
00272 SoMFFloat raiseXList ;
00273
00278 SoSFFloat raiseThreshold ;
00279
00280
00281
00282
00283
00287 PoCurve()
00288 { init(TRUE) ; }
00289
00294 PoCurve(int numPoints, const SbVec2f *_point, CurveRep _curveRep = CURVE_POLYLINE)
00295 { init(FALSE, numPoints, _point, _curveRep) ; }
00296
00300 virtual void rebuild() ;
00301
00302
00303
00304
00305 private:
00306 static void initClass() ;
00307 static void exitClass() ;
00308
00309 private:
00310
00311
00312 virtual ~PoCurve() ;
00313 virtual void setDefaultOnNonWritingFields() ;
00314 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
00315
00316 private:
00317
00318 void init(SbBool isDefault, int numPoints=0, const SbVec2f *_point=NULL,
00319 CurveRep _curveRep = CURVE_POLYLINE) ;
00320
00321
00322 void drawRaisePoints(int numPoints, const SbVec3f *pointList) ;
00323
00324
00325 void drawMarkers(int numPoints, const SbVec3f *pointList) ;
00326
00327
00328 static void calculateInterpolation(const SbVec2f &a, const SbVec2f &b, float x,
00329 float &y) ;
00330 static void calculateInterpolation2(const SbVec2f &a, const SbVec2f &b, float y,
00331 float &x) ;
00332
00333 FieldSensorList fieldSensorList ;
00334
00335
00336 SoFieldList fieldList ;
00337
00338 } ;
00339
00340
00341
00342 #endif
00343
00344