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 =========================================================================*/
33 #ifndef vtkXYPlotWidget_h
34 #define vtkXYPlotWidget_h
35 
36 #include "vtkInteractionWidgetsModule.h" // For export macro
37 #include "vtkInteractorObserver.h"
38 class vtkXYPlotActor;
39 
40 class VTKINTERACTIONWIDGETS_EXPORT vtkXYPlotWidget : public vtkInteractorObserver
41 {
42 public:
43  static vtkXYPlotWidget *New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
48 
51  virtual void SetXYPlotActor(vtkXYPlotActor *);
52  vtkGetObjectMacro(XYPlotActor,vtkXYPlotActor);
54 
58  void SetEnabled(int) override;
59 
60 protected:
62  ~vtkXYPlotWidget() override;
63 
64  // the actor that is used
66 
67  //handles the events
68  static void ProcessEvents(vtkObject* object,
69  unsigned long event,
70  void* clientdata,
71  void* calldata);
72 
73  // ProcessEvents() dispatches to these methods.
74  void OnLeftButtonDown();
75  void OnLeftButtonUp();
76  void OnMouseMove();
77 
78  // used to compute relative movements
79  float StartPosition[2];
80 
81  // Manage the state of the widget
82  int State;
84  {
85  Moving=0,
95  Outside
96  };
97 
98  // use to determine what state the mouse is over, edge1 p1, etc.
99  // returns a state from the WidgetState enum above
100  int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2);
101 
102  // set the cursor to the correct shape based on State argument
103  void SetCursor(int State);
104 
105 private:
106  vtkXYPlotWidget(const vtkXYPlotWidget&) = delete;
107  void operator=(const vtkXYPlotWidget&) = delete;
108 };
109 
110 #endif
generate an x-y plot from input dataset(s) or field data
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkXYPlotActor * XYPlotActor
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
Handles the char widget activation event.
virtual void SetEnabled(int)
Methods for turning the interactor observer on and off, and determining its state.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor ...
a simple class to control print indentation
Definition: vtkIndent.h:39
2D widget for manipulating a XY plot
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...