VTK
vtkInteractorStyleRubberBandZoom.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkInteractorStyleRubberBandZoom.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 =========================================================================*/
25 #ifndef vtkInteractorStyleRubberBandZoom_h
26 #define vtkInteractorStyleRubberBandZoom_h
27 
28 #include "vtkInteractionStyleModule.h" // For export macro
29 #include "vtkInteractorStyle.h"
30 #include "vtkRect.h" // for vtkRecti
31 
33 
34 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBandZoom : public vtkInteractorStyle
35 {
36 public:
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
46  vtkSetMacro(LockAspectToViewport, bool);
47  vtkGetMacro(LockAspectToViewport, bool);
48  vtkBooleanMacro(LockAspectToViewport, bool);
50 
52 
57  vtkSetMacro(CenterAtStartPosition, bool);
58  vtkGetMacro(CenterAtStartPosition, bool);
59  vtkBooleanMacro(CenterAtStartPosition, bool);
61 
63 
72  vtkSetMacro(UseDollyForPerspectiveProjection, bool);
73  vtkGetMacro(UseDollyForPerspectiveProjection, bool);
74  vtkBooleanMacro(UseDollyForPerspectiveProjection, bool);
76 
78 
81  void OnMouseMove() override;
82  void OnLeftButtonDown() override;
83  void OnLeftButtonUp() override;
85 
86 protected:
89 
90  void Zoom() override;
91 
92  int StartPosition[2];
93  int EndPosition[2];
94  int Moving;
99 private:
101  void operator=(const vtkInteractorStyleRubberBandZoom&) = delete;
102 
108  void AdjustBox(int startPosition[2], int endPosition[2]) const;
109 
110  void ZoomTraditional(const vtkRecti& box);
111  void ZoomPerspectiveProjectionUsingViewAngle(const vtkRecti& box);
112 };
113 
114 #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:33
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)
zoom in by amount indicated by rubber band box
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.