Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cGeospatial.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cGeospatial_H
7 #define _INC_cGeospatial_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "../GrayLibBase.h"
13 #include "../Math/cVecT.h"
16 
17 namespace GrayLib
18 {
19  class GRAYLIB_LINK cGeoPos : public cVecT2<double>
20  {
25  typedef cVecT2<double> SUPER_t;
26 
27  public:
28  cGeoPos(double latY = 0, double lonX = 0)
29  : cVecT2<double>(lonX, latY)
30  {
31  }
32 
33  void put_Lat(double ny)
34  {
35  this->m_y = ny;
36  }
37  void put_Lon(double nx)
38  {
39  this->m_x = nx;
40  }
41  double get_Lat() const
42  {
44  return this->m_y;
45  }
46  double get_Lon() const
47  {
49  return this->m_x;
50  }
51  };
52 
53  class GRAYLIB_LINK cGeospatial : public cTypeF<double>
54  {
57  public:
58 
59  typedef cVecT2<double> VEC_t; // Base for cGeoPos
60 
61  static const double k_EarthRadiusMeters;
62  static const double k_SunDia;
63  static const double k_AirRefr;
64 
65  public:
66  static double GRAYCALL GetDistMeters(const cGeoPos& p1, const cGeoPos& p2);
67  static cGeoPos GRAYCALL AddDistMeters(const cGeoPos& p1, double dx, double dy);
68 
69  // GetLatLonStr()
70  };
71 
73  {
79 
80  public:
81  // Derived data from Set()
82  double m_Declination;
83  double m_DayLength;
84  double m_SunAltAtNoon;
85 
86  double m_tCivilAM;
87  double m_tSunRise;
88  double m_tSolarNoon;
89  double m_tSunSet;
90  double m_tCivilPM;
91 
92  protected:
93  double FNrange(double x);
94  double f0(double lat, double declin);
95  double f1(double lat, double declin);
96 
97  public:
98  cGeoSunRise(void);
99  ~cGeoSunRise(void);
100 
101  HRESULT Set(const cTimeDouble& t, const cGeoPos& p, TZ_TYPE nTimeZoneOffset);
102 
104  };
105 }
106 #endif
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
Definition: cGeospatial.h:20
cGeoPos(double latY=0, double lonX=0)
Definition: cGeospatial.h:28
void put_Lon(double nx)
Definition: cGeospatial.h:37
double get_Lon() const
Definition: cGeospatial.h:46
double get_Lat() const
Definition: cGeospatial.h:41
void put_Lat(double ny)
Definition: cGeospatial.h:33
Definition: cGeospatial.h:73
double m_tCivilAM
AM time in the day. double hours. dawn.
Definition: cGeospatial.h:86
double m_tCivilPM
PM time in the day. double hours. dusk.
Definition: cGeospatial.h:90
UNITTEST_FRIEND(cGeospatial)
double m_SunAltAtNoon
sun altitude at noon in radians.
Definition: cGeospatial.h:84
double m_tSolarNoon
double hours. true noon.
Definition: cGeospatial.h:88
double m_tSunRise
AM time in the day. double hours.
Definition: cGeospatial.h:87
double m_Declination
radians
Definition: cGeospatial.h:82
double m_tSunSet
PM time in the day. double hours.
Definition: cGeospatial.h:89
double m_DayLength
double hours.
Definition: cGeospatial.h:83
Definition: cGeospatial.h:54
static const double k_EarthRadiusMeters
= 6371000.0;
Definition: cGeospatial.h:61
cVecT2< double > VEC_t
Definition: cGeospatial.h:59
static const double k_SunDia
= 0.53; // Sun radius degrees. (for daylight time)
Definition: cGeospatial.h:62
static const double k_AirRefr
= 34.0 / 60.0; // atmospheric refraction degrees (for daylight time)
Definition: cGeospatial.h:63
Definition: cVecT.h:473
Definition: cTimeDouble.h:21
Definition: cMesh.h:22
TZ_TYPE
Definition: cTimeUnits.h:29
Definition: Calc.h:37