Sketcher: OCC checks for knot functionality
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
# include <Precision.hxx>
|
||||
# include <ShapeFix_Wire.hxx>
|
||||
# include <TopoDS_Compound.hxx>
|
||||
# include <Standard_Version.hxx>
|
||||
#endif
|
||||
|
||||
#include <Base/Writer.h>
|
||||
@@ -2704,6 +2705,7 @@ bool Sketch::updateGeometry()
|
||||
|
||||
bsp->setKnots(knots,mult);
|
||||
|
||||
#if OCC_VERSION_HEX >= 0x060900
|
||||
int index = 0;
|
||||
for(std::vector<int>::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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# include <QMessageBox>
|
||||
# include <Precision.hxx>
|
||||
# include <QApplication>
|
||||
# include <Standard_Version.hxx>
|
||||
#endif
|
||||
|
||||
# include <QMessageBox>
|
||||
@@ -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<Gui::SelectionObject> 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<Gui::SelectionObject> selection = getSelection().getSelectionEx();
|
||||
|
||||
@@ -772,6 +785,7 @@ CmdSketcherCompModifyKnotMultiplicity::CmdSketcherCompModifyKnotMultiplicity()
|
||||
|
||||
void CmdSketcherCompModifyKnotMultiplicity::activated(int iMsg)
|
||||
{
|
||||
|
||||
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
|
||||
Gui::Command * cmd;
|
||||
|
||||
Reference in New Issue
Block a user