VTK  9.3.0
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 
23 VTK_ABI_NAMESPACE_BEGIN
25 
26 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBandZoom : public vtkInteractorStyle
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
34 
38  vtkSetMacro(LockAspectToViewport, bool);
39  vtkGetMacro(LockAspectToViewport, bool);
40  vtkBooleanMacro(LockAspectToViewport, bool);
42 
44 
54  vtkSetMacro(CenterAtStartPosition, bool);
55  vtkGetMacro(CenterAtStartPosition, bool);
56  vtkBooleanMacro(CenterAtStartPosition, bool);
58 
60 
69  vtkSetMacro(UseDollyForPerspectiveProjection, bool);
70  vtkGetMacro(UseDollyForPerspectiveProjection, bool);
71  vtkBooleanMacro(UseDollyForPerspectiveProjection, bool);
73 
75 
78  void OnMouseMove() override;
79  void OnLeftButtonDown() override;
80  void OnLeftButtonUp() override;
82 
83 protected:
86 
87  void Zoom() override;
88 
89  virtual void ZoomTraditional(const vtkRecti& box);
90 
96 
97  int StartPosition[2];
98  int EndPosition[2];
99  int Moving;
104 
105 private:
107  void operator=(const vtkInteractorStyleRubberBandZoom&) = delete;
108 
114  void AdjustBox(int startPosition[2], int endPosition[2]) const;
115 };
116 
117 VTK_ABI_NAMESPACE_END
118 #endif
a simple class to control print indentation
Definition: vtkIndent.h:29
zoom in by amount indicated by rubber band box
void OnLeftButtonDown() override
Event bindings.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void ZoomTraditional(const vtkRecti &box)
virtual vtkVector3d CalculatePerspectiveZoomFocalPoint(const vtkRecti &box) const
Calculates the focal point to be used when zooming on perspective projection using the view angle bas...
static vtkInteractorStyleRubberBandZoom * New()
void OnLeftButtonUp() override
Event bindings.
void OnMouseMove() override
Event bindings.
provide event-driven interface to the rendering window (defines trackball mode)
dynamic, self-adjusting array of unsigned char