|
@@ -2472,6 +2472,8 @@ bool OpenDriveXmlWriter::WriteJunction (TiXmlElement *node, Junction *junction)
|
|
|
|
|
|
WriteJunctionelevationGrid(nodeJunction,junction);
|
|
|
|
|
|
+ WriteJunctionsurface(nodeJunction,junction);
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
//--------------
|
|
@@ -2971,6 +2973,80 @@ bool OpenDriveXmlWriter::WriteJunctionelevationGridelevation(TiXmlElement *node,
|
|
|
}
|
|
|
|
|
|
|
|
|
+bool OpenDriveXmlWriter::WriteJunctionsurface(TiXmlElement *node, Junction *junction)
|
|
|
+{
|
|
|
+ Junctionsurface surface;
|
|
|
+ int nsurface = junction->GetJunctionSurface(surface);
|
|
|
+
|
|
|
+ if(nsurface == 0)return false;
|
|
|
+
|
|
|
+ TiXmlElement *nodeJunctionsurface = new TiXmlElement("surface");
|
|
|
+
|
|
|
+ node->LinkEndChild(nodeJunctionsurface);
|
|
|
+
|
|
|
+ WriteJunctionsurfaceCRG(nodeJunctionsurface,&surface);
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+bool OpenDriveXmlWriter::WriteJunctionsurfaceCRG(TiXmlElement *node, Junctionsurface *junctionsurface)
|
|
|
+{
|
|
|
+ unsigned int surfaceCRGCount = junctionsurface->GetCRGCount();
|
|
|
+ for(unsigned int i=0;i<surfaceCRGCount;i++)
|
|
|
+ {
|
|
|
+ TiXmlElement * nodeSurfaceCRG = new TiXmlElement("CRG");
|
|
|
+ node->LinkEndChild(nodeSurfaceCRG);
|
|
|
+
|
|
|
+ Junctionsurface_CRG * psurfaceCRG = junctionsurface->GetCRG(i);
|
|
|
+
|
|
|
+ nodeSurfaceCRG->SetAttribute("file",psurfaceCRG->Getfile());
|
|
|
+ nodeSurfaceCRG->SetDoubleAttribute("sStart",psurfaceCRG->GetsStart());
|
|
|
+ nodeSurfaceCRG->SetDoubleAttribute("sEnd",psurfaceCRG->GetsEnd());
|
|
|
+ nodeSurfaceCRG->SetAttribute("orientation",psurfaceCRG->Getorientation());
|
|
|
+ nodeSurfaceCRG->SetAttribute("mode",psurfaceCRG->Getmode());
|
|
|
+
|
|
|
+ std::string purpose;
|
|
|
+ if(psurfaceCRG->Getpurpose(purpose) == 1)
|
|
|
+ {
|
|
|
+ nodeSurfaceCRG->SetAttribute("purpose",purpose);
|
|
|
+ }
|
|
|
+
|
|
|
+ double sOffset,tOffset,zOffset,zScale,hOffset;
|
|
|
+ if(psurfaceCRG->GetsOffset(sOffset) == 1)
|
|
|
+ {
|
|
|
+ nodeSurfaceCRG->SetDoubleAttribute("sOffset",sOffset);
|
|
|
+ }
|
|
|
+ if(psurfaceCRG->GettOffset(tOffset) == 1)
|
|
|
+ {
|
|
|
+ nodeSurfaceCRG->SetDoubleAttribute("tOffset",tOffset);
|
|
|
+ }
|
|
|
+ if(psurfaceCRG->GetzOffset(zOffset) == 1)
|
|
|
+ {
|
|
|
+ nodeSurfaceCRG->SetDoubleAttribute("zOffset",zOffset);
|
|
|
+ }
|
|
|
+ if(psurfaceCRG->GetzScale(zScale) == 1)
|
|
|
+ {
|
|
|
+ nodeSurfaceCRG->SetDoubleAttribute("zScale",zScale);
|
|
|
+ }
|
|
|
+ if(psurfaceCRG->GethOffset(hOffset) == 1)
|
|
|
+ {
|
|
|
+ nodeSurfaceCRG->SetDoubleAttribute("hOffset",hOffset);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+bool OpenDriveXmlWriter::WriteJunctionGroup(TiXmlElement *node, JunctionGroup *junctionGroup)
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+bool OpenDriveXmlWriter::WriteJunctionGroupReference(TiXmlElement *node, JunctionGroupReference *junctionGroupReference)
|
|
|
+{
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
|
/**
|
|
@@ -3017,4 +3093,7 @@ bool OpenDriveXmlWriter::WriteFile(std::string fileName)
|
|
|
// return true;
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//--------------
|