Sketcher: move icons to splines subdirectory

Add the icon path to the workbench's `InitGui.py`.
This commit is contained in:
vocx-fc
2020-09-24 19:12:31 -05:00
committed by Yorik van Havre
parent 6b3691870e
commit a2f8ea98ea
12 changed files with 62 additions and 29 deletions

View File

@@ -410,7 +410,7 @@ bool CmdSketcherConvertToNURB::isActive(void)
return isSketcherBSplineActive( getActiveGuiDocument(), true );
}
// Convert to NURB
// Increase degree of the spline
DEF_STD_CMD_A(CmdSketcherIncreaseDegree)
CmdSketcherIncreaseDegree::CmdSketcherIncreaseDegree()
@@ -444,7 +444,7 @@ void CmdSketcherIncreaseDegree::activated(int iMsg)
const std::vector<std::string> &SubNames = selection[0].getSubNames();
Sketcher::SketchObject* Obj = static_cast<Sketcher::SketchObject*>(selection[0].getObject());
openCommand("Increase degree");
openCommand("Increase spline degree");
bool ignored=false;
@@ -469,8 +469,10 @@ void CmdSketcherIncreaseDegree::activated(int iMsg)
}
if(ignored) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("At least one of the selected objects was not a B-Spline and was ignored."));
QMessageBox::warning(Gui::getMainWindow(),
QObject::tr("Wrong selection"),
QObject::tr("At least one of the selected "
"objects was not a B-Spline and was ignored."));
}
commitCommand();
@@ -485,6 +487,18 @@ bool CmdSketcherIncreaseDegree::isActive(void)
return isSketcherBSplineActive( getActiveGuiDocument(), true );
}
// TODO: implement this function to complement Sketcher_BSplineIncreaseDegree
// Decrease degree of the spline
// DEF_STD_CMD_A(CmdSketcherDecreaseDegree)
// CmdSketcherDecreaseDegree::CmdSketcherDecreaseDegree()
// :Command("Sketcher_BSplineDecreaseDegree")
// {
// ...
// }
DEF_STD_CMD_A(CmdSketcherIncreaseKnotMultiplicity)
CmdSketcherIncreaseKnotMultiplicity::CmdSketcherIncreaseKnotMultiplicity()
@@ -505,11 +519,14 @@ 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"));
#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
#endif
// get the selection
std::vector<Gui::SelectionObject> selection;
@@ -524,7 +541,8 @@ void CmdSketcherIncreaseKnotMultiplicity::activated(int iMsg)
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if(SubNames.size()>1) {
// Check that only one object is selected, as we need only one object to get the new GeoId after multiplicity change
// Check that only one object is selected,
// as we need only one object to get the new GeoId after multiplicity change
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("The selection comprises more than one item. Please select just one knot."));
return;
@@ -560,23 +578,26 @@ void CmdSketcherIncreaseKnotMultiplicity::activated(int iMsg)
applied = true;
// Warning: GeoId list might have changed as the consequence of deleting pole circles and
// Warning: GeoId list might have changed
// as the consequence of deleting pole circles and
// particularly B-spline GeoID might have changed.
}
catch (const Base::CADKernelError& e) {
e.ReportException();
if(e.getTranslatable()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("CAD Kernel Error"),
QObject::tr(e.getMessage().c_str()));
QMessageBox::warning(Gui::getMainWindow(),
QObject::tr("CAD Kernel Error"),
QObject::tr(e.getMessage().c_str()));
}
getSelection().clearSelection();
}
catch (const Base::Exception& e) {
e.ReportException();
if(e.getTranslatable()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Input Error"),
QObject::tr(e.getMessage().c_str()));
QMessageBox::warning(Gui::getMainWindow(),
QObject::tr("Input Error"),
QObject::tr(e.getMessage().c_str()));
}
getSelection().clearSelection();
@@ -591,7 +612,8 @@ void CmdSketcherIncreaseKnotMultiplicity::activated(int iMsg)
}
if(notaknot){
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QMessageBox::warning(Gui::getMainWindow(),
QObject::tr("Wrong selection"),
QObject::tr("None of the selected elements is a knot of a B-spline"));
}
@@ -662,11 +684,14 @@ 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"));
#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
#endif
// get the selection
std::vector<Gui::SelectionObject> selection;
@@ -681,7 +706,8 @@ void CmdSketcherDecreaseKnotMultiplicity::activated(int iMsg)
const std::vector<std::string> &SubNames = selection[0].getSubNames();
if(SubNames.size()>1) {
// Check that only one object is selected, as we need only one object to get the new GeoId after multiplicity change
// Check that only one object is selected,
// as we need only one object to get the new GeoId after multiplicity change
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"),
QObject::tr("The selection comprises more than one item. Please select just one knot."));
return;
@@ -886,6 +912,8 @@ void CreateSketcherCommandsBSpline(void)
rcCmdMgr.addCommand(new CmdSketcherCompBSplineShowHideGeometryInformation());
rcCmdMgr.addCommand(new CmdSketcherConvertToNURB());
rcCmdMgr.addCommand(new CmdSketcherIncreaseDegree());
// TODO: implement this function to complement CmdSketcherIncreaseDegree
// rcCmdMgr.addCommand(new CmdSketcherDecreaseDegree());
rcCmdMgr.addCommand(new CmdSketcherIncreaseKnotMultiplicity());
rcCmdMgr.addCommand(new CmdSketcherDecreaseKnotMultiplicity());
rcCmdMgr.addCommand(new CmdSketcherCompModifyKnotMultiplicity());

