X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXAO%2FXAO_BrepGeometry.cxx;h=f59edc305ecf375b2fed54ce5c62571c59669e33;hb=b4c1887ab3b6b5a3385ce716bfea4745a0020d7c;hp=aea67b6e66881828dff2a0b4e33e9b27bee2ccf1;hpb=7d880c6a8262b6d670ed70ee2b9ec25c199a46d4;p=modules%2Fgeom.git diff --git a/src/XAO/XAO_BrepGeometry.cxx b/src/XAO/XAO_BrepGeometry.cxx index aea67b6e6..f59edc305 100644 --- a/src/XAO/XAO_BrepGeometry.cxx +++ b/src/XAO/XAO_BrepGeometry.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -65,6 +65,25 @@ void BrepGeometry::setShapeString(const std::string& shape) initIds(); } +void BrepGeometry::writeShapeFile(const std::string& fileName) +throw (XAO_Exception) +{ + bool res = BRepTools::Write(m_shape, fileName.c_str()); + if (!res) + throw XAO_Exception(MsgBuilder() << "Cannot write BRep file: " << fileName); +} + +void BrepGeometry::readShapeFile(const std::string& fileName) +throw (XAO_Exception) + { + BRep_Builder builder; + bool res = BRepTools::Read(m_shape, fileName.c_str(), builder); + if (!res) + throw XAO_Exception(MsgBuilder() << "Cannot read BRep file: " << fileName); + + initIds(); +} + TopoDS_Shape BrepGeometry::getTopoDS_Shape() { return m_shape; @@ -78,7 +97,7 @@ void BrepGeometry::setTopoDS_Shape(const TopoDS_Shape& shape) void BrepGeometry::initIds() { - // intialization of Ids + // initialization of Ids initListIds(TopAbs_VERTEX, m_vertices); initListIds(TopAbs_EDGE, m_edges); initListIds(TopAbs_FACE, m_faces);