OrderedTaskPoint* OrderedTaskPoint::clone(const TaskBehaviour &task_behaviour, const OrderedTaskBehaviour &ordered_task_behaviour, const Waypoint* waypoint) const { if (waypoint == NULL) waypoint = &GetWaypoint(); switch (GetType()) { case START: return new StartPoint(GetOZPoint()->Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_behaviour); case AST: return new ASTPoint(GetOZPoint()->Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_behaviour); case AAT: return new AATPoint(GetOZPoint()->Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_behaviour); case FINISH: return new FinishPoint(GetOZPoint()->Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_behaviour, boundary_scored); case UNORDERED: case ROUTE: /* an OrderedTaskPoint must never be UNORDERED or ROUTE */ assert(false); break; } return NULL; }
bool OrderedTaskPoint::equals(const OrderedTaskPoint* other) const { return GetWaypoint() == other->GetWaypoint() && GetType() == other->GetType() && GetOZPoint()->Equals(*other->GetOZPoint()) && other->GetOZPoint()->Equals(*GetOZPoint()); }
bool OrderedTaskPoint::Equals(const OrderedTaskPoint &other) const { return GetWaypoint() == other.GetWaypoint() && GetType() == other.GetType() && GetObservationZone().Equals(other.GetObservationZone()) && other.GetObservationZone().Equals(GetObservationZone()); }
static void TestOzi(wp_vector org_wp) { Waypoints way_points; if (!TestWaypointFile(_T("test/data/waypoints_ozi.wpt"), way_points, org_wp.size())) { skip(3 * org_wp.size(), 0, "opening waypoint file failed"); return; } wp_vector::iterator it; for (it = org_wp.begin(); it < org_wp.end(); it++) { trim_inplace(it->name); GetWaypoint(*it, way_points); } }
static void TestSeeYou(wp_vector org_wp) { Waypoints way_points; if (!TestWaypointFile(_T("test/data/waypoints.cup"), way_points, org_wp.size())) { skip(9 * org_wp.size(), 0, "opening waypoint file failed"); return; } wp_vector::iterator it; for (it = org_wp.begin(); it < org_wp.end(); it++) { const Waypoint *wp = GetWaypoint(*it, way_points); TestSeeYouWaypoint(*it, wp); } }
static void TestFS_UTM(wp_vector org_wp) { Waypoints way_points; if (!TestWaypointFile(_T("test/data/waypoints_utm.wpt"), way_points, org_wp.size())) { skip(3 * org_wp.size(), 0, "opening waypoint file failed"); return; } wp_vector::iterator it; for (it = org_wp.begin(); it < org_wp.end(); it++) { if (it->name.length() > 8) it->name = it->name.erase(8); trim_inplace(it->name); GetWaypoint(*it, way_points); } }
static void TestZander(wp_vector org_wp) { Waypoints way_points; if (!TestWaypointFile(_T("test/data/waypoints.wpz"), way_points, org_wp.size())) { skip(10 * org_wp.size(), 0, "opening waypoint file failed"); return; } wp_vector::iterator it; for (it = org_wp.begin(); it < org_wp.end(); it++) { if (it->name.length() > 12) it->name = it->name.erase(12); trim_inplace(it->name); const Waypoint *wp = GetWaypoint(*it, way_points); TestZanderWaypoint(*it, wp); } }
OrderedTaskPoint * OrderedTaskPoint::Clone(const TaskBehaviour &task_behaviour, const OrderedTaskSettings &ordered_task_settings, const Waypoint *waypoint) const { if (waypoint == NULL) waypoint = &GetWaypoint(); switch (GetType()) { case TaskPointType::START: return new StartPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_settings.start_constraints); case TaskPointType::AST: { const ASTPoint &src = *(const ASTPoint *)this; ASTPoint *dest = new ASTPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour, IsBoundaryScored()); dest->SetScoreExit(src.GetScoreExit()); return dest; } case TaskPointType::AAT: return new AATPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour); case TaskPointType::FINISH: return new FinishPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_settings.finish_constraints, IsBoundaryScored()); case TaskPointType::UNORDERED: /* an OrderedTaskPoint must never be UNORDERED */ gcc_unreachable(); assert(false); break; } return NULL; }
static void TestCompeGPS_UTM(wp_vector org_wp) { Waypoints way_points; if (!TestWaypointFile(_T("test/data/waypoints_compe_utm.wpt"), way_points, org_wp.size())) { skip(3 * org_wp.size(), 0, "opening waypoint file failed"); return; } wp_vector::iterator it; for (it = org_wp.begin(); it < org_wp.end(); it++) { size_t pos; while ((pos = it->name.find_first_of(_T(' '))) != tstring::npos) it->name.erase(pos, 1); if (it->name.length() > 6) it->name = it->name.erase(6); trim_inplace(it->name); const Waypoint *wp = GetWaypoint(*it, way_points); ok1(wp->comment == it->comment); } }
OrderedTaskPoint* OrderedTaskPoint::Clone(const TaskBehaviour &task_behaviour, const OrderedTaskBehaviour &ordered_task_behaviour, const Waypoint* waypoint) const { if (waypoint == NULL) waypoint = &GetWaypoint(); switch (GetType()) { case TaskPointType::START: return new StartPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_behaviour.start_constraints); case TaskPointType::AST: return new ASTPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour, IsBoundaryScored()); case TaskPointType::AAT: return new AATPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour); case TaskPointType::FINISH: return new FinishPoint(GetObservationZone().Clone(waypoint->location), *waypoint, task_behaviour, ordered_task_behaviour.finish_constraints, IsBoundaryScored()); case TaskPointType::UNORDERED: /* an OrderedTaskPoint must never be UNORDERED */ assert(false); break; } return NULL; }