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 
39 #include "vtkSmartPointer.h" // for SP
40 
41 class vtkCamera;
42 class vtkCommand;
43 class vtkCompassWidget;
44 class vtkGeoCamera;
46 
49 {
50 public:
51  static vtkGeoInteractorStyle *New();
52  vtkTypeMacro(vtkGeoInteractorStyle,
54  void PrintSelf(ostream& os, vtkIndent indent);
55 
57 
58  virtual void OnEnter();
59  virtual void OnLeave();
60  virtual void OnMouseMove();
61  virtual void OnLeftButtonUp();
62  virtual void OnMiddleButtonUp();
63  virtual void OnRightButtonUp();
64  virtual void OnLeftButtonDown();
65  virtual void OnMiddleButtonDown();
66  virtual void OnRightButtonDown();
67  virtual void OnChar();
69 
70  virtual void RubberBandZoom();
71  virtual void Pan();
72  virtual void Dolly();
73 
74  // Public for render callback.
75  void RedrawRectangle();
76 
77  // See cxx for description of why we need this method.
78  void StartState(int newstate);
79 
80  // Used for updating the terrain.
81  vtkGeoCamera* GetGeoCamera();
82 
84  void ResetCamera();
85 
87  void WidgetInteraction(vtkObject *caller);
88 
91  virtual void SetInteractor(vtkRenderWindowInteractor *interactor);
92 
93  int ViewportToWorld(double x, double y,
94  double &wx, double &wy, double &wz);
95  void WorldToLongLat(double wx, double wy, double wz,
96  double &lon, double &lat);
97  void ViewportToLongLat(double x, double y,
98  double &lon, double &lat);
99  int GetRayIntersection(double origin[3],
100  double direction[3],
101  double intersection[3]);
102 
104  virtual void SetCurrentRenderer(vtkRenderer*);
105 
107 
108  vtkGetMacro(LockHeading, bool);
109  vtkSetMacro(LockHeading, bool);
110  vtkBooleanMacro(LockHeading, bool);
112 
114  void ResetCameraClippingRange();
115 
116 protected:
119 
120  // To avoid a warning.
121  // We should really inherit directy from vtkInteractorStyle
122  virtual void Dolly(double);
123 
124  void OnTimer();
125  // Used to get a constant speed regardless of frame rate.
126  double LastTime;
127 
128  // Rubberband zoom has a verification stage.
129  int RubberBandExtent[4];
132  void EnableRubberBandRedraw();
133  void DisableRubberBandRedraw();
134  bool InRubberBandRectangle(int x, int y);
135  void DrawRectangle();
136 
137  void KeepCameraAboveGround(vtkCamera* camera);
138  void UpdateLights();
139  void GetPanCenter(double &px, double &py);
140 
141  int StartPosition[2];
142  int EndPosition[2];
144  double MotionFactor;
146  int PixelDims[2];
148 
149 //BTX
151 
152  // widget handling members
155 
156 //ETX
157 
158 private:
159  vtkGeoInteractorStyle(const vtkGeoInteractorStyle&); // Not implemented.
160  void operator=(const vtkGeoInteractorStyle&); // Not implemented.
161 };
162 
163 #endif
virtual void SetInteractor(vtkRenderWindowInteractor *interactor)
abstract base class for most VTK objects
Definition: vtkObject.h:60
Interaction for a globe.
void PrintSelf(ostream &os, vtkIndent indent)
abstract specification for renderers
Definition: vtkRenderer.h:69
static vtkInteractorStyleTrackballCamera * New()
vtkSmartPointer< vtkCompassWidget > CompassWidget
virtual void OnTimer()
virtual void OnEnter()
platform-independent render window interaction including picking and frame rate control.
vtkSmartPointer< vtkGeoCamera > GeoCamera
superclass for callback/observer methods
Definition: vtkCommand.h:211
a simple class to control print indentation
Definition: vtkIndent.h:37
a virtual camera for 3D rendering
Definition: vtkCamera.h:47
#define VTK_GEOVIS_EXPORT
vtkUnsignedCharArray * PixelArray
virtual void SetCurrentRenderer(vtkRenderer *)
dynamic, self-adjusting array of unsigned char
virtual void StartState(int newstate)
virtual void OnChar()
vtkSmartPointer< vtkCommand > EventCommand
interactive manipulation of the camera
virtual void OnLeave()
set a value by manipulating something
Geo interface to a camera.
Definition: vtkGeoCamera.h:81