1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef __LAND_MARK_HPP__
- #define __LAND_MARK_HPP__
- #include <string>
- #include <vector>
- #include <mutex>
- #include <map>
- #include <memory>
- #include <tuple>
- #include "write-copy.h"
- #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:single_base<Landmark_list, int, std::shared_ptr<LandmarkInfo>>
- {
- //std::vector<std::shared_ptr<LandmarkInfo>> m_v;
- std::map<int,std::shared_ptr<map_direction>> m_map_direction;
- //static Landmark_list * instance();
- void init_from_db();
- void init_landmarkInfo(int id = -1);
-
- void init_mapDirection();
- //landmarkId landmark_direction landmark_dis
- std::tuple<int,int,double> get_landmark(int mapid,int areaid,const point &pt);
- DIRECTION_TYPE GetDirectionType(point card_point, point landmark_point, int map_id);
- std::mutex m_mutex;
- };
- #endif
|