VTK
vtkXYPlotWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkXYPlotWidget.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
35 #ifndef vtkXYPlotWidget_h
36 #define vtkXYPlotWidget_h
37 
38 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkInteractorObserver.h"
40 class vtkXYPlotActor;
41 
43 {
44 public:
45  static vtkXYPlotWidget *New();
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
50 
51  virtual void SetXYPlotActor(vtkXYPlotActor *);
52  vtkGetObjectMacro(XYPlotActor,vtkXYPlotActor);
54 
56  virtual void SetEnabled(int);
57 
58 protected:
60  ~vtkXYPlotWidget();
61 
62  // the actor that is used
64 
65  //handles the events
66  static void ProcessEvents(vtkObject* object,
67  unsigned long event,
68  void* clientdata,
69  void* calldata);
70 
71  // ProcessEvents() dispatches to these methods.
72  void OnLeftButtonDown();
73  void OnLeftButtonUp();
74  void OnMouseMove();
75 
76  // used to compute relative movements
77  float StartPosition[2];
78 
79  // Manage the state of the widget
80  int State;
82  {
83  Moving=0,
93  Outside
94  };
95 
96  // use to determine what state the mouse is over, edge1 p1, etc.
97  // returns a state from the WidgetState enum above
98  int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2);
99 
100  // set the cursor to the correct shape based on State argument
101  void SetCursor(int State);
102 
103 private:
104  vtkXYPlotWidget(const vtkXYPlotWidget&); //Not implemented
105  void operator=(const vtkXYPlotWidget&); //Not implemented
106 };
107 
108 #endif
generate an x-y plot from input dataset(s) or field data
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkXYPlotActor * XYPlotActor
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
virtual void SetEnabled(int)
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
2D widget for manipulating a XY plot
void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()