dotnet/NETGeographicLib/PolarStereographic.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "PolarStereographic.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 const char BADALLOC[] = "Failed to allocate memory for a GeographicLib::PolarStereographic";
19 
20 //*****************************************************************************
22 {
23  if ( m_pPolarStereographic != NULL )
24  {
25  delete m_pPolarStereographic;
26  m_pPolarStereographic = NULL;
27  }
28 }
29 
30 //*****************************************************************************
32 {
33  try
34  {
36  }
37  catch ( std::bad_alloc )
38  {
39  throw gcnew GeographicErr( BADALLOC );
40  }
41  catch ( const std::exception& err )
42  {
43  throw gcnew GeographicErr( err.what() );
44  }
45 }
46 
47 //*****************************************************************************
49 {
50  try
51  {
54  }
55  catch (std::bad_alloc)
56  {
57  throw gcnew GeographicErr( BADALLOC );
58  }
59 }
60 
61 //*****************************************************************************
62 void PolarStereographic::SetScale(double lat, double k)
63 {
64  try
65  {
67  }
68  catch ( const std::exception& err )
69  {
70  throw gcnew GeographicErr( err.what() );
71  }
72 }
73 
74 //*****************************************************************************
75 void PolarStereographic::Forward(bool northp, double lat, double lon,
76  [System::Runtime::InteropServices::Out] double% x,
77  [System::Runtime::InteropServices::Out] double% y,
78  [System::Runtime::InteropServices::Out] double% gamma,
79  [System::Runtime::InteropServices::Out] double% k)
80 {
81  double lx, ly, lgamma, lk;
83  lx, ly, lgamma, lk );
84  x = lx;
85  y = ly;
86  gamma = lgamma;
87  k = lk;
88 }
89 
90 //*****************************************************************************
91 void PolarStereographic::Reverse(bool northp, double x, double y,
92  [System::Runtime::InteropServices::Out] double% lat,
93  [System::Runtime::InteropServices::Out] double% lon,
94  [System::Runtime::InteropServices::Out] double% gamma,
95  [System::Runtime::InteropServices::Out] double% k)
96 {
97  double llat, llon, lgamma, lk;
98  m_pPolarStereographic->Reverse( northp, x, y,
99  llat, llon, lgamma, lk );
100  lat = llat;
101  lon = llon;
102  gamma = lgamma;
103  k = lk;
104 }
105 
106 //*****************************************************************************
107 void PolarStereographic::Forward(bool northp, double lat, double lon,
108  [System::Runtime::InteropServices::Out] double% x,
109  [System::Runtime::InteropServices::Out] double% y)
110 {
111  double lx, ly;
112  m_pPolarStereographic->Forward( northp, lat, lon, lx, ly );
113  x = lx;
114  y = ly;
115 }
116 
117 //*****************************************************************************
118 void PolarStereographic::Reverse(bool northp, double x, double y,
119  [System::Runtime::InteropServices::Out] double% lat,
120  [System::Runtime::InteropServices::Out] double% lon)
121 {
122  double llat, llon;
123  m_pPolarStereographic->Reverse( northp, x, y, llat, llon );
124  lat = llat;
125  lon = llon;
126 }
127 
128 //*****************************************************************************
130 { return m_pPolarStereographic->MajorRadius(); }
131 
132 //*****************************************************************************
134 { return m_pPolarStereographic->Flattening(); }
135 
136 //*****************************************************************************
138 { return m_pPolarStereographic->CentralScale(); }
PolarStereographic.hpp
Header for GeographicLib::PolarStereographic class.
PolarStereographic.h
Header for NETGeographicLib::PolarStereographic class.
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::PolarStereographic
.NET wrapper for GeographicLib::PolarStereographic.
Definition: PolarStereographic.h:48
NETGeographicLib::PolarStereographic::Forward
void Forward(bool northp, double lat, double lon, [System::Runtime::InteropServices::Out] double% x, [System::Runtime::InteropServices::Out] double% y, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/PolarStereographic.cpp:75
NETGeographicLib::PolarStereographic::m_pPolarStereographic
GeographicLib::PolarStereographic * m_pPolarStereographic
Definition: PolarStereographic.h:52
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
k0
double k0(double x)
Definition: k0.c:131
GeographicLib::PolarStereographic::Reverse
void Reverse(bool northp, real x, real y, real &lat, real &lon, real &gamma, real &k) const
Definition: src/PolarStereographic.cpp:81
NETGeographicLib::PolarStereographic::PolarStereographic
PolarStereographic()
Definition: dotnet/NETGeographicLib/PolarStereographic.cpp:48
GeographicLib::PolarStereographic::UPS
static const PolarStereographic & UPS()
Definition: src/PolarStereographic.cpp:33
GeographicLib::PolarStereographic::SetScale
void SetScale(real lat, real k=real(1))
Definition: src/PolarStereographic.cpp:98
lgamma
const EIGEN_DEVICE_FUNC LgammaReturnType lgamma() const
Definition: ArrayCwiseUnaryOps.h:620
NETGeographicLib::PolarStereographic::Reverse
void Reverse(bool northp, double x, double y, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, [System::Runtime::InteropServices::Out] double% gamma, [System::Runtime::InteropServices::Out] double% k)
Definition: dotnet/NETGeographicLib/PolarStereographic.cpp:91
stdafx.h
NETGeographicLib::PolarStereographic::SetScale
void SetScale(double lat, double k)
Definition: dotnet/NETGeographicLib/PolarStereographic.cpp:62
gamma
#define gamma
Definition: mconf.h:85
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
y
Scalar * y
Definition: level1_cplx_impl.h:124
tree::f
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Definition: testExpression.cpp:218
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
GeographicLib::PolarStereographic
Polar stereographic projection.
Definition: PolarStereographic.hpp:36
BADALLOC
const char BADALLOC[]
Definition: dotnet/NETGeographicLib/PolarStereographic.cpp:18
GeographicLib::PolarStereographic::Forward
void Forward(bool northp, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Definition: src/PolarStereographic.cpp:61
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
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:03:35