-// 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
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;
void BrepGeometry::initIds()
{
- // intialization of Ids
+ // initialization of Ids
initListIds(TopAbs_VERTEX, m_vertices);
initListIds(TopAbs_EDGE, m_edges);
initListIds(TopAbs_FACE, m_faces);