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_ARROW_
00025 #define _PO_ARROW_
00026
00027 #include <MeshViz/graph/PoGraphMaster.h>
00028
00029
00030 #include <Inventor/fields/SoSFEnum.h>
00031 #include <Inventor/fields/SoSFFloat.h>
00032 #include <Inventor/fields/SoMFVec2f.h>
00033
00034
00059 class PoArrow : public PoGraphMaster {
00060
00061 SO_KIT_HEADER(PoArrow) ;
00062
00063
00064 SO_KIT_CATALOG_ENTRY_HEADER(bodySep) ;
00065 SO_KIT_CATALOG_ENTRY_HEADER(bodyApp) ;
00066 SO_KIT_CATALOG_ENTRY_HEADER(body) ;
00067
00068 SO_KIT_CATALOG_ENTRY_HEADER(startSep) ;
00069 SO_KIT_CATALOG_ENTRY_HEADER(startApp) ;
00070 SO_KIT_CATALOG_ENTRY_HEADER(start) ;
00071
00072 SO_KIT_CATALOG_ENTRY_HEADER(endSep) ;
00073 SO_KIT_CATALOG_ENTRY_HEADER(endApp) ;
00074 SO_KIT_CATALOG_ENTRY_HEADER(end) ;
00075
00076
00077 public:
00078
00082 enum PatternType {
00086 NO_PATTERN,
00090 DIRECT_TRIANGLE,
00094 INDIRECT_TRIANGLE,
00098 RECTANGLE
00099 } ;
00100
00101
00102
00106 SoMFVec2f point ;
00107
00111 SoSFEnum startPatternType ;
00112
00116 SoSFEnum endPatternType ;
00117
00123 SoSFFloat patternWidth ;
00124
00130 SoSFFloat patternHeight ;
00131
00132
00133
00134
00135
00139 PoArrow()
00140 { init(TRUE) ; }
00141
00146 PoArrow(int numPoints, const SbVec2f *_point, PatternType startType = NO_PATTERN,
00147 PatternType endType = NO_PATTERN, float _patternWidth = 0.05f,
00148 float _patternHeight = 0.03f)
00149 { init(FALSE, numPoints, _point, startType, endType, _patternWidth, _patternHeight) ; }
00150
00154 virtual void rebuild() ;
00155
00156
00157 private:
00158 static void initClass() ;
00159 static void exitClass() ;
00160
00161 private:
00162
00163
00164 virtual ~PoArrow() ;
00165 virtual void setDefaultOnNonWritingFields() ;
00166 virtual SbBool setUpConnections(SbBool onOff, SbBool doItAlways = FALSE) ;
00167
00168 private:
00169
00170 enum RefererenType {
00171 RELATIVE_WC,
00172 RELATIVE_01
00173 } ;
00174
00175
00176 void init(SbBool isDefault, int numPoints = 0, const SbVec2f *_point = NULL,
00177 PatternType startType = NO_PATTERN, PatternType endType = NO_PATTERN,
00178 float _patternWidth = 0.05f, float _patternHeight = 0.03f) ;
00179
00180
00181 void arrowShape(RefererenType refType, PatternType patType, const SbVec2f &start,
00182 const SbVec2f &end, SoGroup *group) ;
00183
00184
00185 FieldSensorList fieldSensorList ;
00186
00187
00188 SoFieldList fieldList ;
00189
00190 } ;
00191
00192
00193
00194 #endif
00195
00196