12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #ifndef __LAND_MARK_HPP__
- #define __LAND_MARK_HPP__
- #include <string>
- #include <vector>
- #include <mutex>
- #include <map>
- #include <memory>
- #include <tuple>
- #include "point.h"
- enum DIRECTION_TYPE{
- NODIRECTORY = 0,
- EAST = 1,
- SOURTH = 2,
- WEST = 3,
- NORTH = 4
- };
- struct LandmarkInfo:point
- {
- LandmarkInfo()
- :landmark_id(0)
- ,landmark_name("")
- ,map_id(0)
- ,area_id(0)
- {}
- LandmarkInfo(point &p,int id,std::string & n,int mapid, int areaid)
- :point(p)
- ,landmark_id(id)
- ,landmark_name(n)
- ,map_id(mapid)
- ,area_id(areaid)
- {}
- int landmark_id;
- std::string landmark_name;
- int map_id;
- int area_id;
- };
- struct map_direction
- {
- map_direction(int mapid,int angle)
- :map_id(mapid)
- ,north_angle(angle)
- {}
- int map_id;
- int north_angle;
- };
- struct Landmark_list
- {
- std::vector<std::shared_ptr<LandmarkInfo>> m_v;
- std::map<int,std::shared_ptr<map_direction>> m_map;
- static Landmark_list * instance();
- void init_from_db();
- void init_landmarkInfo(int id = -1);
- void remove_landmarkInfo(int id);
- void init_mapDirection();
- //landmarkId landmark_direction landmark_dis
- std::tuple<int,int,double> get(int mapid,int areaid,const point &pt);
- DIRECTION_TYPE GetDirectionType(point card_point, point landmark_point, int map_id);
- std::mutex m_mutex;
- };
- #endif
|