Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cMapCommon.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cMapCommon_H
7 #define _INC_cMapCommon_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 #include "../Gray3D.h"
16 
17 namespace Gray3D
18 {
19 #if 0
20  typedef float MAP_METER_t;
21 #else
22  typedef double MAP_METER_t;
23 #endif
24 
26  {
29 
30  public:
31  typedef cVecT2<MAP_METER_t> POINT2_t; // a 2d point in the map space.
32  typedef cPoint3T<MAP_METER_t> POINT3_t; // a 3d point in the map space.
34 
35  static cString GetStr(MAP_METER_t x, MAP_METER_t y);
36  static cString GetStr(const POINT2_t& pt);
37  static cString GetStr(const POINT3_t& pt);
38  static cString GetStr(const RECT_t& r);
39  };
40 
42  {
47 
48  // TODO MERGE THIS BACK INTO GrayMapData !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
49 
50  public:
54 
55  public:
56  cMapBase1(const char* pszMapName)
57  {
58  m_sMapSymName = pszMapName;
59  }
60  virtual ~cMapBase1()
61  {
62  }
63 
64  virtual cStringA get_Name() const
65  {
66  return m_sMapSymName;
67  }
69  {
70  // Name of the map directory (not common/friendly name)
71  return m_sMapSymName;
72  }
73 
75  {
76  // Get map height at a 2d point.
77  return 1; // 0 = sea level.
78  }
79  virtual float GetNormalGradeAt(MAP_METER_t x, MAP_METER_t y) // terrain grade at a point. 0 to 1
80  {
81  // Get map grade at a 2d point.
82  return 0; // flat
83  }
84  };
85 }
86 
87 #endif
#define GRAY3D_LINK
Definition: Gray3D.h:15
Definition: cMapCommon.h:42
cStringA m_sMapSymName
Dir name as symbolic id. (NOT descriptive/friendly name, use Regions for that) ex....
Definition: cMapCommon.h:51
virtual float GetNormalGradeAt(MAP_METER_t x, MAP_METER_t y)
Definition: cMapCommon.h:79
cStringF m_sMapDir
Dir Full Path. to find map data. m_sMapSymName.scp file is to be found.
Definition: cMapCommon.h:52
virtual MAP_METER_t GetHeightAt(MAP_METER_t x, MAP_METER_t y)
Definition: cMapCommon.h:74
RECT_t m_MapRect
Restrict dynamics to only use/load/store this part of the map.
Definition: cMapCommon.h:53
cMapBase1(const char *pszMapName)
Definition: cMapCommon.h:56
cStringF get_MapDir() const
Definition: cMapCommon.h:68
virtual ~cMapBase1()
Definition: cMapCommon.h:60
virtual cStringA get_Name() const
Definition: cMapCommon.h:64
Definition: cMapCommon.h:26
cPoint3T< MAP_METER_t > POINT3_t
Definition: cMapCommon.h:32
cRectFT< MAP_METER_t > RECT_t
Definition: cMapCommon.h:33
cVecT2< MAP_METER_t > POINT2_t
Definition: cMapCommon.h:31
Definition: cPoint3.h:20
Definition: cRectT.h:552
Definition: cVecT.h:473
Definition: Gray3D.cpp:12
double MAP_METER_t
float meters for x,y,z, similar to MAP_METERI_t. also D3DVALUE or DVALUEDEF_t METERSf_t
Definition: cMapCommon.h:22