dotnet/NETGeographicLib/MagneticCircle.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "MagneticCircle.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 //*****************************************************************************
20 {
21  if ( m_pMagneticCircle != NULL )
22  {
23  delete m_pMagneticCircle;
24  m_pMagneticCircle = NULL;
25  }
26 }
27 
28 //*****************************************************************************
30 {
31  try
32  {
34  }
35  catch ( std::bad_alloc )
36  {
37  throw gcnew GeographicErr( "Failed to allocate memory for a GeographicLib::MagneticCircle" );
38  }
39 }
40 
41 //*****************************************************************************
43  [System::Runtime::InteropServices::Out] double% Bx,
44  [System::Runtime::InteropServices::Out] double% By,
45  [System::Runtime::InteropServices::Out] double% Bz)
46 {
47  double lx, ly, lz;
48  m_pMagneticCircle->operator()( lon, lx, ly, lz );
49  Bx = lx;
50  By = ly;
51  Bz = lz;
52 }
53 
54 //*****************************************************************************
56  [System::Runtime::InteropServices::Out] double% Bx,
57  [System::Runtime::InteropServices::Out] double% By,
58  [System::Runtime::InteropServices::Out] double% Bz,
59  [System::Runtime::InteropServices::Out] double% Bxt,
60  [System::Runtime::InteropServices::Out] double% Byt,
61  [System::Runtime::InteropServices::Out] double% Bzt)
62 {
63  double lx, ly, lz, lxt, lyt, lzt;
64  m_pMagneticCircle->operator()( lon, lx, ly, lz, lxt, lyt, lzt );
65  Bx = lx;
66  By = ly;
67  Bz = lz;
68  Bxt = lxt;
69  Byt = lyt;
70  Bzt = lzt;
71 }
72 
73 //*****************************************************************************
75 {
76  if ( m_pMagneticCircle->Init() )
77  return m_pMagneticCircle->MajorRadius();
78  throw gcnew GeographicErr("MagneticCircle::MajorRadius failed because the MagneticCircle is not initialized.");
79 }
80 
81 //*****************************************************************************
83 {
84  if ( m_pMagneticCircle->Init() )
85  return m_pMagneticCircle->Flattening();
86  throw gcnew GeographicErr("MagneticCircle::Flattening failed because the MagneticCircle is not initialized.");
87 }
88 
89 //*****************************************************************************
91 {
92  if ( m_pMagneticCircle->Init() )
93  return m_pMagneticCircle->Latitude();
94  throw gcnew GeographicErr("MagneticCircle::Latitude failed because the MagneticCircle is not initialized.");
95 }
96 
97 //*****************************************************************************
99 {
100  if ( m_pMagneticCircle->Init() )
101  return m_pMagneticCircle->Height();
102  throw gcnew GeographicErr("MagneticCircle::Height failed because the MagneticCircle is not initialized.");
103 }
104 
105 //*****************************************************************************
107 {
108  if ( m_pMagneticCircle->Init() )
109  return m_pMagneticCircle->Height();
110  throw gcnew GeographicErr("MagneticCircle::Height failed because the MagneticCircle is not initialized.");
111 }
112 
113 //*****************************************************************************
114 bool MagneticCircle::Init::get() { return m_pMagneticCircle->Init(); }
NETGeographicLib::MagneticCircle::m_pMagneticCircle
const GeographicLib::MagneticCircle * m_pMagneticCircle
Definition: MagneticCircle.h:45
c
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
MagneticCircle.h
Header for NETGeographicLib::MagneticCircle class.
NETGeographicLib::GeographicErr
Exception class for NETGeographicLib.
Definition: NETGeographicLib.h:132
stdafx.h
NETGeographicLib::MagneticCircle::MagneticCircle
MagneticCircle(const GeographicLib::MagneticCircle &c)
Definition: dotnet/NETGeographicLib/MagneticCircle.cpp:29
NETGeographicLib.h
Header for NETGeographicLib::NETGeographicLib objects.
NETGeographicLib::MagneticCircle::Field
void Field(double lon, [System::Runtime::InteropServices::Out] double% Bx, [System::Runtime::InteropServices::Out] double% By, [System::Runtime::InteropServices::Out] double% Bz)
Definition: dotnet/NETGeographicLib/MagneticCircle.cpp:42
MagneticCircle.hpp
Header for GeographicLib::MagneticCircle class.
NETGeographicLib::MagneticCircle
.NET wrapper for GeographicLib::MagneticCircle.
Definition: MagneticCircle.h:41
lon
static const double lon
Definition: testGeographicLib.cpp:34
NULL
#define NULL
Definition: ccolamd.c:609
get
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
NETGeographicLib
Definition: Accumulator.h:13
GeographicLib::MagneticCircle
Geomagnetic field on a circle of latitude.
Definition: MagneticCircle.hpp:37


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