1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_MakeShape.cpp
4 // Created: 20 Oct 2014
5 // Author: Sergey ZARITCHNY
7 #include <GeomAlgoAPI_MakeShape.h>
8 #include <BRepBuilderAPI_MakeShape.hxx>
9 #include <TopTools_ListOfShape.hxx>
10 #include <TopTools_ListIteratorOfListOfShape.hxx>
11 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape(void* theMkShape)
12 : GeomAPI_Interface(theMkShape),myShape(new GeomAPI_Shape())
14 myShape->setImpl((void *)&implPtr<BRepBuilderAPI_MakeShape>()->Shape());
17 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
18 : GeomAPI_Interface(),myShape(new GeomAPI_Shape())
20 void GeomAlgoAPI_MakeShape::init(void* theMkShape)
22 setImpl((void *)implPtr<BRepBuilderAPI_MakeShape>());
25 const std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
30 void GeomAlgoAPI_MakeShape::generated(
31 const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
33 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
35 const TopTools_ListOfShape& aList = aBuilder->Generated(theShape->impl<TopoDS_Shape>());
36 TopTools_ListIteratorOfListOfShape it(aList);
37 for(;it.More();it.Next()) {
38 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
39 aShape->setImpl(new TopoDS_Shape(it.Value()));
40 theHistory.push_back(aShape);
45 void GeomAlgoAPI_MakeShape::modified(
46 const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
48 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
50 const TopTools_ListOfShape& aList = aBuilder->Modified(theShape->impl<TopoDS_Shape>());
51 TopTools_ListIteratorOfListOfShape it(aList);
52 for(;it.More();it.Next()) {
53 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
54 aShape->setImpl(new TopoDS_Shape(it.Value()));
55 theHistory.push_back(aShape);
60 bool GeomAlgoAPI_MakeShape::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
62 bool isDeleted(false);
63 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
65 isDeleted = aBuilder->IsDeleted(theShape->impl<TopoDS_Shape>()) == Standard_True;