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 -------------------------------------------------------------------------*/
71 #ifndef __vtkGeoCamera_h
72 #define __vtkGeoCamera_h
73 
74 #include "vtkObject.h"
75 #include "vtkSmartPointer.h" // for SP
76 
77 class vtkCamera;
78 class vtkGeoTerrainNode;
79 class vtkTransform;
80 
82 {
83 public:
84  static vtkGeoCamera *New();
85  vtkTypeMacro(vtkGeoCamera, vtkObject);
86  void PrintSelf(ostream& os, vtkIndent indent);
87 
89 
90  vtkGetVector3Macro(Position, double);
92 
94 
96  void SetLongitude(double longitude);
97  vtkGetMacro(Longitude,double);
99 
101 
103  void SetLatitude(double latitude);
104  vtkGetMacro(Latitude,double);
106 
108 
111  void SetDistance(double Distance);
112  vtkGetMacro(Distance,double);
114 
116 
120  void SetHeading(double heading);
121  vtkGetMacro(Heading,double);
123 
125 
127  void SetTilt(double tilt);
128  vtkGetMacro(Tilt,double);
130 
133  vtkCamera* GetVTKCamera();
134 
138  void InitializeNodeAnalysis(int rendererSize[2]);
139 
142  double GetNodeCoverage(vtkGeoTerrainNode* node);
143 
145 
147  vtkGetMacro(LockHeading, bool);
148  vtkSetMacro(LockHeading, bool);
149  vtkBooleanMacro(LockHeading, bool);
151 
153 
154  void SetOriginLatitude(double oLat);
155  vtkGetMacro(OriginLatitude, double);
156  void SetOriginLongitude(double oLat);
157  vtkGetMacro(OriginLongitude, double);
159 
161 
163  vtkGetVector3Macro(Origin, double);
164  void SetOrigin( double ox, double oy, double oz ) {
165  this->Origin[0] = ox; this->Origin[1] = oy; this->Origin[2] = oz;
166  this->UpdateVTKCamera();
167  }
169 
170 protected:
171  vtkGeoCamera();
172  ~vtkGeoCamera();
173 
174  void UpdateVTKCamera();
175  void UpdateAngleRanges();
176 
177 //BTX
180 //ETX
181 
182  // This point is shifted to 0,0,0 to avoid openGL issues.
185  double Origin[3];
186  void ComputeRectilinearOrigin();
187 
188  double Longitude;
189  double Latitude;
190  double Distance;
191  double Heading;
192  double Tilt;
194 
195  // Values precomputed to make updating terrain mode efficient.
196  // The vislibility of many terrain nodes is analyzed every render.
197  double ForwardNormal[3];
198  double RightNormal[3];
199  double UpNormal[3];
200  double Aspect[2];
201 
202  // Frustum planes is better than other options for culling spheres.
203  double LeftPlaneNormal[3];
204  double RightPlaneNormal[3];
205  double DownPlaneNormal[3];
206  double UpPlaneNormal[3];
207 
208  double Position[3];
209 
210 private:
211  vtkGeoCamera(const vtkGeoCamera&); // Not implemented.
212  void operator=(const vtkGeoCamera&); // Not implemented.
213 };
214 
215 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
double OriginLatitude
Definition: vtkGeoCamera.h:183
void SetOrigin(double ox, double oy, double oz)
Definition: vtkGeoCamera.h:164
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:58
double Latitude
Definition: vtkGeoCamera.h:189
vtkSmartPointer< vtkCamera > VTKCamera
Definition: vtkGeoCamera.h:178
double OriginLongitude
Definition: vtkGeoCamera.h:184
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
a virtual camera for 3D rendering
Definition: vtkCamera.h:47
vtkSmartPointer< vtkTransform > Transform
Definition: vtkGeoCamera.h:179
double Distance
Definition: vtkGeoCamera.h:190
#define VTK_GEOVIS_EXPORT
double Heading
Definition: vtkGeoCamera.h:191
double Longitude
Definition: vtkGeoCamera.h:188
static vtkObject * New()
Geo interface to a camera.
Definition: vtkGeoCamera.h:81