1 // File: GeomAlgoAPI_MakeShape.cpp
2 // Created: 20 Oct 2014
3 // Author: Sergey ZARITCHNY
5 #include <GeomAlgoAPI_MakeShape.h>
6 #include <BRepBuilderAPI_MakeShape.hxx>
7 #include <TopTools_ListOfShape.hxx>
8 #include <TopTools_ListIteratorOfListOfShape.hxx>
9 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape(void* theMkShape)
10 : GeomAPI_Interface(theMkShape),myShape(new GeomAPI_Shape())
12 myShape->setImpl((void *)&implPtr<BRepBuilderAPI_MakeShape>()->Shape());
15 GeomAlgoAPI_MakeShape::GeomAlgoAPI_MakeShape()
16 : GeomAPI_Interface(),myShape(new GeomAPI_Shape())
18 void GeomAlgoAPI_MakeShape::init(void* theMkShape)
20 setImpl((void *)implPtr<BRepBuilderAPI_MakeShape>());
23 const boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShape::shape() const
28 /// Returns the list of shapes generated from the shape <theShape>
29 void GeomAlgoAPI_MakeShape::generated(
30 const boost::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory)
32 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
34 const TopTools_ListOfShape& aList = aBuilder->Generated(theShape->impl<TopoDS_Shape>());
35 TopTools_ListIteratorOfListOfShape it(aList);
36 for(;it.More();it.Next()) {
37 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
38 aShape->setImpl(new TopoDS_Shape(it.Value()));
39 theHistory.push_back(aShape);
44 /// Returns the list of shapes modified from the shape <theShape>
45 void GeomAlgoAPI_MakeShape::modified(
46 const boost::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 boost::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
54 aShape->setImpl(new TopoDS_Shape(it.Value()));
55 theHistory.push_back(aShape);
60 /// Returns whether the shape is an edge
61 bool GeomAlgoAPI_MakeShape::isDeleted(const boost::shared_ptr<GeomAPI_Shape> theShape)
63 bool isDeleted(false);
64 BRepBuilderAPI_MakeShape* aBuilder = implPtr<BRepBuilderAPI_MakeShape>();
66 isDeleted = aBuilder->IsDeleted(theShape->impl<TopoDS_Shape>()) == Standard_True;