Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Hybrid/vtkScalarBarWidget.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkScalarBarWidget.h,v $ 00005 Language: C++ 00006 00007 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 00008 All rights reserved. 00009 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00010 00011 This software is distributed WITHOUT ANY WARRANTY; without even 00012 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00013 PURPOSE. See the above copyright notice for more information. 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 // the actor that is used 00071 vtkScalarBarActor *ScalarBarActor; 00072 00073 //handles the events 00074 static void ProcessEvents(vtkObject* object, 00075 unsigned long event, 00076 void* clientdata, 00077 void* calldata); 00078 00079 // ProcessEvents() dispatches to these methods. 00080 void OnLeftButtonDown(); 00081 void OnLeftButtonUp(); 00082 void OnRightButtonDown(); 00083 void OnRightButtonUp(); 00084 void OnMouseMove(); 00085 00086 // used to compute relative movements 00087 float StartPosition[2]; 00088 00089 //BTX - manage the state of the widget 00090 int State; 00091 // use this to track whether left/right button was pressed to gate 00092 // action on button up event. 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 //ETX 00110 00111 // use to determine what state the mouse is over, edge1 p1, etc. 00112 // returns a state from the WidgetState enum above 00113 int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2); 00114 00115 // set the cursor to the correct shape based on State argument 00116 void SetCursor(int State); 00117 00118 private: 00119 vtkScalarBarWidget(const vtkScalarBarWidget&); //Not implemented 00120 void operator=(const vtkScalarBarWidget&); //Not implemented 00121 }; 00122 00123 #endif