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

vtkXYPlotWidget.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkXYPlotWidget.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00045 #ifndef __vtkXYPlotWidget_h
00046 #define __vtkXYPlotWidget_h
00047 
00048 #include "vtkInteractorObserver.h"
00049 class vtkXYPlotActor;
00050 
00051 class VTK_HYBRID_EXPORT vtkXYPlotWidget : public vtkInteractorObserver
00052 {
00053 public:
00054   static vtkXYPlotWidget *New();
00055   vtkTypeRevisionMacro(vtkXYPlotWidget,vtkInteractorObserver);
00056   void PrintSelf(ostream& os, vtkIndent indent);
00057 
00059 
00060   virtual void SetXYPlotActor(vtkXYPlotActor *);
00061   vtkGetObjectMacro(XYPlotActor,vtkXYPlotActor);
00063   
00065   virtual void SetEnabled(int);
00066 
00067 protected:
00068   vtkXYPlotWidget();
00069   ~vtkXYPlotWidget();
00070 
00071   // the actor that is used
00072   vtkXYPlotActor *XYPlotActor;
00073 
00074   //handles the events
00075   static void ProcessEvents(vtkObject* object, 
00076                             unsigned long event,
00077                             void* clientdata, 
00078                             void* calldata);
00079 
00080   // ProcessEvents() dispatches to these methods.
00081   void OnLeftButtonDown();
00082   void OnLeftButtonUp();
00083   void OnMouseMove();
00084 
00085   // used to compute relative movements
00086   float StartPosition[2];
00087   
00088 //BTX - manage the state of the widget
00089   int State;
00090   enum WidgetState
00091   {
00092     Moving=0,
00093     AdjustingP1,
00094     AdjustingP2,
00095     AdjustingP3,
00096     AdjustingP4,
00097     AdjustingE1,
00098     AdjustingE2,
00099     AdjustingE3,
00100     AdjustingE4,
00101     Inside,
00102     Outside
00103   };
00104 //ETX
00105 
00106   // use to determine what state the mouse is over, edge1 p1, etc.
00107   // returns a state from the WidgetState enum above
00108   int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2);
00109 
00110   // set the cursor to the correct shape based on State argument
00111   void SetCursor(int State);
00112 
00113 private:
00114   vtkXYPlotWidget(const vtkXYPlotWidget&);  //Not implemented
00115   void operator=(const vtkXYPlotWidget&);  //Not implemented
00116 };
00117 
00118 #endif