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())
21 const std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
26 void GeomAlgoAPI_MakeShape::generated(
27 const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
29 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
31 const TopTools_ListOfShape& aList = aBuilder->Generated(theShape->impl<TopoDS_Shape>());
32 TopTools_ListIteratorOfListOfShape it(aList);
33 for(;it.More();it.Next()) {
34 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
35 aShape->setImpl(new TopoDS_Shape(it.Value()));
36 theHistory.push_back(aShape);
41 void GeomAlgoAPI_MakeShape::modified(
42 const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
44 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
46 const TopTools_ListOfShape& aList = aBuilder->Modified(theShape->impl<TopoDS_Shape>());
47 TopTools_ListIteratorOfListOfShape it(aList);
48 for(;it.More();it.Next()) {
49 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
50 aShape->setImpl(new TopoDS_Shape(it.Value()));
51 theHistory.push_back(aShape);
56 bool GeomAlgoAPI_MakeShape::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
58 bool isDeleted(false);
59 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
61 isDeleted = aBuilder->IsDeleted(theShape->impl<TopoDS_Shape>()) == Standard_True;