VTK  9.3.0
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
21#ifndef vtkXYPlotWidget_h
22#define vtkXYPlotWidget_h
23
24#include "vtkInteractionWidgetsModule.h" // For export macro
26VTK_ABI_NAMESPACE_BEGIN
27class vtkXYPlotActor;
28
29class VTKINTERACTIONWIDGETS_EXPORT vtkXYPlotWidget : public vtkInteractorObserver
30{
31public:
34 void PrintSelf(ostream& os, vtkIndent indent) override;
35
37
41 vtkGetObjectMacro(XYPlotActor, vtkXYPlotActor);
43
47 void SetEnabled(int) override;
48
49protected:
51 ~vtkXYPlotWidget() override;
52
53 // the actor that is used
55
56 // handles the events
57 static void ProcessEvents(
58 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
59
60 // ProcessEvents() dispatches to these methods.
64
65 // used to compute relative movements
66 float StartPosition[2];
67
68 // Manage the state of the widget
69 int State;
71 {
72 Moving = 0,
82 Outside
83 };
84
85 // use to determine what state the mouse is over, edge1 p1, etc.
86 // returns a state from the WidgetState enum above
87 int ComputeStateBasedOnPosition(int X, int Y, int* pos1, int* pos2);
88
89 // set the cursor to the correct shape based on State argument
90 void SetCursor(int State);
91
92private:
93 vtkXYPlotWidget(const vtkXYPlotWidget&) = delete;
94 void operator=(const vtkXYPlotWidget&) = delete;
95};
96
97VTK_ABI_NAMESPACE_END
98#endif
a simple class to control print indentation
Definition vtkIndent.h:29
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
abstract base class for most VTK objects
Definition vtkObject.h:49
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)