VTK  9.0.1
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 
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(
69  vtkObject* object, unsigned long event, void* clientdata, void* calldata);
70 
71  // ProcessEvents() dispatches to these methods.
74  void OnMouseMove();
75 
76  // used to compute relative movements
77  float StartPosition[2];
78 
79  // Manage the state of the widget
80  int State;
82  {
83  Moving = 0,
93  Outside
94  };
95 
96  // use to determine what state the mouse is over, edge1 p1, etc.
97  // returns a state from the WidgetState enum above
98  int ComputeStateBasedOnPosition(int X, int Y, int* pos1, int* pos2);
99 
100  // set the cursor to the correct shape based on State argument
101  void SetCursor(int State);
102 
103 private:
104  vtkXYPlotWidget(const vtkXYPlotWidget&) = delete;
105  void operator=(const vtkXYPlotWidget&) = delete;
106 };
107 
108 #endif
vtkXYPlotWidget::~vtkXYPlotWidget
~vtkXYPlotWidget() override
vtkXYPlotWidget::vtkXYPlotWidget
vtkXYPlotWidget()
vtkXYPlotWidget::AdjustingE3
@ AdjustingE3
Definition: vtkXYPlotWidget.h:90
vtkXYPlotWidget::AdjustingE1
@ AdjustingE1
Definition: vtkXYPlotWidget.h:88
vtkXYPlotWidget::OnLeftButtonDown
void OnLeftButtonDown()
vtkXYPlotWidget::Inside
@ Inside
Definition: vtkXYPlotWidget.h:92
vtkXYPlotWidget::OnMouseMove
void OnMouseMove()
vtkXYPlotWidget::New
static vtkXYPlotWidget * New()
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:54
vtkXYPlotWidget::ProcessEvents
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkXYPlotWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXYPlotWidget::AdjustingP2
@ AdjustingP2
Definition: vtkXYPlotWidget.h:85
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:60
vtkXYPlotWidget::SetCursor
void SetCursor(int State)
vtkXYPlotWidget
2D widget for manipulating a XY plot
Definition: vtkXYPlotWidget.h:41
vtkXYPlotWidget::ComputeStateBasedOnPosition
int ComputeStateBasedOnPosition(int X, int Y, int *pos1, int *pos2)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkXYPlotWidget::OnLeftButtonUp
void OnLeftButtonUp()
vtkXYPlotWidget::XYPlotActor
vtkXYPlotActor * XYPlotActor
Definition: vtkXYPlotWidget.h:65
vtkXYPlotWidget::State
int State
Definition: vtkXYPlotWidget.h:80
vtkXYPlotWidget::AdjustingP3
@ AdjustingP3
Definition: vtkXYPlotWidget.h:86
vtkXYPlotActor
generate an x-y plot from input dataset(s) or field data
Definition: vtkXYPlotActor.h:128
vtkXYPlotWidget::WidgetState
WidgetState
Definition: vtkXYPlotWidget.h:82
vtkXYPlotWidget::SetXYPlotActor
virtual void SetXYPlotActor(vtkXYPlotActor *)
Get the XY plot used by this Widget.
vtkXYPlotWidget::SetEnabled
void SetEnabled(int) override
Methods for turning the interactor observer on and off.
vtkInteractorObserver.h
vtkXYPlotWidget::AdjustingE4
@ AdjustingE4
Definition: vtkXYPlotWidget.h:91
vtkXYPlotWidget::AdjustingP4
@ AdjustingP4
Definition: vtkXYPlotWidget.h:87
vtkXYPlotWidget::AdjustingE2
@ AdjustingE2
Definition: vtkXYPlotWidget.h:89
vtkXYPlotWidget::AdjustingP1
@ AdjustingP1
Definition: vtkXYPlotWidget.h:84