vtkOrientationMarkerWidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00087 #ifndef __vtkOrientationMarkerWidget_h
00088 #define __vtkOrientationMarkerWidget_h
00089
00090 #include "vtkInteractorObserver.h"
00091
00092 class vtkActor2D;
00093 class vtkPolyData;
00094 class vtkProp;
00095 class vtkOrientationMarkerWidgetObserver;
00096 class vtkRenderer;
00097
00098 class VTK_HYBRID_EXPORT vtkOrientationMarkerWidget : public vtkInteractorObserver
00099 {
00100 public:
00101 static vtkOrientationMarkerWidget* New();
00102 vtkTypeRevisionMacro(vtkOrientationMarkerWidget, vtkInteractorObserver);
00103 void PrintSelf(ostream& os, vtkIndent indent);
00104
00106
00107 virtual void SetOrientationMarker(vtkProp *prop);
00108 vtkGetObjectMacro(OrientationMarker, vtkProp);
00110
00112 virtual void SetEnabled(int);
00113
00116 void ExecuteCameraUpdateEvent(vtkObject *o, unsigned long event, void *calldata);
00117
00119
00121 void SetInteractive(int state);
00122 vtkGetMacro(Interactive, int);
00123 vtkBooleanMacro(Interactive, int);
00125
00127
00129 void SetOutlineColor(double r, double g, double b);
00130 double *GetOutlineColor();
00132
00134
00135 void SetViewport(double minX, double minY, double maxX, double maxY);
00136 double* GetViewport();
00138
00139 protected:
00140 vtkOrientationMarkerWidget();
00141 ~vtkOrientationMarkerWidget();
00142
00143 vtkRenderer *Renderer;
00144 vtkProp *OrientationMarker;
00145 vtkPolyData *Outline;
00146 vtkActor2D *OutlineActor;
00147
00148 unsigned long StartEventObserverId;
00149
00150 static void ProcessEvents(vtkObject *object, unsigned long event,
00151 void *clientdata, void *calldata);
00152
00153
00154 void OnLeftButtonDown();
00155 void OnLeftButtonUp();
00156 void OnMouseMove();
00157
00158
00159 vtkOrientationMarkerWidgetObserver *Observer;
00160
00161 int Interactive;
00162
00163
00164 int StartPosition[2];
00165
00166
00167 int State;
00168 enum WidgetState
00169 {
00170 Outside = 0,
00171 Inside,
00172 Moving,
00173 AdjustingP1,
00174 AdjustingP2,
00175 AdjustingP3,
00176 AdjustingP4
00177 };
00178
00179
00180
00181
00182
00183 int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2);
00184
00185
00186 void SetCursor(int state);
00187
00188
00189 void MoveWidget(int X, int Y);
00190 void ResizeTopLeft(int X, int Y);
00191 void ResizeTopRight(int X, int Y);
00192 void ResizeBottomLeft(int X, int Y);
00193 void ResizeBottomRight(int X, int Y);
00194
00195 void SquareRenderer();
00196 void UpdateOutline();
00197
00198 private:
00199 vtkOrientationMarkerWidget(const vtkOrientationMarkerWidget&);
00200 void operator=(const vtkOrientationMarkerWidget&);
00201 };
00202
00203 #endif