|
@@ -1344,6 +1344,18 @@ bool OpenDriveXmlParser::ReadObjectOutlinesOutline(Object_outlines * pObject_out
|
|
|
xoutline.SetlaneType(laneType);
|
|
|
}
|
|
|
|
|
|
+ TiXmlElement *subNode = node->FirstChildElement("cornerRoad");
|
|
|
+ if (subNode)
|
|
|
+ {
|
|
|
+ ReadObjectOutlinesOutlinecornerRoad(&xoutline, subNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ subNode = node->FirstChildElement("cornerLocal");
|
|
|
+ if (subNode)
|
|
|
+ {
|
|
|
+ ReadObjectOutlinesOutlinecornerRoad(&xoutline, subNode);
|
|
|
+ }
|
|
|
+
|
|
|
pObject_outlines->SetObject_outlines_outline(xoutline);
|
|
|
|
|
|
return true;
|
|
@@ -1409,7 +1421,90 @@ bool OpenDriveXmlParser::ReadObjectOutlinesOutline(Object * pObject,TiXmlElement
|
|
|
poutline->SetlaneType(laneType);
|
|
|
}
|
|
|
|
|
|
+ TiXmlElement *subNode = node->FirstChildElement("cornerRoad");
|
|
|
+ if (subNode)
|
|
|
+ {
|
|
|
+ ReadObjectOutlinesOutlinecornerRoad(poutline, subNode);
|
|
|
+ }
|
|
|
+
|
|
|
+ subNode = node->FirstChildElement("cornerLocal");
|
|
|
+ if (subNode)
|
|
|
+ {
|
|
|
+ ReadObjectOutlinesOutlinecornerRoad(poutline, subNode);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+//--------------
|
|
|
+
|
|
|
+bool OpenDriveXmlParser::ReadObjectOutlinesOutlinecornerRoad(Object_outlines_outline *pObject_outline, TiXmlElement *node)
|
|
|
+{
|
|
|
+ double s,t,dz,height;
|
|
|
+ int id;
|
|
|
+
|
|
|
+ int checker=TIXML_SUCCESS;
|
|
|
+ checker+=node->QueryDoubleAttribute("s",&s);
|
|
|
+ checker+=node->QueryDoubleAttribute("t",&t);
|
|
|
+ checker+=node->QueryDoubleAttribute("dz",&dz);
|
|
|
+ checker+=node->QueryDoubleAttribute("height",&height);
|
|
|
+
|
|
|
+ if (checker!=TIXML_SUCCESS)
|
|
|
+ {
|
|
|
+ cout<<"Error parsing Object outline cornerRoad attributes"<<endl;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
+ pObject_outline->AddcornerRoad(s,t,dz,height);
|
|
|
+
|
|
|
+ Object_outlines_outline_cornerRoad * pcornerRoad = pObject_outline->GetLastAddedcornerRoad();
|
|
|
+
|
|
|
+ if(pcornerRoad == NULL)
|
|
|
+ {
|
|
|
+ std::cout<<" OpenDriveXmlParser::ReadObjectOutlinesOutlinecornerRoad pcorenerRoad is NULL"<<std::endl;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(node->QueryIntAttribute("id",&id) == TIXML_SUCCESS)
|
|
|
+ {
|
|
|
+ pcornerRoad->Setid(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+bool OpenDriveXmlParser::ReadObjectOutlinesOutlinecornerLocal(Object_outlines_outline *pObject_outline, TiXmlElement *node)
|
|
|
+{
|
|
|
+ double u,v,z,height;
|
|
|
+ int id;
|
|
|
+
|
|
|
+ int checker=TIXML_SUCCESS;
|
|
|
+ checker+=node->QueryDoubleAttribute("u",&u);
|
|
|
+ checker+=node->QueryDoubleAttribute("v",&v);
|
|
|
+ checker+=node->QueryDoubleAttribute("zz",&z);
|
|
|
+ checker+=node->QueryDoubleAttribute("height",&height);
|
|
|
+
|
|
|
+ if (checker!=TIXML_SUCCESS)
|
|
|
+ {
|
|
|
+ cout<<"Error parsing Object outline cornerRoad attributes"<<endl;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ pObject_outline->AddcornerLocal(u,v,z,height);
|
|
|
+
|
|
|
+ Object_outlines_outline_cornerLocal * pcornerLocal = pObject_outline->GetLastAddedcornerLocal();
|
|
|
+
|
|
|
+ if(pcornerLocal == NULL)
|
|
|
+ {
|
|
|
+ std::cout<<" OpenDriveXmlParser::ReadObjectOutlinesOutlinecornerLocal pcornerLocal is NULL"<<std::endl;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(node->QueryIntAttribute("id",&id) == TIXML_SUCCESS)
|
|
|
+ {
|
|
|
+ pcornerLocal->Setid(id);
|
|
|
+ }
|
|
|
|
|
|
return true;
|
|
|
}
|