NAVTOR SDK  v.3.0
Software Development Kit for fast and efficient development of ECDIS, ECS and generic marine applications
crs_coordinate_transformation.h
Go to the documentation of this file.
1 #ifndef SDK_CRS_COORDINATE_TRANSFORMATION_INTERFACE_H_
11 #define SDK_CRS_COORDINATE_TRANSFORMATION_INTERFACE_H_
12 #pragma once
13 
14 #include <base/inc/platform.h>
15 #include <base/inc/base_types.h>
19 
20 namespace sdk {
21 namespace crs {
22 
23 // Classes declared in other files.
24 class IHorizontalCoordinateSystem;
25 // Classes declared in this file.
26 FWD_DECL_INTERFACE(ICoordinateTransformation);
27 
32  template <class T, typename Dummy = void> struct AnyTypeOf;
33  template <class Dummy> struct AnyTypeOf<double,Dummy> { enum Type { value = kSDKAnyType_Double }; };
34  template <class Dummy> struct AnyTypeOf<float,Dummy> { enum Type { value = kSDKAnyType_Float }; };
35  template <class Dummy> struct AnyTypeOf<SDKInt32,Dummy> { enum Type { value = kSDKAnyType_Int32 }; };
36 
37 public:
47  virtual SDKResult SDK_CALLTYPE Forward(
48  SDKUInt32 count,
49  SDKAnyType in_type,
50  const void* in_points,
51  SDKAnyType out_type,
52  void* out_points) throw() = 0;
53 
63  virtual SDKResult SDK_CALLTYPE Inverse(
64  SDKUInt32 count,
65  SDKAnyType in_type,
66  const void* in_points,
67  SDKAnyType out_type,
68  void* out_points) throw() = 0;
69 
71  virtual SDKResult SDK_CALLTYPE GetTargetCoordinateSystem(
72  IHorizontalCoordinateSystem** coordinate_system) const throw() = 0;
74  virtual SDKResult SDK_CALLTYPE SetTargetCoordinateSystem(
75  IHorizontalCoordinateSystem* coordinate_system) throw() = 0;
76 
78  virtual SDKResult SDK_CALLTYPE GetSourceCoordinateSystem(
79  IHorizontalCoordinateSystem** coordinate_system) const throw() = 0;
81  virtual SDKResult SDK_CALLTYPE SetSourceCoordinateSystem(
82  IHorizontalCoordinateSystem* coordinate_system) throw() = 0;
83 
85  template <class _IType, class _OType>
86  inline SDKResult Forward(SDKUInt32 count, const _IType* inp, _OType* out) {
87  return this->Forward(
88  count,
89  SDKAnyType(AnyTypeOf<typename _IType::coordinate_type>::value), inp,
90  SDKAnyType(AnyTypeOf<typename _OType::coordinate_type>::value), out);
91  }
93  template <class _IType, class _OType>
94  inline SDKResult Inverse(SDKUInt32 count, const _IType* inp, _OType* out) {
95  return this->Inverse(
96  count,
97  SDKAnyType(AnyTypeOf<typename _IType::coordinate_type>::value), inp,
98  SDKAnyType(AnyTypeOf<typename _OType::coordinate_type>::value), out);
99  }
100 
104  inline SDKResult SDK_CALLTYPE ForwardDD(SDKUInt32 count,
105  const SDKPointD2D* in, SDKPointD2D* out) {
106  return Forward(count, kSDKAnyType_Double, in, kSDKAnyType_Double, out);
107  }
108 
111  inline SDKResult SDK_CALLTYPE ForwardDF(SDKUInt32 count,
112  const SDKPointD2D* in, SDKPointF2D* out) {
113  return Forward(count, kSDKAnyType_Double, in, kSDKAnyType_Float, out);
114  }
115 
118  inline SDKResult SDK_CALLTYPE ForwardID(SDKUInt32 count,
119  const SDKGeoIntPoint* in, SDKPointD2D* out) {
120  return Forward(count, kSDKAnyType_Int32, in, kSDKAnyType_Double, out);
121  }
122 
125  inline SDKResult SDK_CALLTYPE ForwardIF(SDKUInt32 count,
126  const SDKGeoIntPoint* in, SDKPointF2D* out) {
127  return Forward(count, kSDKAnyType_Int32, in, kSDKAnyType_Float, out);
128  }
129 
132  inline SDKResult SDK_CALLTYPE ForwardII(SDKUInt32 count,
133  const SDKGeoIntPoint* in, SDKPointI2D* out) {
134  return Forward(count, kSDKAnyType_Int32, in, kSDKAnyType_Int32, out);
135  }
136 
139  inline SDKResult SDK_CALLTYPE Forward3D3D(SDKUInt32 count,
140  const SDKPointD3D* in, SDKPointD3D* out) {
141  return Forward(count, kSDKAnyType_3DGeo, in, kSDKAnyType_3DGeo, out);
142  }
143 
146  inline SDKResult SDK_CALLTYPE Forward3D3F(SDKUInt32 count,
147  const SDKPointD3D* in, SDKPointF3D* out) {
148  return Forward(count, kSDKAnyType_3DGeo, in, kSDKAnyType_3DFloat, out);
149  }
150 
154  inline SDKResult SDK_CALLTYPE InverseDD(SDKUInt32 count,
155  const SDKPointD2D* in, SDKPointD2D* out) {
156  return Inverse(count, kSDKAnyType_Double, in, kSDKAnyType_Double, out);
157  }
158 
161  inline SDKResult SDK_CALLTYPE InverseDI(SDKUInt32 count,
162  const SDKPointD2D* in, SDKGeoIntPoint* out) {
163  return Inverse(count, kSDKAnyType_Double, in, kSDKAnyType_Int32, out);
164  }
165 
168  inline SDKResult SDK_CALLTYPE InverseFD(SDKUInt32 count,
169  const SDKPointF2D* in, SDKPointD2D* out) {
170  return Inverse(count, kSDKAnyType_Float, in, kSDKAnyType_Double, out);
171  }
172 
175  inline SDKResult SDK_CALLTYPE InverseFI(SDKUInt32 count,
176  const SDKPointF2D* in, SDKGeoIntPoint* out) {
177  return Inverse(count, kSDKAnyType_Float, in, kSDKAnyType_Int32, out);
178  }
179 
182  inline SDKResult SDK_CALLTYPE InverseII(SDKUInt32 count,
183  const SDKPointI2D* in, SDKGeoIntPoint* out) {
184  return Inverse(count, kSDKAnyType_Int32, in, kSDKAnyType_Int32, out);
185  }
186 
189  inline SDKResult SDK_CALLTYPE InverseID(SDKUInt32 count,
190  const SDKPointI2D* in, SDKGeoPoint* out) {
191  return Inverse(count, kSDKAnyType_Int32, in, kSDKAnyType_Double, out);
192  }
193 
196  inline SDKResult SDK_CALLTYPE Inverse3D3D(SDKUInt32 count,
197  const SDKPointD3D* in, SDKPointD3D* out) {
198  return Inverse(count, kSDKAnyType_3DGeo, in, kSDKAnyType_3DGeo, out);
199  }
200 
203  inline SDKResult SDK_CALLTYPE Inverse3F3D(SDKUInt32 count,
204  const SDKPointF3D* in, SDKPointD3D* out) {
205  return Inverse(count, kSDKAnyType_3DFloat, in, kSDKAnyType_3DGeo, out);
206  }
207 
208  SDK_IMPLEMENT_IID(ICoordinateTransformation)
209  SDK_END_INTERFACE(ICoordinateTransformation)
210 };
211 SDK_DECLARE_IID(ICoordinateTransformation)
212 
213 } // namespace crs
214 } // namespace sdk
215 
216 #endif // SDK_CRS_COORDINATE_TRANSFORMATION_INTERFACE_H_
SDKGeoIntPoint
Definition of geographic points.
Definition: geometry_base_types.h:1555
sdk::crs::ICoordinateTransformation::InverseFI
SDKResult SDK_CALLTYPE InverseFI(SDKUInt32 count, const SDKPointF2D *in, SDKGeoIntPoint *out)
Inverse transformation of projected coordinates in float to geographic coordinates in GeoInt units.
Definition: crs_coordinate_transformation.h:175
sdk::crs::ICoordinateTransformation::Forward3D3F
SDKResult SDK_CALLTYPE Forward3D3F(SDKUInt32 count, const SDKPointD3D *in, SDKPointF3D *out)
Forward transformation of geographic coordinates in degree units to projected coordinates in d3d.
Definition: crs_coordinate_transformation.h:146
base_types.h
SDK base types.
sdk::crs::ICoordinateTransformation::ForwardDD
SDKResult SDK_CALLTYPE ForwardDD(SDKUInt32 count, const SDKPointD2D *in, SDKPointD2D *out)
Helpers for Forward method.
Definition: crs_coordinate_transformation.h:104
sdk::crs::ICoordinateTransformation::Inverse
SDKResult Inverse(SDKUInt32 count, const _IType *inp, _OType *out)
Template helper for Inverse method.
Definition: crs_coordinate_transformation.h:94
kSDKAnyType_3DGeo
@ kSDKAnyType_3DGeo
3D Geo coordinate - Double
Definition: base_types.h:161
kSDKAnyType_Int32
@ kSDKAnyType_Int32
signed integer 32 bit value
Definition: base_types.h:146
sdk::crs::ICoordinateTransformation::Forward3D3D
SDKResult SDK_CALLTYPE Forward3D3D(SDKUInt32 count, const SDKPointD3D *in, SDKPointD3D *out)
Forward transformation of geographic coordinates in degree units to projected coordinates in d3d.
Definition: crs_coordinate_transformation.h:139
sdk::crs::ICoordinateTransformation::SetSourceCoordinateSystem
virtual SDKResult SDK_CALLTYPE SetSourceCoordinateSystem(IHorizontalCoordinateSystem *coordinate_system)=0
Sets the source coordinate system.
kSDKAnyType_Float
@ kSDKAnyType_Float
single precision real value
Definition: base_types.h:149
sdk::crs::ICoordinateTransformation::ForwardIF
SDKResult SDK_CALLTYPE ForwardIF(SDKUInt32 count, const SDKGeoIntPoint *in, SDKPointF2D *out)
Forward transformation of geographic coordinates in GeoInt units to projected coordinates in float.
Definition: crs_coordinate_transformation.h:125
sdk::crs::ICoordinateTransformation::InverseII
SDKResult SDK_CALLTYPE InverseII(SDKUInt32 count, const SDKPointI2D *in, SDKGeoIntPoint *out)
Inverse transformation of projected coordinates in integers to geographic coordinates in GeoInt uni...
Definition: crs_coordinate_transformation.h:182
sdk_string_handler.h
Wrappers and helper functions for SDKString.
SDKResult
SDKInt32 SDKResult
Type of all error or return codes which SDK functions can end with.
Definition: sdk_results.h:17
sdk::crs::ICoordinateTransformation::InverseFD
SDKResult SDK_CALLTYPE InverseFD(SDKUInt32 count, const SDKPointF2D *in, SDKPointD2D *out)
Inverse transformation of projected coordinates in float to geographic coordinates in degree units.
Definition: crs_coordinate_transformation.h:168
SDKGeoPoint
Geo point in degree units.
Definition: geometry_base_types.h:1727
sdk::crs::ICoordinateTransformation::InverseDD
SDKResult SDK_CALLTYPE InverseDD(SDKUInt32 count, const SDKPointD2D *in, SDKPointD2D *out)
Helpers for Inverse method.
Definition: crs_coordinate_transformation.h:154
sdk_component_interface.h
Common base SDK interfaces.
SDKPointF3D
Single 3D point.
Definition: geometry_base_types.h:101
SDKPointF2D
Single 2D point.
Definition: geometry_base_types.h:33
platform.h
Describes the platform constants.
sdk::crs::ICoordinateTransformation::ForwardDF
SDKResult SDK_CALLTYPE ForwardDF(SDKUInt32 count, const SDKPointD2D *in, SDKPointF2D *out)
Forward transformation of geographic coordinates in degree units to projected coordinates in float.
Definition: crs_coordinate_transformation.h:111
sdk::crs::ICoordinateTransformation::InverseDI
SDKResult SDK_CALLTYPE InverseDI(SDKUInt32 count, const SDKPointD2D *in, SDKGeoIntPoint *out)
Inverse transformation of projected coordinates in double to geographic coordinates in GeoInt units...
Definition: crs_coordinate_transformation.h:161
sdk::crs::ICoordinateTransformation::GetSourceCoordinateSystem
virtual SDKResult SDK_CALLTYPE GetSourceCoordinateSystem(IHorizontalCoordinateSystem **coordinate_system) const =0
Gets the source coordinate system.
ISDKComponent
Base interface for all SDK interfaces.
Definition: sdk_component_interface.h:41
geometry_base_types.h
Geometry base types.
sdk::crs::ICoordinateTransformation::Inverse3D3D
SDKResult SDK_CALLTYPE Inverse3D3D(SDKUInt32 count, const SDKPointD3D *in, SDKPointD3D *out)
Inverse transformation of projected coordinates in 3d geo to 3d geo coordinates in degree units.
Definition: crs_coordinate_transformation.h:196
sdk::crs::ICoordinateTransformation::ForwardII
SDKResult SDK_CALLTYPE ForwardII(SDKUInt32 count, const SDKGeoIntPoint *in, SDKPointI2D *out)
Forward transformation of geographic coordinates in GeoInt units to projected coordinates in integers...
Definition: crs_coordinate_transformation.h:132
sdk::crs::ICoordinateTransformation::ForwardID
SDKResult SDK_CALLTYPE ForwardID(SDKUInt32 count, const SDKGeoIntPoint *in, SDKPointD2D *out)
Forward transformation of geographic coordinates in GeoInt units to projected coordinates in double.
Definition: crs_coordinate_transformation.h:118
kSDKAnyType_Double
@ kSDKAnyType_Double
double precision real value
Definition: base_types.h:150
SDKPointI2D
Single 2D point.
Definition: geometry_base_types.h:178
kSDKAnyType_3DFloat
@ kSDKAnyType_3DFloat
3D Geo coordinate - Float
Definition: base_types.h:162
sdk::crs::ICoordinateTransformation::InverseID
SDKResult SDK_CALLTYPE InverseID(SDKUInt32 count, const SDKPointI2D *in, SDKGeoPoint *out)
Inverse transformation of projected coordinates in integers to geographic coordinates in degree uni...
Definition: crs_coordinate_transformation.h:189
sdk::crs::IHorizontalCoordinateSystem
Describes member that manage the horizontal coordinate system
Definition: crs_horizontal_coordinate_system.h:137
sdk::crs::ICoordinateTransformation::Forward
virtual SDKResult SDK_CALLTYPE Forward(SDKUInt32 count, SDKAnyType in_type, const void *in_points, SDKAnyType out_type, void *out_points)=0
Projects points from geographic to planar coordinates.
sdk::crs::ICoordinateTransformation::Inverse
virtual SDKResult SDK_CALLTYPE Inverse(SDKUInt32 count, SDKAnyType in_type, const void *in_points, SDKAnyType out_type, void *out_points)=0
Projects points from planar to geographic coordinates.
sdk::communication_line::Type
Type
Communication line type.
Definition: ecdislayer/inc/communication_line/component_ids.h:25
sdk::crs::ICoordinateTransformation::GetTargetCoordinateSystem
virtual SDKResult SDK_CALLTYPE GetTargetCoordinateSystem(IHorizontalCoordinateSystem **coordinate_system) const =0
Gets the target coordinate system.
sdk::crs::ICoordinateTransformation::Inverse3F3D
SDKResult SDK_CALLTYPE Inverse3F3D(SDKUInt32 count, const SDKPointF3D *in, SDKPointD3D *out)
Inverse transformation of projected coordinates in 3d geo to 3d geo coordinates in degree units.
Definition: crs_coordinate_transformation.h:203
FWD_DECL_INTERFACE
FWD_DECL_INTERFACE(ILWEParserWrapper)
Provides a wrapper around the message parser to get, add or remove the.
sdk::crs::ICoordinateTransformation::Forward
SDKResult Forward(SDKUInt32 count, const _IType *inp, _OType *out)
Template helper for Forward method.
Definition: crs_coordinate_transformation.h:86
SDKPointD3D
A three dimensional point.
Definition: geometry_base_types.h:306
SDKPointD2D
A two dimensional point.
Definition: geometry_base_types.h:242
sdk::crs::ICoordinateTransformation
Provides access to members that control the properties and methods for the coordinate transformation.
Definition: crs_coordinate_transformation.h:31
sdk::crs::ICoordinateTransformation::SetTargetCoordinateSystem
virtual SDKResult SDK_CALLTYPE SetTargetCoordinateSystem(IHorizontalCoordinateSystem *coordinate_system)=0
Sets the target coordinate system.