]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Save in export to XAO BRep with free top level shape.
authormpv <mpv@opencascade.com>
Mon, 16 Sep 2019 12:16:31 +0000 (15:16 +0300)
committermpv <mpv@opencascade.com>
Mon, 16 Sep 2019 12:16:31 +0000 (15:16 +0300)
src/GeomAlgoAPI/GeomAlgoAPI_XAOExport.cpp

index 22abe96f8768d12b2911a9d1c20898b3760b75f0..9f0983fe25e56aa9f236d88d5aa421f96548ed34 100644 (file)
@@ -67,7 +67,14 @@ bool XAOExport(const std::string& theFileName,
   }
 
   try {
+    XAO::BrepGeometry* aGeometry = dynamic_cast<XAO::BrepGeometry*>(theXao->getGeometry());
+    TopoDS_Shape aShape = aGeometry->getTopoDS_Shape();
+    bool aWasFree = aShape.Free(); // make top level topology free, same as imported
+    if (!aWasFree)
+      aShape.Free(Standard_True);
     XAO::XaoExporter::saveToFile(theXao, theFileName, "");
+    if (!aWasFree)
+      aShape.Free(Standard_False);
   } catch (XAO::XAO_Exception& e) {
     theError = e.what();
     return false;