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 =========================================================================*/
36 #ifndef vtkXYPlotWidget_h
37 #define vtkXYPlotWidget_h
38 
39 #include "vtkInteractionWidgetsModule.h" // For export macro
40 #include "vtkInteractorObserver.h"
41 class vtkXYPlotActor;
42 
43 class VTKINTERACTIONWIDGETS_EXPORT vtkXYPlotWidget : public vtkInteractorObserver
44 {
45 public:
46  static vtkXYPlotWidget* New();
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
54  virtual void SetXYPlotActor(vtkXYPlotActor*);
55  vtkGetObjectMacro(XYPlotActor, vtkXYPlotActor);
57 
61  void SetEnabled(int) override;
62 
63 protected:
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.
75  void OnLeftButtonDown();
76  void OnLeftButtonUp();
77  void OnMouseMove();
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 
106 private:
107  vtkXYPlotWidget(const vtkXYPlotWidget&) = delete;
108  void operator=(const vtkXYPlotWidget&) = delete;
109 };
110 
111 #endif
vtkXYPlotWidget::AdjustingE3
@ AdjustingE3
Definition: vtkXYPlotWidget.h:93
vtkXYPlotWidget::AdjustingE1
@ AdjustingE1
Definition: vtkXYPlotWidget.h:91
vtkXYPlotWidget::Inside
@ Inside
Definition: vtkXYPlotWidget.h:95
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkXYPlotWidget::AdjustingP2
@ AdjustingP2
Definition: vtkXYPlotWidget.h:88
vtkInteractorObserver
an abstract superclass for classes observing events invoked by vtkRenderWindowInteractor
Definition: vtkInteractorObserver.h:65
vtkXYPlotWidget
2D widget for manipulating a XY plot
Definition: vtkXYPlotWidget.h:43
vtkInteractorObserver::ProcessEvents
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
Handles the char widget activation event.
vtkInteractorObserver::SetEnabled
virtual void SetEnabled(int)
Methods for turning the interactor observer on and off, and determining its state.
Definition: vtkInteractorObserver.h:79
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkXYPlotWidget::XYPlotActor
vtkXYPlotActor * XYPlotActor
Definition: vtkXYPlotWidget.h:68
vtkXYPlotWidget::State
int State
Definition: vtkXYPlotWidget.h:83
vtkInteractorObserver::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkXYPlotWidget::AdjustingP3
@ AdjustingP3
Definition: vtkXYPlotWidget.h:89
vtkXYPlotActor
generate an x-y plot from input dataset(s) or field data
Definition: vtkXYPlotActor.h:127
vtkXYPlotWidget::WidgetState
WidgetState
Definition: vtkXYPlotWidget.h:84
vtkInteractorObserver.h
vtkXYPlotWidget::AdjustingE4
@ AdjustingE4
Definition: vtkXYPlotWidget.h:94
vtkXYPlotWidget::AdjustingP4
@ AdjustingP4
Definition: vtkXYPlotWidget.h:90
vtkXYPlotWidget::AdjustingE2
@ AdjustingE2
Definition: vtkXYPlotWidget.h:92
vtkXYPlotWidget::AdjustingP1
@ AdjustingP1
Definition: vtkXYPlotWidget.h:87