| 304 | } |
| 305 | |
| 306 | bool OpenDriveOutput::initFilePath(const char* filePath, bool replace) { |
| 307 | m_filePath = filePath; |
| 308 | if (replace) { |
| 309 | doc = new tinyxml2::XMLDocument(); |
| 310 | tinyxml2::XMLDeclaration* tinyXmlDelare = doc->NewDeclaration(); |
| 311 | tinyxml2::XMLElement* _opendrive_ele = doc->NewElement("OpenDRIVE"); |
| 312 | doc->InsertFirstChild(tinyXmlDelare); |
| 313 | doc->InsertEndChild(_opendrive_ele); |
| 314 | } else { |
| 315 | doc = new tinyxml2::XMLDocument(); |
| 316 | doc->LoadFile(m_filePath); |
| 317 | } |
| 318 | m_isInit = true; |
| 319 | return true; |
| 320 | } |
| 321 | |
| 322 | bool OpenDriveOutput::insertHeader(const hadmap::txPoint refPoint) { |
| 323 | tinyxml2::XMLElement* _header = doc->NewElement("header"); |