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(BRepBuilderAPI_MakeShape * theMkShape)
9 { myBuilder = theMkShape;}
11 const boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
13 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
15 aShape->setImpl(new TopoDS_Shape(myBuilder->Shape()));
19 /// Returns the list of shapes generated from the shape <theShape>
20 const ListOfShape& GeomAlgoAPI_MakeShape::generated(const boost::shared_ptr<GeomAPI_Shape> theShape)
23 if(myBuilder != NULL) {
24 const TopTools_ListOfShape& aList = myBuilder->Generated(theShape->impl<TopoDS_Shape>());
25 TopTools_ListIteratorOfListOfShape it(aList);
26 for(;it.More();it.Next()) {
27 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
28 aShape->setImpl(&(it.Value()));
29 myHistory.push_back(aShape);
35 /// Returns the list of shapes modified from the shape <theShape>
36 const ListOfShape& GeomAlgoAPI_MakeShape::modified(const boost::shared_ptr<GeomAPI_Shape> theShape)
39 if(myBuilder != NULL) {
40 const TopTools_ListOfShape& aList = myBuilder->Modified(theShape->impl<TopoDS_Shape>());
41 TopTools_ListIteratorOfListOfShape it(aList);
42 for(;it.More();it.Next()) {
43 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
44 aShape->setImpl(&(it.Value()));
45 myHistory.push_back(aShape);
51 /// Returns whether the shape is an edge
52 bool GeomAlgoAPI_MakeShape::isDeleted(const boost::shared_ptr<GeomAPI_Shape> theShape)
54 bool isDeleted(false);
55 if (myBuilder != NULL)
56 isDeleted = (bool) myBuilder->IsDeleted(theShape->impl<TopoDS_Shape>());