00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00022 #ifndef __vtkPVAxesWidget_h
00023 #define __vtkPVAxesWidget_h
00024
00025 #include "vtkInteractorObserver.h"
00026
00027 class vtkActor2D;
00028 class vtkKWApplication;
00029 class vtkPolyData;
00030 class vtkPVAxesActor;
00031 class vtkPVAxesWidgetObserver;
00032 class vtkRenderer;
00033
00034 class VTK_EXPORT vtkPVAxesWidget : public vtkInteractorObserver
00035 {
00036 public:
00037 static vtkPVAxesWidget* New();
00038 vtkTypeRevisionMacro(vtkPVAxesWidget, vtkInteractorObserver);
00039 void PrintSelf(ostream& os, vtkIndent indent);
00040
00042
00043 void SetAxesActor(vtkPVAxesActor *actor);
00044 vtkGetObjectMacro(AxesActor, vtkPVAxesActor);
00046
00048 virtual void SetEnabled(int);
00049
00050
00052
00053 void SetParentRenderer(vtkRenderer *ren);
00054 vtkRenderer* GetParentRenderer();
00055
00057
00060 void ExecuteEvent(vtkObject *o, unsigned long event, void *calldata);
00061
00063
00065 void SetInteractive(int state);
00066 vtkGetMacro(Interactive, int);
00067 vtkBooleanMacro(Interactive, int);
00069
00071
00073 void SetOutlineColor(double r, double g, double b);
00074 double *GetOutlineColor();
00076
00078
00079 void SetAxisLabelColor(double r, double g, double b);
00080 double *GetAxisLabelColor();
00082
00084
00085 void SetViewport(double minX, double minY, double maxX, double maxY);
00086 double* GetViewport();
00088
00089 protected:
00090 vtkPVAxesWidget();
00091 ~vtkPVAxesWidget();
00092
00093 vtkRenderer *Renderer;
00094 vtkRenderer *ParentRenderer;
00095
00096 vtkPVAxesActor *AxesActor;
00097 vtkPolyData *Outline;
00098 vtkActor2D *OutlineActor;
00099
00100 static void ProcessEvents(vtkObject *object, unsigned long event,
00101 void *clientdata, void *calldata);
00102
00103 vtkPVAxesWidgetObserver *Observer;
00104 int StartTag;
00105
00106 int MouseCursorState;
00107 int Moving;
00108 int StartPosition[2];
00109
00110 int Interactive;
00111
00112 void UpdateCursorIcon();
00113 void SetMouseCursor(int cursorState);
00114
00115
00116 int State;
00117
00118 enum AxesWidgetState
00119 {
00120 Outside = 0,
00121 Inside,
00122 TopLeft,
00123 TopRight,
00124 BottomLeft,
00125 BottomRight
00126 };
00127
00128
00129 void OnButtonPress();
00130 void OnMouseMove();
00131 void OnButtonRelease();
00132
00133 void MoveWidget();
00134 void ResizeTopLeft();
00135 void ResizeTopRight();
00136 void ResizeBottomLeft();
00137 void ResizeBottomRight();
00138
00139 void SquareRenderer();
00140
00141 unsigned long StartEventObserverId;
00142 private:
00143 vtkPVAxesWidget(const vtkPVAxesWidget&);
00144 void operator=(const vtkPVAxesWidget&);
00145 };
00146
00147 #endif