dox/Hybrid/vtkScalarBarWidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00044 #ifndef __vtkScalarBarWidget_h
00045 #define __vtkScalarBarWidget_h
00046
00047 #include "vtkInteractorObserver.h"
00048 class vtkScalarBarActor;
00049
00050 class VTK_HYBRID_EXPORT vtkScalarBarWidget : public vtkInteractorObserver
00051 {
00052 public:
00053 static vtkScalarBarWidget *New();
00054 vtkTypeRevisionMacro(vtkScalarBarWidget,vtkInteractorObserver);
00055 void PrintSelf(ostream& os, vtkIndent indent);
00056
00058
00059 void SetScalarBarActor(vtkScalarBarActor *scalarbar);
00060 vtkGetObjectMacro(ScalarBarActor,vtkScalarBarActor);
00062
00064 virtual void SetEnabled(int);
00065
00066 protected:
00067 vtkScalarBarWidget();
00068 ~vtkScalarBarWidget();
00069
00070
00071 vtkScalarBarActor *ScalarBarActor;
00072
00073
00074 static void ProcessEvents(vtkObject* object,
00075 unsigned long event,
00076 void* clientdata,
00077 void* calldata);
00078
00079
00080 void OnLeftButtonDown();
00081 void OnLeftButtonUp();
00082 void OnRightButtonDown();
00083 void OnRightButtonUp();
00084 void OnMouseMove();
00085
00086
00087 float StartPosition[2];
00088
00089
00090 int State;
00091
00092
00093 int LeftButtonDown;
00094 int RightButtonDown;
00095 enum WidgetState
00096 {
00097 Moving=0,
00098 AdjustingP1,
00099 AdjustingP2,
00100 AdjustingP3,
00101 AdjustingP4,
00102 AdjustingE1,
00103 AdjustingE2,
00104 AdjustingE3,
00105 AdjustingE4,
00106 Inside,
00107 Outside
00108 };
00109
00110
00111
00112
00113 int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2);
00114
00115
00116 void SetCursor(int State);
00117
00118 private:
00119 vtkScalarBarWidget(const vtkScalarBarWidget&);
00120 void operator=(const vtkScalarBarWidget&);
00121 };
00122
00123 #endif