diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index 94d383976a..d8f124eb53 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -27,6 +27,7 @@ # include # include # include +# include #endif #include @@ -2704,6 +2705,7 @@ bool Sketch::updateGeometry() bsp->setKnots(knots,mult); + #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 != Constraint::GeoUndef) { @@ -2716,6 +2718,7 @@ bool Sketch::updateGeometry() } } } + #endif } } catch (Base::Exception e) { diff --git a/src/Mod/Sketcher/App/SketchObject.cpp b/src/Mod/Sketcher/App/SketchObject.cpp index 80a36a34ea..2fdc03d844 100644 --- a/src/Mod/Sketcher/App/SketchObject.cpp +++ b/src/Mod/Sketcher/App/SketchObject.cpp @@ -3478,6 +3478,7 @@ int SketchObject::exposeInternalGeometry(int GeoId) } } + #if OCC_VERSION_HEX >= 0x060900 index=0; for(it=knotgeoids.begin(), itb=knotpoints.begin(); it!=knotgeoids.end() && itb!=knotpoints.end(); ++it, ++itb, index++) { @@ -3507,7 +3508,7 @@ int SketchObject::exposeInternalGeometry(int GeoId) incrgeo++; } } - + #endif Q_UNUSED(isfirstweightconstrained); // constraint the first weight to allow for seamless weight modification and proper visualization @@ -3959,6 +3960,11 @@ bool SketchObject::increaseBSplineDegree(int GeoId, int degreeincrement /*= 1*/) bool SketchObject::modifyBSplineKnotMultiplicity(int GeoId, int knotIndex, int multiplicityincr) { + #if OCC_VERSION_HEX < 0x060900 + Base::Console().Error("This version of OCE/OCC does not support knot operation. You need 6.9.0 or higher\n"); + return false; + #endif + if (GeoId < 0 || GeoId > getHighestCurveIndex()) return false; diff --git a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp index a38d0b0c1f..b9addfc521 100644 --- a/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp +++ b/src/Mod/Sketcher/Gui/CommandSketcherBSpline.cpp @@ -27,6 +27,7 @@ # include # include # include +# include #endif # include @@ -508,6 +509,12 @@ 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 = getSelection().getSelectionEx(); @@ -641,6 +648,12 @@ 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 = getSelection().getSelectionEx(); @@ -772,6 +785,7 @@ CmdSketcherCompModifyKnotMultiplicity::CmdSketcherCompModifyKnotMultiplicity() void CmdSketcherCompModifyKnotMultiplicity::activated(int iMsg) { + Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager(); Gui::Command * cmd;