//
#include <GeomAlgoAPI_STLImport.h>
+
#include "GeomAlgoAPI_Tools.h"
+
+#include <Basics_OCCTVersion.hxx>
+
+#include <TopoDS.hxx>
#include <TopoDS_Shape.hxx>
-#include <StlAPI_Reader.hxx>
#include <TopoDS_Shell.hxx>
-#include <TopoDS.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
+#include <BRepBuilderAPI_Sewing.hxx>
+#include <StlAPI_Reader.hxx>
std::shared_ptr<GeomAPI_Shape> STLImport(const std::string& theFileName,
std::string& theError)
theError = "Can't import file.";
aResShape.Nullify();
}
+#if OCC_VERSION_LARGE >= 0x07070000
+ BRepBuilderAPI_Sewing aSewingTool;
+ aSewingTool.Init(1.0e-06, Standard_True);
+ aSewingTool.Load(aResShape);
+ aSewingTool.Perform();
+ TopoDS_Shape aSewedShape = aSewingTool.SewedShape();
+ if (!aSewedShape.IsNull())
+ aResShape = aSewedShape;
+#endif
if(aResShape.ShapeType() == TopAbs_SHELL)
{
BRepBuilderAPI_MakeSolid soliMaker(TopoDS::Shell(aResShape));
//
#include <Model_ResultPart.h>
+
#include <ModelAPI_Data.h>
#include <Model_Data.h>
#include <ModelAPI_AttributeDocRef.h>
#include <BRep_Builder.hxx>
#include <TopExp_Explorer.hxx>
+#include <Basics_OCCTVersion.hxx>
+
#define baseRef() \
std::dynamic_pointer_cast<Model_ResultPart>(data()->reference(BASE_REF_ID())->value())
// just update the location of the shape in case of affine transformation
TopoDS_Shape aShape = theShape->impl<TopoDS_Shape>();
if (!aShape.IsNull()) {
+#if OCC_VERSION_LARGE < 0x07070000
aShape.Move(theTrsf);
+#else
+ aShape.Move(theTrsf, Standard_False);
+#endif
aResult->setImpl(new TopoDS_Shape(aShape));
}
}
TopExp_Explorer anExp(anOrigMain, aSelection.ShapeType());
for(; anExp.More(); anExp.Next()) {
if (anExp.Current().IsPartner(aSelection)) {
+#if OCC_VERSION_LARGE < 0x07070000
TopoDS_Shape anOrigMoved = anExp.Current().Moved(*(myTrsf.get()));
+#else
+ TopoDS_Shape anOrigMoved = anExp.Current().Moved(*(myTrsf.get()), Standard_False);
+#endif
//if (anOrigMoved.IsSame(aSelection)) {
if (IsEqualTrsf(aSelTrsf, anOrigMoved.Location().Transformation())) {
std::shared_ptr<GeomAPI_Shape> anOrigSel(new GeomAPI_Shape);
aResult = aSelAttr->value(theIndex - 1)->value();
if (myTrsf.get() && aResult.get() && !aResult->isNull()) {
gp_Trsf aSumTrsf = sumTrsf();
+#if OCC_VERSION_LARGE < 0x07070000
TopoDS_Shape anOrigMoved = aResult->impl<TopoDS_Shape>().Moved(aSumTrsf);
+#else
+ TopoDS_Shape anOrigMoved = aResult->impl<TopoDS_Shape>().Moved(aSumTrsf, Standard_False);
+#endif
aResult->setImpl(new TopoDS_Shape(anOrigMoved));
}
return aResult;
aResult = aSelAttr->value(theIndex - 1)->value();
if (myTrsf.get() && aResult.get() && !aResult->isNull()) {
gp_Trsf aSumTrsf = sumTrsf();
+#if OCC_VERSION_LARGE < 0x07070000
TopoDS_Shape anOrigMoved = aResult->impl<TopoDS_Shape>().Moved(aSumTrsf);
+#else
+ TopoDS_Shape anOrigMoved = aResult->impl<TopoDS_Shape>().Moved(aSumTrsf, Standard_False);
+#endif
aResult->setImpl(new TopoDS_Shape(anOrigMoved));
}
return aResult;