VTK  9.7.1
vtkGeoTransform.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
15 #ifndef vtkGeoTransform_h
16 #define vtkGeoTransform_h
17 
18 #include "vtkAbstractTransform.h"
19 #include "vtkGeovisCoreModule.h" // For export macro
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkGeoProjection;
23 
36 class VTKGEOVISCORE_EXPORT vtkGeoTransform : public vtkAbstractTransform
37 {
38 public:
39  static vtkGeoTransform* New();
40  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
49  void SetSourceProjection(vtkGeoProjection* source);
50  void SetSourceProjection(const char* proj);
51  vtkGetObjectMacro(SourceProjection, vtkGeoProjection);
53 
55 
65  vtkSetMacro(TransformZCoordinate, bool);
66  vtkGetMacro(TransformZCoordinate, bool);
68 
70 
75  void SetDestinationProjection(vtkGeoProjection* dest);
76  void SetDestinationProjection(const char* proj);
77  vtkGetObjectMacro(DestinationProjection, vtkGeoProjection);
79 
83  void TransformPoints(vtkPoints* src, vtkPoints* dst) override;
84 
91  vtkDataArray* dstNms, vtkDataArray* srcVrs, vtkDataArray* dstVrs, int nOptionalVectors = 0,
92  vtkDataArray** srcVrsArr = nullptr, vtkDataArray** dstVrsArr = nullptr) override;
93 
97  void Inverse() override;
98 
100 
104  void InternalTransformPoint(const float in[3], float out[3]) override;
105  void InternalTransformPoint(const double in[3], double out[3]) override;
107 
109 
116  static int ComputeUTMZone(double lon, double lat);
117  static int ComputeUTMZone(double* lonlat) { return ComputeUTMZone(lonlat[0], lonlat[1]); }
119 
121 
128  const float in[3], float out[3], float derivative[3][3]) override;
130  const double in[3], double out[3], double derivative[3][3]) override;
132 
137 
138 protected:
139  vtkGeoTransform();
140  ~vtkGeoTransform() override;
141 
142  void InternalDeepCopy(vtkAbstractTransform*) override;
143  void InternalTransformPoints(double* ptsInOut, vtkIdType numPts, int stride);
147 
148 private:
149  vtkGeoTransform(const vtkGeoTransform&) = delete;
150  void operator=(const vtkGeoTransform&) = delete;
151 };
152 
153 VTK_ABI_NAMESPACE_END
154 #endif // vtkGeoTransform_h
A transformation between two geographic coordinate systems.
Represent a projection from a sphere to a plane.
virtual void TransformPointsNormalsVectors(vtkPoints *inPts, vtkPoints *outPts, vtkDataArray *inNms, vtkDataArray *outNms, vtkDataArray *inVrs, vtkDataArray *outVrs, int nOptionalVectors=0, vtkDataArray **inVrsArr=nullptr, vtkDataArray **outVrsArr=nullptr)
Apply the transformation to a combination of points, normals and vectors.
vtkGeoProjection * DestinationProjection
virtual void TransformPoints(vtkPoints *inPts, vtkPoints *outPts)
Apply the transformation to a series of points, and append the results to outPts. ...
virtual vtkAbstractTransform * MakeTransform()=0
Make another transform of the same type.
int vtkIdType
Definition: vtkType.h:363
vtkGeoProjection * SourceProjection
virtual void InternalDeepCopy(vtkAbstractTransform *)
Perform any subclass-specific DeepCopy.
a simple class to control print indentation
Definition: vtkIndent.h:28
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
superclass for all geometric transformations
virtual void Inverse()=0
Invert the transformation.
static int ComputeUTMZone(double *lonlat)
Computes Universal Transverse Mercator (UTM) zone given the longitude and latitude of the point...
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
virtual void InternalTransformPoint(const float in[3], float out[3])=0
This will calculate the transformation without calling Update.
virtual void InternalTransformDerivative(const float in[3], float out[3], float derivative[3][3])=0
This will transform a point and, at the same time, calculate a 3x3 Jacobian matrix that provides the ...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
represent and manipulate 3D points
Definition: vtkPoints.h:30