1 // File: GeomAlgoAPI_CompoundBuilder.cpp
2 // Created: 24 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #include <GeomAlgoAPI_CompoundBuilder.h>
6 //#include <gp_Pln.hxx>
7 //#include <BRepBuilderAPI_MakeFace.hxx>
8 //#include <TopoDS_Face.hxx>
9 #include <BRep_Builder.hxx>
10 #include <TopoDS_Compound.hxx>
12 boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_CompoundBuilder::compound(
13 std::list<boost::shared_ptr<GeomAPI_Shape> > theShapes)
15 BRep_Builder aBuilder;
16 TopoDS_Compound aComp;
17 aBuilder.MakeCompound(aComp);
19 std::list<boost::shared_ptr<GeomAPI_Shape> >::const_iterator anIt = theShapes.begin(), aLast =
21 for (; anIt != aLast; anIt++) {
22 aBuilder.Add(aComp, (*anIt)->impl<TopoDS_Shape>());
25 boost::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
26 aRes->setImpl(new TopoDS_Shape(aComp));