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