]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAlgoAPI/GeomAlgoAPI_CompoundBuilder.cpp
Salome HOME
Merge branch 'Dev_1.5.0' of salome:modules/shaper into Dev_1.5.0
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_CompoundBuilder.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAlgoAPI_CompoundBuilder.cpp
4 // Created:     24 Apr 2014
5 // Author:      Natalia ERMOLAEVA
6
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>
13
14 std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_CompoundBuilder::compound(
15     std::list<std::shared_ptr<GeomAPI_Shape> > theShapes)
16 {
17   BRep_Builder aBuilder;
18   TopoDS_Compound aComp;
19   aBuilder.MakeCompound(aComp);
20
21   std::list<std::shared_ptr<GeomAPI_Shape> >::const_iterator anIt = theShapes.begin(), aLast =
22       theShapes.end();
23   for (; anIt != aLast; anIt++) {
24     aBuilder.Add(aComp, (*anIt)->impl<TopoDS_Shape>());
25   }
26
27   std::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
28   aRes->setImpl(new TopoDS_Shape(aComp));
29   return aRes;
30 }