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 //=============================================================================
17 bool SetShapeToXAO(const std::shared_ptr<GeomAPI_Shape>& theShape,
19 std::string& theError)
21 if (!theShape.get() || !theXao) {
22 theError = "An invalid argument.";
26 TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
28 XAO::BrepGeometry* aGeometry = new XAO::BrepGeometry;
29 theXao->setGeometry(aGeometry);
30 aGeometry->setTopoDS_Shape(aShape);
31 } catch (XAO::XAO_Exception& e) {
38 //=============================================================================
42 //=============================================================================
43 bool XAOExport(const std::string& theFileName,
45 std::string& theError)
48 std::cout << "Export XAO into file " << theFileName << std::endl;
51 if (theFileName.empty() || !theXao) {
52 theError = "An invalid argument.";
57 XAO::XaoExporter::saveToFile(theXao, theFileName);
58 } catch (XAO::XAO_Exception& e) {