dotnet/NETGeographicLib/CassiniSoldner.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "Geodesic.h"
14 #include "CassiniSoldner.h"
15 #include "NETGeographicLib.h"
16 
17 using namespace NETGeographicLib;
18 
19 const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::CassiniSoldner";
20 
21 //*****************************************************************************
23 {
24  if ( m_pCassiniSoldner != NULL )
25  {
26  delete m_pCassiniSoldner;
27  m_pCassiniSoldner = NULL;
28  }
29 }
30 
31 //*****************************************************************************
33 {
34  try
35  {
37  m_pCassiniSoldner->Reset(lat0, lon0);
38  }
39  catch ( std::bad_alloc )
40  {
41  throw gcnew GeographicErr( BADALLOC );
42  }
43 }
44 
45 //*****************************************************************************
47  Geodesic^ earth )
48 {
49  try
50  {
51  const GeographicLib::Geodesic* pGeodesic =
52  reinterpret_cast<const GeographicLib::Geodesic*>(
53  earth->GetUnmanaged()->ToPointer() );
55  m_pCassiniSoldner->Reset(lat0, lon0);
56  }
57  catch ( std::bad_alloc )
58  {
59  throw gcnew GeographicErr( BADALLOC );
60  }
61 }
62 
63 //*****************************************************************************
64 void CassiniSoldner::Reset(double lat0, double lon0)
65 {
66  m_pCassiniSoldner->Reset(lat0, lon0);
67 }
68 
69 //*****************************************************************************
70 void CassiniSoldner::Forward(double lat, double lon,
71  [System::Runtime::InteropServices::Out] double% x,
72  [System::Runtime::InteropServices::Out] double% y,
73  [System::Runtime::InteropServices::Out] double% azi,
74  [System::Runtime::InteropServices::Out] double% rk)
75 {
76  double lx, ly, lazi, lrk;
77  m_pCassiniSoldner->Forward(lat, lon, lx, ly, lazi, lrk);
78  x = lx;
79  y = ly;
80  azi = lazi;
81  rk = lrk;
82 }
83 
84 //*****************************************************************************
85 void CassiniSoldner::Reverse(double x, double y,
86  [System::Runtime::InteropServices::Out] double% lat,
87  [System::Runtime::InteropServices::Out] double% lon,
88  [System::Runtime::InteropServices::Out] double% azi,
89  [System::Runtime::InteropServices::Out] double% rk)
90 {
91  double llat, llon, lazi, lrk;
92  m_pCassiniSoldner->Reverse( x, y, llat, llon, lazi, lrk );
93  lat = llat;
94  lon = llon;
95  azi = lazi;
96  rk = lrk;
97 }
98 //*****************************************************************************
99 void CassiniSoldner::Forward(double lat, double lon,
100  [System::Runtime::InteropServices::Out] double% x,
101  [System::Runtime::InteropServices::Out] double% y)
102 {
103  double lx, ly, azi, rk;
104  m_pCassiniSoldner->Forward(lat, lon, lx, ly, azi, rk);
105  x = lx;
106  y = ly;
107 }
108 
109 //*****************************************************************************
110 void CassiniSoldner::Reverse(double x, double y,
111  [System::Runtime::InteropServices::Out] double% lat,
112  [System::Runtime::InteropServices::Out] double% lon)
113 {
114  double llat, llon, lazi, lrk;
115  m_pCassiniSoldner->Reverse( x, y, llat, llon, lazi, lrk );
116  lat = llat;
117  lon = llon;
118 }
119 
120 //*****************************************************************************
122 { return m_pCassiniSoldner->LatitudeOrigin(); }
123 
124 //*****************************************************************************
126 { return m_pCassiniSoldner->LongitudeOrigin(); }
127 
128 //*****************************************************************************
130 { return m_pCassiniSoldner->MajorRadius(); }
131 
132 //*****************************************************************************
134 { return m_pCassiniSoldner->Flattening(); }
Math::real LongitudeOrigin() const
void Forward(real lat, real lon, real &x, real &y, real &azi, real &rk) const
void Forward(double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
.NET wrapper for GeographicLib::CassiniSoldner.
Header for NETGeographicLib::NETGeographicLib objects.
Header for GeographicLib::CassiniSoldner class.
Scalar * y
static const double lat
static const Geodesic & WGS84()
Exception class for NETGeographicLib.
void Reverse(double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% azi, [System::Runtime::InteropServices::Out] double% rk)
Cassini-Soldner projection.
Header for NETGeographicLib::CassiniSoldner class.
const double lat0
.NET wrapper for GeographicLib::Geodesic.
Definition: Geodesic.h:170
Math::real LatitudeOrigin() const
void Reverse(real x, real y, real &lat, real &lon, real &azi, real &rk) const
const double lon0
#define NULL
Definition: ccolamd.c:609
static const double lon
Container::iterator get(Container &c, Position position)
Header for NETGeographicLib::Geodesic class.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Geodesic calculations
Definition: Geodesic.hpp:172
void Reset(real lat0, real lon0)
GeographicLib::CassiniSoldner * m_pCassiniSoldner


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:00