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