1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GEOMALGOAPI_XAOExport.cpp
4 // Created: Nov 27, 2015
5 // Author: Sergey POKHODENKO
7 #include <GeomAlgoAPI_XAOExport.h>
9 #include "GeomAlgoAPI_Tools.h"
11 #include <TopoDS_Shape.hxx>
13 #include <XAO_XaoExporter.hxx>
14 #include <XAO_BrepGeometry.hxx>
16 //=============================================================================
20 //=============================================================================
21 bool XAOExport(const std::string& theFileName,
22 const std::shared_ptr<GeomAPI_Shape>& theShape,
24 std::string& theError)
27 std::cout << "Export XAO into file " << theFileName << std::endl;
30 if (theFileName.empty() || !theShape.get() || !theXao) {
31 theError = "An invalid argument.";
35 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
37 XAO::BrepGeometry* aGeometry = new XAO::BrepGeometry;
38 theXao->setGeometry(aGeometry);
39 aGeometry->setTopoDS_Shape(aShape);
40 XAO::XaoExporter::saveToFile(theXao, theFileName);
41 } catch (XAO::XAO_Exception& e) {