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() )
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 //*****************************************************************************
Header for NETGeographicLib::NETGeographicLib objects.
.NET wrapper for GeographicLib::MagneticCircle.
Exception class for NETGeographicLib.
Header for GeographicLib::MagneticCircle class.
Scalar Scalar * c
Definition: benchVecAdd.cpp:17
Geomagnetic field on a circle of latitude.
const GeographicLib::MagneticCircle * m_pMagneticCircle
#define NULL
Definition: ccolamd.c:609
void Field(double lon, [System::Runtime::InteropServices::Out] double% Bx, [System::Runtime::InteropServices::Out] double% By, [System::Runtime::InteropServices::Out] double% Bz)
static const double lon
MagneticCircle(const GeographicLib::MagneticCircle &c)
Container::iterator get(Container &c, Position position)
Header for NETGeographicLib::MagneticCircle class.


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:35