VTK
vtkGeoInteractorStyle.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGeoInteractorStyle.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 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
33 #ifndef vtkGeoInteractorStyle_h
34 #define vtkGeoInteractorStyle_h
35 
36 #include "vtkGeovisCoreModule.h" // For export macro
38 #include "vtkSmartPointer.h" // for SP
39 
40 class vtkCamera;
41 class vtkCommand;
42 class vtkCompassWidget;
43 class vtkGeoCamera;
45 
46 #if !defined(VTK_LEGACY_REMOVE)
47 class VTKGEOVISCORE_EXPORT vtkGeoInteractorStyle :
49 {
50 public:
52  vtkTypeMacro(vtkGeoInteractorStyle,
54  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
57 
60  void OnEnter() override;
61  void OnLeave() override;
62  void OnMouseMove() override;
63  void OnLeftButtonUp() override;
64  void OnMiddleButtonUp() override;
65  void OnRightButtonUp() override;
66  void OnLeftButtonDown() override;
67  void OnMiddleButtonDown() override;
68  void OnRightButtonDown() override;
69  void OnChar() override;
71 
72  virtual void RubberBandZoom();
73  void Pan() override;
74  void Dolly() override;
75 
76  // Public for render callback.
78 
79  // See cxx for description of why we need this method.
80  void StartState(int newstate) override;
81 
82  // Used for updating the terrain.
84 
88  void ResetCamera();
89 
92 
97  void SetInteractor(vtkRenderWindowInteractor *interactor) override;
98 
99  int ViewportToWorld(double x, double y,
100  double &wx, double &wy, double &wz);
101  void WorldToLongLat(double wx, double wy, double wz,
102  double &lon, double &lat);
103  void ViewportToLongLat(double x, double y,
104  double &lon, double &lat);
105  int GetRayIntersection(double origin[3],
106  double direction[3],
107  double intersection[3]);
108 
113 
115 
118  vtkGetMacro(LockHeading, bool);
119  vtkSetMacro(LockHeading, bool);
120  vtkBooleanMacro(LockHeading, bool);
122 
127 
128 protected:
131 
132  // To avoid a warning.
133  // We should really inherit directly from vtkInteractorStyle
134  void Dolly(double) override;
135 
136  void OnTimer() override;
137  // Used to get a constant speed regardless of frame rate.
138  double LastTime;
139 
140  // Rubberband zoom has a verification stage.
141  int RubberBandExtent[4];
146  bool InRubberBandRectangle(int x, int y);
148 
150  void UpdateLights();
151  void GetPanCenter(double &px, double &py);
152 
153  int StartPosition[2];
154  int EndPosition[2];
157  int PixelDims[2];
159 
161 
162  // widget handling members
165 
166 private:
168  void operator=(const vtkGeoInteractorStyle&) = delete;
169 };
170 
171 #endif //VTK_LEGACY_REMOVE
172 #endif
vtkGeoInteractorStyle::ViewportToWorld
int ViewportToWorld(double x, double y, double &wx, double &wy, double &wz)
vtkGeoInteractorStyle::ViewportToLongLat
void ViewportToLongLat(double x, double y, double &lon, double &lat)
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:371
vtkGeoInteractorStyle::SetCurrentRenderer
void SetCurrentRenderer(vtkRenderer *) override
Override to make the renderer use this camera subclass.
vtkGeoInteractorStyle::InRubberBandRectangle
bool InRubberBandRectangle(int x, int y)
vtkGeoInteractorStyle::UpdateLights
void UpdateLights()
vtkGeoInteractorStyle::LastTime
double LastTime
Definition: vtkGeoInteractorStyle.h:138
vtkGeoInteractorStyle::GeoCamera
vtkSmartPointer< vtkGeoCamera > GeoCamera
Definition: vtkGeoInteractorStyle.h:160
vtkGeoInteractorStyle::DrawRectangle
void DrawRectangle()
vtkGeoInteractorStyle::RubberBandExtentEnabled
int RubberBandExtentEnabled
Definition: vtkGeoInteractorStyle.h:142
vtkGeoInteractorStyle::WorldToLongLat
void WorldToLongLat(double wx, double wy, double wz, double &lon, double &lat)
vtkX3D::direction
@ direction
Definition: vtkX3D.h:260
vtkGeoInteractorStyle::RedrawRectangle
void RedrawRectangle()
vtkGeoInteractorStyle::GetPanCenter
void GetPanCenter(double &px, double &py)
vtkGeoInteractorStyle::GetRayIntersection
int GetRayIntersection(double origin[3], double direction[3], double intersection[3])
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:42
vtkSmartPointer< vtkGeoCamera >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkGeoInteractorStyle::vtkGeoInteractorStyle
vtkGeoInteractorStyle()
vtkGeoInteractorStyle::OnTimer
void OnTimer() override
OnTimer calls Rotate, Rotate etc which should be overridden by style subclasses.
vtkGeoInteractorStyle::~vtkGeoInteractorStyle
~vtkGeoInteractorStyle() override
vtkGeoInteractorStyle::PixelArray
vtkUnsignedCharArray * PixelArray
Definition: vtkGeoInteractorStyle.h:156
vtkGeoInteractorStyle::OnRightButtonDown
void OnRightButtonDown() override
vtkGeoInteractorStyle::DisableRubberBandRedraw
void DisableRubberBandRedraw()
vtkGeoInteractorStyle::RenderCallbackTag
int RenderCallbackTag
Definition: vtkGeoInteractorStyle.h:143
vtkGeoInteractorStyle::Pan
void Pan() override
vtkCompassWidget
set a value by manipulating something
Definition: vtkCompassWidget.h:75
vtkGeoInteractorStyle::GetGeoCamera
vtkGeoCamera * GetGeoCamera()
vtkGeoInteractorStyle::OnMiddleButtonUp
void OnMiddleButtonUp() override
vtkGeoInteractorStyle::OnRightButtonUp
void OnRightButtonUp() override
vtkGeoInteractorStyle::OnChar
void OnChar() override
Sets up the keypress-i event.
vtkGeoInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkGeoInteractorStyle::StartState
void StartState(int newstate) override
utility routines used by state changes
vtkGeoInteractorStyle::SetInteractor
void SetInteractor(vtkRenderWindowInteractor *interactor) override
Set/Get the Interactor wrapper being controlled by this object.
vtkGeoInteractorStyle::ResetCameraClippingRange
void ResetCameraClippingRange()
Called after camera properties are modified.
vtkGeoInteractorStyle::OnLeftButtonDown
void OnLeftButtonDown() override
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkGeoInteractorStyle::EnableRubberBandRedraw
void EnableRubberBandRedraw()
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
vtkSmartPointer.h
vtkGeoInteractorStyle::OnEnter
void OnEnter() override
Event bindings.
vtkGeoCamera
Geo interface to a camera.
Definition: vtkGeoCamera.h:85
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:79
vtkGeoInteractorStyle::CompassWidget
vtkSmartPointer< vtkCompassWidget > CompassWidget
Definition: vtkGeoInteractorStyle.h:163
vtkGeoInteractorStyle::RubberBandZoom
virtual void RubberBandZoom()
vtkGeoInteractorStyle::WidgetInteraction
void WidgetInteraction(vtkObject *caller)
Called when the sub widgets have an interaction.
vtkGeoInteractorStyle::OnLeftButtonUp
void OnLeftButtonUp() override
vtkGeoInteractorStyle::EventCommand
vtkSmartPointer< vtkCommand > EventCommand
Definition: vtkGeoInteractorStyle.h:164
vtkGeoInteractorStyle::OnMiddleButtonDown
void OnMiddleButtonDown() override
vtkGeoInteractorStyle::DraggingRubberBandBoxState
int DraggingRubberBandBoxState
Definition: vtkGeoInteractorStyle.h:155
vtkInteractorStyleTrackballCamera
interactive manipulation of the camera
Definition: vtkInteractorStyleTrackballCamera.h:48
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkGeoInteractorStyle::ResetCamera
void ResetCamera()
This can be used to set the camera to the standard view of the earth.
vtkGeoInteractorStyle::OnMouseMove
void OnMouseMove() override
Generic event bindings can be overridden in subclasses.
vtkGeoInteractorStyle::Dolly
void Dolly(double) override
vtkGeoInteractorStyle::OnLeave
void OnLeave() override
vtkGeoInteractorStyle::LockHeading
bool LockHeading
Definition: vtkGeoInteractorStyle.h:158
vtkGeoInteractorStyle::New
static vtkGeoInteractorStyle * New()
vtkGeoInteractorStyle::Dolly
void Dolly() override
vtkGeoInteractorStyle::KeepCameraAboveGround
void KeepCameraAboveGround(vtkCamera *camera)
vtkGeoInteractorStyle
Interaction for a globe.
Definition: vtkGeoInteractorStyle.h:49
vtkInteractorStyleTrackballCamera.h