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 -------------------------------------------------------------------------*/
35 #ifndef vtkGeoInteractorStyle_h
36 #define vtkGeoInteractorStyle_h
37 
38 #include "vtkGeovisCoreModule.h" // For export macro
40 #include "vtkSmartPointer.h" // for SP
41 
42 class vtkCamera;
43 class vtkCommand;
44 class vtkCompassWidget;
45 class vtkGeoCamera;
47 
50 {
51 public:
55  void PrintSelf(ostream& os, vtkIndent indent);
56 
58 
59  virtual void OnEnter();
60  virtual void OnLeave();
61  virtual void OnMouseMove();
62  virtual void OnLeftButtonUp();
63  virtual void OnMiddleButtonUp();
64  virtual void OnRightButtonUp();
65  virtual void OnLeftButtonDown();
66  virtual void OnMiddleButtonDown();
67  virtual void OnRightButtonDown();
68  virtual void OnChar();
70 
71  virtual void RubberBandZoom();
72  virtual void Pan();
73  virtual void Dolly();
74 
75  // Public for render callback.
77 
78  // See cxx for description of why we need this method.
79  void StartState(int newstate);
80 
81  // Used for updating the terrain.
83 
85  void ResetCamera();
86 
89 
92  virtual void SetInteractor(vtkRenderWindowInteractor *interactor);
93 
94  int ViewportToWorld(double x, double y,
95  double &wx, double &wy, double &wz);
96  void WorldToLongLat(double wx, double wy, double wz,
97  double &lon, double &lat);
98  void ViewportToLongLat(double x, double y,
99  double &lon, double &lat);
100  int GetRayIntersection(double origin[3],
101  double direction[3],
102  double intersection[3]);
103 
106 
108 
109  vtkGetMacro(LockHeading, bool);
110  vtkSetMacro(LockHeading, bool);
111  vtkBooleanMacro(LockHeading, bool);
113 
116 
117 protected:
120 
121  // To avoid a warning.
122  // We should really inherit directy from vtkInteractorStyle
123  virtual void Dolly(double);
124 
125  void OnTimer();
126  // Used to get a constant speed regardless of frame rate.
127  double LastTime;
128 
129  // Rubberband zoom has a verification stage.
130  int RubberBandExtent[4];
135  bool InRubberBandRectangle(int x, int y);
137 
139  void UpdateLights();
140  void GetPanCenter(double &px, double &py);
141 
142  int StartPosition[2];
143  int EndPosition[2];
145  double MotionFactor;
147  int PixelDims[2];
149 
150 //BTX
152 
153  // widget handling members
156 
157 //ETX
158 
159 private:
160  vtkGeoInteractorStyle(const vtkGeoInteractorStyle&); // Not implemented.
161  void operator=(const vtkGeoInteractorStyle&); // Not implemented.
162 };
163 
164 #endif
vtkGeoInteractorStyle::Pan
virtual void Pan()
vtkGeoInteractorStyle::OnChar
virtual void OnChar()
vtkGeoInteractorStyle::~vtkGeoInteractorStyle
~vtkGeoInteractorStyle()
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:326
vtkGeoInteractorStyle::OnMiddleButtonUp
virtual void OnMiddleButtonUp()
vtkGeoInteractorStyle::OnRightButtonUp
virtual void OnRightButtonUp()
vtkGeoInteractorStyle::InRubberBandRectangle
bool InRubberBandRectangle(int x, int y)
vtkGeoInteractorStyle::UpdateLights
void UpdateLights()
vtkGeoInteractorStyle::LastTime
double LastTime
Definition: vtkGeoInteractorStyle.h:127
vtkGeoInteractorStyle::GeoCamera
vtkSmartPointer< vtkGeoCamera > GeoCamera
Definition: vtkGeoInteractorStyle.h:151
vtkGeoInteractorStyle::DrawRectangle
void DrawRectangle()
vtkGeoInteractorStyle::Dolly
virtual void Dolly(double)
vtkGeoInteractorStyle::RubberBandExtentEnabled
int RubberBandExtentEnabled
Definition: vtkGeoInteractorStyle.h:131
vtkGeoInteractorStyle::OnMiddleButtonDown
virtual void OnMiddleButtonDown()
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::SetInteractor
virtual void SetInteractor(vtkRenderWindowInteractor *interactor)
vtkGeoInteractorStyle::GetPanCenter
void GetPanCenter(double &px, double &py)
vtkGeoInteractorStyle::GetRayIntersection
int GetRayIntersection(double origin[3], double direction[3], double intersection[3])
vtkGeovisCoreModule.h
vtkUnsignedCharArray
dynamic, self-adjusting array of unsigned char
Definition: vtkUnsignedCharArray.h:49
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkGeoInteractorStyle::OnEnter
virtual void OnEnter()
vtkSmartPointer< vtkGeoCamera >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkGeoInteractorStyle::OnLeftButtonUp
virtual void OnLeftButtonUp()
vtkGeoInteractorStyle::OnLeave
virtual void OnLeave()
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkGeoInteractorStyle::vtkGeoInteractorStyle
vtkGeoInteractorStyle()
vtkGeoInteractorStyle::PixelArray
vtkUnsignedCharArray * PixelArray
Definition: vtkGeoInteractorStyle.h:146
vtkGeoInteractorStyle::DisableRubberBandRedraw
void DisableRubberBandRedraw()
vtkGeoInteractorStyle::OnMouseMove
virtual void OnMouseMove()
vtkGeoInteractorStyle::RenderCallbackTag
int RenderCallbackTag
Definition: vtkGeoInteractorStyle.h:132
vtkGeoInteractorStyle::OnTimer
void OnTimer()
vtkCompassWidget
set a value by manipulating something
Definition: vtkCompassWidget.h:77
vtkGeoInteractorStyle::GetGeoCamera
vtkGeoCamera * GetGeoCamera()
vtkGeoInteractorStyle::ResetCameraClippingRange
void ResetCameraClippingRange()
vtkGeoInteractorStyle::OnLeftButtonDown
virtual void OnLeftButtonDown()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGeoInteractorStyle::EnableRubberBandRedraw
void EnableRubberBandRedraw()
vtkGeoInteractorStyle::MotionFactor
double MotionFactor
Definition: vtkGeoInteractorStyle.h:145
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:49
vtkSmartPointer.h
vtkGeoInteractorStyle::Dolly
virtual void Dolly()
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGeoCamera
Geo interface to a camera.
Definition: vtkGeoCamera.h:83
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:80
vtkGeoInteractorStyle::CompassWidget
vtkSmartPointer< vtkCompassWidget > CompassWidget
Definition: vtkGeoInteractorStyle.h:154
vtkGeoInteractorStyle::RubberBandZoom
virtual void RubberBandZoom()
vtkGeoInteractorStyle::WidgetInteraction
void WidgetInteraction(vtkObject *caller)
Called when the sub widgets have an interaction.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkGeoInteractorStyle::OnRightButtonDown
virtual void OnRightButtonDown()
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkGeoInteractorStyle::EventCommand
vtkSmartPointer< vtkCommand > EventCommand
Definition: vtkGeoInteractorStyle.h:155
VTKGEOVISCORE_EXPORT
#define VTKGEOVISCORE_EXPORT
Definition: vtkGeovisCoreModule.h:15
vtkGeoInteractorStyle::DraggingRubberBandBoxState
int DraggingRubberBandBoxState
Definition: vtkGeoInteractorStyle.h:144
vtkGeoInteractorStyle::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkInteractorStyleTrackballCamera
interactive manipulation of the camera
Definition: vtkInteractorStyleTrackballCamera.h:50
vtkGeoInteractorStyle::StartState
void StartState(int newstate)
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkGeoInteractorStyle::ResetCamera
void ResetCamera()
vtkGeoInteractorStyle::SetCurrentRenderer
virtual void SetCurrentRenderer(vtkRenderer *)
vtkGeoInteractorStyle::LockHeading
bool LockHeading
Definition: vtkGeoInteractorStyle.h:148
vtkGeoInteractorStyle::New
static vtkGeoInteractorStyle * New()
vtkGeoInteractorStyle::KeepCameraAboveGround
void KeepCameraAboveGround(vtkCamera *camera)
vtkGeoInteractorStyle
Interaction for a globe.
Definition: vtkGeoInteractorStyle.h:50
vtkInteractorStyleTrackballCamera.h