dotnet/NETGeographicLib/DMS.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
12 #include "GeographicLib/DMS.hpp"
13 #include "DMS.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 //*****************************************************************************
19 double DMS::Decode( System::String^ dms,
20  [System::Runtime::InteropServices::Out] Flag% ind)
21 {
22  try
23  {
26  ind = static_cast<Flag>(lind);
27  return out;
28  }
29  catch ( const std::exception& xcpt )
30  {
31  throw gcnew GeographicErr( xcpt.what() );
32  }
33 }
34 
35 //*****************************************************************************
36 void DMS::DecodeLatLon(System::String^ dmsa, System::String^ dmsb,
37  [System::Runtime::InteropServices::Out] double% lat,
38  [System::Runtime::InteropServices::Out] double% lon,
39  bool longfirst )
40 {
41  try
42  {
43  double llat, llon;
45  StringConvert::ManagedToUnmanaged( dmsb ), llat, llon, longfirst );
46  lat = llat;
47  lon = llon;
48  }
49  catch ( const std::exception& xcpt )
50  {
51  throw gcnew GeographicErr( xcpt.what() );
52  }
53 }
54 
55 //*****************************************************************************
56 double DMS::DecodeAngle(System::String^ angstr)
57 {
58  try
59  {
61  }
62  catch ( const std::exception& xcpt )
63  {
64  throw gcnew GeographicErr( xcpt.what() );
65  }
66 }
67 
68 //*****************************************************************************
69 double DMS::DecodeAzimuth(System::String^ azistr)
70 {
71  try
72  {
74  }
75  catch ( const std::exception& xcpt )
76  {
77  throw gcnew GeographicErr( xcpt.what() );
78  }
79 }
80 
81 //*****************************************************************************
82 System::String^ DMS::Encode(double angle, Component trailing, unsigned prec,
83  Flag ind, char dmssep)
84 {
85  try
86  {
89  static_cast<GeographicLib::DMS::component>(trailing),
90  prec,
91  static_cast<GeographicLib::DMS::flag>(ind),
92  dmssep )
93  );
94  }
95  catch ( const std::exception& xcpt )
96  {
97  throw gcnew GeographicErr( xcpt.what() );
98  }
99 }
100 //*****************************************************************************
101 System::String^ DMS::Encode(double angle, unsigned prec, Flag ind,
102  char dmssep )
103 {
104  try
105  {
108  prec,
109  static_cast<GeographicLib::DMS::flag>(ind),
110  dmssep )
111  );
112  }
113  catch ( const std::exception& xcpt )
114  {
115  throw gcnew GeographicErr( xcpt.what() );
116  }
117 }
static double Decode(System::String^dms, [System::Runtime::InteropServices::Out] Flag%ind)
static Math::real DecodeAngle(const std::string &angstr)
Definition: src/DMS.cpp:281
Header for NETGeographicLib::NETGeographicLib objects.
static const double lat
Exception class for NETGeographicLib.
static double DecodeAzimuth(System::String^azistr)
static System::String Encode(double angle, Component trailing, unsigned prec, Flag ind, char dmssep)
static std::string ManagedToUnmanaged(System::String^s)
static void DecodeLatLon(System::String^dmsa, System::String^dmsb, [System::Runtime::InteropServices::Out] double%lat, [System::Runtime::InteropServices::Out] double%lon, bool longfirst)
static std::string Encode(real angle, component trailing, unsigned prec, flag ind=NONE, char dmssep=char(0))
Definition: src/DMS.cpp:299
static System::String UnmanagedToManaged(const std::string &s)
static Math::real DecodeAzimuth(const std::string &azistr)
Definition: src/DMS.cpp:290
Header for NETGeographicLib::DMS class.
static Math::real Decode(const std::string &dms, flag &ind)
Definition: src/DMS.cpp:28
static void DecodeLatLon(const std::string &dmsa, const std::string &dmsb, real &lat, real &lon, bool longfirst=false)
Definition: src/DMS.cpp:252
static const double lon
static double DecodeAngle(System::String^angstr)
Header for GeographicLib::DMS class.


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