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 
157  vtkCamera* GetVTKCamera();
158 
164  void InitializeNodeAnalysis(int rendererSize[2]);
165 
170  double GetNodeCoverage(vtkGeoTerrainNode* node);
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:
206  vtkGeoCamera();
207  ~vtkGeoCamera();
208 
209  void UpdateVTKCamera();
210  void UpdateAngleRanges();
211 
214 
215  // This point is shifted to 0,0,0 to avoid openGL issues.
218  double Origin[3];
219  void ComputeRectilinearOrigin();
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
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
double OriginLatitude
Definition: vtkGeoCamera.h:216
void SetOrigin(double ox, double oy, double oz)
Get the rectilinear cooridinate location of the origin.
Definition: vtkGeoCamera.h:199
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
double Latitude
Definition: vtkGeoCamera.h:222
vtkSmartPointer< vtkCamera > VTKCamera
Definition: vtkGeoCamera.h:212
double OriginLongitude
Definition: vtkGeoCamera.h:217
a simple class to control print indentation
Definition: vtkIndent.h:39
a virtual camera for 3D rendering
Definition: vtkCamera.h:50
vtkSmartPointer< vtkTransform > Transform
Definition: vtkGeoCamera.h:213
double Distance
Definition: vtkGeoCamera.h:223
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
double Heading
Definition: vtkGeoCamera.h:224
double Longitude
Definition: vtkGeoCamera.h:221
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Geo interface to a camera.
Definition: vtkGeoCamera.h:83