3D Repo Bouncer  1.4
repo_node_map.h
1 
21 #pragma once
22 #include "repo_node.h"
23 
24 namespace repo {
25  namespace core {
26  namespace model {
27  class REPO_API_EXPORT MapNode :public RepoNode
28  {
29 #define REPO_NODE_MAP_LABEL_APIKEY "apiKey" //FIXME: Temporary measure until we change the way x3dom reads google map tiles
30 #define REPO_NODE_MAP_LABEL_WIDTH "width"
31 #define REPO_NODE_MAP_LABEL_YROT "yrot"
32 #define REPO_NODE_MAP_LABEL_TILESIZE "worldTileSize"
33 #define REPO_NODE_MAP_LABEL_LONG "long"
34 #define REPO_NODE_MAP_LABEL_LAT "lat"
35 #define REPO_NODE_MAP_LABEL_MAP_TYPE "maptype"
36 #define REPO_NODE_MAP_LABEL_ZOOM "zoom"
37 #define REPO_NODE_MAP_LABEL_TRANS "trans"
38 #define REPO_NODE_MAP_LABEL_TWO_SIDED "twosided"
39 #define REPO_NODE_MAP_DEFAULTNAME "<map>"
40 
41  public:
42 
46  MapNode();
47 
52  MapNode(RepoBSON bson);
53 
57  ~MapNode();
58 
63  std::string getAPIKey() const
64  {
65  return getStringField(REPO_NODE_MAP_LABEL_APIKEY);
66  }
67 
68  repo_vector_t getCentre() const;
69 
75  bool isTwoSided() const
76  {
77  return hasField(REPO_NODE_MAP_LABEL_TWO_SIDED);
78  }
79 
86  float getTwoSidedValue() const
87  {
88  float twoSided = false;
89  if (hasField(REPO_NODE_MAP_LABEL_TWO_SIDED))
90  {
91  twoSided = getField(REPO_NODE_MAP_LABEL_TWO_SIDED).Double();
92  }
93  return twoSided;
94  }
95 
100  std::string getMapType() const
101  {
102  return getStringField(REPO_NODE_MAP_LABEL_MAP_TYPE);
103  }
104 
109  float getLat() const;
110 
115  float getLong() const;
116 
121  float getTileSize() const;
122 
127  uint32_t getWidth() const;
128 
133  float getYRot() const;
134 
139  uint32_t getZoom() const;
140 
148  virtual bool sEqual(const RepoNode &other) const;
149  };
150  } //namespace model
151  } //namespace core
152 } //namespace repo
Definition: repo_node_map.h:27
Definition: repo_connection_pool_mongo.h:32
float getTwoSidedValue() const
Definition: repo_node_map.h:86
std::string getMapType() const
Definition: repo_node_map.h:100
Definition: repo_node_utils.h:67
std::string getAPIKey() const
Definition: repo_node_map.h:63
Definition: repo_node.h:33
Definition: repo_bson.h:53
bool isTwoSided() const
Definition: repo_node_map.h:75