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

dox/Hybrid/vtkXYPlotWidget.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkXYPlotWidget.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 =========================================================================*/ 00040 #ifndef __vtkXYPlotWidget_h 00041 #define __vtkXYPlotWidget_h 00042 00043 #include "vtkInteractorObserver.h" 00044 class vtkXYPlotActor; 00045 00046 class VTK_HYBRID_EXPORT vtkXYPlotWidget : public vtkInteractorObserver 00047 { 00048 public: 00049 static vtkXYPlotWidget *New(); 00050 vtkTypeRevisionMacro(vtkXYPlotWidget,vtkInteractorObserver); 00051 void PrintSelf(ostream& os, vtkIndent indent); 00052 00054 00055 virtual void SetXYPlotActor(vtkXYPlotActor *scalarbar); 00056 vtkGetObjectMacro(XYPlotActor,vtkXYPlotActor); 00058 00060 virtual void SetEnabled(int); 00061 00062 protected: 00063 vtkXYPlotWidget(); 00064 ~vtkXYPlotWidget(); 00065 00066 // the actor that is used 00067 vtkXYPlotActor *XYPlotActor; 00068 00069 //handles the events 00070 static void ProcessEvents(vtkObject* object, 00071 unsigned long event, 00072 void* clientdata, 00073 void* calldata); 00074 00075 // ProcessEvents() dispatches to these methods. 00076 void OnLeftButtonDown(); 00077 void OnLeftButtonUp(); 00078 void OnMouseMove(); 00079 00080 // used to compute relative movements 00081 float StartPosition[2]; 00082 00083 //BTX - manage the state of the widget 00084 int State; 00085 enum WidgetState 00086 { 00087 Moving=0, 00088 AdjustingP1, 00089 AdjustingP2, 00090 AdjustingP3, 00091 AdjustingP4, 00092 AdjustingE1, 00093 AdjustingE2, 00094 AdjustingE3, 00095 AdjustingE4, 00096 Inside, 00097 Outside 00098 }; 00099 //ETX 00100 00101 // use to determine what state the mouse is over, edge1 p1, etc. 00102 // returns a state from the WidgetState enum above 00103 int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2); 00104 00105 // set the cursor to the correct shape based on State argument 00106 void SetCursor(int State); 00107 00108 private: 00109 vtkXYPlotWidget(const vtkXYPlotWidget&); //Not implemented 00110 void operator=(const vtkXYPlotWidget&); //Not implemented 00111 }; 00112 00113 #endif