Skip to content
Snippets Groups Projects
Commit 2ab3c4b0 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Added the link to the previous segment.

parent 3464ed41
No related branches found
No related tags found
No related merge requests found
......@@ -137,7 +137,6 @@ void COpendriveRoad::load(const std::string &filename)
// link segments
this->link_segments(*open_drive);
// process junctions
/*
for(OpenDRIVE::junction_iterator junction_it(open_drive->junction().begin());junction_it!=open_drive->junction().end();++junction_it)
{
for(junction::connection_iterator connection_it(junction_it->connection().begin()); connection_it!=junction_it->connection().end();++connection_it)
......@@ -182,7 +181,6 @@ void COpendriveRoad::load(const std::string &filename)
}
}
}
*/
}catch (const xml_schema::exception& e){
std::ostringstream os;
os << e;
......
......@@ -274,7 +274,11 @@ void COpendriveRoadSegment::link_segment(COpendriveRoadSegment &segment)
for(unsigned int i=0;i<this->next.size();i++)
if(this->next[i]->get_id()==segment.get_id())// the segment is already included
return;
for(unsigned int i=0;i<segment.prev.size();i++)
if(segment.prev[i]->get_id()==this->id)
return;
this->next.push_back(&segment);
segment.prev.push_back(this);
// link lanes
for(int i=-this->num_right_lanes;i<0;i++)
{
......@@ -313,7 +317,11 @@ void COpendriveRoadSegment::link_segment(COpendriveRoadSegment &segment,int from
for(unsigned int i=0;i<this->next.size();i++)
if(this->next[i]->get_id()==segment.get_id())// the segment is already included
return;
for(unsigned int i=0;i<segment.prev.size();i++)
if(segment.prev[i]->get_id()==this->id)
return;
this->next.push_back(&segment);
segment.prev.push_back(this);
// link lanes
if(this->lanes.find(from)!=this->lanes.end() && segment.lanes.find(to)!=segment.lanes.end())
this->lanes[from]->link_lane(segment.lanes[to],OD_MARK_NONE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment