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 _POXTAXISEDITOR_H_
00025 #define _POXTAXISEDITOR_H_
00026
00027 #include <MeshViz/PoMeshVizW.h>
00028 #include <Inventor/SbLinear.h>
00029 #include <Inventor/Xt/SoXtComponent.h>
00030
00031 #include <Inventor/dialog/PoXtDialog.h>
00032
00033 class SoCallbackList;
00034 class PoAxis;
00035 class SoSensor;
00036 class SoNodeSensor;
00037 struct menuColumn;
00038
00039 class SoDEPRECATED PoXtAxisEditor
00051 : public SoXtComponent
00052 {
00053
00054 public:
00055
00059 typedef void PoXtAxisEditorCB (void * userData, PoAxis * data);
00060
00061 enum TextAxisMask
00062 {
00063 NO_TEXT_MASK = 0x00000000,
00064
00065 GRAD_VISIBILITY = 0x00000001,
00066 GRAD_POSITION = 0x00000002,
00067 GRAD_PATH = 0x00000004,
00068 GRAD_FONT_NAME = 0x00000008,
00069 GRAD_FONT_SIZE = 0x00000010,
00070 GRAD_DIST_AXIS = 0x00000020,
00071 GRAD_ADD_STRING_VISIBILITY = 0x00000040,
00072 GRAD_ADD_STRING = 0x00000080,
00073 GRAD = GRAD_VISIBILITY | GRAD_POSITION
00074 | GRAD_PATH | GRAD_FONT_NAME | GRAD_FONT_SIZE
00075 | GRAD_DIST_AXIS | GRAD_ADD_STRING_VISIBILITY
00079 | GRAD_ADD_STRING,
00089 TITLE_VISIBILITY = 0x00000100,
00090 TITLE_POSITION = 0x00000200,
00091 TITLE_PATH = 0x00000400,
00092 TITLE_FONT_NAME = 0x00000800,
00093 TITLE_FONT_SIZE = 0x00001000,
00094 TITLE_DIST_AXIS = 0x00002000,
00095 TITLE_STRING = 0x00004000,
00096 TITLE = TITLE_VISIBILITY | TITLE_POSITION | TITLE_PATH
00097 | TITLE_FONT_NAME | TITLE_FONT_SIZE | TITLE_DIST_AXIS
00101 | TITLE_STRING,
00102
00103 REVERSE_FLAG = 0x00008000,
00104
00105 MISC_TEXT_ATTR = 0x00010000,
00106
00107 ALL_TEXT_MASK = GRAD | TITLE | REVERSE_FLAG | MISC_TEXT_ATTR
00108 } ;
00109
00110
00111
00112 enum GeomAxisMask
00113 {
00114 NO_GEOM_MASK = 0x00000000,
00115
00116 MARGIN_TYPE = 0x00000001,
00117 MARGIN_START = 0x00000002,
00118 MARGIN_END = 0x00000004,
00119 MARGIN = MARGIN_TYPE |
00120 MARGIN_START |
00124 MARGIN_END,
00125
00126 GRID_VISIBILITY = 0x00000008,
00127 GRID_LENGTH_GRAD_SIDE = 0x00000010,
00128 GRID_LENGTH_GRAD_OTHER_SIDE = 0x00000020,
00129 GRID = GRID_VISIBILITY |
00130 GRID_LENGTH_GRAD_SIDE |
00134 GRID_LENGTH_GRAD_OTHER_SIDE,
00135
00136 ARROW_VISIBILITY = 0x00000040,
00137 ARROW_HEIGHT = 0x00000080,
00138 ARROW_LENGTH = 0x00000100,
00139 ARROW = ARROW_VISIBILITY |
00140 ARROW_HEIGHT |
00144 ARROW_LENGTH,
00145
00146 TICK_VISIBILITY = 0x00000200,
00147 TICK_POSITION = 0x00000400,
00148 TICK_MAIN_LENGTH = 0x00000800,
00149 TICK_SUB_LENGTH = 0x00001000,
00150 TICK_SUB_DEF = 0x00002000,
00151 TICK_NUM_OR_PERIOD = 0x00004000,
00152 TICK_FIRST_GRAD = 0x00008000,
00153 TICK_LAST_GRAD = 0x00010000,
00154 TICK_ALL = TICK_VISIBILITY |
00155 TICK_POSITION |
00156 TICK_MAIN_LENGTH |
00157 TICK_SUB_LENGTH |
00158 TICK_SUB_DEF |
00159 TICK_NUM_OR_PERIOD |
00160 TICK_FIRST_GRAD |
00164 TICK_LAST_GRAD,
00165
00166 ALL_GEOM_MASK = MARGIN | GRID | ARROW | TICK_ALL
00167 } ;
00168
00169
00170
00171 enum Presentation
00172 {
00173 TOGGLE_FOLD,
00174 TOGGLE_UNFOLD,
00175 LABEL_UNFOLD
00176 } ;
00177
00178
00179
00183 enum UpdateFrequency
00184 {
00188 CONTINUOUS,
00192 AFTER_ACCEPT
00193 } ;
00194
00195 public:
00196
00200 virtual void attach (PoAxis * axis);
00201
00205 void detach ();
00206
00210 SbBool isAttached () const;
00211
00217 void addAxisChangedCallback (PoXtAxisEditorCB * func, void * userData);
00218
00223 void removeAxisChangedCallback (PoXtAxisEditorCB * func, void * userData);
00224
00228 virtual void setPresentation (Presentation type);
00229
00233 Presentation getPresentation () const;
00234
00238 void setUpdateFrequency (UpdateFrequency freq);
00239
00243 UpdateFrequency getUpdateFrequency () const;
00244
00250 void setTextAxisFilter (unsigned long inclusionMask,
00251 unsigned long exclusionMask);
00252
00257 void getTextAxisFilter (unsigned long & inclusionMask,
00258 unsigned long & exclusionMask) const;
00259
00265 void setGeomAxisFilter (unsigned long inclusionMask,
00266 unsigned long exclusionMask);
00267
00272 void getGeomAxisFilter (unsigned long & inclusionMask,
00273 unsigned long & exclusionMask) const;
00274
00275 virtual void show ();
00276 virtual void hide ();
00277
00278
00279 private:
00280 PoXtAxisEditor (SoWidget Parent = NULL,
00281 const char * name = NULL,
00282 SbBool buildInsideParent = TRUE);
00283
00284 virtual void buildWidget (SoWidget Parent,
00285 const char * name,
00286 SbBool buildInsideParent);
00287 virtual void setAxisFilter();
00288
00289 virtual ~PoXtAxisEditor ();
00290
00291
00292 virtual SbString getDefaultWidgetName() const;
00293 virtual SbString getDefaultTitle() const;
00294 virtual SbString getDefaultIconTitle() const;
00295
00296 void updateXtElements ();
00297
00298 virtual void copyAxisFields(PoAxis * dest, PoAxis * source);
00299 virtual void updateAxisFromXtElements ();
00300
00301 virtual int getMenuItems();
00302
00303
00304 PoAxis * _axis;
00305 PoAxis * _attachedAxis;
00306 PoXtDialog * _dialog;
00307 SoNodeSensor * _sensor;
00308
00309 Presentation _presentation;
00310
00311 menuColumn * _menu;
00312 int _menuItems;
00313 SoCallbackList * _callbackList;
00314
00315 private:
00316 UpdateFrequency _frequency;
00317 int _classMenusNb;
00318 unsigned long _incTextMask;
00319 unsigned long _excTextMask;
00320 unsigned long _incGeomMask;
00321 unsigned long _excGeomMask;
00322
00323 SbBool _isTextSet;
00324 SbBool _isGeomSet;
00325
00326 void activate ();
00327 void deactivate ();
00328
00329
00330
00331 static void acceptCallback (void *, const PoXtDialog::PoXtDialogDataCB *);
00332 static void elementsCallback (void *, const PoXtDialog::PoXtDialogDataCB *);
00333 static void visibilityChangeCB (void *, SbBool visible);
00334 static void sensorCB (void *, SoSensor *);
00335 };
00336
00337
00338 #endif // _POXTAXISEDITOR_H_
00339
00340