|
@@ -1293,6 +1293,99 @@ int CYAServerDlg::init_drivingface_render(void)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+int CYAServerDlg::init_landmark(void)
|
|
|
+{
|
|
|
+ CMysqlConn* pConn = NULL;
|
|
|
+ CDBConnGuard pDbGuard(pConn);
|
|
|
+ if(pConn == NULL){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ MYSQL_ROW pRow;
|
|
|
+ MYSQL_RES *pRes = NULL;
|
|
|
+ int err = 0;
|
|
|
+ char strsql[LENGTH_SQL] = {0};
|
|
|
+ sprintf_s(strsql, "select landmark_id, name, map_id, x, y, z from dat_landmark;");
|
|
|
+
|
|
|
+ pRes = pConn->Execute(strsql, err);
|
|
|
+
|
|
|
+ if (err > 0)
|
|
|
+ {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<LandmarkInfo> pLandmarkInfo = nullptr;
|
|
|
+ int nRow = 0;
|
|
|
+ while(pRow = mysql_fetch_row(pRes)){
|
|
|
+ LandmarkInfoMap::iterator it = mp_landmark_list.find(atoi(pRow[0]));
|
|
|
+ if(it != mp_landmark_list.end()){
|
|
|
+ pLandmarkInfo = it->second;
|
|
|
+ }else{
|
|
|
+ pLandmarkInfo = std::make_shared<LandmarkInfo>();
|
|
|
+ mp_landmark_list.insert(make_pair(atoi(pRow[0]), pLandmarkInfo));
|
|
|
+ nRow++;
|
|
|
+ }
|
|
|
+
|
|
|
+ pLandmarkInfo->landmark_id = atoi(pRow[0]);
|
|
|
+ pLandmarkInfo->landmark_name = pRow[1];
|
|
|
+ pLandmarkInfo->map_id = atoi(pRow[2]);
|
|
|
+ pLandmarkInfo->x = atof(pRow[3]);
|
|
|
+ pLandmarkInfo->y = atof(pRow[4]);
|
|
|
+ pLandmarkInfo->z = atof(pRow[5]);
|
|
|
+ }
|
|
|
+ mysql_free_result(pRes);
|
|
|
+
|
|
|
+ CString strlog;
|
|
|
+ strlog.Format(_T("%s%d%s"), _T(LOG_INIT_AREA), nRow, _T(LOG_RECORD_COUNT));
|
|
|
+ show_log(strlog);
|
|
|
+ debug_print_syslog(0, "Init landmark info num: %d", nRow);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+int CYAServerDlg::init_map_directory(void)
|
|
|
+{
|
|
|
+ CMysqlConn* pConn = NULL;
|
|
|
+ CDBConnGuard pDbGuard(pConn);
|
|
|
+ if(pConn == NULL){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ MYSQL_ROW pRow;
|
|
|
+ MYSQL_RES *pRes = NULL;
|
|
|
+ int err = 0;
|
|
|
+ char strsql[LENGTH_SQL] = {0};
|
|
|
+ sprintf_s(strsql, "select map_directory_id, map_id, north_angle from dat_map_directory;");
|
|
|
+
|
|
|
+ pRes = pConn->Execute(strsql, err);
|
|
|
+
|
|
|
+ if (err > 0)
|
|
|
+ {
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<MapDirectoryInfo> pMapDirectoryInfo = nullptr;
|
|
|
+ int nRow = 0;
|
|
|
+ while(pRow = mysql_fetch_row(pRes)){
|
|
|
+ MapDirectoryInfoMap::iterator it = mp_map_directory_list.find(atoi(pRow[1]));
|
|
|
+ if(it != mp_map_directory_list.end()){
|
|
|
+ pMapDirectoryInfo = it->second;
|
|
|
+ }else{
|
|
|
+ pMapDirectoryInfo = std::make_shared<MapDirectoryInfo>();
|
|
|
+ mp_map_directory_list.insert(make_pair(atoi(pRow[1]), pMapDirectoryInfo));
|
|
|
+ nRow++;
|
|
|
+ }
|
|
|
+
|
|
|
+ pMapDirectoryInfo->map_directory_id = atoi(pRow[0]);
|
|
|
+ pMapDirectoryInfo->map_id = atoi(pRow[1]);
|
|
|
+ pMapDirectoryInfo->north_angle = atoi(pRow[2]);
|
|
|
+ }
|
|
|
+ mysql_free_result(pRes);
|
|
|
+
|
|
|
+ CString strlog;
|
|
|
+ strlog.Format(_T("%s%d%s"), _T(LOG_INIT_AREA), nRow, _T(LOG_RECORD_COUNT));
|
|
|
+ show_log(strlog);
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
int CYAServerDlg::init_reader(int reader_id /* = 0 */)
|
|
|
{
|
|
|
// 从数据库中读取
|
|
@@ -4711,6 +4804,33 @@ std::string CYAServerDlg::get_json_position()
|
|
|
pos_card[JSON_KEY_SPEED] = CFunctions::round(it->second->get_speed(),2);
|
|
|
pos_cards.append(pos_card[JSON_KEY_SPEED]);
|
|
|
|
|
|
+ //landmark ID
|
|
|
+ _point card_point = {it->second->x, it->second->y, it->second->z};
|
|
|
+ int landmark_id = GetLandmarkID(card_point);
|
|
|
+ it->second->landmark_id = landmark_id;
|
|
|
+ pos_card[JSON_KEY_LANDMARK_ID] = landmark_id;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_LANDMARK_ID]);
|
|
|
+
|
|
|
+ //directory ID
|
|
|
+ _point landmark_point = {0};
|
|
|
+ LandmarkInfoMap::iterator itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ int directory_id = GetDirectoryType(card_point, landmark_point, it->second->map_id);
|
|
|
+ it->second->directory = directory_id;
|
|
|
+ pos_card[JSON_KEY_DIRECTORY_ID] = directory_id;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_DIRECTORY_ID]);
|
|
|
+
|
|
|
+ //distance
|
|
|
+ double distance = GetDistance(card_point, landmark_point) * it->second->map_scale;
|
|
|
+ it->second->landmark_dis = distance;
|
|
|
+ pos_card[JSON_KEY_LANDMARK_DIS] = distance;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_LANDMARK_DIS]);
|
|
|
+
|
|
|
if(!pos_cards.isNull()){
|
|
|
root[JSON_ROOT_KEY_DATA].append(pos_cards);
|
|
|
cnt++;
|
|
@@ -4720,7 +4840,8 @@ std::string CYAServerDlg::get_json_position()
|
|
|
|
|
|
std::string ret = "";
|
|
|
if(cnt > 0){
|
|
|
- root[JSON_ROOT_KEY_CMD] = JSON_CMD_VALUE_POS_MAP;
|
|
|
+ root[JSON_ROOT_KEY_CMD] = JSON_CMD_VALUE_POS_MAP;
|
|
|
+ root[JSON_ROOT_KEY_VERSION] = INTERFACE_VERSION_1_3;
|
|
|
ret = root.toFastString().c_str();
|
|
|
CString str;
|
|
|
str = ret.c_str();
|
|
@@ -4838,6 +4959,32 @@ std::string CYAServerDlg::get_json_card_position(std::shared_ptr<Card> card)
|
|
|
pos_card[JSON_KEY_SPEED] = CFunctions::round(card->get_speed(),2);
|
|
|
pos_cards.append(pos_card[JSON_KEY_SPEED]);
|
|
|
|
|
|
+ //landmark ID
|
|
|
+ _point card_point = {card->x, card->y, card->z};
|
|
|
+ int landmark_id = GetLandmarkID(card_point);
|
|
|
+ card->landmark_id = landmark_id;
|
|
|
+ pos_card[JSON_KEY_LANDMARK_ID] = landmark_id;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_LANDMARK_ID]);
|
|
|
+
|
|
|
+ //directory ID
|
|
|
+ _point landmark_point = {0};
|
|
|
+ LandmarkInfoMap::iterator itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ int directory_id = GetDirectoryType(card_point, landmark_point, card->map_id);
|
|
|
+ card->directory = directory_id;
|
|
|
+ pos_card[JSON_KEY_DIRECTORY_ID] = directory_id;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_DIRECTORY_ID]);
|
|
|
+ //distance
|
|
|
+ double distance = GetDistance(card_point, landmark_point) * card->map_scale;
|
|
|
+ card->landmark_dis = distance;
|
|
|
+ pos_card[JSON_KEY_LANDMARK_DIS] = distance;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_LANDMARK_DIS]);
|
|
|
+
|
|
|
if(!pos_cards.isNull()){
|
|
|
root[JSON_ROOT_KEY_DATA].append(pos_cards);
|
|
|
cnt++;
|
|
@@ -5109,6 +5256,32 @@ std::string CYAServerDlg::get_json_position_all()
|
|
|
pos_card[JSON_KEY_SPEED] = CFunctions::round(it->second->get_speed(),2);
|
|
|
pos_cards.append(pos_card[JSON_KEY_SPEED]);
|
|
|
|
|
|
+ //landmark ID
|
|
|
+ _point card_point = {it->second->x, it->second->y, it->second->z};
|
|
|
+ int landmark_id = GetLandmarkID(card_point);
|
|
|
+ it->second->landmark_id = landmark_id;
|
|
|
+ pos_card[JSON_KEY_LANDMARK_ID] = landmark_id;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_LANDMARK_ID]);
|
|
|
+
|
|
|
+ //directory ID
|
|
|
+ _point landmark_point = {0};
|
|
|
+ LandmarkInfoMap::iterator itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ int directory_id = GetDirectoryType(card_point, landmark_point, it->second->map_id);
|
|
|
+ it->second->directory = directory_id;
|
|
|
+ pos_card[JSON_KEY_DIRECTORY_ID] = directory_id;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_DIRECTORY_ID]);
|
|
|
+ //distance
|
|
|
+ double distance = GetDistance(card_point, landmark_point) * it->second->map_scale;
|
|
|
+ it->second->landmark_dis = distance;
|
|
|
+ pos_card[JSON_KEY_LANDMARK_DIS] = distance;
|
|
|
+ pos_cards.append(pos_card[JSON_KEY_LANDMARK_DIS]);
|
|
|
+
|
|
|
if(!pos_cards.isNull()){
|
|
|
root[JSON_ROOT_KEY_DATA].append(pos_cards);
|
|
|
cnt++;
|
|
@@ -5744,6 +5917,52 @@ void CYAServerDlg::card_enter_area(std::shared_ptr<Card> card /* Card* card*/)
|
|
|
store_data_card(card, HIS_AREA_LOCATION_ENTER);
|
|
|
}
|
|
|
|
|
|
+void CYAServerDlg::card_enter_special_area(std::shared_ptr<Card> card, int special_area_id)
|
|
|
+{
|
|
|
+ if (card.use_count() == 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(card->area_id == special_area_id){
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ card->area_id = special_area_id;
|
|
|
+ card->enter_area_time = card->deal_time;
|
|
|
+ card->pos_state = card->pos_state_old = PDT_UP;
|
|
|
+
|
|
|
+ AreaMap::iterator it_area = mp_area_list.find(special_area_id);
|
|
|
+ if(it_area != mp_area_list.end())
|
|
|
+ {
|
|
|
+ if(CT_PERSON == card->card_type)
|
|
|
+ {
|
|
|
+ it_area->second->area_card_list_person->insert(make_pair(card->card_id, card));
|
|
|
+ if(it_area->second->area_type_id == 3)
|
|
|
+ {
|
|
|
+ deal_alarm_card(card, mp_card_list_forbidden_person, true, AF_CARD_AREA_FORBIDDEN);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(CT_VEHICLE == card->card_type)
|
|
|
+ {
|
|
|
+ it_area->second->area_card_list_vehicle->insert(make_pair(card->card_id, card));
|
|
|
+ if(it_area->second->area_type_id == 3)
|
|
|
+ {
|
|
|
+ deal_alarm_card(card, mp_card_list_forbidden_vehicle, true, AF_CARD_AREA_FORBIDDEN);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ debug_print_syslog(0, "x: %f, y: %f, lx: %f,ly: %f,area_id: %d",
|
|
|
+ card->x, card->y, card->last_x, card->last_y, card->area_id);
|
|
|
+
|
|
|
+ //deal_areas();
|
|
|
+ if(CT_VEHICLE == card->card_type){
|
|
|
+ deal_area_over_speed(card);
|
|
|
+ }
|
|
|
+ // 保存区域信息
|
|
|
+ store_data_card(card, HIS_AREA_LOCATION_ENTER);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
void CYAServerDlg::card_leave_area(std::shared_ptr<Card> card, std::shared_ptr<Area> area /*Card* card, Area* area*/)
|
|
|
{
|
|
|
// 从列表中删除
|
|
@@ -8994,6 +9213,9 @@ void CYAServerDlg::init_base_data()
|
|
|
init_section();
|
|
|
init_light_group();
|
|
|
//init_patrol_info();
|
|
|
+ init_landmark();
|
|
|
+ init_map_directory();
|
|
|
+ //TestLandmarkRequirement(); //test landmark
|
|
|
debug_print_syslog(0, "Base data init success.");
|
|
|
}
|
|
|
|
|
@@ -11948,9 +12170,13 @@ void CYAServerDlg::deal_card_lost_state()
|
|
|
int special_area_id = get_special_area_id(card);
|
|
|
if(-1 != special_area_id)
|
|
|
{
|
|
|
- card->pos_state = card->pos_state_old = PDT_UP;
|
|
|
- card->area_id = special_area_id;
|
|
|
-
|
|
|
+ AreaMap::iterator it = mp_area_list.find(card->area_id);
|
|
|
+ if(it != mp_area_list.end())
|
|
|
+ {
|
|
|
+ card_leave_area(card, it->second);
|
|
|
+ store_data_card(card, HIS_AREA_LOCATION_LEAVE);
|
|
|
+ }
|
|
|
+ card_enter_special_area(card, special_area_id);
|
|
|
send_json_data(JSON_CMD_VALUE_PUSH, get_json_special_area_process(card));
|
|
|
debug_print_syslog(0, "lost state, moving: %s", get_json_special_area_process(card).c_str());
|
|
|
}
|
|
@@ -11959,7 +12185,7 @@ void CYAServerDlg::deal_card_lost_state()
|
|
|
AreaMap::iterator it = mp_area_list.find(card->area_id);
|
|
|
if (it != mp_area_list.end())
|
|
|
{
|
|
|
- card_leave_area(card,it->second);
|
|
|
+ card_leave_area(card, it->second);
|
|
|
}
|
|
|
|
|
|
card_enter_mine(card, POS_DEVICE_TYPE::PDT_UP);
|
|
@@ -12388,7 +12614,6 @@ bool CYAServerDlg::IsInLine( _point p1, _point p2, _point p3 )
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
void CYAServerDlg::OnBnClickedButton1()
|
|
|
{
|
|
|
list<std::shared_ptr<POS>> his_pos;
|
|
@@ -12465,4 +12690,249 @@ void CYAServerDlg::OnBnClickedButton1()
|
|
|
}
|
|
|
|
|
|
ReadFileTest();
|
|
|
+}
|
|
|
+double CYAServerDlg::GetDistance(_point p1, _point p2)
|
|
|
+{
|
|
|
+ double distance = 0.0;
|
|
|
+ distance = sqrt(pow(p1.x - p2.x, 2)
|
|
|
+ + pow(p1.y - p2.y, 2));
|
|
|
+ return distance;
|
|
|
+}
|
|
|
+
|
|
|
+int CYAServerDlg::GetLandmarkID(_point card_point)
|
|
|
+{
|
|
|
+ int minLandmarkID = -1;
|
|
|
+ double minDistance = 100000;
|
|
|
+ std::shared_ptr<LandmarkInfo> pLandmarkInfo = nullptr;
|
|
|
+ int nRow = 0;
|
|
|
+ LandmarkInfoMap::iterator it = mp_landmark_list.begin();
|
|
|
+ while(it != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ pLandmarkInfo = it->second;
|
|
|
+ _point landmark_position = {pLandmarkInfo->x,
|
|
|
+ pLandmarkInfo->y,
|
|
|
+ pLandmarkInfo->z};
|
|
|
+ _point card_position = {card_point.x,
|
|
|
+ card_point.y,
|
|
|
+ card_point.z};
|
|
|
+ double distance = 0.0;
|
|
|
+ distance = GetDistance(landmark_position, card_position);
|
|
|
+ if(distance < minDistance)
|
|
|
+ {
|
|
|
+ minDistance = distance;
|
|
|
+ minLandmarkID = pLandmarkInfo->landmark_id;
|
|
|
+ }
|
|
|
+ it++;
|
|
|
+ }
|
|
|
+ return minLandmarkID;
|
|
|
+}
|
|
|
+
|
|
|
+DIRECTORY_TYPE CYAServerDlg::GetDirectoryType(_point card_point, _point landmark_point, int map_id)
|
|
|
+{
|
|
|
+ DIRECTORY_TYPE directory = NODIRECTORY;
|
|
|
+ int x_offset = 0;
|
|
|
+ int y_offset = 0;
|
|
|
+ int angle = 0; // x,y坐标系与地理北极的角度
|
|
|
+ x_offset = card_point.x - landmark_point.x;
|
|
|
+ y_offset = card_point.y - landmark_point.y;
|
|
|
+
|
|
|
+
|
|
|
+ if(abs(x_offset) < 1)
|
|
|
+ {
|
|
|
+ x_offset = 0;
|
|
|
+ }
|
|
|
+ if(abs(y_offset) < 1)
|
|
|
+ {
|
|
|
+ y_offset = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ std::shared_ptr<MapDirectoryInfo> pMapDirectoryInfo = nullptr;
|
|
|
+ MapDirectoryInfoMap::iterator it = mp_map_directory_list.find(map_id);
|
|
|
+ if(it == mp_map_directory_list.end())
|
|
|
+ {
|
|
|
+ return NODIRECTORY;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ pMapDirectoryInfo = it->second;
|
|
|
+ }
|
|
|
+
|
|
|
+ //get direction
|
|
|
+ if(0 == y_offset)
|
|
|
+ {
|
|
|
+ if(x_offset > 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle + 0;
|
|
|
+ }
|
|
|
+ if(x_offset < 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle - 180;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(0 == x_offset)
|
|
|
+ {
|
|
|
+ if(y_offset > 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle - 90;
|
|
|
+ }
|
|
|
+ if(y_offset < 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle + 90;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(abs(x_offset) >= abs(y_offset))
|
|
|
+ {
|
|
|
+ if(x_offset > 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle + 0;
|
|
|
+ }
|
|
|
+ if(x_offset < 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle - 180;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(y_offset > 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle - 90;
|
|
|
+ }
|
|
|
+ if(y_offset < 0)
|
|
|
+ {
|
|
|
+ angle = pMapDirectoryInfo->north_angle + 90;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ directory = (DIRECTORY_TYPE)((angle % 360) / 90);
|
|
|
+ if(angle % 360 == 0)
|
|
|
+ {
|
|
|
+ directory = NORTH;
|
|
|
+ }
|
|
|
+ if((0 == y_offset) && (0 == x_offset))
|
|
|
+ {
|
|
|
+ directory = NODIRECTORY;
|
|
|
+ }
|
|
|
+ return directory;
|
|
|
+}
|
|
|
+
|
|
|
+void CYAServerDlg::TestLandmarkRequirement()
|
|
|
+{
|
|
|
+ _point card_point = {0};
|
|
|
+ _point landmark_point = {0};
|
|
|
+ int directory_id = 0;
|
|
|
+ int landmark_id = 0;
|
|
|
+ LandmarkInfoMap::iterator itLandmark = mp_landmark_list.begin();
|
|
|
+
|
|
|
+ //test 1
|
|
|
+ card_point.x = 4727;
|
|
|
+ card_point.y = 90;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+
|
|
|
+ //test 2
|
|
|
+ card_point.x = 4727;
|
|
|
+ card_point.y = 70;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+
|
|
|
+ //test 3
|
|
|
+ card_point.x = 4727;
|
|
|
+ card_point.y = 80;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+
|
|
|
+ //test 4
|
|
|
+ card_point.x = 4727;
|
|
|
+ card_point.y = 82.5;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+
|
|
|
+ //test 5
|
|
|
+ card_point.x = 3200;
|
|
|
+ card_point.y = 75;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+
|
|
|
+ //test 6
|
|
|
+ card_point.x = 3400;
|
|
|
+ card_point.y = 75;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+
|
|
|
+ //test 7
|
|
|
+ card_point.x = 5200;
|
|
|
+ card_point.y = 250;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+
|
|
|
+ //test 8
|
|
|
+ card_point.x = 5400;
|
|
|
+ card_point.y = 300;
|
|
|
+ card_point.z = 0;
|
|
|
+ landmark_id = GetLandmarkID(card_point);
|
|
|
+ itLandmark = mp_landmark_list.find(landmark_id);
|
|
|
+ if(itLandmark != mp_landmark_list.end())
|
|
|
+ {
|
|
|
+ landmark_point.x = itLandmark->second->x;
|
|
|
+ landmark_point.y = itLandmark->second->y;
|
|
|
+ landmark_point.z = itLandmark->second->z;
|
|
|
+ }
|
|
|
+ directory_id = GetDirectoryType(card_point, landmark_point, 5);
|
|
|
+ return;
|
|
|
}
|