00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00054 #ifndef __vtkAbstractWidget_h
00055 #define __vtkAbstractWidget_h
00056
00057 #include "vtkInteractorObserver.h"
00058
00059 class vtkWidgetEventTranslator;
00060 class vtkWidgetCallbackMapper;
00061 class vtkWidgetRepresentation;
00062
00063
00064 class VTK_WIDGETS_EXPORT vtkAbstractWidget : public vtkInteractorObserver
00065 {
00066 public:
00068
00069 vtkTypeMacro(vtkAbstractWidget,vtkInteractorObserver);
00070 void PrintSelf(ostream& os, vtkIndent indent);
00072
00078 virtual void SetEnabled(int);
00079
00081
00085 vtkSetClampMacro(ProcessEvents, int, 0, 1);
00086 vtkGetMacro(ProcessEvents, int);
00087 vtkBooleanMacro(ProcessEvents, int);
00089
00091
00093 vtkWidgetEventTranslator *GetEventTranslator()
00094 {return this->EventTranslator;}
00096
00101 virtual void CreateDefaultRepresentation() = 0;
00102
00107 void Render();
00108
00110
00114 void SetParent(vtkAbstractWidget *parent) {this->Parent = parent;}
00115 vtkGetObjectMacro(Parent,vtkAbstractWidget);
00117
00119
00123 vtkWidgetRepresentation *GetRepresentation()
00124 {
00125 this->CreateDefaultRepresentation();
00126 return this->WidgetRep;
00127 }
00129
00131
00135 vtkSetMacro(ManagesCursor,int);
00136 vtkGetMacro(ManagesCursor,int);
00137 vtkBooleanMacro(ManagesCursor,int);
00139
00143 virtual void SetPriority( float );
00144
00145 protected:
00146 vtkAbstractWidget();
00147 ~vtkAbstractWidget();
00148
00149
00150 static void ProcessEventsHandler(vtkObject* object, unsigned long event,
00151 void* clientdata, void* calldata);
00152
00153
00154
00155
00156
00157 void SetWidgetRepresentation(vtkWidgetRepresentation *r);
00158 vtkWidgetRepresentation *WidgetRep;
00159
00160
00161 int ManagesCursor;
00162 virtual void SetCursor(int vtkNotUsed(state)) {}
00163
00164
00165 vtkWidgetEventTranslator *EventTranslator;
00166 vtkWidgetCallbackMapper *CallbackMapper;
00167
00168
00169 vtkAbstractWidget *Parent;
00170
00171
00172
00173
00174 void *CallData;
00175
00176
00177
00178 int ProcessEvents;
00179
00180 private:
00181 vtkAbstractWidget(const vtkAbstractWidget&);
00182 void operator=(const vtkAbstractWidget&);
00183 };
00184
00185 #endif