|
@@ -184,6 +184,12 @@ bool OpenDriveXmlWriter::WriteRoad(TiXmlElement *node, Road *road)
|
|
WriteRoadBorrows(nodeRoad,road);
|
|
WriteRoadBorrows(nodeRoad,road);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ int nPriority;
|
|
|
|
+ if(road->GetRoadPriority(nPriority) == 1)
|
|
|
|
+ {
|
|
|
|
+ WriteRoadPriority(nodeRoad,road);
|
|
|
|
+ }
|
|
|
|
+
|
|
if(road->GetRoadNoavoidCount()>0)
|
|
if(road->GetRoadNoavoidCount()>0)
|
|
{
|
|
{
|
|
WriteRoadNoavoids(nodeRoad,road);
|
|
WriteRoadNoavoids(nodeRoad,road);
|
|
@@ -223,7 +229,8 @@ bool OpenDriveXmlWriter::WriteRoadLinks (TiXmlElement *node, Road* road)
|
|
nodeLink->LinkEndChild(nodeLinkPredecessor);
|
|
nodeLink->LinkEndChild(nodeLinkPredecessor);
|
|
nodeLinkPredecessor->SetAttribute("elementType", lPredecessor->GetElementType());
|
|
nodeLinkPredecessor->SetAttribute("elementType", lPredecessor->GetElementType());
|
|
nodeLinkPredecessor->SetAttribute("elementId", lPredecessor->GetElementId());
|
|
nodeLinkPredecessor->SetAttribute("elementId", lPredecessor->GetElementId());
|
|
- nodeLinkPredecessor->SetAttribute("contactPoint", lPredecessor->GetContactPoint());
|
|
|
|
|
|
+ if(lPredecessor->GetContactPoint() != "NA")
|
|
|
|
+ nodeLinkPredecessor->SetAttribute("contactPoint", lPredecessor->GetContactPoint());
|
|
if(lPredecessor->GetElementS()>=0)
|
|
if(lPredecessor->GetElementS()>=0)
|
|
{
|
|
{
|
|
std::stringstream ss;
|
|
std::stringstream ss;
|
|
@@ -242,7 +249,8 @@ bool OpenDriveXmlWriter::WriteRoadLinks (TiXmlElement *node, Road* road)
|
|
nodeLink->LinkEndChild(nodeLinkSuccessor);
|
|
nodeLink->LinkEndChild(nodeLinkSuccessor);
|
|
nodeLinkSuccessor->SetAttribute("elementType", lSuccessor->GetElementType());
|
|
nodeLinkSuccessor->SetAttribute("elementType", lSuccessor->GetElementType());
|
|
nodeLinkSuccessor->SetAttribute("elementId", lSuccessor->GetElementId());
|
|
nodeLinkSuccessor->SetAttribute("elementId", lSuccessor->GetElementId());
|
|
- nodeLinkSuccessor->SetAttribute("contactPoint", lSuccessor->GetContactPoint());
|
|
|
|
|
|
+ if(lSuccessor->GetContactPoint() != "NA")
|
|
|
|
+ nodeLinkSuccessor->SetAttribute("contactPoint", lSuccessor->GetContactPoint());
|
|
if(lSuccessor->GetElementS()>=0)
|
|
if(lSuccessor->GetElementS()>=0)
|
|
{
|
|
{
|
|
std::stringstream ss;
|
|
std::stringstream ss;
|
|
@@ -1875,6 +1883,28 @@ bool OpenDriveXmlWriter::WriteObjectOutlinesOutlinecornerLocal(TiXmlElement *nod
|
|
|
|
|
|
//--------------
|
|
//--------------
|
|
|
|
|
|
|
|
+
|
|
|
|
+bool OpenDriveXmlWriter::WriteRoadPriority(TiXmlElement * node,Road * road)
|
|
|
|
+{
|
|
|
|
+ TiXmlElement* nodeRoadPriority = new TiXmlElement("userData");
|
|
|
|
+ nodeRoadPriority->SetAttribute("code","roadPriority");
|
|
|
|
+ node->LinkEndChild(nodeRoadPriority);
|
|
|
|
+
|
|
|
|
+ int nPriority;
|
|
|
|
+ if(road->GetRoadPriority(nPriority) == 1)
|
|
|
|
+ {
|
|
|
|
+ TiXmlElement* nodeRoadPV = new TiXmlElement("roadPriority");
|
|
|
|
+ nodeRoadPriority->LinkEndChild(nodeRoadPV);
|
|
|
|
+
|
|
|
|
+ nodeRoadPV->SetAttribute("Priority",nPriority);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return true;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//--------------
|
|
|
|
+
|
|
bool OpenDriveXmlWriter::WriteRoadBorrow(TiXmlElement *node, RoadBorrow *pRoadBorrow)
|
|
bool OpenDriveXmlWriter::WriteRoadBorrow(TiXmlElement *node, RoadBorrow *pRoadBorrow)
|
|
{
|
|
{
|
|
TiXmlElement* nodeRoadBorrow = new TiXmlElement("roadborrow");
|
|
TiXmlElement* nodeRoadBorrow = new TiXmlElement("roadborrow");
|