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 }
ind
std::vector< int > ind
Definition: Slicing_stdvector_cxx11.cpp:1
GeographicLib::DMS::DecodeLatLon
static void DecodeLatLon(const std::string &dmsa, const std::string &dmsb, real &lat, real &lon, bool longfirst=false)
Definition: src/DMS.cpp:252
GeographicLib::DMS::DecodeAngle
static Math::real DecodeAngle(const std::string &angstr)
Definition: src/DMS.cpp:281
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
GeographicLib::DMS::Decode
static Math::real Decode(const std::string &dms, flag &ind)
Definition: src/DMS.cpp:28
NETGeographicLib::StringConvert::UnmanagedToManaged
static System::String UnmanagedToManaged(const std::string &s)
Definition: NETGeographicLib.h:153
NETGeographicLib::DMS::Encode
static System::String Encode(double angle, Component trailing, unsigned prec, Flag ind, char dmssep)
Definition: dotnet/NETGeographicLib/DMS.cpp:82
GeographicLib::DMS::Encode
static std::string Encode(real angle, component trailing, unsigned prec, flag ind=NONE, char dmssep=char(0))
Definition: src/DMS.cpp:299
DMS.h
Header for NETGeographicLib::DMS class.
NETGeographicLib::DMS::Flag
Flag
Definition: DMS.h:36
NETGeographicLib::DMS::DecodeAngle
static double DecodeAngle(System::String^ angstr)
Definition: dotnet/NETGeographicLib/DMS.cpp:56
NETGeographicLib::DMS::Component
Component
Definition: DMS.h:68
stdafx.h
GeographicLib::DMS::flag
flag
Definition: DMS.hpp:41
NETGeographicLib::DMS::DecodeAzimuth
static double DecodeAzimuth(System::String^ azistr)
Definition: dotnet/NETGeographicLib/DMS.cpp:69
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
out
std::ofstream out("Result.txt")
NETGeographicLib::DMS::DecodeLatLon
static void DecodeLatLon(System::String^ dmsa, System::String^ dmsb, [System::Runtime::InteropServices::Out] double% lat, [System::Runtime::InteropServices::Out] double% lon, bool longfirst)
Definition: dotnet/NETGeographicLib/DMS.cpp:36
NETGeographicLib::DMS::Decode
static double Decode(System::String^ dms, [System::Runtime::InteropServices::Out] Flag% ind)
Definition: dotnet/NETGeographicLib/DMS.cpp:19
GeographicLib::DMS::component
component
Definition: DMS.hpp:73
lon
static const double lon
Definition: testGeographicLib.cpp:34
GeographicLib::DMS::DecodeAzimuth
static Math::real DecodeAzimuth(const std::string &azistr)
Definition: src/DMS.cpp:290
NETGeographicLib
Definition: Accumulator.h:13
NETGeographicLib::StringConvert::ManagedToUnmanaged
static std::string ManagedToUnmanaged(System::String^ s)
Definition: NETGeographicLib.cpp:20
DMS.hpp
Header for GeographicLib::DMS class.
lat
static const double lat
Definition: testGeographicLib.cpp:34


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:13