1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Copy.cpp
4 // Created: 06 Sept 2016
5 // Author: Dmitry Bobylev
7 #include "GeomAlgoAPI_Copy.h"
10 #include <BRepBuilderAPI_Copy.hxx>
12 //=================================================================================================
13 GeomAlgoAPI_Copy::GeomAlgoAPI_Copy(const std::shared_ptr<GeomAPI_Shape> theShape,
14 const bool theCopyGeom,
15 const bool theCopyMesh)
17 build(theShape, theCopyGeom, theCopyMesh);
21 //=================================================================================================
22 void GeomAlgoAPI_Copy::build(const std::shared_ptr<GeomAPI_Shape> theShape,
23 const bool theCopyGeom,
24 const bool theCopyMesh)
31 const TopoDS_Shape& aBaseShape = theShape->impl<TopoDS_Shape>();
34 BRepBuilderAPI_Copy* aBuilder = new BRepBuilderAPI_Copy(aBaseShape, theCopyGeom, theCopyMesh);
35 this->setImpl(aBuilder);
36 this->setBuilderType(OCCT_BRepBuilderAPI_MakeShape);
38 TopoDS_Shape aResult = aBuilder->Shape();
40 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
41 aShape->setImpl(new TopoDS_Shape(aResult));
42 this->setShape(aShape);