VTK  9.1.0
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
41class vtkXYPlotActor;
42
43class VTKINTERACTIONWIDGETS_EXPORT vtkXYPlotWidget : public vtkInteractorObserver
44{
45public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
55 vtkGetObjectMacro(XYPlotActor, vtkXYPlotActor);
57
61 void SetEnabled(int) override;
62
63protected:
65 ~vtkXYPlotWidget() override;
66
67 // the actor that is used
69
70 // handles the events
71 static void ProcessEvents(
72 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
73
74 // ProcessEvents() dispatches to these methods.
78
79 // used to compute relative movements
80 float StartPosition[2];
81
82 // Manage the state of the widget
83 int State;
85 {
86 Moving = 0,
96 Outside
97 };
98
99 // use to determine what state the mouse is over, edge1 p1, etc.
100 // returns a state from the WidgetState enum above
101 int ComputeStateBasedOnPosition(int X, int Y, int* pos1, int* pos2);
102
103 // set the cursor to the correct shape based on State argument
104 void SetCursor(int State);
105
106private:
107 vtkXYPlotWidget(const vtkXYPlotWidget&) = delete;
108 void operator=(const vtkXYPlotWidget&) = delete;
109};
110
111#endif
a simple class to control print indentation
Definition: vtkIndent.h:113
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
abstract base class for most VTK objects
Definition: vtkObject.h:82
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
static vtkXYPlotWidget * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void OnLeftButtonDown()
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)