diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index 9a47dfcd63..069a9aee98 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -356,12 +356,7 @@ private: // writer.SetColorMode(Standard_False); writer.Transfer(hDoc, STEPControl_AsIs); - // edit STEP header -#if OCC_VERSION_HEX >= 0x060500 APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model()); -#else - APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model()); -#endif Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); diff --git a/src/Mod/Import/App/ExportOCAF.cpp b/src/Mod/Import/App/ExportOCAF.cpp index 3a76769b42..b237a4213c 100644 --- a/src/Mod/Import/App/ExportOCAF.cpp +++ b/src/Mod/Import/App/ExportOCAF.cpp @@ -73,11 +73,7 @@ # include # include # include -#if OCC_VERSION_HEX >= 0x060500 # include -# else -# include -# endif #endif #include diff --git a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp index b0801c5c4a..978674db4e 100644 --- a/src/Mod/Import/App/ImportOCAF.cpp +++ b/src/Mod/Import/App/ImportOCAF.cpp @@ -75,11 +75,7 @@ # include # include # include -#if OCC_VERSION_HEX >= 0x060500 # include -# else -# include -# endif #endif #include diff --git a/src/Mod/Import/App/ImportOCAFAssembly.cpp b/src/Mod/Import/App/ImportOCAFAssembly.cpp index bd0d681019..084124a7ef 100644 --- a/src/Mod/Import/App/ImportOCAFAssembly.cpp +++ b/src/Mod/Import/App/ImportOCAFAssembly.cpp @@ -56,11 +56,7 @@ # include # include # include -#if OCC_VERSION_HEX >= 0x060500 # include -# else -# include -# endif #endif #include "ImportOCAFAssembly.h" diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 4377092bc1..8d6bc08038 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -71,11 +71,7 @@ # include # include -#if OCC_VERSION_HEX >= 0x060500 # include -# else -# include -# endif #if OCC_VERSION_HEX >= 0x070500 # include # include @@ -644,11 +640,8 @@ private: writer.Transfer(hDoc, STEPControl_AsIs); // edit STEP header -#if OCC_VERSION_HEX >= 0x060500 APIHeaderSection_MakeHeader makeHeader(writer.ChangeWriter().Model()); -#else - APIHeaderSection_MakeHeader makeHeader(writer.Writer().Model()); -#endif + Base::Reference hGrp = App::GetApplication().GetUserParameter() .GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part")->GetGroup("STEP"); diff --git a/src/Mod/MeshPart/App/MeshFlattening.cpp b/src/Mod/MeshPart/App/MeshFlattening.cpp index d01f8496c1..e74534e73a 100644 --- a/src/Mod/MeshPart/App/MeshFlattening.cpp +++ b/src/Mod/MeshPart/App/MeshFlattening.cpp @@ -196,15 +196,9 @@ ColMat FaceUnwrapper::interpolateFlatFace(const TopoDS_Face& face) // extract xyz poles, knots, weights, degree const Handle(Geom_Surface) &_surface = BRep_Tool::Surface(face); const Handle(Geom_BSplineSurface) &_bspline = Handle(Geom_BSplineSurface)::DownCast(_surface); -#if OCC_VERSION_HEX < 0x070000 - TColStd_Array1OfReal _uknots(1, _bspline->NbUPoles() + _bspline->UDegree() + 1); - TColStd_Array1OfReal _vknots(1, _bspline->NbVPoles() + _bspline->VDegree() + 1); - _bspline->UKnotSequence(_uknots); - _bspline->VKnotSequence(_vknots); -#else + const TColStd_Array1OfReal &_uknots = _bspline->UKnotSequence(); const TColStd_Array1OfReal &_vknots = _bspline->VKnotSequence(); -#endif Eigen::VectorXd weights; weights.resize(_bspline->NbUPoles() * _bspline->NbVPoles()); diff --git a/src/Mod/Part/App/AppPartPy.cpp b/src/Mod/Part/App/AppPartPy.cpp index 5e961db381..8c7c9e09cb 100644 --- a/src/Mod/Part/App/AppPartPy.cpp +++ b/src/Mod/Part/App/AppPartPy.cpp @@ -1172,11 +1172,7 @@ private: aPlane = new Geom_Plane(p, d); } - BRepBuilderAPI_MakeFace Face(aPlane, 0.0, length, 0.0, width -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace Face(aPlane, 0.0, length, 0.0, width, Precision::Confusion() ); return Py::asObject(new TopoShapeFacePy(new TopoShape((Face.Face())))); } catch (Standard_DomainError&) { diff --git a/src/Mod/Part/App/Attacher.cpp b/src/Mod/Part/App/Attacher.cpp index ede1359034..b7269a6c68 100644 --- a/src/Mod/Part/App/Attacher.cpp +++ b/src/Mod/Part/App/Attacher.cpp @@ -495,10 +495,8 @@ eRefType AttachEngine::getShapeType(const TopoDS_Shape& sh) case GeomAbs_BezierCurve: case GeomAbs_BSplineCurve: case GeomAbs_OtherCurve: -#if OCC_VERSION_HEX >= 0x070000 case GeomAbs_OffsetCurve: -#endif - return rtCurve; + return rtCurve; } }break; case TopAbs_WIRE: diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp index 2fb9e08bee..8c160c76c9 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp +++ b/src/Mod/Part/App/BRepOffsetAPI_MakeOffsetFix.cpp @@ -52,12 +52,7 @@ BRepOffsetAPI_MakeOffsetFix::BRepOffsetAPI_MakeOffsetFix() BRepOffsetAPI_MakeOffsetFix::BRepOffsetAPI_MakeOffsetFix(const GeomAbs_JoinType Join, const Standard_Boolean IsOpenResult) { -#if OCC_VERSION_HEX >= 0x060900 mkOffset.Init(Join, IsOpenResult); -#else - (void)IsOpenResult; - mkOffset.Init(Join); -#endif } BRepOffsetAPI_MakeOffsetFix::~BRepOffsetAPI_MakeOffsetFix() diff --git a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp index 616adc3946..f09b9e6145 100644 --- a/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp +++ b/src/Mod/Part/App/BRepOffsetAPI_MakePipeShellPyImp.cpp @@ -142,7 +142,6 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setSpineSupport(PyObject *args) PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args) { -#if OCC_VERSION_HEX >= 0x060700 PyObject *spine, *curv, *keep; if (!PyArg_ParseTuple(args, "O!O!O!",&Part::TopoShapePy::Type,&spine ,&PyBool_Type,&curv @@ -178,31 +177,6 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setAuxiliarySpine(PyObject *args) PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); return nullptr; } -#else - PyObject *spine, *curv, *keep; - if (!PyArg_ParseTuple(args, "O!O!O!",&Part::TopoShapePy::Type,&spine - ,&PyBool_Type,&curv - ,&PyBool_Type,&keep)) - return 0; - - try { - const TopoDS_Shape& s = static_cast(spine)->getTopoShapePtr()->getShape(); - if (s.IsNull() || s.ShapeType() != TopAbs_WIRE) { - PyErr_SetString(PyExc_TypeError, "spine is not a wire"); - return 0; - } - - this->getBRepOffsetAPI_MakePipeShellPtr()->SetMode( - TopoDS::Wire(s), - PyObject_IsTrue(curv) ? Standard_True : Standard_False, - PyObject_IsTrue(keep) ? Standard_True : Standard_False); - Py_Return; - } - catch (Standard_Failure& e) { - PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); - return 0; - } -#endif } PyObject* BRepOffsetAPI_MakePipeShellPy::add(PyObject *args, PyObject *kwds) @@ -440,14 +414,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxDegree(PyObject *args) return nullptr; try { -#if OCC_VERSION_HEX >= 0x060800 this->getBRepOffsetAPI_MakePipeShellPtr()->SetMaxDegree(degree); Py_Return; -#else - (void)args; - PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.8"); - return 0; -#endif } catch (Standard_Failure& e) { PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); @@ -462,14 +430,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setMaxSegments(PyObject *args) return nullptr; try { -#if OCC_VERSION_HEX >= 0x060800 this->getBRepOffsetAPI_MakePipeShellPtr()->SetMaxSegments(nbseg); Py_Return; -#else - (void)args; - PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.8"); - return 0; -#endif } catch (Standard_Failure& e) { PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); @@ -484,13 +446,8 @@ PyObject* BRepOffsetAPI_MakePipeShellPy::setForceApproxC1(PyObject *args) return nullptr; try { -#if OCC_VERSION_HEX >= 0x060700 this->getBRepOffsetAPI_MakePipeShellPtr()->SetForceApproxC1(PyObject_IsTrue(obj) ? Standard_True : Standard_False); Py_Return; -#else - PyErr_SetString(PyExc_RuntimeError, "requires OCC >= 6.7"); - return 0; -#endif } catch (Standard_Failure& e) { PyErr_SetString(PartExceptionOCCError, e.GetMessageString()); diff --git a/src/Mod/Part/App/FeaturePartFuse.cpp b/src/Mod/Part/App/FeaturePartFuse.cpp index d98ecb760f..3e425309ae 100644 --- a/src/Mod/Part/App/FeaturePartFuse.cpp +++ b/src/Mod/Part/App/FeaturePartFuse.cpp @@ -112,34 +112,6 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void) if (s.size() >= 2) { try { std::vector history; -#if OCC_VERSION_HEX <= 0x060800 - TopoDS_Shape resShape = s.front(); - if (resShape.IsNull()) - throw NullShapeException("Input shape is null"); - for (std::vector::iterator it = s.begin()+1; it != s.end(); ++it) { - if (it->IsNull()) - throw NullShapeException("Input shape is null"); - - // Let's call algorithm computing a fuse operation: - BRepAlgoAPI_Fuse mkFuse(resShape, *it); - // Let's check if the fusion has been successful - if (!mkFuse.IsDone()) - throw BooleanException("Fusion failed"); - resShape = mkFuse.Shape(); - - ShapeHistory hist1 = buildHistory(mkFuse, TopAbs_FACE, resShape, mkFuse.Shape1()); - ShapeHistory hist2 = buildHistory(mkFuse, TopAbs_FACE, resShape, mkFuse.Shape2()); - if (history.empty()) { - history.push_back(hist1); - history.push_back(hist2); - } - else { - for (std::vector::iterator jt = history.begin(); jt != history.end(); ++jt) - *jt = joinHistory(*jt, hist1); - history.push_back(hist2); - } - } -#else BRepAlgoAPI_Fuse mkFuse; TopTools_ListOfShape shapeArguments,shapeTools; const TopoDS_Shape& shape = s.front(); @@ -163,7 +135,6 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void) for (std::vector::iterator it = s.begin(); it != s.end(); ++it) { history.push_back(buildHistory(mkFuse, TopAbs_FACE, resShape, *it)); } -#endif if (resShape.IsNull()) throw Base::RuntimeError("Resulting shape is null"); diff --git a/src/Mod/Part/App/FeaturePartSection.cpp b/src/Mod/Part/App/FeaturePartSection.cpp index da4e47855b..cd5de1f1ff 100644 --- a/src/Mod/Part/App/FeaturePartSection.cpp +++ b/src/Mod/Part/App/FeaturePartSection.cpp @@ -51,9 +51,7 @@ short Section::mustExecute() const BRepAlgoAPI_BooleanOperation* Section::makeOperation(const TopoDS_Shape& base, const TopoDS_Shape& tool) const { // Let's call algorithm computing a section operation: -#if OCC_VERSION_HEX < 0x060900 - return new BRepAlgoAPI_Section(base, tool); -#else + bool approx = Approximation.getValue(); std::unique_ptr mkSection(new BRepAlgoAPI_Section()); mkSection->Init1(base); @@ -63,5 +61,4 @@ BRepAlgoAPI_BooleanOperation* Section::makeOperation(const TopoDS_Shape& base, c if (!mkSection->IsDone()) throw Base::RuntimeError("Section failed"); return mkSection.release(); -#endif } diff --git a/src/Mod/Part/App/Geom2d/Geometry2dPyImp.cpp b/src/Mod/Part/App/Geom2d/Geometry2dPyImp.cpp index 5b7c9523d1..b8bc44e237 100644 --- a/src/Mod/Part/App/Geom2d/Geometry2dPyImp.cpp +++ b/src/Mod/Part/App/Geom2d/Geometry2dPyImp.cpp @@ -143,13 +143,7 @@ PyObject* Geometry2dPy::transform(PyObject *args) double a23 = static_cast(Py::Float(list.getItem(5))); gp_Trsf mat; - mat.SetValues(a11, a12, 0, a13, - a21, a22, 0, a23, - 0 , 0, 1, 0 -#if OCC_VERSION_HEX < 0x060800 - , 0.00001,0.00001 -#endif - ); //precision was removed in OCCT CR0025194 + mat.SetValues(a11, a12, 0, a13, a21, a22, 0, a23, 0, 0, 1, 0); gp_Trsf2d trf(mat); getGeometry2dPtr()->handle()->Transform(trf); diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp index 6ebcf01b0a..346968974e 100644 --- a/src/Mod/Part/App/Geometry.cpp +++ b/src/Mod/Part/App/Geometry.cpp @@ -462,11 +462,7 @@ void Geometry::transform(const Base::Matrix4D& mat) gp_Trsf trf; trf.SetValues(mat[0][0],mat[0][1],mat[0][2],mat[0][3], mat[1][0],mat[1][1],mat[1][2],mat[1][3], - mat[2][0],mat[2][1],mat[2][2],mat[2][3] -#if OCC_VERSION_HEX < 0x060800 - , 0.00001,0.00001 -#endif - ); //precision was removed in OCCT CR0025194 + mat[2][0],mat[2][1],mat[2][2],mat[2][3]); handle()->Transform(trf); } @@ -2138,11 +2134,8 @@ void GeomArcOfConic::setXAxisDir(const Base::Vector3d& newdir) Handle(Geom_TrimmedCurve) curve = Handle(Geom_TrimmedCurve)::DownCast(handle()); Handle(Geom_Conic) c = Handle(Geom_Conic)::DownCast( curve->BasisCurve() ); assert(!c.IsNull()); -#if OCC_VERSION_HEX >= 0x060504 + if (newdir.Sqr() < Precision::SquareConfusion()) -#else - if (newdir.Length() < Precision::Confusion()) -#endif return;//zero vector was passed. Keep the old orientation. try { @@ -2722,11 +2715,7 @@ Base::Vector3d GeomEllipse::getMajorAxisDir() const */ void GeomEllipse::setMajorAxisDir(Base::Vector3d newdir) { -#if OCC_VERSION_HEX >= 0x060504 if (newdir.Sqr() < Precision::SquareConfusion()) -#else - if (newdir.Length() < Precision::Confusion()) -#endif return;//zero vector was passed. Keep the old orientation. try { gp_Ax2 pos = myCurve->Position(); @@ -2941,11 +2930,7 @@ void GeomArcOfEllipse::setMajorAxisDir(Base::Vector3d newdir) { Handle(Geom_Ellipse) c = Handle(Geom_Ellipse)::DownCast( myCurve->BasisCurve() ); assert(!c.IsNull()); -#if OCC_VERSION_HEX >= 0x060504 if (newdir.Sqr() < Precision::SquareConfusion()) -#else - if (newdir.Length() < Precision::Confusion()) -#endif return;//zero vector was passed. Keep the old orientation. try { gp_Ax2 pos = c->Position(); @@ -3379,11 +3364,7 @@ void GeomArcOfHyperbola::setMajorAxisDir(Base::Vector3d newdir) { Handle(Geom_Hyperbola) c = Handle(Geom_Hyperbola)::DownCast( myCurve->BasisCurve() ); assert(!c.IsNull()); - #if OCC_VERSION_HEX >= 0x060504 if (newdir.Sqr() < Precision::SquareConfusion()) - #else - if (newdir.Length() < Precision::Confusion()) - #endif return;//zero vector was passed. Keep the old orientation. try { @@ -4239,11 +4220,7 @@ TopoDS_Shape GeomSurface::toShape() const Handle(Geom_Surface) s = Handle(Geom_Surface)::DownCast(handle()); Standard_Real u1,u2,v1,v2; s->Bounds(u1,u2,v1,v2); - BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2 -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2, Precision::Confusion() ); return mkBuilder.Shape(); } @@ -4255,7 +4232,6 @@ bool GeomSurface::tangentU(double u, double v, gp_Dir& dirU) const prop.TangentU(dirU); return true; } - return false; } @@ -5555,13 +5531,11 @@ std::unique_ptr makeFromCurveAdaptor(const Adaptor3d_Curve& adapt) geoCurve.reset(new GeomBSplineCurve(adapt.BSpline())); break; } -#if OCC_VERSION_HEX >= 0x070000 case GeomAbs_OffsetCurve: { geoCurve.reset(new GeomOffsetCurve(adapt.OffsetCurve())); break; } -#endif case GeomAbs_OtherCurve: default: break; diff --git a/src/Mod/Part/App/GeometrySurfacePyImp.cpp b/src/Mod/Part/App/GeometrySurfacePyImp.cpp index 8b4ffcf53b..f513033eca 100644 --- a/src/Mod/Part/App/GeometrySurfacePyImp.cpp +++ b/src/Mod/Part/App/GeometrySurfacePyImp.cpp @@ -136,11 +136,7 @@ PyObject* GeometrySurfacePy::toShape(PyObject *args) s->Bounds(u1,u2,v1,v2); if (!PyArg_ParseTuple(args, "|dddd", &u1,&u2,&v1,&v2)) return nullptr; - BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2 -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkBuilder(s, u1, u2, v1, v2, Precision::Confusion() ); TopoDS_Shape sh = mkBuilder.Shape(); return new TopoShapeFacePy(new TopoShape(sh)); } diff --git a/src/Mod/Part/App/ImportStep.cpp b/src/Mod/Part/App/ImportStep.cpp index c8a7fb5f12..5800270ef5 100644 --- a/src/Mod/Part/App/ImportStep.cpp +++ b/src/Mod/Part/App/ImportStep.cpp @@ -243,222 +243,16 @@ int Part::ImportStepParts(App::Document *pcDoc, const char* Name) return 0; } -#if OCC_VERSION_HEX < 0x070000 -static void findStyledSR (const Handle(StepVisual_StyledItem) &style, - Handle(StepShape_ShapeRepresentation)& aSR) -{ - // search Shape Representation for component styled item - for (Standard_Integer j=1; j <= style->NbStyles(); j++) { - Handle(StepVisual_PresentationStyleByContext) PSA = - Handle(StepVisual_PresentationStyleByContext)::DownCast(style->StylesValue ( j )); - if (PSA.IsNull()) - continue; - StepVisual_StyleContextSelect aStyleCntxSlct = PSA->StyleContext(); - Handle(StepShape_ShapeRepresentation) aCurrentSR = - Handle(StepShape_ShapeRepresentation)::DownCast(aStyleCntxSlct.Representation()); - if (aCurrentSR.IsNull()) - continue; - aSR = aCurrentSR; - break; - } -} -#endif bool Part::ReadColors (const Handle(XSControl_WorkSession) &WS, std::map& hash_col) { -#if OCC_VERSION_HEX >= 0x070000 (void)WS; (void)hash_col; return Standard_False; -#else - STEPConstruct_Styles Styles (WS); - if (!Styles.LoadStyles()) { -#ifdef FC_DEBUG - std::cout << "Warning: no styles are found in the model" << std::endl; -#endif - return Standard_False; - } - // searching for invisible items in the model - Handle(TColStd_HSequenceOfTransient) aHSeqOfInvisStyle = new TColStd_HSequenceOfTransient; - Styles.LoadInvisStyles( aHSeqOfInvisStyle ); - - // parse and search for color attributes - Standard_Integer nb = Styles.NbStyles(); - for (Standard_Integer i=1; i <= nb; i++) { - Handle(StepVisual_StyledItem) style = Styles.Style (i); - if (style.IsNull()) continue; - - Standard_Boolean IsVisible = Standard_True; - // check the visibility of styled item. - for (Standard_Integer si = 1; si <= aHSeqOfInvisStyle->Length(); si++) { - if (style != aHSeqOfInvisStyle->Value(si)) - continue; - // found that current style is invisible. -#ifdef FC_DEBUG - std::cout << "Warning: item No " << i << "(" << style->Item()->DynamicType()->Name() << ") is invisible" << std::endl; -#endif - IsVisible = Standard_False; - break; - } - - Handle(StepVisual_Colour) SurfCol, BoundCol, CurveCol; - // check if it is component style - Standard_Boolean IsComponent = Standard_False; - if (!Styles.GetColors (style, SurfCol, BoundCol, CurveCol, IsComponent) && IsVisible) - continue; - - // find shape - TopoDS_Shape S = STEPConstruct::FindShape(Styles.TransientProcess(), style->Item()); - //TopAbs_ShapeEnum type = S.ShapeType(); - Standard_Boolean isSkipSHUOstyle = Standard_False; - // take shape with real location. - while (IsComponent) { - // take SR of NAUO - Handle(StepShape_ShapeRepresentation) aSR; - findStyledSR(style, aSR); - // search for SR along model - if (aSR.IsNull()) - break; -// Handle(Interface_InterfaceModel) Model = WS->Model(); - Handle(XSControl_TransferReader) TR = WS->TransferReader(); - Handle(Transfer_TransientProcess) TP = TR->TransientProcess(); - Interface_EntityIterator subs = WS->HGraph()->Graph().Sharings( aSR ); - Handle(StepShape_ShapeDefinitionRepresentation) aSDR; - for (subs.Start(); subs.More(); subs.Next()) { - aSDR = Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(subs.Value()); - if (aSDR.IsNull()) - continue; - StepRepr_RepresentedDefinition aPDSselect = aSDR->Definition(); - Handle(StepRepr_ProductDefinitionShape) PDS = - Handle(StepRepr_ProductDefinitionShape)::DownCast(aPDSselect.PropertyDefinition()); - if (PDS.IsNull()) - continue; - StepRepr_CharacterizedDefinition aCharDef = PDS->Definition(); - - Handle(StepRepr_AssemblyComponentUsage) ACU = - Handle(StepRepr_AssemblyComponentUsage)::DownCast(aCharDef.ProductDefinitionRelationship()); - // PTV 10.02.2003 skip styled item that refer to SHUO - if (ACU->IsKind(STANDARD_TYPE(StepRepr_SpecifiedHigherUsageOccurrence))) { - isSkipSHUOstyle = Standard_True; - break; - } - Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO = - Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(ACU); - if (NAUO.IsNull()) - continue; - - TopoDS_Shape aSh; - // PTV 10.02.2003 to find component of assembly CORRECTLY - STEPConstruct_Tool Tool( WS ); -// Handle(Transfer_Binder) binder = TP->Find(NAUO); -// if (binder.IsNull() || ! binder->HasResult()) -// continue; -// aSh = TransferBRep::ShapeResult ( TP, binder ); - if (!aSh.IsNull()) { - S = aSh; - break; - } - } - break; - } - if (isSkipSHUOstyle) - continue; // skip styled item which refer to SHUO - - if ( S.IsNull() ) { -#ifdef FC_DEBUG - std::cout << "Warning: item No " << i << "(" << style->Item()->DynamicType()->Name() << ") is not mapped to shape" << std::endl; -#endif - continue; - } - - if (!SurfCol.IsNull()) { - Quantity_Color col; - Styles.DecodeColor (SurfCol, col); - //Base::Console().Message("%d: (%.2f,%.2f,%.2f)\n",col.Name(),col.Red(),col.Green(),col.Blue()); - hash_col[S.HashCode(INT_MAX)] = col; - } - if (!BoundCol.IsNull()) { - Quantity_Color col; - Styles.DecodeColor (BoundCol, col); - //Base::Console().Message("%d: (%.2f,%.2f,%.2f)\n",col.Name(),col.Red(),col.Green(),col.Blue()); - hash_col[S.HashCode(INT_MAX)] = col; - } - if (!CurveCol.IsNull()) { - Quantity_Color col; - Styles.DecodeColor (CurveCol, col); - //Base::Console().Message("%d: (%.2f,%.2f,%.2f)\n",col.Name(),col.Red(),col.Green(),col.Blue()); - hash_col[S.HashCode(INT_MAX)] = col; - } - if (!IsVisible) { - // sets the invisibility for shape. - } - } - - return Standard_True; -#endif } bool Part::ReadNames (const Handle(XSControl_WorkSession) &WS) { -#if OCC_VERSION_HEX >= 0x070000 (void)WS; return Standard_False; -#else - // get starting data - Handle(Interface_InterfaceModel) Model = WS->Model(); - Handle(XSControl_TransferReader) TR = WS->TransferReader(); - Handle(Transfer_TransientProcess) TP = TR->TransientProcess(); - - STEPConstruct_Tool Tool ( WS ); - - // iterate on model to find all SDRs and CDSRs - Standard_Integer nb = Model->NbEntities(); - Handle(Standard_Type) tNAUO = STANDARD_TYPE(StepRepr_NextAssemblyUsageOccurrence); - Handle(Standard_Type) tPD = STANDARD_TYPE(StepBasic_ProductDefinition); - Handle(TCollection_HAsciiString) name; - for (Standard_Integer i = 1; i <= nb; i++) { - Handle(Standard_Transient) enti = Model->Value(i); - - // get description of NAUO - if (enti->DynamicType() == tNAUO) { - Handle(StepRepr_NextAssemblyUsageOccurrence) NAUO = - Handle(StepRepr_NextAssemblyUsageOccurrence)::DownCast(enti); - if (NAUO.IsNull()) continue; - Interface_EntityIterator subs = WS->Graph().Sharings(NAUO); - for (subs.Start(); subs.More(); subs.Next()) { - Handle(StepRepr_ProductDefinitionShape) PDS = - Handle(StepRepr_ProductDefinitionShape)::DownCast(subs.Value()); - if (PDS.IsNull()) continue; - Handle(StepBasic_ProductDefinitionRelationship) PDR = PDS->Definition().ProductDefinitionRelationship(); - if (PDR.IsNull()) continue; - if (PDR->HasDescription() && - PDR->Description()->Length() >0 ) name = PDR->Description(); - else if (PDR->Name()->Length() >0) name = PDR->Name(); - else name = PDR->Id(); - } - - // find proper label - TCollection_ExtendedString str ( name->String() ); - Base::Console().Message("Name: %s\n",name->String().ToCString()); - } - - // for PD get name of associated product - if (enti->DynamicType() == tPD) { - Handle(StepBasic_ProductDefinition) PD = - Handle(StepBasic_ProductDefinition)::DownCast(enti); - if (PD.IsNull()) continue; - Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct(); - if (Prod->Name()->UsefullLength()>0) name = Prod->Name(); - else name = Prod->Id(); - - TCollection_ExtendedString str ( name->String() ); - Base::Console().Message("Name: %s\n",name->String().ToCString()); - } - // set a name to the document - //TCollection_ExtendedString str ( name->String() ); - //TDataStd_Name::Set ( L, str ); - } - - return Standard_True; -#endif } diff --git a/src/Mod/Part/App/OCCError.h b/src/Mod/Part/App/OCCError.h index 19e8208179..fecd402149 100644 --- a/src/Mod/Part/App/OCCError.h +++ b/src/Mod/Part/App/OCCError.h @@ -27,9 +27,7 @@ # include # include # include -# if OCC_VERSION_HEX >= 0x060500 # include -# endif # include # include # include diff --git a/src/Mod/Part/App/OpenCascadeAll.h b/src/Mod/Part/App/OpenCascadeAll.h index 5babfe44b9..b4b8afc233 100644 --- a/src/Mod/Part/App/OpenCascadeAll.h +++ b/src/Mod/Part/App/OpenCascadeAll.h @@ -184,10 +184,7 @@ #include #include - -#if OCC_VERSION_HEX >= 0x060600 #include -#endif #if OCC_VERSION_HEX < 0x070600 #include #include @@ -231,15 +228,11 @@ #include #include #include -#if OCC_VERSION_HEX >= 0x060600 #include -#endif #include #include #include -#if OCC_VERSION_HEX >= 0x060801 #include -#endif #include #include #include @@ -507,18 +500,14 @@ #include #include -#if OCC_VERSION_HEX >= 0x060600 # include # include -#endif #if OCC_VERSION_HEX >= 0x070300 # include #endif -#if OCC_VERSION_HEX >= 0x060800 #include -#endif #endif // __OpenCascadeAll__ diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index 0dcb2883c4..475f4924e8 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -188,12 +188,10 @@ App::DocumentObject *Feature::getSubObject(const char *subname, // instance or do simply nothing. For now the error message is degraded to a log message. std::ostringstream str; Standard_CString msg = e.GetMessageString(); -#if OCC_VERSION_HEX >= 0x070000 + // Avoid name mangling str << e.DynamicType()->get_type_name() << " "; -#else - str << typeid(e).name() << " "; -#endif + if (msg) {str << msg;} else {str << "No OCCT Exception Message";} str << ": " << getFullName(); diff --git a/src/Mod/Part/App/PrimitiveFeature.cpp b/src/Mod/Part/App/PrimitiveFeature.cpp index de04a851d6..ac057e79a3 100644 --- a/src/Mod/Part/App/PrimitiveFeature.cpp +++ b/src/Mod/Part/App/PrimitiveFeature.cpp @@ -324,11 +324,7 @@ App::DocumentObjectExecReturn *Plane::execute(void) gp_Pnt pnt(0.0,0.0,0.0); gp_Dir dir(0.0,0.0,1.0); Handle(Geom_Plane) aPlane = new Geom_Plane(pnt, dir); - BRepBuilderAPI_MakeFace mkFace(aPlane, 0.0, L, 0.0, W -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkFace(aPlane, 0.0, L, 0.0, W, Precision::Confusion()); const char *error=nullptr; switch (mkFace.Error()) @@ -346,11 +342,6 @@ App::DocumentObjectExecReturn *Plane::execute(void) case BRepBuilderAPI_ParametersOutOfRange: error = "parameters out of range"; break; -#if OCC_VERSION_HEX < 0x060500 - case BRepBuilderAPI_SurfaceNotC2: - error = "surface not C2"; - break; -#endif default: error = "unknown error"; break; diff --git a/src/Mod/Part/App/PropertyTopoShape.cpp b/src/Mod/Part/App/PropertyTopoShape.cpp index 38513236de..61664f045f 100644 --- a/src/Mod/Part/App/PropertyTopoShape.cpp +++ b/src/Mod/Part/App/PropertyTopoShape.cpp @@ -43,9 +43,7 @@ # include # include -#if OCC_VERSION_HEX >= 0x060800 # include -#endif #endif // _PreComp_ @@ -248,11 +246,8 @@ void PropertyPartShape::Restore(Base::XMLReader &reader) static Standard_Boolean BRepTools_Write(const TopoDS_Shape& Sh, const Standard_CString File) { std::ofstream os; -#if OCC_VERSION_HEX >= 0x060800 OSD_OpenStream(os, File, std::ios::out); -#else - os.open(File, std::ios::out); -#endif + if (!os.rdbuf()->is_open()) return Standard_False; diff --git a/src/Mod/Part/App/Tools.cpp b/src/Mod/Part/App/Tools.cpp index c29ead7a6d..514426652e 100644 --- a/src/Mod/Part/App/Tools.cpp +++ b/src/Mod/Part/App/Tools.cpp @@ -632,11 +632,7 @@ Handle (Poly_Triangulation) Part::Tools::triangulationOfFace(const TopoDS_Face& selectRange(v1, v2); Handle(Geom_Surface) surface = BRep_Tool::Surface(face); - BRepBuilderAPI_MakeFace mkBuilder(surface, u1, u2, v1, v2 -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkBuilder(surface, u1, u2, v1, v2, Precision::Confusion() ); TopoDS_Shape shape = mkBuilder.Shape(); shape.Location(loc); diff --git a/src/Mod/Part/App/TopoShape.cpp b/src/Mod/Part/App/TopoShape.cpp index b556326cc5..a9c07c0197 100644 --- a/src/Mod/Part/App/TopoShape.cpp +++ b/src/Mod/Part/App/TopoShape.cpp @@ -176,10 +176,8 @@ # include #endif -#if OCC_VERSION_HEX >= 0x060600 # include # include -#endif #if OCC_VERSION_HEX >= 0x070300 # include @@ -239,10 +237,6 @@ const char* BRepBuilderAPI_FaceErrorText(BRepBuilderAPI_FaceError et) return "Curve projection failed"; case BRepBuilderAPI_ParametersOutOfRange: return "Parameters out of range"; -#if OCC_VERSION_HEX < 0x060500 - case BRepBuilderAPI_SurfaceNotC2: - return "Surface not C2-continuous"; -#endif default: return "Unknown creation error"; } @@ -627,16 +621,11 @@ void TopoShape::convertTogpTrsf(const Base::Matrix4D& mtrx, gp_Trsf& trsf) { trsf.SetValues(mtrx[0][0],mtrx[0][1],mtrx[0][2],mtrx[0][3], mtrx[1][0],mtrx[1][1],mtrx[1][2],mtrx[1][3], - mtrx[2][0],mtrx[2][1],mtrx[2][2],mtrx[2][3] -#if OCC_VERSION_HEX < 0x060800 - , 0.00001,0.00001 -#endif - ); //precision was removed in OCCT CR0025194 + mtrx[2][0],mtrx[2][1],mtrx[2][2],mtrx[2][3]); } void TopoShape::convertToMatrix(const gp_Trsf& trsf, Base::Matrix4D& mtrx) { -#if OCC_VERSION_HEX >= 0x070000 // https://www.opencascade.com/doc/occt-7.0.0/refman/html/classgp___trsf.html // VectorialPart() already includes the scale factor gp_Mat m = trsf.VectorialPart(); @@ -659,29 +648,6 @@ void TopoShape::convertToMatrix(const gp_Trsf& trsf, Base::Matrix4D& mtrx) mtrx[0][3] = p.X(); mtrx[1][3] = p.Y(); mtrx[2][3] = p.Z(); -#else - gp_Mat m = trsf._CSFDB_Getgp_Trsfmatrix(); - gp_XYZ p = trsf._CSFDB_Getgp_Trsfloc(); - Standard_Real scale = trsf._CSFDB_Getgp_Trsfscale(); - - // set Rotation matrix - mtrx[0][0] = scale * m._CSFDB_Getgp_Matmatrix(0,0); - mtrx[0][1] = scale * m._CSFDB_Getgp_Matmatrix(0,1); - mtrx[0][2] = scale * m._CSFDB_Getgp_Matmatrix(0,2); - - mtrx[1][0] = scale * m._CSFDB_Getgp_Matmatrix(1,0); - mtrx[1][1] = scale * m._CSFDB_Getgp_Matmatrix(1,1); - mtrx[1][2] = scale * m._CSFDB_Getgp_Matmatrix(1,2); - - mtrx[2][0] = scale * m._CSFDB_Getgp_Matmatrix(2,0); - mtrx[2][1] = scale * m._CSFDB_Getgp_Matmatrix(2,1); - mtrx[2][2] = scale * m._CSFDB_Getgp_Matmatrix(2,2); - - // set pos vector - mtrx[0][3] = p._CSFDB_Getgp_XYZx(); - mtrx[1][3] = p._CSFDB_Getgp_XYZy(); - mtrx[2][3] = p._CSFDB_Getgp_XYZz(); -#endif } Base::Matrix4D TopoShape::convert(const gp_Trsf& trsf) { @@ -872,7 +838,7 @@ void TopoShape::importBrep(const char *FileName) // read brep-file BRep_Builder aBuilder; TopoDS_Shape aShape; -#if OCC_VERSION_HEX >= 0x060300 && OCC_VERSION_HEX < 0x070500 +#if OCC_VERSION_HEX < 0x070500 Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); pi->NewScope(100, "Reading BREP file..."); pi->Show(); @@ -894,7 +860,7 @@ void TopoShape::importBrep(std::istream& str, int indicator) // read brep-file BRep_Builder aBuilder; TopoDS_Shape aShape; -#if OCC_VERSION_HEX >= 0x060300 && OCC_VERSION_HEX < 0x070500 +#if OCC_VERSION_HEX < 0x070500 if (indicator) { Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100); pi->NewScope(100, "Reading BREP file..."); @@ -1095,18 +1061,11 @@ void TopoShape::dump(std::ostream& out) const void TopoShape::exportStl(const char *filename, double deflection) const { StlAPI_Writer writer; -#if OCC_VERSION_HEX < 0x060801 - if (deflection > 0) { - writer.RelativeMode() = false; - writer.SetDeflection(deflection); - } -#else BRepMesh_IncrementalMesh aMesh(this->_Shape, deflection, /*isRelative*/ Standard_False, /*theAngDeflection*/ defaultAngularDeflection(deflection), /*isInParallel*/ true); -#endif writer.Write(this->_Shape,encodeFilename(filename).c_str()); } @@ -1652,31 +1611,23 @@ bool TopoShape::analyze(bool runBopCheck, std::ostream& str) const return false; // errors detected } else if (runBopCheck) { - // Copied from TaskCheckGeometryResults::goBOPSingleCheck -#if OCC_VERSION_HEX >= 0x060600 + TopoDS_Shape BOPCopy = BRepBuilderAPI_Copy(this->_Shape).Shape(); BOPAlgo_ArgumentAnalyzer BOPCheck; - // BOPCheck.StopOnFirstFaulty() = true; //this doesn't run any faster but gives us less results. BOPCheck.SetShape1(BOPCopy); //all settings are false by default. so only turn on what we want. BOPCheck.ArgumentTypeMode() = true; BOPCheck.SelfInterMode() = true; BOPCheck.SmallEdgeMode() = true; BOPCheck.RebuildFaceMode() = true; -#if OCC_VERSION_HEX >= 0x060700 BOPCheck.ContinuityMode() = true; -#endif -#if OCC_VERSION_HEX >= 0x060900 BOPCheck.SetParallelMode(true); //this doesn't help for speed right now(occt 6.9.1). BOPCheck.SetRunParallel(true); //performance boost, use all available cores BOPCheck.TangentMode() = true; //these 4 new tests add about 5% processing time. BOPCheck.MergeVertexMode() = true; BOPCheck.CurveOnSurfaceMode() = true; BOPCheck.MergeEdgeMode() = true; -#endif - BOPCheck.Perform(); - if (!BOPCheck.HasFaulty()) return true; @@ -1688,25 +1639,17 @@ bool TopoShape::analyze(bool runBopCheck, std::ostream& str) const for (; BOPResultsIt.More(); BOPResultsIt.Next()) { const BOPAlgo_CheckResult ¤t = BOPResultsIt.Value(); -#if OCC_VERSION_HEX < 0x070000 - const BOPCol_ListOfShape &faultyShapes1 = current.GetFaultyShapes1(); - BOPCol_ListIteratorOfListOfShape faultyShapes1It(faultyShapes1); -#else const TopTools_ListOfShape &faultyShapes1 = current.GetFaultyShapes1(); TopTools_ListIteratorOfListOfShape faultyShapes1It(faultyShapes1); -#endif for (;faultyShapes1It.More(); faultyShapes1It.Next()) { const TopoDS_Shape &faultyShape = faultyShapes1It.Value(); str << "Error in " << shapeEnumToString[faultyShape.ShapeType()] << ": "; str << bopEnumToString[current.GetCheckStatus()] << std::endl; } } - return false; -#endif // 0x060600 } } - return true; } diff --git a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp index 981dd503b7..1018b70242 100644 --- a/src/Mod/Part/App/TopoShapeEdgePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeEdgePyImp.cpp @@ -871,7 +871,6 @@ Py::Object TopoShapeEdgePy::getCurve() const curve = new BSplineCurvePy(bspline); break; } -#if OCC_VERSION_HEX >= 0x070000 case GeomAbs_OffsetCurve: { Standard_Real first, last; @@ -886,7 +885,6 @@ Py::Object TopoShapeEdgePy::getCurve() const throw Py::RuntimeError("Failed to convert to offset curve"); } } -#endif case GeomAbs_OtherCurve: break; } diff --git a/src/Mod/Part/App/TopoShapeFacePyImp.cpp b/src/Mod/Part/App/TopoShapeFacePyImp.cpp index f4a62e7544..ac5ed87690 100644 --- a/src/Mod/Part/App/TopoShapeFacePyImp.cpp +++ b/src/Mod/Part/App/TopoShapeFacePyImp.cpp @@ -233,11 +233,7 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/) return -1; } - BRepBuilderAPI_MakeFace mkFace(S -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkFace(S, Precision::Confusion()); if (bound) { Py::List list(bound); for (Py::List::iterator it = list.begin(); it != list.end(); ++it) { @@ -301,11 +297,6 @@ int TopoShapeFacePy::PyInit(PyObject* args, PyObject* /*kwd*/) case BRepBuilderAPI_ParametersOutOfRange: Standard_Failure::Raise("Parameters out of range"); break; -#if OCC_VERSION_HEX < 0x060500 - case BRepBuilderAPI_SurfaceNotC2: - Standard_Failure::Raise("Surface not C2"); - break; -#endif default: Standard_Failure::Raise("Unknown failure"); break; @@ -847,11 +838,6 @@ PyObject* TopoShapeFacePy::cutHoles(PyObject *args) case BRepBuilderAPI_ParametersOutOfRange: Standard_Failure::Raise("Parameters out of range"); break; -#if OCC_VERSION_HEX < 0x060500 - case BRepBuilderAPI_SurfaceNotC2: - Standard_Failure::Raise("Surface not C2"); - break; -#endif default: Standard_Failure::Raise("Unknown failure"); break; diff --git a/src/Mod/Part/App/TopoShapePyImp.cpp b/src/Mod/Part/App/TopoShapePyImp.cpp index 91d9bcde6f..c3af7be9f6 100644 --- a/src/Mod/Part/App/TopoShapePyImp.cpp +++ b/src/Mod/Part/App/TopoShapePyImp.cpp @@ -38,9 +38,7 @@ # include # include # include -#if OCC_VERSION_HEX >= 0x060801 # include -#endif # include # include # include @@ -182,14 +180,9 @@ PyObject* TopoShapePy::copy(PyObject *args) } if (!shape.IsNull()) { -#if OCC_VERSION_HEX >= 0x070000 BRepBuilderAPI_Copy c(shape, PyObject_IsTrue(copyGeom) ? Standard_True : Standard_False, PyObject_IsTrue(copyMesh) ? Standard_True : Standard_False); -#else - BRepBuilderAPI_Copy c(shape, - PyObject_IsTrue(copyGeom) ? Standard_True : Standard_False); -#endif static_cast(cpy)->getTopoShapePtr()->setShape(c.Shape()); } return cpy; @@ -2488,10 +2481,8 @@ PyObject* _getSupportIndex(const char* suppStr, TopoShape* ts, TopoDS_Shape supp PyObject* TopoShapePy::proximity(PyObject *args) { -#if OCC_VERSION_HEX >= 0x060801 -#if OCC_VERSION_HEX >= 0x060901 typedef BRepExtrema_MapOfIntegerPackedMapOfInteger BRepExtrema_OverlappedSubShapes; -#endif + PyObject* ps2; Standard_Real tol = Precision::Confusion(); if (!PyArg_ParseTuple(args, "O!|d",&(TopoShapePy::Type), &ps2, &tol)) @@ -2577,11 +2568,7 @@ PyObject* TopoShapePy::proximity(PyObject *args) tuple.setItem(0, overlappssindex1); tuple.setItem(1, overlappssindex2); return Py::new_reference_to(tuple); //face indexes -#else - (void)args; - PyErr_SetString(PyExc_NotImplementedError, "proximity requires OCCT >= 6.8.1"); - return 0; -#endif + } PyObject* TopoShapePy::distToShape(PyObject *args) diff --git a/src/Mod/Part/App/TopoShapeShellPyImp.cpp b/src/Mod/Part/App/TopoShapeShellPyImp.cpp index 1229a6f375..a5182b33f8 100644 --- a/src/Mod/Part/App/TopoShapeShellPyImp.cpp +++ b/src/Mod/Part/App/TopoShapeShellPyImp.cpp @@ -167,11 +167,8 @@ PyObject* TopoShapeShellPy::getFreeEdges(PyObject *args) return nullptr; ShapeAnalysis_Shell as; as.LoadShells(getTopoShapePtr()->getShape()); -#if OCC_VERSION_HEX < 0x060500 - as.CheckOrientedShells(getTopoShapePtr()->getShape(), Standard_True); -#else as.CheckOrientedShells(getTopoShapePtr()->getShape(), Standard_True, Standard_True); -#endif + TopoDS_Compound comp = as.FreeEdges(); return new TopoShapeCompoundPy(new TopoShape(comp)); } @@ -182,11 +179,8 @@ PyObject* TopoShapeShellPy::getBadEdges(PyObject *args) return nullptr; ShapeAnalysis_Shell as; as.LoadShells(getTopoShapePtr()->getShape()); -#if OCC_VERSION_HEX < 0x060500 as.CheckOrientedShells(getTopoShapePtr()->getShape(), Standard_True); -#else - as.CheckOrientedShells(getTopoShapePtr()->getShape(), Standard_True, Standard_True); -#endif + TopoDS_Compound comp = as.BadEdges(); return new TopoShapeCompoundPy(new TopoShape(comp)); } diff --git a/src/Mod/Part/App/TopoShapeSolidPyImp.cpp b/src/Mod/Part/App/TopoShapeSolidPyImp.cpp index 0df6437b10..ec6b512a03 100644 --- a/src/Mod/Part/App/TopoShapeSolidPyImp.cpp +++ b/src/Mod/Part/App/TopoShapeSolidPyImp.cpp @@ -28,9 +28,7 @@ # include # include # include -#if OCC_VERSION_HEX >= 0x060600 # include -#endif # include # include # include @@ -219,11 +217,7 @@ Py::Object TopoShapeSolidPy::getOuterShell(void) const TopoDS_Shell shell; const TopoDS_Shape& shape = getTopoShapePtr()->getShape(); if (!shape.IsNull() && shape.ShapeType() == TopAbs_SOLID) -#if OCC_VERSION_HEX >= 0x060600 shell = BRepClass3d::OuterShell(TopoDS::Solid(shape)); -#else - shell = BRepTools::OuterShell(TopoDS::Solid(shape)); -#endif return Py::Object(new TopoShapeShellPy(new TopoShape(shell)),true); } diff --git a/src/Mod/Part/App/encodeFilename.h b/src/Mod/Part/App/encodeFilename.h index 4fadafa3e9..6f86e4241c 100644 --- a/src/Mod/Part/App/encodeFilename.h +++ b/src/Mod/Part/App/encodeFilename.h @@ -24,23 +24,11 @@ #ifndef PART_ENCODEFILENAME_H #define PART_ENCODEFILENAME_H -#if (OCC_VERSION_HEX < 0x060800 && defined(_WIN32)) -#include -#endif - namespace Part { inline std::string encodeFilename(std::string fn) { -#if (OCC_VERSION_HEX < 0x060800 && defined(_WIN32)) - // Workaround to support latin1 characters in path until OCCT supports - // conversion from UTF8 to wchar_t on windows - // http://tracker.dev.opencascade.org/view.php?id=22484 - QByteArray str8bit = QString::fromUtf8(fn.c_str()).toLocal8Bit(); - return std::string(str8bit.constData()); -#else return fn; -#endif } } //namespace Part diff --git a/src/Mod/Part/App/modelRefine.cpp b/src/Mod/Part/App/modelRefine.cpp index ada41fe931..cdbf9021d8 100644 --- a/src/Mod/Part/App/modelRefine.cpp +++ b/src/Mod/Part/App/modelRefine.cpp @@ -1250,16 +1250,6 @@ void Part::BRepBuilderAPI_RefineModel::Build() } } myShape = mkSolid.Solid(); - -#if OCC_VERSION_HEX <= 0x060700 - // With occ 6.7 and older it can happen that a solid is flipped. - // In this case it must be reversed - GProp_GProps props; - BRepGProp::VolumeProperties(myShape, props); - if (props.Mass() < 0) { - myShape.Reverse(); - } -#endif } else if (myShape.ShapeType() == TopAbs_SHELL) { const TopoDS_Shell& shell = TopoDS::Shell(myShape); diff --git a/src/Mod/Part/BOPTools/__init__.py b/src/Mod/Part/BOPTools/__init__.py index 8a3ac59154..eb83cbccf4 100644 --- a/src/Mod/Part/BOPTools/__init__.py +++ b/src/Mod/Part/BOPTools/__init__.py @@ -64,7 +64,7 @@ def addCommands(): def generalFuseIsAvailable(): """generalFuseIsAvailable(): returns True if FreeCAD's Part.Shape.generalFuse is functional. - True if Part.OCC_VERSION >= 6.9.0.""" + True if Part.OCC_VERSION >= 7.0.0.""" import Part if not hasattr(Part, "OCC_VERSION"): return False @@ -74,4 +74,4 @@ def generalFuseIsAvailable(): match = re.match(r"([0-9]+)\.([0-9]+)\.([0-9]+)",ver_string) major,minor,rev = match.groups() major = int(major); minor = int(minor); rev = int(rev) - return (major,minor,rev)>=(6,9,0) + return (major,minor,rev)>=(7,0,0) diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index 2a07634c98..d6ee2f9e14 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -784,11 +784,7 @@ void CmdPartCompSplitFeatures::languageChange() bool CmdPartCompSplitFeatures::isActive(void) { if (getActiveGuiDocument()) -#if OCC_VERSION_HEX < 0x060900 - return false; -#else return true; -#endif else return false; } diff --git a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp index 3393a2ee8f..87263d5a99 100644 --- a/src/Mod/Part/Gui/CommandSimple.cpp +++ b/src/Mod/Part/Gui/CommandSimple.cpp @@ -437,18 +437,6 @@ bool CmdPartDefeaturing::isActive(void) } -// { -// if (getActiveGuiDocument()) -// #if OCC_VERSION_HEX < 0x060900 -// return false; -// #else -// return true; -// #endif -// else -// return false; -// } - - //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void CreateSimplePartCommands(void) diff --git a/src/Mod/Part/Gui/PreCompiled.h b/src/Mod/Part/Gui/PreCompiled.h index 1eabcbbde6..d9a1379c9e 100644 --- a/src/Mod/Part/Gui/PreCompiled.h +++ b/src/Mod/Part/Gui/PreCompiled.h @@ -152,10 +152,8 @@ #include #include -#if OCC_VERSION_HEX >= 0x060600 # include # include -#endif // Boost #include diff --git a/src/Mod/Part/Gui/TaskCheckGeometry.cpp b/src/Mod/Part/Gui/TaskCheckGeometry.cpp index 322d0e3fb6..9b0452c0ed 100644 --- a/src/Mod/Part/Gui/TaskCheckGeometry.cpp +++ b/src/Mod/Part/Gui/TaskCheckGeometry.cpp @@ -38,11 +38,8 @@ # include # include # include - -# if OCC_VERSION_HEX >= 0x060600 -# include -# include -# endif +# include +# include # include # include @@ -177,7 +174,7 @@ QVector buildBOPCheckResultVector() return results; } -#if OCC_VERSION_HEX >= 0x060600 + QString getBOPCheckString(const BOPAlgo_CheckStatus &status) { static QVector strings = buildBOPCheckResultVector(); @@ -186,7 +183,7 @@ QString getBOPCheckString(const BOPAlgo_CheckStatus &status) index = 0; return strings.at(index); } -#endif + ResultEntry::ResultEntry() { @@ -425,9 +422,7 @@ void TaskCheckGeometryResults::goCheck() #if OCC_VERSION_HEX < 0x070500 Handle(Message_ProgressIndicator) theProgress = new BOPProgressIndicator(tr("Check geometry"), Gui::getMainWindow()); theProgress->NewScope("BOP check..."); -#if OCC_VERSION_HEX >= 0x060900 theProgress->Show(); -#endif #else Handle(Message_ProgressIndicator) theProgress = new BOPProgressIndicator(tr("Check geometry"), Gui::getMainWindow()); Message_ProgressRange theRange(theProgress->Start()); @@ -647,8 +642,6 @@ int TaskCheckGeometryResults::goBOPSingleCheck(const TopoDS_Shape& shapeIn, Resu bool mergeEdgeMode = group->GetBool("MergeEdgeMode", true); bool curveOnSurfaceMode = group->GetBool("CurveOnSurfaceMode", true); - //ArgumentAnalyser was moved at version 6.6. no back port for now. -#if OCC_VERSION_HEX >= 0x060600 //Reference use: src/BOPTest/BOPTest_CheckCommands.cxx //I don't why we need to make a copy, but it doesn't work without it. @@ -661,35 +654,30 @@ int TaskCheckGeometryResults::goBOPSingleCheck(const TopoDS_Shape& shapeIn, Resu //this is left for another time. TopoDS_Shape BOPCopy = BRepBuilderAPI_Copy(shapeIn).Shape(); BOPAlgo_ArgumentAnalyzer BOPCheck; -#if OCC_VERSION_HEX >= 0x060900 -#if OCC_VERSION_HEX < 0x070500 - BOPCheck.SetProgressIndicator(theProgress); -#elif OCC_VERSION_HEX < 0x070600 - BOPCheck.SetProgressIndicator(theScope); -#else - Q_UNUSED(theScope) -#endif // 0x070500 -#else - Q_UNUSED(theProgress); -#endif -// BOPCheck.StopOnFirstFaulty() = true; //this doesn't run any faster but gives us less results. + + #if OCC_VERSION_HEX < 0x070500 + BOPCheck.SetProgressIndicator(theProgress); + #elif OCC_VERSION_HEX < 0x070600 + BOPCheck.SetProgressIndicator(theScope); + #else + Q_UNUSED(theScope) + #endif // 0x070500 + + BOPCheck.SetShape1(BOPCopy); //all settings are false by default. so only turn on what we want. BOPCheck.ArgumentTypeMode() = argumentTypeMode; BOPCheck.SelfInterMode() = selfInterMode; BOPCheck.SmallEdgeMode() = smallEdgeMode; BOPCheck.RebuildFaceMode() = rebuildFaceMode; -#if OCC_VERSION_HEX >= 0x060700 BOPCheck.ContinuityMode() = continuityMode; -#endif -#if OCC_VERSION_HEX >= 0x060900 + BOPCheck.SetParallelMode(!runSingleThreaded); //this doesn't help for speed right now(occt 6.9.1). BOPCheck.SetRunParallel(!runSingleThreaded); //performance boost, use all available cores BOPCheck.TangentMode() = tangentMode; //these 4 new tests add about 5% processing time. BOPCheck.MergeVertexMode() = mergeVertexMode; BOPCheck.MergeEdgeMode() = mergeEdgeMode; BOPCheck.CurveOnSurfaceMode() = curveOnSurfaceMode; -#endif #ifdef FC_DEBUG Base::TimeInfo start_time; @@ -721,14 +709,9 @@ int TaskCheckGeometryResults::goBOPSingleCheck(const TopoDS_Shape& shapeIn, Resu for (; BOPResultsIt.More(); BOPResultsIt.Next()) { const BOPAlgo_CheckResult ¤t = BOPResultsIt.Value(); - -#if OCC_VERSION_HEX < 0x070000 - const BOPCol_ListOfShape &faultyShapes1 = current.GetFaultyShapes1(); - BOPCol_ListIteratorOfListOfShape faultyShapes1It(faultyShapes1); -#else const TopTools_ListOfShape &faultyShapes1 = current.GetFaultyShapes1(); TopTools_ListIteratorOfListOfShape faultyShapes1It(faultyShapes1); -#endif + for (;faultyShapes1It.More(); faultyShapes1It.Next()) { const TopoDS_Shape &faultyShape = faultyShapes1It.Value(); @@ -767,9 +750,6 @@ int TaskCheckGeometryResults::goBOPSingleCheck(const TopoDS_Shape& shapeIn, Resu } } return 1; -#else - return 0; -#endif } diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index 95651294be..c0431075d8 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -950,12 +950,9 @@ void ViewProviderPartExt::updateVisual() deflection = Precision::Confusion(); // create or use the mesh on the data structure -#if OCC_VERSION_HEX >= 0x060600 Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * M_PI; BRepMesh_IncrementalMesh(cShape, deflection, Standard_False, AngDeflectionRads, Standard_True); -#else - BRepMesh_IncrementalMesh(cShape, deflection); -#endif + // We must reset the location here because the transformation data // are set in the placement property TopLoc_Location aLoc; diff --git a/src/Mod/PartDesign/App/FeatureSketchBased.cpp b/src/Mod/PartDesign/App/FeatureSketchBased.cpp index bf8d9bc1b8..17a4860755 100644 --- a/src/Mod/PartDesign/App/FeatureSketchBased.cpp +++ b/src/Mod/PartDesign/App/FeatureSketchBased.cpp @@ -494,11 +494,7 @@ void ProfileBased::getUpToFace(TopoDS_Face& upToFace, BRepAdaptor_Surface adapt(upToFace, Standard_False); // use the placement of the adapter, not of the upToFace loc = TopLoc_Location(adapt.Trsf()); - BRepBuilderAPI_MakeFace mkFace(adapt.Surface().Surface() -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkFace(adapt.Surface().Surface(), Precision::Confusion()); if (!mkFace.IsDone()) throw Base::ValueError("SketchBased: Up To Face: Failed to create unlimited face"); upToFace = TopoDS::Face(mkFace.Shape()); @@ -687,12 +683,7 @@ bool ProfileBased::checkLineCrossesFace(const gp_Lin& line, const TopoDS_Face& f if (intersector.IsDone()) { for (int i = 1; i <= intersector.NbExt(); i++) { - -#if OCC_VERSION_HEX >= 0x060500 if (intersector.SquareDistance(i) < Precision::Confusion()) { -#else - if (intersector.Value(i) < Precision::Confusion()) { -#endif if (intersector.IsParallel()) { // A line that is coincident with the axis produces three intersections // 1 with the line itself and 2 with the adjacent edges diff --git a/src/Mod/PartDesign/App/PreCompiled.h b/src/Mod/PartDesign/App/PreCompiled.h index 4eff1066ee..3eca1395ba 100644 --- a/src/Mod/PartDesign/App/PreCompiled.h +++ b/src/Mod/PartDesign/App/PreCompiled.h @@ -98,9 +98,7 @@ # include # include -#if OCC_VERSION_HEX >= 0x060800 # include -#endif #endif // _PreComp_ #endif diff --git a/src/Mod/PartDesign/Gui/ViewProviderAddSub.cpp b/src/Mod/PartDesign/Gui/ViewProviderAddSub.cpp index 4b971c4f26..8cfb1ca69c 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderAddSub.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderAddSub.cpp @@ -121,12 +121,8 @@ void ViewProviderAddSub::updateAddSubShapeIndicator() { Standard_Real deflection = ((xMax-xMin)+(yMax-yMin)+(zMax-zMin))/300.0 * Deviation.getValue(); // create or use the mesh on the data structure -#if OCC_VERSION_HEX >= 0x060600 Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * M_PI; - BRepMesh_IncrementalMesh(cShape, deflection, Standard_False, AngDeflectionRads, Standard_True); -#else - BRepMesh_IncrementalMesh(cShape, deflection); -#endif + // We must reset the location here because the transformation data // are set in the placement property TopLoc_Location aLoc; diff --git a/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp b/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp index c6655ac8f9..5816a721ad 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderTransformed.cpp @@ -214,12 +214,9 @@ void ViewProviderTransformed::showRejectedShape(TopoDS_Shape shape) // create or use the mesh on the data structure // Note: This DOES have an effect on shape -#if OCC_VERSION_HEX >= 0x060600 Standard_Real AngDeflectionRads = AngularDeflection.getValue() / 180.0 * M_PI; BRepMesh_IncrementalMesh(shape, deflection, Standard_False, AngDeflectionRads, Standard_True); -#else - BRepMesh_IncrementalMesh(shape, deflection); -#endif + // We must reset the location here because the transformation data // are set in the placement property TopLoc_Location aLoc; diff --git a/src/Mod/Path/App/Area.cpp b/src/Mod/Path/App/Area.cpp index 62b36d7f2e..77e1884160 100644 --- a/src/Mod/Path/App/Area.cpp +++ b/src/Mod/Path/App/Area.cpp @@ -860,11 +860,7 @@ struct WireJoiner { int rcount = 0; for (auto& info : edges) { -#if OCC_VERSION_HEX >= 0x070000 if (BRep_Tool::IsClosed(info.edge)) -#else - if (info.p1.SquareDistance(info.p2) < tol) -#endif { auto wire = BRepBuilderAPI_MakeWire(info.edge).Wire(); Area::showShape(wire, "closed"); diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 490cdf7040..442a0ea127 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -3463,7 +3463,6 @@ bool Sketch::updateGeometry() for(auto it3 = occtknots.begin() ; it3 != occtknots.end(); ++it3) knots.push_back(*it3); - #if OCC_VERSION_HEX >= 0x060900 int index = 0; for(std::vector::const_iterator it5 = mybsp.knotpointGeoids.begin(); it5 != mybsp.knotpointGeoids.end(); ++it5, index++) { if( *it5 != GeoEnum::GeoUndef) { @@ -3488,8 +3487,6 @@ bool Sketch::updateGeometry() } } } - #endif - } } catch (Base::Exception &e) { Base::Console().Error("Updating geometry: Error build geometry(%d): %s\n", diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 81e6c4bb41..c75d96978f 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -5204,12 +5204,10 @@ int SketchObject::exposeInternalGeometry(int GeoId) else { controlpointgeoids[0] = currentgeoid+incrgeo+1; } - incrgeo++; } } - #if OCC_VERSION_HEX >= 0x060900 index=0; for(it=knotgeoids.begin(), itb=knotpoints.begin(); it!=knotgeoids.end() && itb!=knotpoints.end(); ++it, ++itb, index++) { @@ -5239,21 +5237,8 @@ int SketchObject::exposeInternalGeometry(int GeoId) incrgeo++; } } - #endif Q_UNUSED(isfirstweightconstrained); - // constraint the first weight to allow for seamless weight modification and proper visualization - /*if(!isfirstweightconstrained) { - - Sketcher::Constraint *newConstr = new Sketcher::Constraint(); - newConstr->Type = Sketcher::Radius; - newConstr->First = controlpointgeoids[0]; - newConstr->FirstPos = Sketcher::PointPos::none; - newConstr->setValue( round(distance_p0_p1/6)); // 1/6 is just an estimation for acceptable general visualization - - icon.push_back(newConstr); - - }*/ this->addGeometry(igeo,true); this->addConstraints(icon); @@ -5750,10 +5735,6 @@ bool SketchObject::modifyBSplineKnotMultiplicity(int GeoId, int knotIndex, int m { Base::StateLocker lock(managedoperation, true); // no need to check input data validity as this is an sketchobject managed operation. - #if OCC_VERSION_HEX < 0x060900 - THROWMT(Base::NotImplementedError, QT_TRANSLATE_NOOP("Exceptions", "This version of OCE/OCC does not support knot operation. You need 6.9.0 or higher.")) - #endif - if (GeoId < 0 || GeoId > getHighestCurveIndex()) THROWMT(Base::ValueError,QT_TRANSLATE_NOOP("Exceptions", "BSpline Geometry Index (GeoID) is out of bounds.")) @@ -5927,10 +5908,6 @@ bool SketchObject::insertBSplineKnot(int GeoId, double param, int multiplicity) { Base::StateLocker lock(managedoperation, true); // TODO: Check if this is still valid: no need to check input data validity as this is an sketchobject managed operation. - #if OCC_VERSION_HEX < 0x060900 - THROWMT(Base::NotImplementedError, QT_TRANSLATE_NOOP("Exceptions", "This version of OCE/OCC does not support knot operation. You need 6.9.0 or higher.")) - #endif - // handling unacceptable cases if (GeoId < 0 || GeoId > getHighestCurveIndex()) THROWMT(Base::ValueError,QT_TRANSLATE_NOOP("Exceptions", "BSpline Geometry Index (GeoID) is out of bounds.")); @@ -6634,11 +6611,7 @@ void SketchObject::rebuildExternalGeometry(void) gp_Trsf mov; mov.SetValues(invMat[0][0],invMat[0][1],invMat[0][2],invMat[0][3], invMat[1][0],invMat[1][1],invMat[1][2],invMat[1][3], - invMat[2][0],invMat[2][1],invMat[2][2],invMat[2][3] -#if OCC_VERSION_HEX < 0x060800 - , 0.00001, 0.00001 -#endif - ); //precision was removed in OCCT CR0025194 + invMat[2][0],invMat[2][1],invMat[2][2],invMat[2][3]); gp_Ax3 sketchAx3(gp_Pnt(Pos.x,Pos.y,Pos.z), gp_Dir(dN.x,dN.y,dN.z), @@ -7727,32 +7700,6 @@ double SketchObject::calculateAngleViaPoint(int GeoId1, int GeoId2, double px, d } else throw Base::ValueError("Null geometry in calculateAngleViaPoint"); - -/* - // OCC-based calculation. It is faster, but it was removed due to problems - // with reversed geometry (clockwise arcs). More info in "Sketch: how to - // handle reversed external arcs?" forum thread - // http://forum.freecadweb.org/viewtopic.php?f=10&t=9130&sid=1b994fa1236db5ac2371eeb9a53de23f - - const Part::GeomCurve &g1 = *(dynamic_cast(this->getGeometry(GeoId1))); - const Part::GeomCurve &g2 = *(dynamic_cast(this->getGeometry(GeoId2))); - Base::Vector3d p(px, py, 0.0); - - double u1 = 0.0; - double u2 = 0.0; - if (! g1.closestParameterToBasicCurve(p, u1) ) throw Base::ValueError("SketchObject::calculateAngleViaPoint: closestParameter(curve1) failed!"); - if (! g2.closestParameterToBasicCurve(p, u2) ) throw Base::ValueError("SketchObject::calculateAngleViaPoint: closestParameter(curve2) failed!"); - - gp_Dir tan1, tan2; - if (! g1.tangent(u1,tan1) ) throw Base::ValueError("SketchObject::calculateAngleViaPoint: tangent1 failed!"); - if (! g2.tangent(u2,tan2) ) throw Base::ValueError("SketchObject::calculateAngleViaPoint: tangent2 failed!"); - - assert(abs(tan1.Z())<0.0001); - assert(abs(tan2.Z())<0.0001); - - double ang = atan2(-tan2.X()*tan1.Y()+tan2.Y()*tan1.X(), tan2.X()*tan1.X() + tan2.Y()*tan1.Y()); - return ang; -*/ } void SketchObject::constraintsRenamed(const std::map &renamed) diff --git a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp index 2912d77225..78193fefb9 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp @@ -653,15 +653,6 @@ void CmdSketcherIncreaseKnotMultiplicity::activated(int iMsg) { Q_UNUSED(iMsg); -#if OCC_VERSION_HEX < 0x060900 - QMessageBox::warning(Gui::getMainWindow(), - QObject::tr("Wrong OCE/OCC version"), - QObject::tr("This version of OCE/OCC " - "does not support knot operation. " - "You need 6.9.0 or higher")); - return; -#endif - // get the selection std::vector selection; selection = getSelection().getSelectionEx(nullptr, Sketcher::SketchObject::getClassTypeId()); @@ -800,15 +791,6 @@ void CmdSketcherDecreaseKnotMultiplicity::activated(int iMsg) { Q_UNUSED(iMsg); -#if OCC_VERSION_HEX < 0x060900 - QMessageBox::warning(Gui::getMainWindow(), - QObject::tr("Wrong OCE/OCC version"), - QObject::tr("This version of OCE/OCC " - "does not support knot operation. " - "You need 6.9.0 or higher")); - return; -#endif - // get the selection std::vector selection; selection = getSelection().getSelectionEx(nullptr, Sketcher::SketchObject::getClassTypeId()); @@ -1175,15 +1157,6 @@ void CmdSketcherInsertKnot::activated(int iMsg) { Q_UNUSED(iMsg); -#if OCC_VERSION_HEX < 0x060900 - QMessageBox::warning(Gui::getMainWindow(), - QObject::tr("Wrong OCE/OCC version"), - QObject::tr("This version of OCE/OCC " - "does not support knot operation. " - "You need 6.9.0 or higher")); - return; -#endif - // get the selection std::vector selection; selection = getSelection().getSelectionEx(nullptr, Sketcher::SketchObject::getClassTypeId()); diff --git a/src/Mod/Surface/App/FeatureExtend.cpp b/src/Mod/Surface/App/FeatureExtend.cpp index 67cf6c9a92..da53f3415f 100644 --- a/src/Mod/Surface/App/FeatureExtend.cpp +++ b/src/Mod/Surface/App/FeatureExtend.cpp @@ -143,11 +143,7 @@ App::DocumentObjectExecReturn *Extend::execute(void) approx.Init(approxPoints, ParType, DegMin, DegMax, Continuity, Tol3d); Handle(Geom_BSplineSurface) surface(approx.Surface()); - BRepBuilderAPI_MakeFace mkFace(surface -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkFace(surface, Precision::Confusion()); Shape.setValue(mkFace.Face()); diff --git a/src/Mod/Surface/App/FeatureSections.cpp b/src/Mod/Surface/App/FeatureSections.cpp index 9583f8b316..7aeccce826 100644 --- a/src/Mod/Surface/App/FeatureSections.cpp +++ b/src/Mod/Surface/App/FeatureSections.cpp @@ -92,11 +92,7 @@ App::DocumentObjectExecReturn *Sections::execute(void) if (aSurf.IsNull()) return new App::DocumentObjectExecReturn("Failed to create surface from sections."); - BRepBuilderAPI_MakeFace mkFace(aSurf -#if OCC_VERSION_HEX >= 0x060502 - , Precision::Confusion() -#endif - ); + BRepBuilderAPI_MakeFace mkFace(aSurf, Precision::Confusion() ); Shape.setValue(mkFace.Face()); return StdReturn;