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 //*****************************************************************************
31 PolarStereographic::PolarStereographic(double a, double f, double k0)
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;
82  m_pPolarStereographic->Forward( northp, lat, lon,
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(); }
Header for NETGeographicLib::NETGeographicLib objects.
Scalar * y
static const double lat
Exception class for NETGeographicLib.
GeographicLib::PolarStereographic * m_pPolarStereographic
Header for NETGeographicLib::PolarStereographic class.
void Reverse(bool northp, real x, real y, real &lat, real &lon, real &gamma, real &k) const
EIGEN_DEVICE_FUNC const LgammaReturnType lgamma() const
static const PolarStereographic & UPS()
void SetScale(real lat, real k=real(1))
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
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)
#define NULL
Definition: ccolamd.c:609
Polar stereographic projection.
.NET wrapper for GeographicLib::PolarStereographic.
static const double lon
Header for GeographicLib::PolarStereographic class.
Container::iterator get(Container &c, Position position)
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)
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
void Forward(bool northp, real lat, real lon, real &x, real &y, real &gamma, real &k) const


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:35:14