]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAlgoAPI/GeomAlgoAPI_Boolean.cpp
Salome HOME
Create Boolean operations
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Boolean.cpp
1 // File:        GeomAlgoAPI_Boolean.cpp
2 // Created:     02 Sept 2014
3 // Author:      Vitaly Smetannikov
4
5 #include "GeomAlgoAPI_Boolean.h"
6
7 #include <BRepAlgoAPI_Cut.hxx>
8
9
10 boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_Boolean::makeCut(
11   boost::shared_ptr<GeomAPI_Shape> theShape,
12   boost::shared_ptr<GeomAPI_Shape> theTool)
13 {
14   const TopoDS_Shape& aShape = theShape->impl<TopoDS_Shape>();
15   const TopoDS_Shape& aTool = theTool->impl<TopoDS_Shape>();
16
17   BRepAlgoAPI_Cut aCut(aShape, aTool);
18   if (aCut.IsDone()) {
19     boost::shared_ptr<GeomAPI_Shape> aResult(new GeomAPI_Shape());
20     aResult->setImpl(new TopoDS_Shape(aCut.Shape()));
21     return aResult;
22   }
23   return boost::shared_ptr<GeomAPI_Shape>();
24 }