1 // File: GeomAlgoAPI_MakeShape.cpp
2 // Created: 20 Oct 2014
3 // Author: Sergey ZARITCHNY
5 #include <GeomAlgoAPI_MakeShape.h>
6 #include <TopTools_ListOfShape.hxx>
7 #include <TopTools_ListIteratorOfListOfShape.hxx>
8 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape(void* theMkShape)
9 : GeomAPI_Interface(theMkShape)
12 const boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
17 /// Returns the list of shapes generated from the shape <theShape>
18 void GeomAlgoAPI_MakeShape::generated(
19 const boost::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
21 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
23 const TopTools_ListOfShape& aList = aBuilder->Generated(theShape->impl<TopoDS_Shape>());
24 TopTools_ListIteratorOfListOfShape it(aList);
25 for(;it.More();it.Next()) {
26 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
27 aShape->setImpl(&(it.Value()));
28 theHistory.push_back(aShape);
33 /// Returns the list of shapes modified from the shape <theShape>
34 void GeomAlgoAPI_MakeShape::modified(
35 const boost::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
37 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
39 const TopTools_ListOfShape& aList = aBuilder->Modified(theShape->impl<TopoDS_Shape>());
40 TopTools_ListIteratorOfListOfShape it(aList);
41 for(;it.More();it.Next()) {
42 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
43 aShape->setImpl(&(it.Value()));
44 theHistory.push_back(aShape);
49 /// Returns whether the shape is an edge
50 bool GeomAlgoAPI_MakeShape::isDeleted(const boost::shared_ptr<GeomAPI_Shape> theShape)
52 bool isDeleted(false);
53 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
55 isDeleted = aBuilder->IsDeleted(theShape->impl<TopoDS_Shape>()) == Standard_True;