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 =========================================================================*/
28 #ifndef vtkInteractorStyleRubberBandZoom_h
29 #define vtkInteractorStyleRubberBandZoom_h
30 
31 #include "vtkInteractionStyleModule.h" // For export macro
32 #include "vtkInteractorStyle.h"
33 #include "vtkRect.h" // for vtkRecti
34 
36 
37 class VTKINTERACTIONSTYLE_EXPORT vtkInteractorStyleRubberBandZoom : public vtkInteractorStyle
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
45 
49  vtkSetMacro(LockAspectToViewport, bool);
50  vtkGetMacro(LockAspectToViewport, bool);
51  vtkBooleanMacro(LockAspectToViewport, bool);
53 
55 
60  vtkSetMacro(CenterAtStartPosition, bool);
61  vtkGetMacro(CenterAtStartPosition, bool);
62  vtkBooleanMacro(CenterAtStartPosition, bool);
64 
66 
75  vtkSetMacro(UseDollyForPerspectiveProjection, bool);
76  vtkGetMacro(UseDollyForPerspectiveProjection, bool);
77  vtkBooleanMacro(UseDollyForPerspectiveProjection, bool);
79 
81 
84  void OnMouseMove() override;
85  void OnLeftButtonDown() override;
86  void OnLeftButtonUp() override;
88 
89 protected:
92 
93  void Zoom() override;
94 
95  int StartPosition[2];
96  int EndPosition[2];
97  int Moving;
102 private:
104  void operator=(const vtkInteractorStyleRubberBandZoom&) = delete;
105 
111  void AdjustBox(int startPosition[2], int endPosition[2]) const;
112 
113  void ZoomTraditional(const vtkRecti& box);
114  void ZoomPerspectiveProjectionUsingViewAngle(const vtkRecti& box);
115 };
116 
117 #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:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
dynamic, self-adjusting array of unsigned char
provide event-driven interface to the rendering window (defines trackball mode)
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
zoom in by amount indicated by rubber band box
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.