VTK  9.2.6
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
26#ifndef vtkInteractiveArea_h
27#define vtkInteractiveArea_h
28
29#include "vtkChartsCoreModule.h" // For export macro
30#include "vtkContextArea.h"
31#include "vtkNew.h" // For vtkNew
32
34class vtkRectd;
35
36class VTKCHARTSCORE_EXPORT vtkInteractiveArea : public vtkContextArea
37{
38public:
40
42 void PrintSelf(ostream& os, vtkIndent indent) override;
43
45
48 bool Paint(vtkContext2D* painter) override;
49 bool Hit(const vtkContextMouseEvent& mouse) override;
50 bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
51 bool MouseMoveEvent(const vtkContextMouseEvent& mouse) override;
52 bool MouseButtonPressEvent(const vtkContextMouseEvent& mouse) override;
54
55protected:
58
60
63 void SetAxisRange(vtkRectd const& data) override;
64
65private:
69 void RecalculateTickSpacing(vtkAxis* axis, int const numClicks);
70
74 void ComputeViewTransform() override;
75
76 void ComputeZoom(
77 vtkVector2d const& origin, vtkVector2d& scale, vtkVector2d& shift, vtkVector2d& factor);
78
79 class MouseActions;
80 MouseActions* Actions;
81
83 void operator=(const vtkInteractiveArea&) = delete;
84};
85
86#endif // vtkInteractiveArea_h
takes care of drawing 2D axes
Definition: vtkAxis.h:72
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
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:40
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()