dotnet/NETGeographicLib/LambertConformalConic.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "LambertConformalConic.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 const char BADALLOC[] = "Failed to allocte memory for a GeographicLib::LambertConformalConic";
19 
20 //*****************************************************************************
22 {
23  if ( m_pLambertConformalConic != NULL )
24  {
25  delete m_pLambertConformalConic;
26  m_pLambertConformalConic = NULL;
27  }
28 }
29 
30 //*****************************************************************************
31 LambertConformalConic::LambertConformalConic(double a, double f, double stdlat,
32  double k0)
33 {
34  try
35  {
37  new GeographicLib::LambertConformalConic( a, f, stdlat, k0 );
38  }
39  catch ( std::bad_alloc )
40  {
41  throw gcnew GeographicErr( BADALLOC );
42  }
43  catch ( const std::exception& err )
44  {
45  throw gcnew GeographicErr( err.what() );
46  }
47 }
48 
49 //*****************************************************************************
51  double stdlat1, double stdlat2, double k1)
52 {
53  try
54  {
56  new GeographicLib::LambertConformalConic( a, f, stdlat1, stdlat2, k1 );
57  }
58  catch ( std::bad_alloc )
59  {
60  throw gcnew GeographicErr( BADALLOC );
61  }
62  catch ( const std::exception& err )
63  {
64  throw gcnew GeographicErr( err.what() );
65  }
66 }
67 
68 //*****************************************************************************
70  double sinlat1, double coslat1,
71  double sinlat2, double coslat2,
72  double k1)
73 {
74  try
75  {
77  new GeographicLib::LambertConformalConic( a, f, sinlat1, coslat1,
78  sinlat2, coslat2, k1 );
79  }
80  catch ( std::bad_alloc )
81  {
82  throw gcnew GeographicErr( BADALLOC );
83  }
84  catch ( const std::exception& err )
85  {
86  throw gcnew GeographicErr( err.what() );
87  }
88 }
89 
90 //*****************************************************************************
92 {
93  try
94  {
97  }
98  catch ( std::bad_alloc )
99  {
100  throw gcnew GeographicErr( BADALLOC );
101  }
102 }
103 
104 //*****************************************************************************
105 void LambertConformalConic::SetScale(double lat, double k)
106 {
107  try
108  {
110  }
111  catch ( std::exception err )
112  {
113  throw gcnew GeographicErr( err.what() );
114  }
115 }
116 
117 //*****************************************************************************
118 void LambertConformalConic::Forward(double lon0, double lat, double lon,
119  [System::Runtime::InteropServices::Out] double% x,
120  [System::Runtime::InteropServices::Out] double% y,
121  [System::Runtime::InteropServices::Out] double% gamma,
122  [System::Runtime::InteropServices::Out] double% k)
123 {
124  double lx, ly, lgamma, lk;
125  m_pLambertConformalConic->Forward( lon0, lat, lon, lx, ly, lgamma, lk );
126  x = lx;
127  y = ly;
128  gamma = lgamma;
129  k = lk;
130 }
131 
132 //*****************************************************************************
133 void LambertConformalConic::Reverse(double lon0, double x, double y,
134  [System::Runtime::InteropServices::Out] double% lat,
135  [System::Runtime::InteropServices::Out] double% lon,
136  [System::Runtime::InteropServices::Out] double% gamma,
137  [System::Runtime::InteropServices::Out] double% k)
138 {
139  double llat, llon, lgamma, lk;
140  m_pLambertConformalConic->Reverse( lon0, x, y, llat, llon, lgamma, lk );
141  lat = llat;
142  lon = llon;
143  gamma = lgamma;
144  k = lk;
145 }
146 
147 //*****************************************************************************
148 void LambertConformalConic::Forward(double lon0, double lat, double lon,
149  [System::Runtime::InteropServices::Out] double% x,
150  [System::Runtime::InteropServices::Out] double% y)
151 {
152  double lx, ly;
153  m_pLambertConformalConic->Forward( lon0, lat, lon, lx, ly );
154  x = lx;
155  y = ly;
156 }
157 
158 //*****************************************************************************
159 void LambertConformalConic::Reverse(double lon0, double x, double y,
160  [System::Runtime::InteropServices::Out] double% lat,
161  [System::Runtime::InteropServices::Out] double% lon)
162 {
163  double llat, llon;
164  m_pLambertConformalConic->Reverse( lon0, x, y, llat, llon );
165  lat = llat;
166  lon = llon;
167 }
168 
169 //*****************************************************************************
172 
173 //*****************************************************************************
176 
177 //*****************************************************************************
180 
181 //*****************************************************************************
void Forward(real lon0, real lat, real lon, real &x, real &y, real &gamma, real &k) const
Header for NETGeographicLib::NETGeographicLib objects.
Scalar * y
static const double lat
Exception class for NETGeographicLib.
void Reverse(double lon0, 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)
Lambert conformal conic projection.
.NET wrapper for GeographicLib::LambertConformalConic.
Array33i a
Header for GeographicLib::LambertConformalConic class.
const mpreal gamma(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
Definition: mpreal.h:2262
static const LambertConformalConic & Mercator()
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
const double lon0
#define NULL
Definition: ccolamd.c:609
Header for NETGeographicLib::LambertConformalConic class.
void Forward(double lon0, 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)
static const double lon
void Reverse(real lon0, real x, real y, real &lat, real &lon, real &gamma, real &k) const
Container::iterator get(Container &c, Position position)
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
GeographicLib::LambertConformalConic * m_pLambertConformalConic
EIGEN_DEVICE_FUNC const LgammaReturnType lgamma() const


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:27