1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_CompoundBuilder.cpp
4 // Created: 24 Apr 2014
5 // Author: Natalia ERMOLAEVA
7 #include <GeomAlgoAPI_CompoundBuilder.h>
8 //#include <gp_Pln.hxx>
9 //#include <BRepBuilderAPI_MakeFace.hxx>
10 //#include <TopoDS_Face.hxx>
11 #include <BRep_Builder.hxx>
12 #include <TopoDS_Compound.hxx>
14 std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_CompoundBuilder::compound(
15 std::list<std::shared_ptr<GeomAPI_Shape> > theShapes)
17 BRep_Builder aBuilder;
18 TopoDS_Compound aComp;
19 aBuilder.MakeCompound(aComp);
21 std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator anIt = theShapes.begin(), aLast =
23 for (; anIt != aLast; anIt++) {
24 aBuilder.Add(aComp, (*anIt)->impl<TopoDS_Shape>());
27 std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
28 aRes->setImpl(new TopoDS_Shape(aComp));