NETGeographicLib.h
Go to the documentation of this file.
1 #pragma once
2 
12 #include <string>
13 
14 using namespace System;
15 
16 namespace NETGeographicLib
17 {
18  enum class captype {
19  CAP_NONE = 0U,
20  CAP_C1 = 1U<<0,
21  CAP_C1p = 1U<<1,
22  CAP_C2 = 1U<<2,
23  CAP_C3 = 1U<<3,
24  CAP_C4 = 1U<<4,
25  CAP_ALL = 0x1FU,
26  CAP_MASK = CAP_ALL,
27  OUT_ALL = 0x7F80U,
28  OUT_MASK = 0xFF80U,
29  };
30 
38  public enum class Mask {
43  NONE = 0U,
49  LATITUDE = 1U<<7 | unsigned(captype::CAP_NONE),
54  LONGITUDE = 1U<<8 | unsigned(captype::CAP_C3),
61  AZIMUTH = 1U<<9 | unsigned(captype::CAP_NONE),
66  DISTANCE = 1U<<10 | unsigned(captype::CAP_C1),
72  DISTANCE_IN = 1U<<11 | unsigned(captype::CAP_C1) |
73  unsigned(captype::CAP_C1p),
78  REDUCEDLENGTH = 1U<<12 | unsigned(captype::CAP_C1) |
79  unsigned(captype::CAP_C2),
84  GEODESICSCALE = 1U<<13 | unsigned(captype::CAP_C1) |
85  unsigned(captype::CAP_C2),
90  AREA = 1U<<14 | unsigned(captype::CAP_C4),
95  LONG_UNROLL = 1U<<15,
100  ALL = unsigned(captype::OUT_ALL) | unsigned(captype::CAP_ALL),
101  };
102 
106  public ref class VersionInfo
107  {
108  private:
110  public:
114  static System::String^ GetString();
118  static int MajorVersion();
122  static int MinorVersion();
126  static int Patch();
127  };
128 
132  public ref class GeographicErr : public System::Exception
133  {
134  public:
139  GeographicErr( const char* msg ) :
140  System::Exception( gcnew System::String( msg ) ) {}
145  GeographicErr( System::String^ msg ) : System::Exception( msg ) {}
146  };
147 
148  ref class StringConvert
149  {
151  public:
152  static std::string ManagedToUnmanaged( System::String^ s );
153  static System::String^ UnmanagedToManaged( const std::string& s )
154  { return gcnew System::String( s.c_str() ); }
155  };
156 
165  public ref class Constants
166  {
167  private:
169  public:
170 
174  ref class WGS72
175  {
176  private:
177  WGS72() {}
178  // The equatorial radius in meters.
179  static const double m_MajorRadius = 6378135.0;
180  // The flattening of the ellipsoid
181  static const double m_Flattening = 1.0 / 298.26;
182  // The gravitational constant in meters<sup>3</sup>/second<sup>2</sup>.
183  static const double m_GravitationalConstant = 3.986008e+14;
184  // The spin rate of the Earth in radians/second.
185  static const double m_EarthRate = 7.292115147e-5;
186  // dynamical form factor
187  static const double m_J2 = 1.0826158e-3;
188  public:
190  static property double MajorRadius { double get() { return m_MajorRadius; } }
192  static property double Flattening { double get() { return m_Flattening; } }
194  static property double GravitationalConstant { double get() { return m_GravitationalConstant; } }
196  static property double EarthRate { double get() { return m_EarthRate; } }
198  static property double J2 { double get() { return m_J2; } }
199  };
200 
204  ref class WGS84
205  {
206  private:
207  WGS84() {}
208  // The equatorial radius in meters.
209  static const double m_MajorRadius = 6378137.0;
210  // The flattening of the ellipsoid
211  static const double m_Flattening = 1.0 / 298.257223563;
212  // The gravitational constant in meters<sup>3</sup>/second<sup>2</sup>.
213  // I have also seen references that set this value to 3.986004418e+14.
214  // The following value is used to maintain consistency with GeographicLib.
215  static const double m_GravitationalConstant = 3.986005e+14;
216  // The spin rate of the Earth in radians/second.
217  static const double m_EarthRate = 7.292115e-5;
218  // dynamical form factor
219  static const double m_J2 = 1.08263e-3;
220  public:
222  static property double MajorRadius { double get() { return m_MajorRadius; } }
224  static property double Flattening { double get() { return m_Flattening; } }
226  static property double GravitationalConstant { double get() { return m_GravitationalConstant; } }
228  static property double EarthRate { double get() { return m_EarthRate; } }
230  static property double J2 { double get() { return m_J2; } }
231  };
232 
236  ref class GRS80
237  {
238  private:
239  GRS80() {}
240  // The equatorial radius in meters.
241  static const double m_MajorRadius = 6378137.0;
242  // The flattening of the ellipsoid
243  static const double m_Flattening = 1.0 / 298.257222100882711;
244  // The gravitational constant in meters<sup>3</sup>/second<sup>2</sup>.
245  static const double m_GravitationalConstant = 3.986005e+14;
246  // The spin rate of the Earth in radians/second.
247  static const double m_EarthRate = 7.292115e-5;
248  // dynamical form factor
249  static const double m_J2 = 1.08263e-3;
250  public:
252  static property double MajorRadius { double get() { return m_MajorRadius; } }
254  static property double Flattening { double get() { return m_Flattening; } }
256  static property double GravitationalConstant { double get() { return m_GravitationalConstant; } }
258  static property double EarthRate { double get() { return m_EarthRate; } }
260  static property double J2 { double get() { return m_J2; } }
261  };
262  };
263 
270  public ref class Utility
271  {
272  private:
273  // hide the constructor since all members of this class are static
274  Utility() {}
275  public:
288  static double FractionalYear( System::String^ s );
289  };
290 } // namespace NETGeographicLib
Exception class for NETGeographicLib.
static System::String UnmanagedToManaged(const std::string &s)
GeographicErr(const char *msg)
Creates an exception using an unmanaged string.
RealScalar s
GeographicErr(System::String^msg)
Creates an exception using a managed string.
The version information.


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