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:
52  static vtkGeoInteractorStyle *New();
53  vtkTypeMacro(vtkGeoInteractorStyle,
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.
76  void RedrawRectangle();
77 
78  // See cxx for description of why we need this method.
79  void StartState(int newstate);
80 
81  // Used for updating the terrain.
82  vtkGeoCamera* GetGeoCamera();
83 
85  void ResetCamera();
86 
88  void WidgetInteraction(vtkObject *caller);
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 
105  virtual void SetCurrentRenderer(vtkRenderer*);
106 
108 
109  vtkGetMacro(LockHeading, bool);
110  vtkSetMacro(LockHeading, bool);
111  vtkBooleanMacro(LockHeading, bool);
113 
115  void ResetCameraClippingRange();
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];
133  void EnableRubberBandRedraw();
134  void DisableRubberBandRedraw();
135  bool InRubberBandRectangle(int x, int y);
136  void DrawRectangle();
137 
138  void KeepCameraAboveGround(vtkCamera* camera);
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
virtual void SetInteractor(vtkRenderWindowInteractor *interactor)
abstract base class for most VTK objects
Definition: vtkObject.h:61
Interaction for a globe.
void PrintSelf(ostream &os, vtkIndent indent)
abstract specification for renderers
Definition: vtkRenderer.h:63
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:325
a simple class to control print indentation
Definition: vtkIndent.h:38
a virtual camera for 3D rendering
Definition: vtkCamera.h:48
vtkUnsignedCharArray * PixelArray
virtual void SetCurrentRenderer(vtkRenderer *)
dynamic, self-adjusting array of unsigned char
#define VTKGEOVISCORE_EXPORT
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:82