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  {
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() );
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 {
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(); }
NETGeographicLib::CassiniSoldner::CassiniSoldner
CassiniSoldner(double lat0, double lon0)
Definition: dotnet/NETGeographicLib/CassiniSoldner.cpp:32
GeographicLib::CassiniSoldner::Forward
void Forward(real lat, real lon, real &x, real &y, real &azi, real &rk) const
Definition: src/CassiniSoldner.cpp:34
Geodesic.h
Header for NETGeographicLib::Geodesic class.
GeographicLib::Geodesic::WGS84
static const Geodesic & WGS84()
Definition: src/Geodesic.cpp:89
x
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
Definition: gnuplot_common_settings.hh:12
NETGeographicLib::CassiniSoldner
.NET wrapper for GeographicLib::CassiniSoldner.
Definition: CassiniSoldner.h:70
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
GeographicLib::CassiniSoldner::Reverse
void Reverse(real x, real y, real &lat, real &lon, real &azi, real &rk) const
Definition: src/CassiniSoldner.cpp:79
BADALLOC
const char BADALLOC[]
Definition: dotnet/NETGeographicLib/CassiniSoldner.cpp:19
example::lat0
const double lat0
Definition: testGPSFactor.cpp:41
example::lon0
const double lon0
Definition: testGPSFactor.cpp:41
NETGeographicLib::CassiniSoldner::m_pCassiniSoldner
GeographicLib::CassiniSoldner * m_pCassiniSoldner
Definition: CassiniSoldner.h:74
NETGeographicLib::Geodesic
.NET wrapper for GeographicLib::Geodesic.
Definition: Geodesic.h:170
stdafx.h
NETGeographicLib::CassiniSoldner::Forward
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)
Definition: dotnet/NETGeographicLib/CassiniSoldner.cpp:70
CassiniSoldner.hpp
Header for GeographicLib::CassiniSoldner class.
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
y
Scalar * y
Definition: level1_cplx_impl.h:124
NETGeographicLib::CassiniSoldner::Reverse
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)
Definition: dotnet/NETGeographicLib/CassiniSoldner.cpp:85
NETGeographicLib::CassiniSoldner::Reset
void Reset(double lat0, double lon0)
Definition: dotnet/NETGeographicLib/CassiniSoldner.cpp:64
GeographicLib::CassiniSoldner::Reset
void Reset(real lat0, real lon0)
Definition: src/CassiniSoldner.cpp:23
lon
static const double lon
Definition: testGeographicLib.cpp:34
NULL
#define NULL
Definition: ccolamd.c:609
get
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::Geodesic
Geodesic calculations
Definition: Geodesic.hpp:172
GeographicLib::CassiniSoldner
Cassini-Soldner projection.
Definition: CassiniSoldner.hpp:69
lat
static const double lat
Definition: testGeographicLib.cpp:34
CassiniSoldner.h
Header for NETGeographicLib::CassiniSoldner class.
NETGeographicLib::Geodesic::GetUnmanaged
System::IntPtr GetUnmanaged()
Definition: dotnet/NETGeographicLib/Geodesic.cpp:465


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:14