RORouteDef* RORouteDef::copyOrigDest(const std::string& id) const { RORouteDef* result = new RORouteDef(id, 0, true, true); RORoute* route = myAlternatives[0]; RGBColor* col = route->getColor() != 0 ? new RGBColor(*route->getColor()) : 0; ConstROEdgeVector edges; edges.push_back(route->getFirst()); edges.push_back(route->getLast()); result->addLoadedAlternative(new RORoute(id, 0, 1, edges, col, route->getStops())); return result; }
RORouteDef* RORouteDef::copy(const std::string& id, const SUMOTime stopOffset) const { RORouteDef* result = new RORouteDef(id, 0, myTryRepair, myMayBeDisconnected); for (std::vector<RORoute*>::const_iterator i = myAlternatives.begin(); i != myAlternatives.end(); i++) { RORoute* route = *i; RGBColor* col = route->getColor() != 0 ? new RGBColor(*route->getColor()) : 0; RORoute* newRoute = new RORoute(id, 0, 1, route->getEdgeVector(), col, route->getStops()); newRoute->addStopOffset(stopOffset); result->addLoadedAlternative(newRoute); } return result; }