VTK  9.0.1
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 
62  vtkSetMacro(CenterAtStartPosition, bool);
63  vtkGetMacro(CenterAtStartPosition, bool);
64  vtkBooleanMacro(CenterAtStartPosition, bool);
66 
68 
77  vtkSetMacro(UseDollyForPerspectiveProjection, bool);
78  vtkGetMacro(UseDollyForPerspectiveProjection, bool);
79  vtkBooleanMacro(UseDollyForPerspectiveProjection, bool);
81 
83 
86  void OnMouseMove() override;
87  void OnLeftButtonDown() override;
88  void OnLeftButtonUp() override;
90 
91 protected:
94 
95  void Zoom() override;
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  void ZoomTraditional(const vtkRecti& box);
117  void ZoomPerspectiveProjectionUsingViewAngle(const vtkRecti& box);
118 };
119 
120 #endif
vtkInteractorStyle.h
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:35
vtkInteractorStyleRubberBandZoom::CenterAtStartPosition
bool CenterAtStartPosition
Definition: vtkInteractorStyleRubberBandZoom.h:101
vtkInteractorStyleRubberBandZoom::PixelArray
vtkUnsignedCharArray * PixelArray
Definition: vtkInteractorStyleRubberBandZoom.h:103
vtkInteractorStyle::OnMouseMove
virtual void OnMouseMove()
Generic event bindings can be overridden in subclasses.
Definition: vtkInteractorStyle.h:235
vtkInteractorStyleRubberBandZoom::Moving
int Moving
Definition: vtkInteractorStyleRubberBandZoom.h:99
vtkRect.h
vtkInteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown()
Definition: vtkInteractorStyle.h:236
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkInteractorStyleRubberBandZoom
zoom in by amount indicated by rubber band box
Definition: vtkInteractorStyleRubberBandZoom.h:34
vtkInteractorStyle
provide event-driven interface to the rendering window (defines trackball mode)
Definition: vtkInteractorStyle.h:147
vtkInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
Definition: vtkInteractorStyle.h:237
vtkInteractorStyleRubberBandZoom::UseDollyForPerspectiveProjection
bool UseDollyForPerspectiveProjection
Definition: vtkInteractorStyleRubberBandZoom.h:102
vtkInteractorStyle::New
static vtkInteractorStyle * New()
This class must be supplied with a vtkRenderWindowInteractor wrapper or parent.
vtkInteractorStyleRubberBandZoom::LockAspectToViewport
bool LockAspectToViewport
Definition: vtkInteractorStyleRubberBandZoom.h:100
vtkInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkRecti
Definition: vtkRect.h:312
vtkInteractorStyle::Zoom
virtual void Zoom()
Definition: vtkInteractorStyle.h:307