VTK
vtkGeoCamera.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGeoCamera.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 -------------------------------------------------------------------------*/
72 #ifndef vtkGeoCamera_h
73 #define vtkGeoCamera_h
74 
75 #include "vtkGeovisCoreModule.h" // For export macro
76 #include "vtkObject.h"
77 #include "vtkSmartPointer.h" // for SP
78 
79 class vtkCamera;
80 class vtkGeoTerrainNode;
81 class vtkTransform;
82 
83 class VTKGEOVISCORE_EXPORT vtkGeoCamera : public vtkObject
84 {
85 public:
86  static vtkGeoCamera *New();
87  vtkTypeMacro(vtkGeoCamera, vtkObject);
88  void PrintSelf(ostream& os, vtkIndent indent);
89 
91 
94  vtkGetVector3Macro(Position, double);
96 
98 
103  void SetLongitude(double longitude);
104  vtkGetMacro(Longitude,double);
106 
108 
113  void SetLatitude(double latitude);
114  vtkGetMacro(Latitude,double);
116 
118 
124  void SetDistance(double Distance);
125  vtkGetMacro(Distance,double);
127 
129 
138  void SetHeading(double heading);
139  vtkGetMacro(Heading,double);
141 
143 
149  void SetTilt(double tilt);
150  vtkGetMacro(Tilt,double);
152 
158 
164  void InitializeNodeAnalysis(int rendererSize[2]);
165 
171 
173 
178  vtkGetMacro(LockHeading, bool);
179  vtkSetMacro(LockHeading, bool);
180  vtkBooleanMacro(LockHeading, bool);
182 
184 
187  void SetOriginLatitude(double oLat);
188  vtkGetMacro(OriginLatitude, double);
189  void SetOriginLongitude(double oLat);
190  vtkGetMacro(OriginLongitude, double);
192 
194 
198  vtkGetVector3Macro(Origin, double);
199  void SetOrigin( double ox, double oy, double oz ) {
200  this->Origin[0] = ox; this->Origin[1] = oy; this->Origin[2] = oz;
201  this->UpdateVTKCamera();
202  }
204 
205 protected:
208 
211 
214 
215  // This point is shifted to 0,0,0 to avoid openGL issues.
218  double Origin[3];
220 
221  double Longitude;
222  double Latitude;
223  double Distance;
224  double Heading;
225  double Tilt;
227 
228  // Values precomputed to make updating terrain mode efficient.
229  // The vislibility of many terrain nodes is analyzed every render.
230  double ForwardNormal[3];
231  double RightNormal[3];
232  double UpNormal[3];
233  double Aspect[2];
234 
235  // Frustum planes is better than other options for culling spheres.
236  double LeftPlaneNormal[3];
237  double RightPlaneNormal[3];
238  double DownPlaneNormal[3];
239  double UpPlaneNormal[3];
240 
241  double Position[3];
242 
243 private:
244  vtkGeoCamera(const vtkGeoCamera&) VTK_DELETE_FUNCTION;
245  void operator=(const vtkGeoCamera&) VTK_DELETE_FUNCTION;
246 };
247 
248 #endif
vtkGeoCamera::GetVTKCamera
vtkCamera * GetVTKCamera()
This vtk camera is updated to match this geo cameras state.
vtkGeoCamera::Heading
double Heading
Definition: vtkGeoCamera.h:224
vtkGeoCamera::Transform
vtkSmartPointer< vtkTransform > Transform
Definition: vtkGeoCamera.h:213
vtkGeoCamera::vtkGeoCamera
vtkGeoCamera()
vtkGeoCamera::New
static vtkGeoCamera * New()
vtkGeoCamera::Tilt
double Tilt
Definition: vtkGeoCamera.h:225
vtkGeoCamera::Longitude
double Longitude
Definition: vtkGeoCamera.h:221
vtkGeoCamera::SetHeading
void SetHeading(double heading)
Heading is in degrees: (-180->180) Relative to Logitude and Latitude.
vtkGeoCamera::VTKCamera
vtkSmartPointer< vtkCamera > VTKCamera
Definition: vtkGeoCamera.h:212
vtkGeoCamera::InitializeNodeAnalysis
void InitializeNodeAnalysis(int rendererSize[2])
We precompute some values to speed up update of the terrain.
vtkSmartPointer< vtkCamera >
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
vtkGeoCamera::LockHeading
bool LockHeading
Definition: vtkGeoCamera.h:226
vtkGeoCamera::OriginLongitude
double OriginLongitude
Definition: vtkGeoCamera.h:217
vtkGeoCamera::SetOriginLongitude
void SetOriginLongitude(double oLat)
vtkGeoCamera::~vtkGeoCamera
~vtkGeoCamera()
vtkGeoCamera::UpdateAngleRanges
void UpdateAngleRanges()
vtkGeoTerrainNode
Definition: vtkGeoTerrainNode.h:41
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkCamera
a virtual camera for 3D rendering
Definition: vtkCamera.h:51
vtkSmartPointer.h
vtkGeoCamera
Geo interface to a camera.
Definition: vtkGeoCamera.h:84
vtkGeoCamera::SetLongitude
void SetLongitude(double longitude)
Longitude is in degrees: (-180->180) Relative to absolute coordinates.
vtkObject.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGeoCamera::SetDistance
void SetDistance(double Distance)
Distance is in Meters Relative to Longitude and Latitude.
vtkGeoCamera::ComputeRectilinearOrigin
void ComputeRectilinearOrigin()
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGeoCamera::Distance
double Distance
Definition: vtkGeoCamera.h:223
vtkGeoCamera::SetTilt
void SetTilt(double tilt)
Tilt is also know as pitch.
vtkGeoCamera::UpdateVTKCamera
void UpdateVTKCamera()
vtkGeoCamera::GetNodeCoverage
double GetNodeCoverage(vtkGeoTerrainNode *node)
This method estimates how much of the view is covered by the sphere.
vtkGeoCamera::Latitude
double Latitude
Definition: vtkGeoCamera.h:222
vtkGeoCamera::SetLatitude
void SetLatitude(double latitude)
Latitude is in degrees: (-90->90) Relative to Longitude.
vtkGeoCamera::SetOriginLatitude
void SetOriginLatitude(double oLat)
This point is shifted to 0,0,0 to avoid openGL issues.
vtkGeoCamera::SetOrigin
void SetOrigin(double ox, double oy, double oz)
Definition: vtkGeoCamera.h:199
vtkGeoCamera::OriginLatitude
double OriginLatitude
Definition: vtkGeoCamera.h:216
vtkGeoCamera::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.