VTK  9.3.20240522
vtkXYPlotWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
24#ifndef vtkXYPlotWidget_h
25#define vtkXYPlotWidget_h
26
27#include "vtkInteractionWidgetsModule.h" // For export macro
29VTK_ABI_NAMESPACE_BEGIN
30class vtkXYPlotActor;
31
32class VTKINTERACTIONWIDGETS_EXPORT vtkXYPlotWidget : public vtkInteractorObserver
33{
34public:
37 void PrintSelf(ostream& os, vtkIndent indent) override;
38
40
44 vtkGetObjectMacro(XYPlotActor, vtkXYPlotActor);
46
50 void SetEnabled(int) override;
51
52protected:
54 ~vtkXYPlotWidget() override;
55
56 // the actor that is used
58
59 // handles the events
60 static void ProcessEvents(
61 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
62
63 // ProcessEvents() dispatches to these methods.
67
68 // used to compute relative movements
69 float StartPosition[2];
70
71 // Manage the state of the widget
72 int State;
74 {
75 Moving = 0,
85 Outside
86 };
87
88 // use to determine what state the mouse is over, edge1 p1, etc.
89 // returns a state from the WidgetState enum above
90 int ComputeStateBasedOnPosition(int X, int Y, int* pos1, int* pos2);
91
92 // set the cursor to the correct shape based on State argument
93 void SetCursor(int State);
94
95private:
96 vtkXYPlotWidget(const vtkXYPlotWidget&) = delete;
97 void operator=(const vtkXYPlotWidget&) = delete;
98};
99
100VTK_ABI_NAMESPACE_END
101#endif
a simple class to control print indentation
Definition vtkIndent.h:108
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
abstract base class for most VTK objects
Definition vtkObject.h:162
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)