- std::string txtShape = xaoGeometry->getShapeString();
- xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), txtShape.size());
- xmlAddChild(shape, cdata);
+
+ if (shapeFileName == "")
+ {
+ // export the shape in the XAO file
+ std::string txtShape = xaoGeometry->getShapeString();
+ xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), txtShape.size());
+ xmlAddChild(shape, cdata);
+ }
+ else
+ {
+ // export the shape in an external file
+ xmlNewProp(shape, C_ATTR_SHAPE_FILE, BAD_CAST shapeFileName.c_str());
+ xaoGeometry->writeShapeFile(shapeFileName);
+ }