VTK  9.7.1
vtkInteractorStyleRubberBandZoom.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkInteractorStyleRubberBandZoom_h
17 #define vtkInteractorStyleRubberBandZoom_h
18 
19 #include "vtkInteractionStyleModule.h" // For export macro
20 #include "vtkInteractorStyle.h"
21 #include "vtkRect.h" // for vtkRecti
22 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
23 
24 VTK_ABI_NAMESPACE_BEGIN
26 
27 class VTKINTERACTIONSTYLE_EXPORT VTK_MARSHALAUTO vtkInteractorStyleRubberBandZoom
28  : public vtkInteractorStyle
29 {
30 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34 
36 
40  vtkSetMacro(LockAspectToViewport, bool);
41  vtkGetMacro(LockAspectToViewport, bool);
42  vtkBooleanMacro(LockAspectToViewport, bool);
44 
46 
56  vtkSetMacro(CenterAtStartPosition, bool);
57  vtkGetMacro(CenterAtStartPosition, bool);
58  vtkBooleanMacro(CenterAtStartPosition, bool);
60 
62 
71  vtkSetMacro(UseDollyForPerspectiveProjection, bool);
72  vtkGetMacro(UseDollyForPerspectiveProjection, bool);
73  vtkBooleanMacro(UseDollyForPerspectiveProjection, bool);
75 
77 
80  void OnMouseMove() override;
81  void OnLeftButtonDown() override;
82  void OnLeftButtonUp() override;
84 
85 protected:
88 
89  void Zoom() override;
90 
91  virtual void ZoomTraditional(const vtkRecti& box);
92 
97  virtual vtkVector3d CalculatePerspectiveZoomFocalPoint(const vtkRecti& box) const;
98 
99  int StartPosition[2];
100  int EndPosition[2];
101  int Moving;
106 
107 private:
109  void operator=(const vtkInteractorStyleRubberBandZoom&) = delete;
110 
116  void AdjustBox(int startPosition[2], int endPosition[2]) const;
117 };
118 
119 VTK_ABI_NAMESPACE_END
120 #endif
virtual void OnLeftButtonDown()
virtual void OnLeftButtonUp()
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
dynamic, self-adjusting array of unsigned char
provide event-driven interface to the rendering window (defines trackball mode)
#define VTK_MARSHALAUTO
zoom in by amount indicated by rubber band box
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.