VTK
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 
30 
32 class vtkRectd;
33 
34 class VTKCHARTSCORE_EXPORT vtkInteractiveArea : public vtkContextArea
35 {
36 public:
38 
39  static vtkInteractiveArea* New();
40  void PrintSelf(ostream &os, vtkIndent indent) override;
41 
43 
46  bool Paint(vtkContext2D *painter) override;
47  bool Hit(const vtkContextMouseEvent& mouse) override;
48  bool MouseWheelEvent(const vtkContextMouseEvent& mouse, int delta) override;
49  bool MouseMoveEvent(const vtkContextMouseEvent &mouse) override;
50  bool MouseButtonPressEvent(const vtkContextMouseEvent &mouse) override;
52 
53 protected:
55  ~vtkInteractiveArea() override;
56 
58 
61  void SetAxisRange(vtkRectd const& data) override;
62 
63 private:
67  void RecalculateTickSpacing(vtkAxis* axis, int const numClicks);
68 
72  void ComputeViewTransform() override;
73 
74  void ComputeZoom(vtkVector2d const& origin, vtkVector2d & scale,
75  vtkVector2d& shift, vtkVector2d& factor);
76 
77  class MouseActions;
78  MouseActions* Actions;
79 
80  vtkInteractiveArea(const vtkInteractiveArea &) = delete;
81  void operator=(const vtkInteractiveArea &) = delete;
82 };
83 
84 #endif //vtkInteractiveArea_h
Implements zooming and panning in a vtkContextArea.
all children of this item are transformed by the vtkTransform2D of this item.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:58
takes care of drawing 2D axes
Definition: vtkAxis.h:71
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:39
Clipped, transformed area with axes for context items.