View File

@@ -46,15 +46,19 @@
</qresource>
<qresource>
<file>icons/Sketcher_AlterFillet.svg</file>
<file>icons/Sketcher_BSplineApproximate.svg</file>
<file>icons/Sketcher_BSplineComb.svg</file>
<file>icons/Sketcher_BSplineDecreaseDegree.svg</file>
<file>icons/Sketcher_BSplineDecreaseKnotMultiplicity.svg</file>
<file>icons/Sketcher_BSplineDegree.svg</file>
<file>icons/Sketcher_BSplineIncreaseDegree.svg</file>
<file>icons/Sketcher_BSplineIncreaseKnotMultiplicity.svg</file>
<file>icons/Sketcher_BSplineKnotMultiplicity.svg</file>
<file>icons/Sketcher_BSplinePolygon.svg</file>
</qresource>
<qresource>
<file>icons/splines/Sketcher_BSplineApproximate.svg</file>
<file>icons/splines/Sketcher_BSplineComb.svg</file>
<file>icons/splines/Sketcher_BSplineDecreaseDegree.svg</file>
<file>icons/splines/Sketcher_BSplineDecreaseKnotMultiplicity.svg</file>
<file>icons/splines/Sketcher_BSplineDegree.svg</file>
<file>icons/splines/Sketcher_BSplineIncreaseDegree.svg</file>
<file>icons/splines/Sketcher_BSplineIncreaseKnotMultiplicity.svg</file>
<file>icons/splines/Sketcher_BSplineKnotMultiplicity.svg</file>
<file>icons/splines/Sketcher_BSplinePolygon.svg</file>
</qresource>
<qresource>
<file>icons/Sketcher_CarbonCopy.svg</file>
<file>icons/Sketcher_CarbonCopy_Constr.svg</file>
<file>icons/Sketcher_Clone.svg</file>

View File

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -47,6 +47,7 @@ class SketcherWorkbench ( Workbench ):
Gui.addIconPath(":/icons/geometry")
# Gui.addIconPath(":/icons/obsolete")
Gui.addIconPath(":/icons/pointers")
Gui.addIconPath(":/icons/splines")
try:
import Profiles
except ImportError: