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 #if !defined(VTK_LEGACY_REMOVE)
84 class VTKGEOVISCORE_EXPORT vtkGeoCamera : public vtkObject
85 {
86 public:
87  static vtkGeoCamera *New();
88  vtkTypeMacro(vtkGeoCamera, vtkObject);
89  void PrintSelf(ostream& os, vtkIndent indent) override;
90 
92 
95  vtkGetVector3Macro(Position, double);
97 
99 
104  void SetLongitude(double longitude);
105  vtkGetMacro(Longitude,double);
107 
109 
114  void SetLatitude(double latitude);
115  vtkGetMacro(Latitude,double);
117 
119 
125  void SetDistance(double Distance);
126  vtkGetMacro(Distance,double);
128 
130 
139  void SetHeading(double heading);
140  vtkGetMacro(Heading,double);
142 
144 
150  void SetTilt(double tilt);
151  vtkGetMacro(Tilt,double);
153 
158  vtkCamera* GetVTKCamera();
159 
165  void InitializeNodeAnalysis(int rendererSize[2]);
166 
171  double GetNodeCoverage(vtkGeoTerrainNode* node);
172 
174 
179  vtkGetMacro(LockHeading, bool);
180  vtkSetMacro(LockHeading, bool);
181  vtkBooleanMacro(LockHeading, bool);
183 
185 
188  void SetOriginLatitude(double oLat);
189  vtkGetMacro(OriginLatitude, double);
190  void SetOriginLongitude(double oLat);
191  vtkGetMacro(OriginLongitude, double);
193 
195 
199  vtkGetVector3Macro(Origin, double);
200  void SetOrigin( double ox, double oy, double oz ) {
201  this->Origin[0] = ox; this->Origin[1] = oy; this->Origin[2] = oz;
202  this->UpdateVTKCamera();
203  }
205 
206 protected:
207  vtkGeoCamera();
208  ~vtkGeoCamera() override;
209 
210  void UpdateVTKCamera();
211  void UpdateAngleRanges();
212 
215 
216  // This point is shifted to 0,0,0 to avoid openGL issues.
219  double Origin[3];
220  void ComputeRectilinearOrigin();
221 
222  double Longitude;
223  double Latitude;
224  double Distance;
225  double Heading;
226  double Tilt;
228 
229  // Values precomputed to make updating terrain mode efficient.
230  // The vislibility of many terrain nodes is analyzed every render.
231  double ForwardNormal[3];
232  double RightNormal[3];
233  double UpNormal[3];
234  double Aspect[2];
235 
236  // Frustum planes is better than other options for culling spheres.
237  double LeftPlaneNormal[3];
238  double RightPlaneNormal[3];
239  double DownPlaneNormal[3];
240  double UpPlaneNormal[3];
241 
242  double Position[3];
243 
244 private:
245  vtkGeoCamera(const vtkGeoCamera&) = delete;
246  void operator=(const vtkGeoCamera&) = delete;
247 };
248 
249 #endif //VTK_LEGACY_REMOVE
250 #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:217
void SetOrigin(double ox, double oy, double oz)
Get the rectilinear cooridinate location of the origin.
Definition: vtkGeoCamera.h:200
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
double Latitude
Definition: vtkGeoCamera.h:223
vtkSmartPointer< vtkCamera > VTKCamera
Definition: vtkGeoCamera.h:213
double OriginLongitude
Definition: vtkGeoCamera.h:218
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:214
double Distance
Definition: vtkGeoCamera.h:224
double Heading
Definition: vtkGeoCamera.h:225
double Longitude
Definition: vtkGeoCamera.h:222
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:84