backport to occt < 6.9

This commit is contained in:
wmayer
2018-06-10 21:57:25 +02:00
parent 9eaafad8a0
commit 9bc9ebed21
3 changed files with 17 additions and 6 deletions

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <BRepAlgoAPI_Section.hxx>
# include <Standard_Version.hxx>
#endif
#include "FeaturePartSection.h"
@@ -47,10 +48,12 @@ short Section::mustExecute() const
return 0;
}
BRepAlgoAPI_BooleanOperation *Section::makeOperation(const TopoDS_Shape& base, const TopoDS_Shape& tool) const
BRepAlgoAPI_BooleanOperation* Section::makeOperation(const TopoDS_Shape& base, const TopoDS_Shape& tool) const
{
// Let's call algorithm computing a section operation:
// return new BRepAlgoAPI_Section(base, tool);
#if OCC_VERSION_HEX < 0x060900
return new BRepAlgoAPI_Section(base, tool);
#else
bool approx = Approximation.getValue();
BRepAlgoAPI_Section* mkSection = new BRepAlgoAPI_Section();
mkSection->Init1(base);
@@ -60,4 +63,5 @@ BRepAlgoAPI_BooleanOperation *Section::makeOperation(const TopoDS_Shape& base, c
if (!mkSection->IsDone())
throw Base::RuntimeError("Section failed");
return mkSection;
#endif
}