VTK  9.1.0
vtkInteractiveArea.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkInteractiveArea.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=========================================================================*/
15
23#ifndef vtkInteractiveArea_h
24#define vtkInteractiveArea_h
25
26#include "vtkChartsCoreModule.h" // For export macro
27#include "vtkContextArea.h"
28#include "vtkNew.h" // For vtkNew
29
31class vtkRectd;
32
33class VTKCHARTSCORE_EXPORT vtkInteractiveArea : public vtkContextArea
34{
35public:
37
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
42
45 bool Paint(vtkContext2D* painter) override;
46 bool Hit(const vtkContextMouseEvent& mouse) override;
47 bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
48 bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
49 bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
51
52protected:
55
57
60 void SetAxisRange(vtkRectd const& data) override;
61
62private:
66 void RecalculateTickSpacing(vtkAxis* axis, int const numClicks);
67
71 void ComputeViewTransform() override;
72
73 void ComputeZoom(
74 vtkVector2d const& origin, vtkVector2d& scale, vtkVector2d& shift, vtkVector2d& factor);
75
76 class MouseActions;
77 MouseActions* Actions;
78
80 void operator=(const vtkInteractiveArea&) = delete;
81};
82
83#endif // vtkInteractiveArea_h
takes care of drawing 2D axes
Definition: vtkAxis.h:178
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:73
Clipped, transformed area with axes for context items.
virtual void ComputeViewTransform()
data structure to represent mouse events.
all children of this item are transformed by the vtkTransform2D of this item.
a simple class to control print indentation
Definition: vtkIndent.h:113
Implements zooming and panning in a vtkContextArea.
bool MouseWheelEvent(const vtkContextMouseEvent &mouse, int delta) override
Mouse wheel event, positive delta indicates forward movement of the wheel.
bool Hit(const vtkContextMouseEvent &mouse) override
Return true if the supplied x, y coordinate is inside the item.
~vtkInteractiveArea() override
bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override
Mouse button down event Return true if the item holds the event, false if the event can be propagated...
bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override
Mouse move event.
void SetAxisRange(vtkRectd const &data) override
vtkContextArea API
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool Paint(vtkContext2D *painter) override
vtkAbstractContextItem API
static vtkInteractiveArea * New()
@ scale
Definition: vtkX3D.h:235
@ data
Definition: vtkX3D.h:321