From 4c39b2f2bdcc6a759a2907be9785b9c7ae032db2 Mon Sep 17 00:00:00 2001 From: Bas Ruigrok Date: Sun, 12 May 2024 14:31:09 +0200 Subject: [PATCH 01/58] App: Add getCameraAlignmentDirection() to GeoFeature --- src/App/GeoFeature.cpp | 7 +++++++ src/App/GeoFeature.h | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/src/App/GeoFeature.cpp b/src/App/GeoFeature.cpp index 1d9e6d763c..b09323d4d7 100644 --- a/src/App/GeoFeature.cpp +++ b/src/App/GeoFeature.cpp @@ -209,6 +209,13 @@ void GeoFeature::setMaterialAppearance(const App::Material& material) Q_UNUSED(material) } +bool GeoFeature::getCameraAlignmentDirection(Base::Vector3d& direction, const char* subname) const +{ + Q_UNUSED(subname) + Q_UNUSED(direction) + return false; +} + #ifdef FC_USE_TNP_FIX bool GeoFeature::hasMissingElement(const char* subname) { diff --git a/src/App/GeoFeature.h b/src/App/GeoFeature.h index 025d5f969e..d483a45243 100644 --- a/src/App/GeoFeature.h +++ b/src/App/GeoFeature.h @@ -141,6 +141,15 @@ public: * appearance from an App::Material object. */ virtual void setMaterialAppearance(const App::Material& material); + + /** + * @brief Virtual function to get the camera alignment direction + * + * Finds a direction to align the camera with. + * + * @return bool whether or not a direction is found. + */ + virtual bool getCameraAlignmentDirection(Base::Vector3d& direction, const char* subname = nullptr) const; #ifdef FC_USE_TNP_FIX /** Search sub element using internal cached geometry * From fb1539f48e80e804398873ac13962a82f5230806 Mon Sep 17 00:00:00 2001 From: Bas Ruigrok Date: Sun, 12 May 2024 14:37:19 +0200 Subject: [PATCH 02/58] Part: Implement getCameraAlignmentDirection() for PartFeature Returns normal of a face or direction of an edge --- src/Mod/Part/App/PartFeature.cpp | 40 ++++++++++++++++++++++++++++++++ src/Mod/Part/App/PartFeature.h | 2 ++ 2 files changed, 42 insertions(+) diff --git a/src/Mod/Part/App/PartFeature.cpp b/src/Mod/Part/App/PartFeature.cpp index aae5563c10..32df8cc8e0 100644 --- a/src/Mod/Part/App/PartFeature.cpp +++ b/src/Mod/Part/App/PartFeature.cpp @@ -35,6 +35,7 @@ # include # include # include +# include # include # include # include @@ -68,6 +69,7 @@ #include #include +#include "Geometry.h" #include "PartFeature.h" #include "PartFeaturePy.h" #include "PartPyCXX.h" @@ -1410,6 +1412,44 @@ bool Feature::isElementMappingDisabled(App::PropertyContainer* container) // return false; } +bool Feature::getCameraAlignmentDirection(Base::Vector3d& direction, const char* subname) const +{ + const auto topoShape = getTopoShape(this, subname, true); + + if (topoShape.isNull()) { + return false; + } + + // Face normal + if (topoShape.isPlanar()) { + try { + const auto face = TopoDS::Face(topoShape.getShape()); + gp_Pnt point; + gp_Vec vector; + BRepGProp_Face(face).Normal(0, 0, point, vector); + direction = Base::Vector3d(vector.X(), vector.Y(), vector.Z()).Normalize(); + return true; + } + catch (Standard_TypeMismatch&) { + // Shape is not a face, do nothing + } + } + + // Edge direction + const size_t edgeCount = topoShape.countSubShapes(TopAbs_EDGE); + if (edgeCount == 1 && topoShape.isLinearEdge()) { + if (const std::unique_ptr geometry = Geometry::fromShape(topoShape.getSubShape(TopAbs_EDGE, 1), true)) { + const std::unique_ptr geomLine(static_cast(geometry.get())->toLine()); + if (geomLine) { + direction = geomLine->getDir().Normalize(); + return true; + } + } + } + + return GeoFeature::getCameraAlignmentDirection(direction, subname); +} + // --------------------------------------------------------- PROPERTY_SOURCE(Part::FilletBase, Part::Feature) diff --git a/src/Mod/Part/App/PartFeature.h b/src/Mod/Part/App/PartFeature.h index 6a1af4d48a..4387ccdd74 100644 --- a/src/Mod/Part/App/PartFeature.h +++ b/src/Mod/Part/App/PartFeature.h @@ -152,6 +152,8 @@ public: create(const TopoShape& shape, const char* name = nullptr, App::Document* document = nullptr); static bool isElementMappingDisabled(App::PropertyContainer *container); + + bool getCameraAlignmentDirection(Base::Vector3d& direction, const char* subname) const override; #ifdef FC_USE_TNP_FIX const std::vector& searchElementCache(const std::string &element, From 3fae3fac63a4ed04f551435543ad8908e00de27e Mon Sep 17 00:00:00 2001 From: Bas Ruigrok Date: Sun, 12 May 2024 14:45:16 +0200 Subject: [PATCH 03/58] Gui: Add alignToSelection() method and command --- src/Gui/CommandView.cpp | 28 +++++++++++++++++++++++++++ src/Gui/View3DInventor.cpp | 7 +++++++ src/Gui/View3DInventorViewer.cpp | 33 ++++++++++++++++++++++++++++++++ src/Gui/View3DInventorViewer.h | 2 ++ 4 files changed, 70 insertions(+) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index f4cb50cd8c..6e77adfb17 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -4076,6 +4076,33 @@ bool StdRecallWorkingView::isActive() return view && view->getViewer()->hasHomePosition(); } +//=========================================================================== +// Std_AlignToSelection +//=========================================================================== + +DEF_STD_CMD_A(StdCmdAlignToSelection) + +StdCmdAlignToSelection::StdCmdAlignToSelection() + : Command("Std_AlignToSelection") +{ + sGroup = "Standard-View"; + sMenuText = QT_TR_NOOP("Align to selection"); + sToolTipText = QT_TR_NOOP("Align the view with the selection"); + sWhatsThis = "Std_AlignToSelection"; + eType = Alter3DView; +} + +void StdCmdAlignToSelection::activated(int iMsg) +{ + Q_UNUSED(iMsg); + doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"AlignToSelection\")"); +} + +bool StdCmdAlignToSelection::isActive() +{ + return getGuiApplication()->sendHasMsgToActiveView("AlignToSelection"); +} + //=========================================================================== // Instantiation //=========================================================================== @@ -4107,6 +4134,7 @@ void CreateViewStdCommands() rcCmdMgr.addCommand(new StdStoreWorkingView()); rcCmdMgr.addCommand(new StdRecallWorkingView()); rcCmdMgr.addCommand(new StdCmdViewGroup()); + rcCmdMgr.addCommand(new StdCmdAlignToSelection()); rcCmdMgr.addCommand(new StdCmdViewExample1()); rcCmdMgr.addCommand(new StdCmdViewExample2()); diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 937128baf1..7770a71f2e 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -408,6 +408,10 @@ bool View3DInventor::onMsg(const char* pMsg, const char** ppReturn) getGuiDocument()->saveCopy(); return true; } + else if (strcmp("AlignToSelection", pMsg) == 0) { + _viewer->alignToSelection(); + return true; + } else if (strcmp("ZoomIn", pMsg) == 0) { View3DInventorViewer* viewer = getViewer(); viewer->navigationStyle()->zoomIn(); @@ -511,6 +515,9 @@ bool View3DInventor::onHasMsg(const char* pMsg) const else if(strncmp("Dump",pMsg,4) == 0) { return true; } + else if (strcmp("AlignToSelection", pMsg) == 0) { + return true; + } if (strcmp("ZoomIn", pMsg) == 0) { return true; } diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index ee5313b081..c792191e0c 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -3341,6 +3341,39 @@ void View3DInventorViewer::viewSelection() } } +void View3DInventorViewer::alignToSelection() +{ + if (!getCamera()) { + return; + } + + const auto selection = Selection().getSelection(); + + // Empty selection + if (selection.empty()) { + return; + } + + // Too much selections + if (selection.size() > 1) { + return; + } + + // Get the geo feature + App::GeoFeature* geoFeature = nullptr; + std::pair elementName; + App::GeoFeature::resolveElement(selection[0].pObject, selection[0].SubName, elementName, false, App::GeoFeature::ElementNameType::Normal, nullptr, nullptr, &geoFeature); + if (!geoFeature) { + return; + } + + Base::Vector3d direction; + if (geoFeature->getCameraAlignmentDirection(direction, selection[0].SubName)) { + const auto orientation = SbRotation(SbVec3f(0, 0, 1), Base::convertTo(direction)); + setCameraOrientation(orientation); + } +} + /** * @brief Decide if it should be possible to start any animation * diff --git a/src/Gui/View3DInventorViewer.h b/src/Gui/View3DInventorViewer.h index eca7f186b0..cdcdc5c853 100644 --- a/src/Gui/View3DInventorViewer.h +++ b/src/Gui/View3DInventorViewer.h @@ -414,6 +414,8 @@ public: */ void viewSelection(); + void alignToSelection(); + void setGradientBackground(Background); Background getGradientBackground() const; void setGradientBackgroundColor(const SbColor& fromColor, From 491f4ea114e75d35eeca850c69ce1f96ce4765b6 Mon Sep 17 00:00:00 2001 From: Bas Ruigrok Date: Thu, 9 May 2024 18:01:18 +0200 Subject: [PATCH 04/58] Gui: Add alignToSelection() icon and add to toolbar Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com> --- src/Gui/CommandView.cpp | 4 +- src/Gui/Icons/align-to-selection.svg | 148 +++++++++++++++++++++++++++ src/Gui/Icons/resource.qrc | 1 + src/Gui/Workbench.cpp | 2 +- 4 files changed, 152 insertions(+), 3 deletions(-) create mode 100644 src/Gui/Icons/align-to-selection.svg diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 6e77adfb17..bf9427538c 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -4079,16 +4079,16 @@ bool StdRecallWorkingView::isActive() //=========================================================================== // Std_AlignToSelection //=========================================================================== - DEF_STD_CMD_A(StdCmdAlignToSelection) StdCmdAlignToSelection::StdCmdAlignToSelection() : Command("Std_AlignToSelection") { - sGroup = "Standard-View"; + sGroup = "View"; sMenuText = QT_TR_NOOP("Align to selection"); sToolTipText = QT_TR_NOOP("Align the view with the selection"); sWhatsThis = "Std_AlignToSelection"; + sPixmap = "align-to-selection"; eType = Alter3DView; } diff --git a/src/Gui/Icons/align-to-selection.svg b/src/Gui/Icons/align-to-selection.svg new file mode 100644 index 0000000000..0d4e894525 --- /dev/null +++ b/src/Gui/Icons/align-to-selection.svg @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + + + + + + + + + diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index 614a660e4b..7a1decff26 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -235,6 +235,7 @@ colors.svg px.svg AddonManager.svg + align-to-selection.svg Group.svg Geofeaturegroup.svg Geoassembly.svg diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index dcc97d9561..e2cdb337da 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -810,7 +810,7 @@ ToolBarItem* StdWorkbench::setupToolBars() const // View auto view = new ToolBarItem( root ); view->setCommand("View"); - *view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewGroup" + *view << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_ViewGroup" << "Std_AlignToSelection" << "Separator" << "Std_DrawStyle" << "Std_TreeViewActions" << "Separator" << "Std_MeasureDistance" << "Std_Measure"; From 88216148ce59679458c1f6c099b421a15ea62ab5 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 14 May 2024 12:06:15 +0200 Subject: [PATCH 05/58] Fix linter warnings --- src/Gui/propertyeditor/PropertyItem.cpp | 13 +++++++------ src/Gui/propertyeditor/PropertyItem.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index b248226738..5403db49fb 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -102,7 +102,7 @@ QVariant PropertyItemAttorney::toString(PropertyItem* item, const QVariant& valu // ---------------------------------------------------- -Q_DECLARE_METATYPE(Py::Object) +Q_DECLARE_METATYPE(Py::Object) // NOLINT PROPERTYITEM_SOURCE(Gui::PropertyEditor::PropertyItem) @@ -843,7 +843,7 @@ void PropertyStringItem::setValue(const QVariant& value) return; } QString val = value.toString(); - val = QString::fromUtf8(Base::Interpreter().strToPython(val.toUtf8()).c_str()); + val = QString::fromUtf8(Base::InterpreterSingleton::strToPython(val.toUtf8()).c_str()); QString data = QString::fromLatin1("\"%1\"").arg(val); setPropertyValue(data); } @@ -3000,7 +3000,7 @@ void PropertyEnumItem::setValue(const QVariant& value) text.replace(QString::fromUtf8("'"),QString::fromUtf8("\\'")); std::string pystr = Base::Tools::escapedUnicodeFromUtf8(text.toUtf8()); - pystr = Base::Interpreter().strToPython(pystr.c_str()); + pystr = Base::InterpreterSingleton::strToPython(pystr.c_str()); str << "u\"" << pystr.c_str() << "\", "; } str << "]"; @@ -3264,7 +3264,7 @@ void PropertyStringListItem::setValue(const QVariant& value) str << "["; for (const auto & it : values) { QString text(it); - std::string pystr = Base::Interpreter().strToPython(text.toUtf8().constData()); + std::string pystr = Base::InterpreterSingleton::strToPython(text.toUtf8().constData()); str << "\"" << QString::fromUtf8(pystr.c_str()) << "\", "; } str << "]"; @@ -3507,7 +3507,7 @@ namespace Gui::PropertyEditor { }; } -Q_DECLARE_METATYPE(Gui::PropertyEditor::Material) +Q_DECLARE_METATYPE(Gui::PropertyEditor::Material) // NOLINT PROPERTYITEM_SOURCE(Gui::PropertyEditor::PropertyMaterialItem) @@ -4533,7 +4533,8 @@ QVariant PropertyTransientFileItem::editorData(QWidget *editor) const // --------------------------------------------------------------- -LinkSelection::LinkSelection(const App::SubObjectT &link) : link(link) +LinkSelection::LinkSelection(App::SubObjectT link) + : link(std::move(link)) { } diff --git a/src/Gui/propertyeditor/PropertyItem.h b/src/Gui/propertyeditor/PropertyItem.h index 806383e09a..7b6064ae22 100644 --- a/src/Gui/propertyeditor/PropertyItem.h +++ b/src/Gui/propertyeditor/PropertyItem.h @@ -1179,7 +1179,7 @@ class LinkSelection : public QObject Q_OBJECT public: - explicit LinkSelection(const App::SubObjectT &); + explicit LinkSelection(App::SubObjectT); ~LinkSelection() override; public Q_SLOTS: From f3327475b92a2908adf1d436bdc1ea4237dc8911 Mon Sep 17 00:00:00 2001 From: wmayer Date: Tue, 14 May 2024 15:58:44 +0200 Subject: [PATCH 06/58] Gui: move to new-style connect() in createEditor() --- src/Gui/propertyeditor/PropertyItem.cpp | 112 +++++++++--------- src/Gui/propertyeditor/PropertyItem.h | 56 ++++----- .../propertyeditor/PropertyItemDelegate.cpp | 18 ++- src/Gui/propertyeditor/PropertyItemDelegate.h | 3 +- src/Mod/Fem/Gui/PropertyFemMeshItem.cpp | 4 +- src/Mod/Fem/Gui/PropertyFemMeshItem.h | 3 +- src/Mod/Mesh/Gui/PropertyEditorMesh.cpp | 4 +- src/Mod/Mesh/Gui/PropertyEditorMesh.h | 4 +- src/Mod/Part/Gui/PropertyEnumAttacherItem.cpp | 5 +- src/Mod/Part/Gui/PropertyEnumAttacherItem.h | 2 +- .../Gui/PropertyConstraintListItem.cpp | 4 +- .../Sketcher/Gui/PropertyConstraintListItem.h | 3 +- 12 files changed, 109 insertions(+), 109 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index 5403db49fb..6167dd4c17 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -498,7 +498,7 @@ void PropertyItem::setValue(const QVariant& /*value*/) { } -QWidget* PropertyItem::createEditor(QWidget* /*parent*/, const QObject* /*receiver*/, const char* /*method*/) const +QWidget* PropertyItem::createEditor(QWidget* /*parent*/, const std::function& /*method*/) const { return nullptr; } @@ -512,7 +512,7 @@ QVariant PropertyItem::editorData(QWidget * /*editor*/) const return {}; } -QWidget* PropertyItem::createExpressionEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyItem::createExpressionEditor(QWidget* parent, const std::function& method) const { if(!isBound()) { return nullptr; @@ -520,7 +520,7 @@ QWidget* PropertyItem::createExpressionEditor(QWidget* parent, const QObject* re auto le = new ExpLineEdit(parent,true); le->setFrame(false); le->setReadOnly(true); - QObject::connect(le, SIGNAL(textChanged(QString)), receiver, method); + QObject::connect(le, &ExpLineEdit::textChanged, method); le->bind(getPath()); le->setAutoApply(autoApply()); return le; @@ -849,12 +849,12 @@ void PropertyStringItem::setValue(const QVariant& value) } } -QWidget* PropertyStringItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyStringItem::createEditor(QWidget* parent, const std::function& method) const { auto le = new ExpLineEdit(parent); le->setFrame(false); le->setReadOnly(isReadOnly()); - QObject::connect(le, SIGNAL(textChanged(QString)), receiver, method); + QObject::connect(le, &ExpLineEdit::textChanged, method); if(isBound()) { le->bind(getPath()); le->setAutoApply(autoApply()); @@ -900,12 +900,16 @@ void PropertyFontItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyFontItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyFontItem::createEditor(QWidget* parent, const std::function& method) const { auto cb = new QComboBox(parent); cb->setFrame(false); cb->setDisabled(isReadOnly()); - QObject::connect(cb, SIGNAL(activated(QString)), receiver, method); +#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) + QObject::connect(cb, qOverload(&QComboBox::activated), method); +#else + QObject::connect(cb, &QComboBox::textActivated, method); +#endif return cb; } @@ -932,11 +936,10 @@ QVariant PropertyFontItem::editorData(QWidget *editor) const PROPERTYITEM_SOURCE(Gui::PropertyEditor::PropertySeparatorItem) -QWidget* PropertySeparatorItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertySeparatorItem::createEditor(QWidget* parent, const std::function& method) const { - Q_UNUSED(parent); - Q_UNUSED(receiver); - Q_UNUSED(method); + Q_UNUSED(parent); + Q_UNUSED(method); return nullptr; } @@ -967,12 +970,12 @@ void PropertyIntegerItem::setValue(const QVariant& value) } } -QWidget* PropertyIntegerItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyIntegerItem::createEditor(QWidget* parent, const std::function& method) const { auto sb = new Gui::IntSpinBox(parent); sb->setFrame(false); sb->setReadOnly(isReadOnly()); - QObject::connect(sb, SIGNAL(valueChanged(int)), receiver, method); + QObject::connect(sb, qOverload(&Gui::IntSpinBox::valueChanged), method); if (isBound()) { sb->bind(getPath()); @@ -1034,12 +1037,12 @@ void PropertyIntegerConstraintItem::setValue(const QVariant& value) } } -QWidget* PropertyIntegerConstraintItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyIntegerConstraintItem::createEditor(QWidget* parent, const std::function& method) const { auto sb = new Gui::IntSpinBox(parent); sb->setFrame(false); sb->setReadOnly(isReadOnly()); - QObject::connect(sb, SIGNAL(valueChanged(int)), receiver, method); + QObject::connect(sb, qOverload(&Gui::IntSpinBox::valueChanged), method); if (isBound()) { sb->bind(getPath()); @@ -1131,13 +1134,13 @@ void PropertyFloatItem::setValue(const QVariant& value) } } -QWidget* PropertyFloatItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyFloatItem::createEditor(QWidget* parent, const std::function& method) const { auto sb = new Gui::DoubleSpinBox(parent); sb->setFrame(false); sb->setDecimals(decimals()); sb->setReadOnly(isReadOnly()); - QObject::connect(sb, SIGNAL(valueChanged(double)), receiver, method); + QObject::connect(sb, qOverload(&Gui::DoubleSpinBox::valueChanged), method); if (isBound()) { sb->bind(getPath()); @@ -1201,7 +1204,7 @@ void PropertyUnitItem::setValue(const QVariant& value) } } -QWidget* PropertyUnitItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyUnitItem::createEditor(QWidget* parent, const std::function& method) const { auto infield = new Gui::QuantitySpinBox(parent); infield->setFrame(false); @@ -1215,7 +1218,7 @@ QWidget* PropertyUnitItem::createEditor(QWidget* parent, const QObject* receiver } - QObject::connect(infield, SIGNAL(valueChanged(double)), receiver, method); + QObject::connect(infield, qOverload(&Gui::QuantitySpinBox::valueChanged), method); return infield; } @@ -1304,13 +1307,13 @@ void PropertyFloatConstraintItem::setValue(const QVariant& value) } } -QWidget* PropertyFloatConstraintItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyFloatConstraintItem::createEditor(QWidget* parent, const std::function& method) const { auto sb = new Gui::DoubleSpinBox(parent); sb->setDecimals(decimals()); sb->setFrame(false); sb->setReadOnly(isReadOnly()); - QObject::connect(sb, SIGNAL(valueChanged(double)), receiver, method); + QObject::connect(sb, qOverload(&Gui::DoubleSpinBox::valueChanged), method); if (isBound()) { sb->bind(getPath()); @@ -1400,14 +1403,14 @@ void PropertyBoolItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyBoolItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyBoolItem::createEditor(QWidget* parent, const std::function& method) const { auto cb = new QComboBox(parent); cb->setFrame(false); cb->addItem(QLatin1String("false")); cb->addItem(QLatin1String("true")); cb->setDisabled(isReadOnly()); - QObject::connect(cb, SIGNAL(activated(int)), receiver, method); + QObject::connect(cb, qOverload(&QComboBox::activated), method); return cb; } @@ -1513,7 +1516,7 @@ void PropertyVectorItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyVectorItem::createEditor(QWidget* parent, const QObject* /*receiver*/, const char* /*method*/) const +QWidget* PropertyVectorItem::createEditor(QWidget* parent, const std::function& /*method*/) const { auto le = new VectorLineEdit(decimals(), parent); le->setFrame(false); @@ -1735,10 +1738,10 @@ void PropertyVectorListItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyVectorListItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyVectorListItem::createEditor(QWidget* parent, const std::function& method) const { auto pe = new VectorListWidget(decimals(), parent); - QObject::connect(pe, SIGNAL(valueChanged(QVariant)), receiver, method); + QObject::connect(pe, &VectorListWidget::valueChanged, method); pe->setDisabled(isReadOnly()); return pe; } @@ -1823,7 +1826,7 @@ void PropertyVectorDistanceItem::setEditorData(QWidget *editor, const QVariant& le->setText(toString(data).toString()); } -QWidget* PropertyVectorDistanceItem::createEditor(QWidget* parent, const QObject* /*receiver*/, const char* /*method*/) const +QWidget* PropertyVectorDistanceItem::createEditor(QWidget* parent, const std::function& /*method*/) const { auto le = new VectorLineEdit(decimals(), parent); le->setFrame(false); @@ -2045,7 +2048,7 @@ void PropertyMatrixItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyMatrixItem::createEditor(QWidget* parent, const QObject* /*receiver*/, const char* /*method*/) const +QWidget* PropertyMatrixItem::createEditor(QWidget* parent, const std::function& /*method*/) const { auto le = new QLineEdit(parent); le->setFrame(false); @@ -2570,10 +2573,9 @@ void PropertyRotationItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyRotationItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyRotationItem::createEditor(QWidget* parent, const std::function& method) const { Q_UNUSED(parent) - Q_UNUSED(receiver) Q_UNUSED(method) return nullptr; } @@ -2891,10 +2893,10 @@ void PropertyPlacementItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyPlacementItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyPlacementItem::createEditor(QWidget* parent, const std::function& method) const { auto pe = new PlacementEditor(this->propertyName(), parent); - QObject::connect(pe, SIGNAL(valueChanged(QVariant)), receiver, method); + QObject::connect(pe, &PlacementEditor::valueChanged, method); // The Placement dialog only works if property is part of a DocumentObject bool readonly = isReadOnly(); @@ -3135,7 +3137,7 @@ QStringList PropertyEnumItem::getCommonModes() const return commonModes; } -QWidget* PropertyEnumItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyEnumItem::createEditor(QWidget* parent, const std::function& method) const { QStringList commonModes = getCommonModes(); if (commonModes.isEmpty()) { @@ -3149,7 +3151,7 @@ QWidget* PropertyEnumItem::createEditor(QWidget* parent, const QObject* receiver cb->setFrame(false); cb->setDisabled(isReadOnly()); cb->addItems(commonModes); - QObject::connect(cb, SIGNAL(activated(int)), receiver, method); + QObject::connect(cb, qOverload(&QComboBox::activated), method); return cb; } @@ -3167,7 +3169,7 @@ QWidget* PropertyEnumItem::createEditor(QWidget* parent, const QObject* receiver button->setText(action->data().toString()); Q_EMIT button->picked(); }); - QObject::connect(button, SIGNAL(picked()), receiver, method); + QObject::connect(button, &PropertyEnumButton::picked, method); return button; } @@ -3199,12 +3201,12 @@ PROPERTYITEM_SOURCE(Gui::PropertyEditor::PropertyStringListItem) PropertyStringListItem::PropertyStringListItem() = default; -QWidget* PropertyStringListItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyStringListItem::createEditor(QWidget* parent, const std::function& method) const { auto le = new Gui::LabelEditor(parent); le->setAutoFillBackground(true); le->setDisabled(isReadOnly()); - QObject::connect(le, SIGNAL(textChanged(QString)), receiver, method); + QObject::connect(le, &Gui::LabelEditor::textChanged, method); return le; } @@ -3278,13 +3280,13 @@ PROPERTYITEM_SOURCE(Gui::PropertyEditor::PropertyFloatListItem) PropertyFloatListItem::PropertyFloatListItem() = default; -QWidget* PropertyFloatListItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyFloatListItem::createEditor(QWidget* parent, const std::function& method) const { auto le = new Gui::LabelEditor(parent); le->setAutoFillBackground(true); le->setInputType(Gui::LabelEditor::Float); le->setDisabled(isReadOnly()); - QObject::connect(le, SIGNAL(textChanged(QString)), receiver, method); + QObject::connect(le, &Gui::LabelEditor::textChanged, method); return le; } @@ -3353,13 +3355,13 @@ PROPERTYITEM_SOURCE(Gui::PropertyEditor::PropertyIntegerListItem) PropertyIntegerListItem::PropertyIntegerListItem() = default; -QWidget* PropertyIntegerListItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyIntegerListItem::createEditor(QWidget* parent, const std::function& method) const { auto le = new Gui::LabelEditor(parent); le->setAutoFillBackground(true); le->setInputType(Gui::LabelEditor::Integer); le->setDisabled(isReadOnly()); - QObject::connect(le, SIGNAL(textChanged(QString)), receiver, method); + QObject::connect(le, &Gui::LabelEditor::textChanged, method); return le; } @@ -3469,11 +3471,11 @@ void PropertyColorItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyColorItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyColorItem::createEditor(QWidget* parent, const std::function& method) const { auto cb = new Gui::ColorButton( parent ); cb->setDisabled(isReadOnly()); - QObject::connect(cb, SIGNAL(changed()), receiver, method); + QObject::connect(cb, &Gui::ColorButton::changed, method); return cb; } @@ -3807,11 +3809,11 @@ void PropertyMaterialItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyMaterialItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyMaterialItem::createEditor(QWidget* parent, const std::function& method) const { auto cb = new Gui::ColorButton(parent); cb->setDisabled(isReadOnly()); - QObject::connect(cb, SIGNAL(changed()), receiver, method); + QObject::connect(cb, &Gui::ColorButton::changed, method); return cb; } @@ -4305,11 +4307,11 @@ void PropertyMaterialListItem::setValue(const QVariant& value) setPropertyValue(data); } -QWidget* PropertyMaterialListItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyMaterialListItem::createEditor(QWidget* parent, const std::function& method) const { auto cb = new Gui::ColorButton(parent); cb->setDisabled(isReadOnly()); - QObject::connect(cb, SIGNAL(changed()), receiver, method); + QObject::connect(cb, &Gui::ColorButton::changed, method); return cb; } @@ -4390,12 +4392,12 @@ QVariant PropertyFileItem::toolTip(const App::Property* prop) const return value(prop); } -QWidget* PropertyFileItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyFileItem::createEditor(QWidget* parent, const std::function& method) const { auto fc = new Gui::FileChooser(parent); fc->setAutoFillBackground(true); fc->setDisabled(isReadOnly()); - QObject::connect(fc, SIGNAL(fileNameSelected(QString)), receiver, method); + QObject::connect(fc, &Gui::FileChooser::fileNameSelected, method); return fc; } @@ -4448,13 +4450,13 @@ QVariant PropertyPathItem::toolTip(const App::Property* prop) const return value(prop); } -QWidget* PropertyPathItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyPathItem::createEditor(QWidget* parent, const std::function& method) const { auto fc = new Gui::FileChooser(parent); fc->setMode(FileChooser::Directory); fc->setAutoFillBackground(true); fc->setDisabled(isReadOnly()); - QObject::connect(fc, SIGNAL(fileNameSelected(QString)), receiver, method); + QObject::connect(fc, &Gui::FileChooser::fileNameSelected, method); return fc; } @@ -4500,12 +4502,12 @@ QVariant PropertyTransientFileItem::toolTip(const App::Property* prop) const return value(prop); } -QWidget* PropertyTransientFileItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyTransientFileItem::createEditor(QWidget* parent, const std::function& method) const { auto fc = new Gui::FileChooser(parent); fc->setAutoFillBackground(true); fc->setDisabled(isReadOnly()); - QObject::connect(fc, SIGNAL(fileNameSelected(QString)), receiver, method); + QObject::connect(fc, &Gui::FileChooser::fileNameSelected, method); return fc; } @@ -4728,7 +4730,7 @@ void PropertyLinkItem::setValue(const QVariant& value) setPropertyValue(DlgPropertyLink::linksToPython(links)); } -QWidget* PropertyLinkItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyLinkItem::createEditor(QWidget* parent, const std::function& method) const { if (propertyItems.empty()) { return nullptr; @@ -4736,7 +4738,7 @@ QWidget* PropertyLinkItem::createEditor(QWidget* parent, const QObject* receiver auto ll = new LinkLabel(parent, propertyItems.front()); ll->setAutoFillBackground(true); ll->setDisabled(isReadOnly()); - QObject::connect(ll, SIGNAL(linkChanged(QVariant)), receiver, method); + QObject::connect(ll, &LinkLabel::linkChanged, method); return ll; } diff --git a/src/Gui/propertyeditor/PropertyItem.h b/src/Gui/propertyeditor/PropertyItem.h index 7b6064ae22..54d9ca860d 100644 --- a/src/Gui/propertyeditor/PropertyItem.h +++ b/src/Gui/propertyeditor/PropertyItem.h @@ -135,12 +135,12 @@ public: const App::Property* getFirstProperty() const; /** Creates the appropriate editor for this item and sets the editor to the value of overrideValue(). */ - virtual QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const; + virtual QWidget* createEditor(QWidget* parent, const std::function& method) const; virtual void setEditorData(QWidget *editor, const QVariant& data) const; virtual QVariant editorData(QWidget *editor) const; virtual bool isSeparator() const { return false; } - QWidget* createExpressionEditor(QWidget* parent, const QObject* receiver, const char* method) const; + QWidget* createExpressionEditor(QWidget* parent, const std::function& method) const; void setExpressionEditorData(QWidget *editor, const QVariant& data) const; QVariant expressionEditorData(QWidget *editor) const; @@ -233,7 +233,7 @@ class GuiExport PropertyStringItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -254,7 +254,7 @@ class GuiExport PropertyFontItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -276,7 +276,7 @@ class GuiExport PropertySeparatorItem : public PropertyItem PROPERTYITEM_HEADER bool isSeparator() const override { return true; } - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; int row() const override { return _row<0?PropertyItem::row():_row; @@ -296,7 +296,7 @@ class GuiExport PropertyIntegerItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -318,7 +318,7 @@ class GuiExport PropertyIntegerConstraintItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -356,7 +356,7 @@ class GuiExport PropertyFloatItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -378,7 +378,7 @@ class GuiExport PropertyUnitItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -430,7 +430,7 @@ class GuiExport PropertyFloatConstraintItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -496,7 +496,7 @@ class GuiExport PropertyBoolItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -521,7 +521,7 @@ class GuiExport PropertyVectorItem: public PropertyItem Q_PROPERTY(double z READ z WRITE setZ DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -600,7 +600,7 @@ class GuiExport PropertyVectorListItem : public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -626,7 +626,7 @@ class GuiExport PropertyVectorDistanceItem: public PropertyItem Q_PROPERTY(Base::Quantity z READ z WRITE setZ DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -686,7 +686,7 @@ class GuiExport PropertyMatrixItem: public PropertyItem Q_PROPERTY(double A44 READ getA44 WRITE setA44 DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -784,7 +784,7 @@ class GuiExport PropertyRotationItem: public PropertyItem Q_PROPERTY(Base::Vector3d Axis READ getAxis WRITE setAxis DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -842,7 +842,7 @@ class GuiExport PropertyPlacementItem: public PropertyItem Q_PROPERTY(Base::Vector3d Position READ getPosition WRITE setPosition DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -883,7 +883,7 @@ class GuiExport PropertyEnumItem: public PropertyItem Q_PROPERTY(QStringList Enum READ getEnum WRITE setEnum DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -926,7 +926,7 @@ class GuiExport PropertyStringListItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -948,7 +948,7 @@ class GuiExport PropertyFloatListItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -970,7 +970,7 @@ class GuiExport PropertyIntegerListItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -992,7 +992,7 @@ class GuiExport PropertyColorItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -1021,7 +1021,7 @@ class GuiExport PropertyMaterialItem : public PropertyItem Q_PROPERTY(float Transparency READ getTransparency WRITE setTransparency DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -1070,7 +1070,7 @@ class GuiExport PropertyMaterialListItem : public PropertyItem Q_PROPERTY(float Transparency READ getTransparency WRITE setTransparency DESIGNABLE true USER true) // clazy:exclude=qproperty-without-notify PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -1117,7 +1117,7 @@ class GuiExport PropertyFileItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -1139,7 +1139,7 @@ class GuiExport PropertyPathItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -1161,7 +1161,7 @@ class GuiExport PropertyTransientFileItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; @@ -1229,7 +1229,7 @@ class GuiExport PropertyLinkItem: public PropertyItem Q_OBJECT PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget *editor, const QVariant& data) const override; QVariant editorData(QWidget *editor) const override; diff --git a/src/Gui/propertyeditor/PropertyItemDelegate.cpp b/src/Gui/propertyeditor/PropertyItemDelegate.cpp index 33a2c6995b..fe0568c8dd 100644 --- a/src/Gui/propertyeditor/PropertyItemDelegate.cpp +++ b/src/Gui/propertyeditor/PropertyItemDelegate.cpp @@ -159,19 +159,26 @@ QWidget * PropertyItemDelegate::createEditor (QWidget * parent, const QStyleOpti FC_LOG("create editor " << index.row() << "," << index.column()); - QWidget* editor; + QWidget* editor = nullptr; expressionEditor = nullptr; userEditor = nullptr; if (parentEditor && parentEditor->isBinding()) { - expressionEditor = editor = childItem->createExpressionEditor(parent, this, SLOT(valueChanged())); + expressionEditor = editor = childItem->createExpressionEditor(parent, [this]() { + const_cast(this)->valueChanged(); // NOLINT + }); + propertyEditor = editor; } else { const auto &props = childItem->getPropertyData(); if (!props.empty() && props[0]->testStatus(App::Property::UserEdit)) { editor = userEditor = childItem->createPropertyEditorWidget(parent); + propertyEditor = editor; } else { - editor = childItem->createEditor(parent, this, SLOT(valueChanged())); + editor = childItem->createEditor(parent, [this]() { + const_cast(this)->valueChanged(); // NOLINT + }); + propertyEditor = editor; } } if (editor) { @@ -208,10 +215,9 @@ QWidget * PropertyItemDelegate::createEditor (QWidget * parent, const QStyleOpti void PropertyItemDelegate::valueChanged() { - QWidget* editor = qobject_cast(sender()); - if (editor) { + if (propertyEditor) { Base::FlagToggler<> flag(changed); - Q_EMIT commitData(editor); + Q_EMIT commitData(propertyEditor); } } diff --git a/src/Gui/propertyeditor/PropertyItemDelegate.h b/src/Gui/propertyeditor/PropertyItemDelegate.h index f5db047406..fc26d2045d 100644 --- a/src/Gui/propertyeditor/PropertyItemDelegate.h +++ b/src/Gui/propertyeditor/PropertyItemDelegate.h @@ -25,6 +25,7 @@ #define PROPERTYITEMDELEGATE_H #include +#include namespace Gui { namespace PropertyEditor { @@ -49,10 +50,10 @@ public: protected: bool eventFilter(QObject *, QEvent *) override; -public Q_SLOTS: void valueChanged(); private: + mutable QPointer propertyEditor; mutable QWidget *expressionEditor; mutable PropertyEditorWidget *userEditor = nullptr; mutable bool pressed; diff --git a/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp b/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp index 71f1228ce5..210060c527 100644 --- a/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp +++ b/src/Mod/Fem/Gui/PropertyFemMeshItem.cpp @@ -129,11 +129,9 @@ void PropertyFemMeshItem::setValue(const QVariant& value) } QWidget* PropertyFemMeshItem::createEditor(QWidget* parent, - const QObject* receiver, - const char* method) const + const std::function& method) const { Q_UNUSED(parent); - Q_UNUSED(receiver); Q_UNUSED(method); return nullptr; } diff --git a/src/Mod/Fem/Gui/PropertyFemMeshItem.h b/src/Mod/Fem/Gui/PropertyFemMeshItem.h index e90fcb86c8..e55b324d5d 100644 --- a/src/Mod/Fem/Gui/PropertyFemMeshItem.h +++ b/src/Mod/Fem/Gui/PropertyFemMeshItem.h @@ -44,8 +44,7 @@ class PropertyFemMeshItem: public Gui::PropertyEditor::PropertyItem Q_PROPERTY(int Groups READ countGroups CONSTANT) PROPERTYITEM_HEADER - QWidget* - createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget* editor, const QVariant& data) const override; QVariant editorData(QWidget* editor) const override; diff --git a/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp b/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp index 9d0e4198c4..69c6f46a75 100644 --- a/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp +++ b/src/Mod/Mesh/Gui/PropertyEditorMesh.cpp @@ -89,11 +89,9 @@ void PropertyMeshKernelItem::setValue(const QVariant& value) } QWidget* PropertyMeshKernelItem::createEditor(QWidget* parent, - const QObject* receiver, - const char* method) const + const std::function& method) const { Q_UNUSED(parent); - Q_UNUSED(receiver); Q_UNUSED(method); return nullptr; } diff --git a/src/Mod/Mesh/Gui/PropertyEditorMesh.h b/src/Mod/Mesh/Gui/PropertyEditorMesh.h index 670272a3c8..3522e003ef 100644 --- a/src/Mod/Mesh/Gui/PropertyEditorMesh.h +++ b/src/Mod/Mesh/Gui/PropertyEditorMesh.h @@ -45,9 +45,7 @@ class MeshGuiExport PropertyMeshKernelItem: public Gui::PropertyEditor::Property PROPERTYITEM_HEADER // clang-format off - QWidget* createEditor(QWidget* parent, - const QObject* receiver, - const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; // clang-format on void setEditorData(QWidget* editor, const QVariant& data) const override; QVariant editorData(QWidget* editor) const override; diff --git a/src/Mod/Part/Gui/PropertyEnumAttacherItem.cpp b/src/Mod/Part/Gui/PropertyEnumAttacherItem.cpp index ba8d38b0b3..4907910d5d 100644 --- a/src/Mod/Part/Gui/PropertyEnumAttacherItem.cpp +++ b/src/Mod/Part/Gui/PropertyEnumAttacherItem.cpp @@ -42,10 +42,11 @@ PROPERTYITEM_SOURCE(PartGui::PropertyEnumAttacherItem) PropertyEnumAttacherItem::PropertyEnumAttacherItem() = default; -QWidget* PropertyEnumAttacherItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const +QWidget* PropertyEnumAttacherItem::createEditor(QWidget* parent, + const std::function& method) const { Gui::LabelButton* modeEditor = new Gui::LabelButton(parent); - QObject::connect(modeEditor, SIGNAL(valueChanged(const QVariant &)), receiver, method); + QObject::connect(modeEditor, &Gui::LabelButton::valueChanged, method); QObject::connect(modeEditor, &Gui::LabelButton::buttonClicked, this, &PropertyEnumAttacherItem::openTask); modeEditor->setDisabled(isReadOnly()); return modeEditor; diff --git a/src/Mod/Part/Gui/PropertyEnumAttacherItem.h b/src/Mod/Part/Gui/PropertyEnumAttacherItem.h index 65715b8806..b409db84fa 100644 --- a/src/Mod/Part/Gui/PropertyEnumAttacherItem.h +++ b/src/Mod/Part/Gui/PropertyEnumAttacherItem.h @@ -40,7 +40,7 @@ class PartGuiExport PropertyEnumAttacherItem: public Gui::PropertyEditor::Proper public: PROPERTYITEM_HEADER - QWidget* createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget* editor, const QVariant& data) const override; QVariant editorData(QWidget* editor) const override; diff --git a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp index ba9a1ebca0..bad00d161b 100644 --- a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp +++ b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.cpp @@ -369,10 +369,8 @@ void PropertyConstraintListItem::setValue(const QVariant& value) } QWidget* PropertyConstraintListItem::createEditor(QWidget* parent, - const QObject* receiver, - const char* method) const + const std::function& method) const { - Q_UNUSED(receiver); Q_UNUSED(method); QLineEdit* le = new QLineEdit(parent); le->setFrame(false); diff --git a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h index 77b7ec29f8..bae8508c28 100644 --- a/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h +++ b/src/Mod/Sketcher/Gui/PropertyConstraintListItem.h @@ -38,8 +38,7 @@ class PropertyConstraintListItem: public Gui::PropertyEditor::PropertyItem ~PropertyConstraintListItem() override; void assignProperty(const App::Property* prop) override; - QWidget* - createEditor(QWidget* parent, const QObject* receiver, const char* method) const override; + QWidget* createEditor(QWidget* parent, const std::function& method) const override; void setEditorData(QWidget* editor, const QVariant& data) const override; QVariant editorData(QWidget* editor) const override; From ae7a16f9458b9c310351daddc9b94fd10a952cf5 Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Mon, 13 May 2024 12:21:15 +0200 Subject: [PATCH 07/58] Measure Prefs: Set background default color to white --- src/Mod/Measure/Gui/DlgPrefsMeasureAppearanceImp.ui | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Mod/Measure/Gui/DlgPrefsMeasureAppearanceImp.ui b/src/Mod/Measure/Gui/DlgPrefsMeasureAppearanceImp.ui index e370751ca8..4befac72aa 100644 --- a/src/Mod/Measure/Gui/DlgPrefsMeasureAppearanceImp.ui +++ b/src/Mod/Measure/Gui/DlgPrefsMeasureAppearanceImp.ui @@ -113,9 +113,9 @@ - 60 - 240 - 0 + 255 + 255 + 255 @@ -180,9 +180,9 @@ - 60 - 240 - 0 + 255 + 255 + 255 From c797c146e9da827ea97cdc89a357947e4a32d657 Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Tue, 14 May 2024 17:53:22 +0200 Subject: [PATCH 08/58] Gui: Add icon support in SoFrameLabel --- src/Gui/SoTextLabel.cpp | 39 +++++++++++++++++++++++++++++++++++---- src/Gui/SoTextLabel.h | 4 ++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/src/Gui/SoTextLabel.cpp b/src/Gui/SoTextLabel.cpp index 9aaf958a81..a081055819 100644 --- a/src/Gui/SoTextLabel.cpp +++ b/src/Gui/SoTextLabel.cpp @@ -61,7 +61,6 @@ #include #include "SoTextLabel.h" -#include "BitmapFactory.h" #include "SoFCInteractiveElement.h" #include "Tools.h" @@ -383,6 +382,12 @@ SoFrameLabel::SoFrameLabel() //SO_NODE_ADD_FIELD(image, (SbVec2s(0,0), 0, NULL)); } +void SoFrameLabel::setIcon(const QPixmap &pixMap) +{ + iconPixmap = pixMap; +} + + void SoFrameLabel::notify(SoNotList * list) { SoField *f = list->getLastField(); @@ -425,7 +430,27 @@ void SoFrameLabel::drawImage() lines << line; } - QImage image(w+10,h+10,QImage::Format_ARGB32_Premultiplied); + int padding = 5; + + bool drawIcon = false; + QImage iconImg; + int widthIcon = 0; + int heightIcon = 0; + if (!iconPixmap.isNull()) { + drawIcon = true; + iconImg = iconPixmap.toImage(); + widthIcon = iconImg.width() + 2*padding; + heightIcon = iconImg.height() + 2*padding; + } + + int widthText = w + 2*padding; + int heightText = h + 2*padding; + int widthTotal = widthText + widthIcon; + int heightTotal = heightText > heightIcon ? heightText : heightIcon; + int paddingTextV = (heightTotal - h) / 2; + int paddingIconV = (heightTotal - iconImg.height()) / 2; + + QImage image(widthTotal, heightTotal, QImage::Format_ARGB32_Premultiplied); image.fill(0x00000000); QPainter painter(&image); painter.setRenderHint(QPainter::Antialiasing); @@ -435,10 +460,16 @@ void SoFrameLabel::drawImage() painter.setPen(QPen(QColor(0,0,127), 2, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin)); painter.setBrush(QBrush(brush, Qt::SolidPattern)); - QRectF rectangle(0.0, 0.0, w+10, h+10); + QRectF rectangle(0.0, 0.0, widthTotal, heightTotal); painter.drawRoundedRect(rectangle, 5, 5); } + + if (drawIcon) { + painter.drawImage(QPoint(padding, paddingIconV), iconImg); + + } + painter.setPen(front); Qt::Alignment align = Qt::AlignVCenter; @@ -450,7 +481,7 @@ void SoFrameLabel::drawImage() align = Qt::AlignVCenter | Qt::AlignHCenter; QString text = lines.join(QLatin1String("\n")); painter.setFont(font); - painter.drawText(5,5,w,h,align,text); + painter.drawText(widthIcon + padding, paddingTextV, w, h, align, text); painter.end(); SoSFImage sfimage; diff --git a/src/Gui/SoTextLabel.h b/src/Gui/SoTextLabel.h index 6581455d6a..b91feb1980 100644 --- a/src/Gui/SoTextLabel.h +++ b/src/Gui/SoTextLabel.h @@ -34,6 +34,8 @@ #include #include +#include "BitmapFactory.h" + namespace Gui { @@ -107,6 +109,7 @@ public: static void initClass(); SoFrameLabel(); + void setIcon(const QPixmap &pixMap); SoMFString string; SoSFColor textColor; @@ -116,6 +119,7 @@ public: SoSFInt32 size; SoSFBool frame; //SoSFImage image; + QPixmap iconPixmap; protected: ~SoFrameLabel() override = default; From b3ea58a5033b339125d0b1faa20de9aa3d0dc768 Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Mon, 13 May 2024 12:20:38 +0200 Subject: [PATCH 09/58] MeasureGui: Add icons Co-Authored-By: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com> --- src/Mod/Measure/App/MeasureArea.h | 2 +- src/Mod/Measure/App/MeasureLength.h | 2 +- src/Mod/Measure/App/MeasurePosition.h | 2 +- src/Mod/Measure/App/MeasureRadius.h | 2 +- src/Mod/Measure/Gui/AppMeasureGui.cpp | 5 + src/Mod/Measure/Gui/Resources/Measure.qrc | 9 + .../Gui/Resources/icons/Measurement-Angle.svg | 66 ++++ .../Gui/Resources/icons/Measurement-Area.svg | 188 ++++++++++ .../icons/Measurement-CenterOfMass.svg | 124 ++++++ .../Resources/icons/Measurement-Distance.svg | 58 +++ .../Gui/Resources/icons/Measurement-Group.svg | 354 ++++++++++++++++++ .../Resources/icons/Measurement-Inertia.svg | 62 +++ .../Resources/icons/Measurement-Position.svg | 106 ++++++ .../Resources/icons/Measurement-Radius.svg | 58 +++ .../Resources/icons/Measurement-Volume.svg | 118 ++++++ .../Measure/Gui/ViewProviderMeasureAngle.cpp | 2 +- .../Measure/Gui/ViewProviderMeasureBase.cpp | 12 +- src/Mod/Measure/Gui/ViewProviderMeasureBase.h | 46 +++ .../Gui/ViewProviderMeasureDistance.cpp | 2 +- 19 files changed, 1211 insertions(+), 7 deletions(-) create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Angle.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Area.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-CenterOfMass.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Distance.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Group.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Inertia.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Position.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Radius.svg create mode 100644 src/Mod/Measure/Gui/Resources/icons/Measurement-Volume.svg diff --git a/src/Mod/Measure/App/MeasureArea.h b/src/Mod/Measure/App/MeasureArea.h index 0fef35e382..d40fdae55e 100644 --- a/src/Mod/Measure/App/MeasureArea.h +++ b/src/Mod/Measure/App/MeasureArea.h @@ -58,7 +58,7 @@ public: void recalculateArea(); const char* getViewProviderName() const override { - return "MeasureGui::ViewProviderMeasure"; + return "MeasureGui::ViewProviderMeasureArea"; } static bool isValidSelection(const App::MeasureSelection& selection); diff --git a/src/Mod/Measure/App/MeasureLength.h b/src/Mod/Measure/App/MeasureLength.h index 6904205a7e..13f90bdf0d 100644 --- a/src/Mod/Measure/App/MeasureLength.h +++ b/src/Mod/Measure/App/MeasureLength.h @@ -53,7 +53,7 @@ public: void recalculateLength(); const char* getViewProviderName() const override { - return "MeasureGui::ViewProviderMeasure"; + return "MeasureGui::ViewProviderMeasureLength"; } static bool isValidSelection(const App::MeasureSelection& selection); diff --git a/src/Mod/Measure/App/MeasurePosition.h b/src/Mod/Measure/App/MeasurePosition.h index 054ff37021..735cc23ff1 100644 --- a/src/Mod/Measure/App/MeasurePosition.h +++ b/src/Mod/Measure/App/MeasurePosition.h @@ -56,7 +56,7 @@ public: void recalculatePosition(); const char* getViewProviderName() const override { - return "MeasureGui::ViewProviderMeasure"; + return "MeasureGui::ViewProviderMeasurePosition"; } static bool isValidSelection(const App::MeasureSelection& selection); diff --git a/src/Mod/Measure/App/MeasureRadius.h b/src/Mod/Measure/App/MeasureRadius.h index 9686e4a392..51869f88b4 100644 --- a/src/Mod/Measure/App/MeasureRadius.h +++ b/src/Mod/Measure/App/MeasureRadius.h @@ -54,7 +54,7 @@ public: App::DocumentObjectExecReturn *execute() override; const char* getViewProviderName() const override { - return "MeasureGui::ViewProviderMeasure"; + return "MeasureGui::ViewProviderMeasureRadius"; } void recalculateRadius(); diff --git a/src/Mod/Measure/Gui/AppMeasureGui.cpp b/src/Mod/Measure/Gui/AppMeasureGui.cpp index ec717a13bc..5b9043e1af 100644 --- a/src/Mod/Measure/Gui/AppMeasureGui.cpp +++ b/src/Mod/Measure/Gui/AppMeasureGui.cpp @@ -92,6 +92,11 @@ PyMOD_INIT_FUNC(MeasureGui) MeasureGui::ViewProviderMeasureAngle ::init(); MeasureGui::ViewProviderMeasureDistance ::init(); + MeasureGui::ViewProviderMeasureArea ::init(); + MeasureGui::ViewProviderMeasureLength ::init(); + MeasureGui::ViewProviderMeasurePosition ::init(); + MeasureGui::ViewProviderMeasureRadius ::init(); + // register preferences pages new Gui::PrefPageProducer(QT_TRANSLATE_NOOP("QObject", "Measure")); diff --git a/src/Mod/Measure/Gui/Resources/Measure.qrc b/src/Mod/Measure/Gui/Resources/Measure.qrc index 43a28bbdab..8baf77aaf0 100644 --- a/src/Mod/Measure/Gui/Resources/Measure.qrc +++ b/src/Mod/Measure/Gui/Resources/Measure.qrc @@ -2,5 +2,14 @@ icons/umf-measurement.svg icons/preferences-measure.svg + icons/Measurement-Angle.svg + icons/Measurement-Area.svg + icons/Measurement-CenterOfMass.svg + icons/Measurement-Distance.svg + icons/Measurement-Group.svg + icons/Measurement-Inertia.svg + icons/Measurement-Position.svg + icons/Measurement-Radius.svg + icons/Measurement-Volume.svg diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Angle.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Angle.svg new file mode 100644 index 0000000000..41489adf52 --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Angle.svg @@ -0,0 +1,66 @@ + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Area.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Area.svg new file mode 100644 index 0000000000..c1346b7400 --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Area.svg @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-CenterOfMass.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-CenterOfMass.svg new file mode 100644 index 0000000000..8dc38b0612 --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-CenterOfMass.svg @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Distance.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Distance.svg new file mode 100644 index 0000000000..016c49397b --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Distance.svg @@ -0,0 +1,58 @@ + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Group.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Group.svg new file mode 100644 index 0000000000..0406f0836d --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Group.svg @@ -0,0 +1,354 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + 2015-07-04 + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-Stock.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Inertia.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Inertia.svg new file mode 100644 index 0000000000..f0793e83be --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Inertia.svg @@ -0,0 +1,62 @@ + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Position.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Position.svg new file mode 100644 index 0000000000..e402ca8750 --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Position.svg @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Radius.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Radius.svg new file mode 100644 index 0000000000..e32a7b666d --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Radius.svg @@ -0,0 +1,58 @@ + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + diff --git a/src/Mod/Measure/Gui/Resources/icons/Measurement-Volume.svg b/src/Mod/Measure/Gui/Resources/icons/Measurement-Volume.svg new file mode 100644 index 0000000000..1ded544f76 --- /dev/null +++ b/src/Mod/Measure/Gui/Resources/icons/Measurement-Volume.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + + + diff --git a/src/Mod/Measure/Gui/ViewProviderMeasureAngle.cpp b/src/Mod/Measure/Gui/ViewProviderMeasureAngle.cpp index 392ef01ce4..50630a3965 100644 --- a/src/Mod/Measure/Gui/ViewProviderMeasureAngle.cpp +++ b/src/Mod/Measure/Gui/ViewProviderMeasureAngle.cpp @@ -243,7 +243,7 @@ PROPERTY_SOURCE(MeasureGui::ViewProviderMeasureAngle, MeasureGui::ViewProviderMe ViewProviderMeasureAngle::ViewProviderMeasureAngle() { - sPixmap = "umf-measurement"; + sPixmap = "Measurement-Angle"; // Primary Arc Gui::ArcEngine *arcEngine = new Gui::ArcEngine(); diff --git a/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp b/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp index a0bf468f27..fbcb9270b7 100644 --- a/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp +++ b/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp @@ -268,7 +268,11 @@ void ViewProviderMeasureBase::positionAnno(const Measure::MeasureBase* measureOb void ViewProviderMeasureBase::attach(App::DocumentObject *pcObj) { ViewProviderDocumentObject::attach(pcObj); - positionAnno(static_cast(pcObj)); + auto measureObj = static_cast(pcObj); + positionAnno(measureObj); + + // Set the icon + pLabel->setIcon(Gui::BitmapFactory().pixmapFromSvg(sPixmap, QSize(20, 20))); } @@ -595,3 +599,9 @@ void ViewProviderMeasureBase::show() ViewProviderDocumentObject::show(); } } + + +PROPERTY_SOURCE(MeasureGui::ViewProviderMeasureArea, MeasureGui::ViewProviderMeasure) +PROPERTY_SOURCE(MeasureGui::ViewProviderMeasureLength, MeasureGui::ViewProviderMeasure) +PROPERTY_SOURCE(MeasureGui::ViewProviderMeasurePosition, MeasureGui::ViewProviderMeasure) +PROPERTY_SOURCE(MeasureGui::ViewProviderMeasureRadius, MeasureGui::ViewProviderMeasure) \ No newline at end of file diff --git a/src/Mod/Measure/Gui/ViewProviderMeasureBase.h b/src/Mod/Measure/Gui/ViewProviderMeasureBase.h index 42832ca035..5b6f456d32 100644 --- a/src/Mod/Measure/Gui/ViewProviderMeasureBase.h +++ b/src/Mod/Measure/Gui/ViewProviderMeasureBase.h @@ -128,6 +128,7 @@ private: boost::signals2::connection _mVisibilityChangedConnection; }; + //NOLINTBEGIN class MeasureGuiExport ViewProviderMeasure : public MeasureGui::ViewProviderMeasureBase { @@ -153,6 +154,51 @@ private: SoIndexedLineSet * pLines; }; + +class ViewProviderMeasureArea : public ViewProviderMeasure +{ + PROPERTY_HEADER(MeasureGui::ViewProviderMeasureArea); + +public: + ViewProviderMeasureArea() { + sPixmap = "Measurement-Area"; + } +}; + + +class ViewProviderMeasureLength : public ViewProviderMeasure +{ + PROPERTY_HEADER(MeasureGui::ViewProviderMeasureLength); + +public: + ViewProviderMeasureLength() { + sPixmap = "Measurement-Distance"; + } +}; + + +class ViewProviderMeasurePosition : public ViewProviderMeasure +{ + PROPERTY_HEADER(MeasureGui::ViewProviderMeasurePosition); + +public: + ViewProviderMeasurePosition() { + sPixmap = "Measurement-Position"; + } +}; + + +class ViewProviderMeasureRadius : public ViewProviderMeasure +{ + PROPERTY_HEADER(MeasureGui::ViewProviderMeasureRadius); + +public: + ViewProviderMeasureRadius() { + sPixmap = "Measurement-Radius"; + } +}; + + } // namespace Gui #endif // GUI_VIEWPROVIDER_MEASUREMENTBASE_H diff --git a/src/Mod/Measure/Gui/ViewProviderMeasureDistance.cpp b/src/Mod/Measure/Gui/ViewProviderMeasureDistance.cpp index 019932eebf..f3d944d0b1 100644 --- a/src/Mod/Measure/Gui/ViewProviderMeasureDistance.cpp +++ b/src/Mod/Measure/Gui/ViewProviderMeasureDistance.cpp @@ -116,7 +116,7 @@ Base::Vector3d ViewProviderMeasureDistance::getTextDirection(Base::Vector3d elem ViewProviderMeasureDistance::ViewProviderMeasureDistance() { - sPixmap = "umf-measurement"; + sPixmap = "Measurement-Distance"; // vert indexes used to create the annotation lines const size_t lineCount(3); From 030cdcfa5e851bf74f9880e5e842f0f9c561cc95 Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Tue, 14 May 2024 12:07:21 +0200 Subject: [PATCH 10/58] MeasureGui: Add UMF folder icon Co-Authored-By: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com> --- src/Gui/TaskMeasure.cpp | 2 +- src/Mod/Measure/Gui/AppMeasureGui.cpp | 1 + .../Measure/Gui/ViewProviderMeasureBase.cpp | 17 ++++++++++++++++- src/Mod/Measure/Gui/ViewProviderMeasureBase.h | 19 +++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/Gui/TaskMeasure.cpp b/src/Gui/TaskMeasure.cpp index 7d18b5593a..3b09f43e5f 100644 --- a/src/Gui/TaskMeasure.cpp +++ b/src/Gui/TaskMeasure.cpp @@ -259,7 +259,7 @@ void ensureGroup(Measure::MeasureBase* measurement) { App::Document* doc = App::GetApplication().getActiveDocument(); App::DocumentObject* obj = doc->getObject(measurementGroupName); if (!obj || !obj->isValid()) { - obj = doc->addObject("App::DocumentObjectGroup", measurementGroupName); + obj = doc->addObject("App::DocumentObjectGroup", measurementGroupName, true, "MeasureGui::ViewProviderMeasureGroup"); } auto group = static_cast(obj); diff --git a/src/Mod/Measure/Gui/AppMeasureGui.cpp b/src/Mod/Measure/Gui/AppMeasureGui.cpp index 5b9043e1af..4e109250c6 100644 --- a/src/Mod/Measure/Gui/AppMeasureGui.cpp +++ b/src/Mod/Measure/Gui/AppMeasureGui.cpp @@ -87,6 +87,7 @@ PyMOD_INIT_FUNC(MeasureGui) // instantiating the commands CreateMeasureCommands(); + MeasureGui::ViewProviderMeasureGroup ::init(); MeasureGui::ViewProviderMeasureBase ::init(); MeasureGui::ViewProviderMeasure ::init(); MeasureGui::ViewProviderMeasureAngle ::init(); diff --git a/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp b/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp index fbcb9270b7..167daef964 100644 --- a/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp +++ b/src/Mod/Measure/Gui/ViewProviderMeasureBase.cpp @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -50,10 +51,24 @@ #include #include "ViewProviderMeasureBase.h" - using namespace MeasureGui; using namespace Measure; + +PROPERTY_SOURCE(MeasureGui::ViewProviderMeasureGroup, Gui::ViewProviderDocumentObjectGroup) + +ViewProviderMeasureGroup::ViewProviderMeasureGroup() +{} + +ViewProviderMeasureGroup::~ViewProviderMeasureGroup() = default; + +QIcon ViewProviderMeasureGroup::getIcon() const +{ + return Gui::BitmapFactory().pixmap("Measurement-Group.svg"); +} + + + //NOLINTBEGIN PROPERTY_SOURCE(MeasureGui::ViewProviderMeasureBase, Gui::ViewProviderDocumentObject) //NOLINTEND diff --git a/src/Mod/Measure/Gui/ViewProviderMeasureBase.h b/src/Mod/Measure/Gui/ViewProviderMeasureBase.h index 5b6f456d32..79d87593cc 100644 --- a/src/Mod/Measure/Gui/ViewProviderMeasureBase.h +++ b/src/Mod/Measure/Gui/ViewProviderMeasureBase.h @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -49,6 +50,24 @@ class SoTranslate2Dragger; namespace MeasureGui { + +class MeasureGuiExport ViewProviderMeasureGroup : public Gui::ViewProviderDocumentObjectGroup +{ + PROPERTY_HEADER_WITH_OVERRIDE(MeasureGui::ViewProviderMeasureGroup); + +public: + ViewProviderMeasureGroup(); + ~ViewProviderMeasureGroup() override; + + bool allowOverride(const App::DocumentObject &) const override { + return true; + } + + QIcon getIcon() const override; +}; + + + //NOLINTBEGIN class MeasureGuiExport ViewProviderMeasureBase :public Gui::ViewProviderDocumentObject { From a6ef045617da2915a56b7b5bea9b42657f1ee8b1 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 24 Apr 2024 15:14:38 +0200 Subject: [PATCH 11/58] Gui: Fix possible crashes with SoDatumLabel There are possible crashes in the methods: * SoDatumLabel::getLabelTextCenter() * SoDatumLabel::generatePrimitives() The two methods expect three points but do not check that they are defined. Depending on the use case of the SoDatumLabel only two points may be defined. Accessing a third point is undefined behaviour. --- src/Gui/SoDatumLabel.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/Gui/SoDatumLabel.cpp b/src/Gui/SoDatumLabel.cpp index 1839e52b24..16713aea0e 100644 --- a/src/Gui/SoDatumLabel.cpp +++ b/src/Gui/SoDatumLabel.cpp @@ -519,10 +519,14 @@ void SoDatumLabel::computeBBox(SoAction * action, SbBox3f &box, SbVec3f ¢er) SbVec3f SoDatumLabel::getLabelTextCenter() { // Get the points stored + int numPts = this->pnts.getNum(); + if (numPts < 2) { + return {}; + } + const SbVec3f* points = this->pnts.getValues(0); SbVec3f p1 = points[0]; SbVec3f p2 = points[1]; - SbVec3f p3 = points[2]; if (datumtype.getValue() == SoDatumLabel::DISTANCE || datumtype.getValue() == SoDatumLabel::DISTANCEX || @@ -538,7 +542,10 @@ SbVec3f SoDatumLabel::getLabelTextCenter() return getLabelTextCenterAngle(p1); } else if (datumtype.getValue() == SoDatumLabel::ARCLENGTH) { - return getLabelTextCenterArcLength(p1, p2, p3); + if (numPts >= 3) { + SbVec3f p3 = points[2]; + return getLabelTextCenterArcLength(p1, p2, p3); + } } return p1; @@ -865,14 +872,19 @@ void SoDatumLabel::generateArcLengthPrimitives(SoAction * action, const SbVec3f& void SoDatumLabel::generatePrimitives(SoAction * action) { // Initialisation check (needs something more sensible) prevents an infinite loop bug - if (this->imgHeight <= FLT_EPSILON || this->imgWidth <= FLT_EPSILON) + if (this->imgHeight <= FLT_EPSILON || this->imgWidth <= FLT_EPSILON) { return; + } + + int numPts = this->pnts.getNum(); + if (numPts < 2) { + return; + } // Get the points stored const SbVec3f *points = this->pnts.getValues(0); SbVec3f p1 = points[0]; SbVec3f p2 = points[1]; - SbVec3f p3 = points[2]; // Change the offset and bounding box parameters depending on Datum Type if (this->datumtype.getValue() == DISTANCE || @@ -896,7 +908,10 @@ void SoDatumLabel::generatePrimitives(SoAction * action) } else if (this->datumtype.getValue() == ARCLENGTH) { - generateArcLengthPrimitives(action, p1, p2, p3); + if (numPts >= 3) { + SbVec3f p3 = points[2]; + generateArcLengthPrimitives(action, p1, p2, p3); + } } } From 3ade47cbe5705a76fef24096e9a03b819d994214 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 24 Apr 2024 15:37:42 +0200 Subject: [PATCH 12/58] Gui: fix linter warnings in SoDatumLabel --- src/Gui/SoDatumLabel.cpp | 251 ++++++++++++++++++++------------------- 1 file changed, 130 insertions(+), 121 deletions(-) diff --git a/src/Gui/SoDatumLabel.cpp b/src/Gui/SoDatumLabel.cpp index 16713aea0e..616ede92f3 100644 --- a/src/Gui/SoDatumLabel.cpp +++ b/src/Gui/SoDatumLabel.cpp @@ -52,8 +52,8 @@ #include "SoDatumLabel.h" - -#define ZCONSTR 0.006f +// NOLINTBEGIN(readability-magic-numbers,cppcoreguidelines-pro-bounds-pointer-arithmetic) +constexpr const float ZCONSTR {0.006F}; using namespace Gui; @@ -66,18 +66,18 @@ void SoDatumLabel::initClass() SO_NODE_INIT_CLASS(SoDatumLabel, SoShape, "Shape"); } - +// NOLINTNEXTLINE SoDatumLabel::SoDatumLabel() { SO_NODE_CONSTRUCTOR(SoDatumLabel); SO_NODE_ADD_FIELD(string, ("")); - SO_NODE_ADD_FIELD(textColor, (SbVec3f(1.0f,1.0f,1.0f))); - SO_NODE_ADD_FIELD(pnts, (SbVec3f(.0f,.0f,.0f))); - SO_NODE_ADD_FIELD(norm, (SbVec3f(.0f,.0f,1.f))); + SO_NODE_ADD_FIELD(textColor, (SbVec3f(1.0F,1.0F,1.0F))); + SO_NODE_ADD_FIELD(pnts, (SbVec3f(.0F,.0F,.0F))); + SO_NODE_ADD_FIELD(norm, (SbVec3f(.0F,.0F,1.F))); SO_NODE_ADD_FIELD(name, ("Helvetica")); - SO_NODE_ADD_FIELD(size, (10.f)); - SO_NODE_ADD_FIELD(lineWidth, (2.f)); + SO_NODE_ADD_FIELD(size, (10.F)); + SO_NODE_ADD_FIELD(lineWidth, (2.F)); SO_NODE_ADD_FIELD(datumtype, (SoDatumLabel::DISTANCE)); @@ -90,13 +90,13 @@ SoDatumLabel::SoDatumLabel() SO_NODE_DEFINE_ENUM_VALUE(Type, ARCLENGTH); SO_NODE_SET_SF_ENUM_TYPE(datumtype, Type); - SO_NODE_ADD_FIELD(param1, (0.f)); - SO_NODE_ADD_FIELD(param2, (0.f)); - SO_NODE_ADD_FIELD(param4, (0.f)); - SO_NODE_ADD_FIELD(param5, (0.f)); - SO_NODE_ADD_FIELD(param6, (0.f)); - SO_NODE_ADD_FIELD(param7, (0.f)); - SO_NODE_ADD_FIELD(param8, (0.f)); + SO_NODE_ADD_FIELD(param1, (0.F)); + SO_NODE_ADD_FIELD(param2, (0.F)); + SO_NODE_ADD_FIELD(param4, (0.F)); + SO_NODE_ADD_FIELD(param5, (0.F)); + SO_NODE_ADD_FIELD(param6, (0.F)); + SO_NODE_ADD_FIELD(param7, (0.F)); + SO_NODE_ADD_FIELD(param8, (0.F)); useAntialiasing = true; @@ -135,8 +135,9 @@ void SoDatumLabel::drawImage() image.fill(0x00000000); QPainter painter(&image); - if(useAntialiasing) + if (useAntialiasing) { painter.setRenderHint(QPainter::Antialiasing); + } painter.setPen(front); painter.setFont(font); @@ -205,7 +206,7 @@ private: std::vector computeDistanceBBox() const { SbVec2s imgsize; - int nc; + int nc {}; int srcw = 1; int srch = 1; @@ -284,7 +285,7 @@ private: std::vector computeRadiusDiameterBBox() const { SbVec2s imgsize; - int nc; + int nc {}; int srcw = 1; int srch = 1; @@ -339,7 +340,7 @@ private: std::vector computeAngleBBox() const { SbVec2s imgsize; - int nc; + int nc {}; int srcw = 1; int srch = 1; @@ -435,8 +436,9 @@ private: } std::vector computeArcLengthBBox() const - { SbVec2s imgsize; - int nc; + { + SbVec2s imgsize; + int nc {}; int srcw = 1; int srch = 1; @@ -460,10 +462,10 @@ private: SbVec3f p1 = points[1]; SbVec3f p2 = points[2]; - SbVec3f img1 = SbVec3f(-imgWidth / 2, -imgHeight / 2, 0.f); - SbVec3f img2 = SbVec3f(-imgWidth / 2, imgHeight / 2, 0.f); - SbVec3f img3 = SbVec3f( imgWidth / 2, -imgHeight / 2, 0.f); - SbVec3f img4 = SbVec3f( imgWidth / 2, imgHeight / 2, 0.f); + SbVec3f img1 = SbVec3f(-imgWidth / 2, -imgHeight / 2, 0.F); + SbVec3f img2 = SbVec3f(-imgWidth / 2, imgHeight / 2, 0.F); + SbVec3f img3 = SbVec3f( imgWidth / 2, -imgHeight / 2, 0.F); + SbVec3f img4 = SbVec3f( imgWidth / 2, imgHeight / 2, 0.F); //Text orientation SbVec3f dir = (p2 - p1); @@ -474,10 +476,10 @@ private: // Rotate through an angle float s = sin(angle); float c = cos(angle); - img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.f); - img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.f); - img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.f); - img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.f); + img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.F); + img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.F); + img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.F); + img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.F); float length = label->param1.getValue(); @@ -533,15 +535,15 @@ SbVec3f SoDatumLabel::getLabelTextCenter() datumtype.getValue() == SoDatumLabel::DISTANCEY) { return getLabelTextCenterDistance(p1, p2); } - else if (datumtype.getValue() == SoDatumLabel::RADIUS || + if (datumtype.getValue() == SoDatumLabel::RADIUS || datumtype.getValue() == SoDatumLabel::DIAMETER) { return getLabelTextCenterDiameter(p1, p2); } - else if (datumtype.getValue() == SoDatumLabel::ANGLE) { + if (datumtype.getValue() == SoDatumLabel::ANGLE) { return getLabelTextCenterAngle(p1); } - else if (datumtype.getValue() == SoDatumLabel::ARCLENGTH) { + if (datumtype.getValue() == SoDatumLabel::ARCLENGTH) { if (numPts >= 3) { SbVec3f p3 = points[2]; return getLabelTextCenterArcLength(p1, p2, p3); @@ -635,19 +637,19 @@ void SoDatumLabel::generateDistancePrimitives(SoAction * action, const SbVec3f& // Get magnitude of angle between horizontal float angle = atan2f(dir[1],dir[0]); - SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.f); - SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.f); + SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.F); + SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.F); // Rotate through an angle float s = sin(angle); float c = cos(angle); - img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.f); - img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.f); - img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.f); - img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.f); + img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.F); + img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.F); + img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.F); + img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.F); SbVec3f textOffset = getLabelTextCenterDistance(p1, p2); @@ -661,7 +663,7 @@ void SoDatumLabel::generateDistancePrimitives(SoAction * action, const SbVec3f& this->beginShape(action, TRIANGLE_STRIP); - pv.setNormal( SbVec3f(0.f, 0.f, 1.f) ); + pv.setNormal( SbVec3f(0.F, 0.F, 1.F) ); // Set coordinates pv.setPoint( img1 ); @@ -686,19 +688,19 @@ void SoDatumLabel::generateDiameterPrimitives(SoAction * action, const SbVec3f& float angle = atan2f(dir[1],dir[0]); - SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.f); - SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.f); + SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.F); + SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.F); // Rotate through an angle float s = sin(angle); float c = cos(angle); - img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.f); - img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.f); - img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.f); - img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.f); + img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.F); + img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.F); + img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.F); + img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.F); SbVec3f textOffset = getLabelTextCenterDiameter(p1, p2); @@ -712,7 +714,7 @@ void SoDatumLabel::generateDiameterPrimitives(SoAction * action, const SbVec3f& this->beginShape(action, TRIANGLE_STRIP); - pv.setNormal( SbVec3f(0.f, 0.f, 1.f) ); + pv.setNormal( SbVec3f(0.F, 0.F, 1.F) ); // Set coordinates pv.setPoint( img1 ); @@ -734,10 +736,10 @@ void SoDatumLabel::generateAnglePrimitives(SoAction * action, const SbVec3f& p0) { SbVec3f textOffset = getLabelTextCenterAngle(p0); - SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.f); - SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.f); + SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.F); + SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.F); img1 += textOffset; img2 += textOffset; @@ -749,7 +751,7 @@ void SoDatumLabel::generateAnglePrimitives(SoAction * action, const SbVec3f& p0) this->beginShape(action, TRIANGLE_STRIP); - pv.setNormal( SbVec3f(0.f, 0.f, 1.f) ); + pv.setNormal( SbVec3f(0.F, 0.F, 1.F) ); // Set coordinates pv.setPoint( img1 ); @@ -776,25 +778,23 @@ void SoDatumLabel::generateSymmetricPrimitives(SoAction * action, const SbVec3f& float margin = this->imgHeight / 4.0; // Calculate coordinates for the first arrow - SbVec3f ar0, ar1, ar2; - ar0 = p1 + dir * 5 * margin ; - ar1 = ar0 - dir * 0.866f * 2 * margin; // Base Point of Arrow - ar2 = ar1 + normal * margin; // Triangular corners + SbVec3f ar0 = p1 + dir * 5 * margin ; + SbVec3f ar1 = ar0 - dir * 0.866F * 2 * margin; // Base Point of Arrow + SbVec3f ar2 = ar1 + normal * margin; // Triangular corners ar1 -= normal * margin; // Calculate coordinates for the second arrow - SbVec3f ar3, ar4, ar5; - ar3 = p2 - dir * 5 * margin ; - ar4 = ar3 + dir * 0.866f * 2 * margin; // Base Point of 2nd Arrow + SbVec3f ar3 = p2 - dir * 5 * margin ; + SbVec3f ar4 = ar3 + dir * 0.866F * 2 * margin; // Base Point of 2nd Arrow - ar5 = ar4 + normal * margin; // Triangular corners + SbVec3f ar5 = ar4 + normal * margin; // Triangular corners ar4 -= normal * margin; SoPrimitiveVertex pv; this->beginShape(action, TRIANGLES); - pv.setNormal( SbVec3f(0.f, 0.f, 1.f) ); + pv.setNormal( SbVec3f(0.F, 0.F, 1.F) ); // Set coordinates pv.setPoint( ar0 ); @@ -821,10 +821,10 @@ void SoDatumLabel::generateSymmetricPrimitives(SoAction * action, const SbVec3f& void SoDatumLabel::generateArcLengthPrimitives(SoAction * action, const SbVec3f& ctr, const SbVec3f& p1, const SbVec3f& p2) { - SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.f); - SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.f); - SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.f); + SbVec3f img1 = SbVec3f(-this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img2 = SbVec3f(-this->imgWidth / 2, this->imgHeight / 2, 0.F); + SbVec3f img3 = SbVec3f( this->imgWidth / 2, -this->imgHeight / 2, 0.F); + SbVec3f img4 = SbVec3f( this->imgWidth / 2, this->imgHeight / 2, 0.F); //Text orientation SbVec3f dir = (p2 - p1); @@ -834,10 +834,10 @@ void SoDatumLabel::generateArcLengthPrimitives(SoAction * action, const SbVec3f& // Rotate through an angle float s = sin(angle); float c = cos(angle); - img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.f); - img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.f); - img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.f); - img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.f); + img1 = SbVec3f((img1[0] * c) - (img1[1] * s), (img1[0] * s) + (img1[1] * c), 0.F); + img2 = SbVec3f((img2[0] * c) - (img2[1] * s), (img2[0] * s) + (img2[1] * c), 0.F); + img3 = SbVec3f((img3[0] * c) - (img3[1] * s), (img3[0] * s) + (img3[1] * c), 0.F); + img4 = SbVec3f((img4[0] * c) - (img4[1] * s), (img4[0] * s) + (img4[1] * c), 0.F); //Text location SbVec3f textOffset = getLabelTextCenterArcLength(ctr, p1, p2); @@ -851,7 +851,7 @@ void SoDatumLabel::generateArcLengthPrimitives(SoAction * action, const SbVec3f& this->beginShape(action, TRIANGLE_STRIP); - pv.setNormal( SbVec3f(0.f, 0.f, 1.f) ); + pv.setNormal( SbVec3f(0.F, 0.F, 1.F) ); // Set coordinates pv.setPoint( img1 ); @@ -955,7 +955,7 @@ float SoDatumLabel::getScaleFactor(SoState* state) const // scale factor. See #7082 and #7860. float focal = SoFocalDistanceElement::get(state); SbVec3f center = vv.getSightPoint(focal); - float scale = vv.getWorldToScreenScale(center, 1.f); + float scale = vv.getWorldToScreenScale(center, 1.F); const SbViewportRegion & vp = SoViewportRegionElement::get(state); SbVec2s vp_size = vp.getViewportSizePixels(); scale /= float(vp_size[0]); @@ -967,19 +967,22 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) { SoState *state = action->getState(); - if (!shouldGLRender(action)) + if (!shouldGLRender(action)) { return; - if (action->handleTransparency(true)) + } + if (action->handleTransparency(true)) { return; + } float scale = getScaleFactor(state); const SbString* s = string.getValues(0); - bool hasText = (s->getLength() > 0) ? true : false; + bool hasText = (s->getLength() > 0); SbVec2s imgsize; - int nc; - int srcw=1, srch=1; + int nc {}; + int srcw=1; + int srch=1; if (hasText) { if (!this->glimagevalid) { @@ -988,8 +991,9 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) } const unsigned char * dataptr = this->image.getValue(imgsize, nc); - if (!dataptr) // no image + if (!dataptr) { // no image return; + } srcw = imgsize[0]; srch = imgsize[1]; @@ -1000,8 +1004,8 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) } if (this->datumtype.getValue() == SYMMETRIC) { - this->imgHeight = scale*25.0f; - this->imgWidth = scale*25.0f; + this->imgHeight = scale*25.0F; + this->imgWidth = scale*25.0F; } // Get the points stored in the pnt field @@ -1042,7 +1046,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) SbVec3f p1 = points[0]; SbVec3f p2 = points[1]; - SbVec3f dir, normal; + SbVec3f dir; if (this->datumtype.getValue() == DISTANCE) { dir = (p2-p1); } else if (this->datumtype.getValue() == DISTANCEX) { @@ -1052,7 +1056,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) } dir.normalize(); - normal = SbVec3f (-dir[1],dir[0],0); + SbVec3f normal = SbVec3f (-dir[1],dir[0],0); // when the datum line is not parallel to p1-p2 the projection of // p1-p2 on normal is not zero, p2 is considered as reference and p1 @@ -1105,10 +1109,10 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) flipTriang = true; } } - else if ((par2-par1).dot(dir) < 0.f) { + else if ((par2-par1).dot(dir) < 0.F) { float tmpMargin = this->imgHeight /0.75; par2 = par1; - if((par3-par1).dot(dir) < 0.f) { + if((par3-par1).dot(dir) < 0.F) { par2 = par3; par3 = par4 + dir * tmpMargin; flipTriang = true; @@ -1133,11 +1137,11 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) float arrowWidth = margin * 0.5; - SbVec3f ar1 = par1 + ((flipTriang) ? -1 : 1) * dir * 0.866f * 2 * margin; + SbVec3f ar1 = par1 + ((flipTriang) ? -1 : 1) * dir * 0.866F * 2 * margin; SbVec3f ar2 = ar1 + normal * arrowWidth; ar1 -= normal * arrowWidth; - SbVec3f ar3 = par4 - ((flipTriang) ? -1 : 1) * dir * 0.866f * 2 * margin; + SbVec3f ar3 = par4 - ((flipTriang) ? -1 : 1) * dir * 0.866F * 2 * margin; SbVec3f ar4 = ar3 + normal * arrowWidth; ar3 -= normal * arrowWidth; @@ -1218,18 +1222,19 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) textOffset = pos; - float margin = this->imgHeight / 3.0; + float margin = this->imgHeight / 3.0F; // Create the arrowhead - float arrowWidth = margin * 0.5; + float arrowWidth = margin * 0.5F; SbVec3f ar0 = p2; - SbVec3f ar1 = p2 - dir * 0.866f * 2 * margin; + SbVec3f ar1 = p2 - dir * 0.866F * 2 * margin; SbVec3f ar2 = ar1 + normal * arrowWidth; ar1 -= normal * arrowWidth; SbVec3f p3 = pos + dir * (this->imgWidth / 2 + margin); - if ((p3-p1).length() > (p2-p1).length()) + if ((p3-p1).length() > (p2-p1).length()) { p2 = p3; + } // Calculate the points SbVec3f pnt1 = pos - dir * (margin + this->imgWidth / 2); @@ -1253,7 +1258,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) if (this->datumtype.getValue() == DIAMETER) { // create second arrowhead SbVec3f ar0_1 = p1; - SbVec3f ar1_1 = p1 + dir * 0.866f * 2 * margin; + SbVec3f ar1_1 = p1 + dir * 0.866F * 2 * margin; SbVec3f ar2_1 = ar1_1 + normal * arrowWidth; ar1_1 -= normal * arrowWidth; @@ -1285,7 +1290,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) // Only the angle intersection point is needed SbVec3f p0 = points[0]; - float margin = this->imgHeight / 3.0; + float margin = this->imgHeight / 3.0F; // Load the Parameters float length = this->param1.getValue(); @@ -1301,7 +1306,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) float r = 2*length; // Set the Text label angle to zero - angle = 0.f; + angle = 0.F; // Useful Information // v0 - vector for text position @@ -1309,10 +1314,12 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) SbVec3f v0(cos(startangle+range/2),sin(startangle+range/2),0); // leave some space for the text - if (range >= 0) - range = std::max(0.2f*range, range - this->imgWidth/(2*r)); - else - range = std::min(0.2f*range, range + this->imgWidth/(2*r)); + if (range >= 0) { + range = std::max(0.2F*range, range - this->imgWidth/(2*r)); + } + else { + range = std::min(0.2F*range, range + this->imgWidth/(2*r)); + } int countSegments = std::max(6, abs(int(50.0 * range / (2 * M_PI)))); double segment = range / (2*countSegments-2); @@ -1357,7 +1364,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) // Create the arrowheads float arrowLength = margin * 2; - float arrowWidth = margin * 0.5; + float arrowWidth = margin * 0.5F; // Normals for the arrowheads SbVec3f dirStart(v1[1], -v1[0], 0); @@ -1395,13 +1402,12 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) dir.normalize(); SbVec3f normal (-dir[1],dir[0],0); - float margin = this->imgHeight / 4.0; + float margin = this->imgHeight / 4.0F; // Calculate coordinates for the first arrow - SbVec3f ar0, ar1, ar2; - ar0 = p1 + dir * 4 * margin; // Tip of Arrow - ar1 = ar0 - dir * 0.866f * 2 * margin; - ar2 = ar1 + normal * margin; + SbVec3f ar0 = p1 + dir * 4 * margin; // Tip of Arrow + SbVec3f ar1 = ar0 - dir * 0.866F * 2 * margin; + SbVec3f ar2 = ar1 + normal * margin; ar1 -= normal * margin; glBegin(GL_LINES); @@ -1414,10 +1420,9 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) glEnd(); // Calculate coordinates for the second arrow - SbVec3f ar3, ar4, ar5; - ar3 = p2 - dir * 4 * margin; // Tip of 2nd Arrow - ar4 = ar3 + dir * 0.866f * 2 * margin; - ar5 = ar4 + normal * margin; + SbVec3f ar3 = p2 - dir * 4 * margin; // Tip of 2nd Arrow + SbVec3f ar4 = ar3 + dir * 0.866F * 2 * margin; + SbVec3f ar5 = ar4 + normal * margin; ar4 -= normal * margin; glBegin(GL_LINES); @@ -1435,7 +1440,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) SbVec3f p2 = points[2]; float length = this->param1.getValue(); - float margin = this->imgHeight / 3.0; + float margin = this->imgHeight / 3.0F; // Angles calculations SbVec3f vc1 = (p1 - ctr); @@ -1443,8 +1448,9 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) float startangle = atan2f(vc1[1], vc1[0]); float endangle = atan2f(vc2[1], vc2[0]); - if (endangle < startangle) + if (endangle < startangle) { endangle += 2. * M_PI; + } float radius = vc1.length(); @@ -1498,7 +1504,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) SbVec3f v1(cos(startangle),sin(startangle),0); SbVec3f v2(cos(endangle),sin(endangle),0); float arrowLength = margin * 2; - float arrowWidth = margin * 0.5; + float arrowWidth = margin * 0.5F; // Normals for the arrowheads SbVec3f dirStart(v1[1], -v1[0], 0); @@ -1541,7 +1547,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) static bool npot = false; if (!init) { init = true; - std::string ext = (const char*)(glGetString(GL_EXTENSIONS)); + std::string ext = reinterpret_cast(glGetString(GL_EXTENSIONS)); // NOLINT npot = (ext.find("GL_ARB_texture_non_power_of_two") != std::string::npos); } @@ -1552,8 +1558,9 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) if ((w & (w-1)) != 0) { int i=1; while (i < 8) { - if ((w >> i) == 0) + if ((w >> i) == 0) { break; + } i++; } w = (1 << i); @@ -1562,8 +1569,9 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) if ((h & (h-1)) != 0) { int i=1; while (i < 8) { - if ((h >> i) == 0) + if ((h >> i) == 0) { break; + } i++; } h = (1 << i); @@ -1579,7 +1587,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) // #0001185: Planer image changes to number graphic when a part design constraint is made after the planar image // // Copy the text bitmap into memory and bind - GLuint myTexture; + GLuint myTexture {}; // generate a texture glGenTextures(1, &myTexture); glBindTexture(GL_TEXTURE_2D, myTexture); @@ -1608,12 +1616,12 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) glRotatef((GLfloat) angle * 180 / M_PI, 0,0,1); glBegin(GL_QUADS); - glColor3f(1.f, 1.f, 1.f); + glColor3f(1.F, 1.F, 1.F); - glTexCoord2f(flip ? 0.f : 1.f, 1.f); glVertex2f( -this->imgWidth / 2, this->imgHeight / 2); - glTexCoord2f(flip ? 0.f : 1.f, 0.f); glVertex2f( -this->imgWidth / 2, -this->imgHeight / 2); - glTexCoord2f(flip ? 1.f : 0.f, 0.f); glVertex2f( this->imgWidth / 2, -this->imgHeight / 2); - glTexCoord2f(flip ? 1.f : 0.f, 1.f); glVertex2f( this->imgWidth / 2, this->imgHeight / 2); + glTexCoord2f(flip ? 0.F : 1.F, 1.F); glVertex2f( -this->imgWidth / 2, this->imgHeight / 2); + glTexCoord2f(flip ? 0.F : 1.F, 0.F); glVertex2f( -this->imgWidth / 2, -this->imgHeight / 2); + glTexCoord2f(flip ? 1.F : 0.F, 0.F); glVertex2f( this->imgWidth / 2, -this->imgHeight / 2); + glTexCoord2f(flip ? 1.F : 0.F, 1.F); glVertex2f( this->imgWidth / 2, this->imgHeight / 2); glEnd(); @@ -1638,3 +1646,4 @@ void SoDatumLabel::setPoints(SbVec3f p1, SbVec3f p2) verts[1] = p2; pnts.finishEditing(); } +// NOLINTEND(readability-magic-numbers,cppcoreguidelines-pro-bounds-pointer-arithmetic) From c00bcdfb4cf6c8808e91f0d4390c263123d1683c Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 24 Apr 2024 16:48:11 +0200 Subject: [PATCH 13/58] Gui: refactor SoDatumLabel::GLRender() --- src/Gui/SoDatumLabel.cpp | 1202 ++++++++++++++++++++------------------ src/Gui/SoDatumLabel.h | 9 + 2 files changed, 633 insertions(+), 578 deletions(-) diff --git a/src/Gui/SoDatumLabel.cpp b/src/Gui/SoDatumLabel.cpp index 616ede92f3..1cd1d21007 100644 --- a/src/Gui/SoDatumLabel.cpp +++ b/src/Gui/SoDatumLabel.cpp @@ -775,7 +775,7 @@ void SoDatumLabel::generateSymmetricPrimitives(SoAction * action, const SbVec3f& dir.normalize(); SbVec3f normal (-dir[1],dir[0],0); - float margin = this->imgHeight / 4.0; + float margin = this->imgHeight / 4.0F; // Calculate coordinates for the first arrow SbVec3f ar0 = p1 + dir * 5 * margin ; @@ -974,33 +974,14 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) return; } - float scale = getScaleFactor(state); + const float scale = getScaleFactor(state); + bool hasText = hasDatumText(); - const SbString* s = string.getValues(0); - bool hasText = (s->getLength() > 0); - - SbVec2s imgsize; - int nc {}; - int srcw=1; - int srch=1; + int srcw = 1; + int srch = 1; if (hasText) { - if (!this->glimagevalid) { - drawImage(); - this->glimagevalid = true; - } - - const unsigned char * dataptr = this->image.getValue(imgsize, nc); - if (!dataptr) { // no image - return; - } - - srcw = imgsize[0]; - srch = imgsize[1]; - - float aspectRatio = (float) srcw / (float) srch; - this->imgHeight = scale * (float) (srch); - this->imgWidth = aspectRatio * (float) this->imgHeight; + getDimension(scale, srcw, srch); } if (this->datumtype.getValue() == SYMMETRIC) { @@ -1040,602 +1021,667 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) if (this->datumtype.getValue() == DISTANCE || this->datumtype.getValue() == DISTANCEX || this->datumtype.getValue() == DISTANCEY ) { - float length = this->param1.getValue(); - float length2 = this->param2.getValue(); - - SbVec3f p1 = points[0]; - SbVec3f p2 = points[1]; - - SbVec3f dir; - if (this->datumtype.getValue() == DISTANCE) { - dir = (p2-p1); - } else if (this->datumtype.getValue() == DISTANCEX) { - dir = SbVec3f( (p2[0] - p1[0] >= FLT_EPSILON) ? 1 : -1, 0, 0); - } else if (this->datumtype.getValue() == DISTANCEY) { - dir = SbVec3f(0, (p2[1] - p1[1] >= FLT_EPSILON) ? 1 : -1, 0); - } - - dir.normalize(); - SbVec3f normal = SbVec3f (-dir[1],dir[0],0); - - // when the datum line is not parallel to p1-p2 the projection of - // p1-p2 on normal is not zero, p2 is considered as reference and p1 - // is replaced by its projection p1_ - float normproj12 = (p2-p1).dot(normal); - SbVec3f p1_ = p1 + normproj12 * normal; - - SbVec3f midpos = (p1_ + p2)/2; - - float offset1 = ((length + normproj12 < 0) ? -1. : 1.) * srch; - float offset2 = ((length < 0) ? -1 : 1)*srch; - - // Get magnitude of angle between horizontal - angle = atan2f(dir[1],dir[0]); - if (angle > M_PI_2+M_PI/12) { - angle -= (float)M_PI; - } else if (angle <= -M_PI_2+M_PI/12) { - angle += (float)M_PI; - } - - textOffset = midpos + normal * length + dir * length2; - - // Get the colour - const SbColor& t = textColor.getValue(); - - // Set GL Properties - glLineWidth(this->lineWidth.getValue()); - glColor3f(t[0], t[1], t[2]); - float margin = this->imgHeight / 3.0; - - - SbVec3f perp1 = p1_ + normal * (length + offset1 * scale); - SbVec3f perp2 = p2 + normal * (length + offset2 * scale); - - // Calculate the coordinates for the parallel datum lines - SbVec3f par1 = p1_ + normal * length; - SbVec3f par2 = midpos + normal * length + dir * (length2 - this->imgWidth / 2 - margin); - SbVec3f par3 = midpos + normal * length + dir * (length2 + this->imgWidth / 2 + margin); - SbVec3f par4 = p2 + normal * length; - - bool flipTriang = false; - - if ((par3-par1).dot(dir) > (par4 - par1).length()) { - // Increase Margin to improve visibility - float tmpMargin = this->imgHeight /0.75; - par3 = par4; - if ((par2-par1).dot(dir) > (par4 - par1).length()) { - par3 = par2; - par2 = par1 - dir * tmpMargin; - flipTriang = true; - } - } - else if ((par2-par1).dot(dir) < 0.F) { - float tmpMargin = this->imgHeight /0.75; - par2 = par1; - if((par3-par1).dot(dir) < 0.F) { - par2 = par3; - par3 = par4 + dir * tmpMargin; - flipTriang = true; - } - } - // Perp Lines - glBegin(GL_LINES); - if (length != 0.) { - glVertex2f(p1[0], p1[1]); - glVertex2f(perp1[0], perp1[1]); - - glVertex2f(p2[0], p2[1]); - glVertex2f(perp2[0], perp2[1]); - } - - glVertex2f(par1[0], par1[1]); - glVertex2f(par2[0], par2[1]); - - glVertex2f(par3[0], par3[1]); - glVertex2f(par4[0], par4[1]); - glEnd(); - - float arrowWidth = margin * 0.5; - - SbVec3f ar1 = par1 + ((flipTriang) ? -1 : 1) * dir * 0.866F * 2 * margin; - SbVec3f ar2 = ar1 + normal * arrowWidth; - ar1 -= normal * arrowWidth; - - SbVec3f ar3 = par4 - ((flipTriang) ? -1 : 1) * dir * 0.866F * 2 * margin; - SbVec3f ar4 = ar3 + normal * arrowWidth; - ar3 -= normal * arrowWidth; - - // Draw the arrowheads - glBegin(GL_TRIANGLES); - glVertex2f(par1[0], par1[1]); - glVertex2f(ar1[0], ar1[1]); - glVertex2f(ar2[0], ar2[1]); - - glVertex2f(par4[0], par4[1]); - glVertex2f(ar3[0], ar3[1]); - glVertex2f(ar4[0], ar4[1]); - glEnd(); - - - if (this->datumtype.getValue() == DISTANCE) { - // Draw arc helpers if needed - float range1 = this->param4.getValue(); - if (range1 != 0.0) { - float startangle1 = this->param3.getValue(); - float radius1 = this->param5.getValue(); - SbVec3f center = points[2]; - int countSegments = std::max(6, abs(int(50.0 * range1 / (2 * M_PI)))); - double segment = range1 / (countSegments - 1); - - glBegin(GL_LINE_STRIP); - for (int i = 0; i < countSegments; i++) { - double theta = startangle1 + segment * i; - SbVec3f v1 = center + SbVec3f(radius1 * cos(theta), radius1 * sin(theta), 0); - glVertex2f(v1[0], v1[1]); - } - glEnd(); - } - float range2 = this->param7.getValue(); - if (range2 != 0.0) { - float startangle2 = this->param6.getValue(); - float radius2 = this->param8.getValue(); - SbVec3f center = points[3]; - int countSegments = std::max(6, abs(int(50.0 * range2 / (2 * M_PI)))); - double segment = range2 / (countSegments - 1); - - glBegin(GL_LINE_STRIP); - for (int i = 0; i < countSegments; i++) { - double theta = startangle2 + segment * i; - SbVec3f v1 = center + SbVec3f(radius2 * cos(theta), radius2 * sin(theta), 0); - glVertex2f(v1[0], v1[1]); - } - glEnd(); - } - } + drawDistance(points, scale, srch, angle, textOffset); } else if (this->datumtype.getValue() == RADIUS || this->datumtype.getValue() == DIAMETER) { - // Get the Points - SbVec3f p1 = points[0]; - SbVec3f p2 = points[1]; - - SbVec3f dir = (p2-p1); - SbVec3f center = p1; - double radius = (p2 - p1).length(); - if (this->datumtype.getValue() == DIAMETER) { - center = (p1 + p2) / 2; - radius = radius / 2; - } - - dir.normalize(); - SbVec3f normal (-dir[1],dir[0],0); - - float length = this->param1.getValue(); - SbVec3f pos = p2 + length*dir; - - // Get magnitude of angle between horizontal - angle = atan2f(dir[1],dir[0]); - if (angle > M_PI_2+M_PI/12) { - angle -= (float)M_PI; - } else if (angle <= -M_PI_2+M_PI/12) { - angle += (float)M_PI; - } - - textOffset = pos; - - float margin = this->imgHeight / 3.0F; - - // Create the arrowhead - float arrowWidth = margin * 0.5F; - SbVec3f ar0 = p2; - SbVec3f ar1 = p2 - dir * 0.866F * 2 * margin; - SbVec3f ar2 = ar1 + normal * arrowWidth; - ar1 -= normal * arrowWidth; - - SbVec3f p3 = pos + dir * (this->imgWidth / 2 + margin); - if ((p3-p1).length() > (p2-p1).length()) { - p2 = p3; - } - - // Calculate the points - SbVec3f pnt1 = pos - dir * (margin + this->imgWidth / 2); - SbVec3f pnt2 = pos + dir * (margin + this->imgWidth / 2); - - // Draw the Lines - glBegin(GL_LINES); - glVertex2f(p1[0], p1[1]); - glVertex2f(pnt1[0], pnt1[1]); - - glVertex2f(pnt2[0], pnt2[1]); - glVertex2f(p2[0], p2[1]); - glEnd(); - - glBegin(GL_TRIANGLES); - glVertex2f(ar0[0], ar0[1]); - glVertex2f(ar1[0], ar1[1]); - glVertex2f(ar2[0], ar2[1]); - glEnd(); - - if (this->datumtype.getValue() == DIAMETER) { - // create second arrowhead - SbVec3f ar0_1 = p1; - SbVec3f ar1_1 = p1 + dir * 0.866F * 2 * margin; - SbVec3f ar2_1 = ar1_1 + normal * arrowWidth; - ar1_1 -= normal * arrowWidth; - - glBegin(GL_TRIANGLES); - glVertex2f(ar0_1[0], ar0_1[1]); - glVertex2f(ar1_1[0], ar1_1[1]); - glVertex2f(ar2_1[0], ar2_1[1]); - glEnd(); - } - - // Draw arc helper if needed - float startangle = this->param3.getValue(); - float range = this->param4.getValue(); - if (range != 0.0) { - int countSegments = std::max(6, abs(int(50.0 * range / (2 * M_PI)))); - double segment = range / (countSegments - 1); - - glBegin(GL_LINE_STRIP); - for (int i = 0; i < countSegments; i++) { - double theta = startangle + segment * i; - SbVec3f v1 = center + SbVec3f(radius * cos(theta), radius * sin(theta), 0); - glVertex2f(v1[0], v1[1]); - } - glEnd(); - } - + drawRadiusOrDiameter(points, angle, textOffset); } else if (this->datumtype.getValue() == ANGLE) { - // Only the angle intersection point is needed - SbVec3f p0 = points[0]; - - float margin = this->imgHeight / 3.0F; - - // Load the Parameters - float length = this->param1.getValue(); - float startangle = this->param2.getValue(); - float range = this->param3.getValue(); - float endangle = startangle + range; - float endLineLength1 = std::max(this->param4.getValue(), margin); - float endLineLength2 = std::max(this->param5.getValue(), margin); - float endLineLength12 = std::max(- this->param4.getValue(), margin); - float endLineLength22 = std::max(- this->param5.getValue(), margin); - - - float r = 2*length; - - // Set the Text label angle to zero - angle = 0.F; - - // Useful Information - // v0 - vector for text position - // p0 - vector for angle intersect - SbVec3f v0(cos(startangle+range/2),sin(startangle+range/2),0); - - // leave some space for the text - if (range >= 0) { - range = std::max(0.2F*range, range - this->imgWidth/(2*r)); - } - else { - range = std::min(0.2F*range, range + this->imgWidth/(2*r)); - } - - int countSegments = std::max(6, abs(int(50.0 * range / (2 * M_PI)))); - double segment = range / (2*countSegments-2); - - textOffset = p0 + v0 * r; - - - // Draw - glBegin(GL_LINE_STRIP); - - for (int i=0; i < countSegments; i++) { - double theta = startangle + segment*i; - SbVec3f v1 = p0+SbVec3f(r*cos(theta),r*sin(theta),0); - glVertex2f(v1[0],v1[1]); - } - glEnd(); - - glBegin(GL_LINE_STRIP); - for (int i=0; i < countSegments; i++) { - double theta = endangle - segment*i; - SbVec3f v1 = p0+SbVec3f(r*cos(theta),r*sin(theta),0); - glVertex2f(v1[0],v1[1]); - } - glEnd(); - - // Direction vectors for start and end lines - SbVec3f v1(cos(startangle),sin(startangle),0); - SbVec3f v2(cos(endangle),sin(endangle),0); - - SbVec3f pnt1 = p0 + (r - endLineLength1) * v1; - SbVec3f pnt2 = p0 + (r + endLineLength12) * v1; - SbVec3f pnt3 = p0 + (r - endLineLength2) * v2; - SbVec3f pnt4 = p0 + (r + endLineLength22) * v2; - - glBegin(GL_LINES); - glVertex2f(pnt1[0],pnt1[1]); - glVertex2f(pnt2[0],pnt2[1]); - - glVertex2f(pnt3[0],pnt3[1]); - glVertex2f(pnt4[0],pnt4[1]); - glEnd(); - - // Create the arrowheads - float arrowLength = margin * 2; - float arrowWidth = margin * 0.5F; - - // Normals for the arrowheads - SbVec3f dirStart(v1[1], -v1[0], 0); - SbVec3f dirEnd(-v2[1], v2[0], 0); - - // Calculate arrowhead points for start angle - SbVec3f startArrowBase = p0 + r * v1; - SbVec3f startArrowLeft = startArrowBase - arrowLength * dirStart + arrowWidth * v1; - SbVec3f startArrowRight = startArrowBase - arrowLength * dirStart - arrowWidth * v1; - - // Calculate arrowhead points for end angle - SbVec3f endArrowBase = p0 + r * v2; - SbVec3f endArrowLeft = endArrowBase - arrowLength * dirEnd + arrowWidth * v2; - SbVec3f endArrowRight = endArrowBase - arrowLength * dirEnd - arrowWidth * v2; - - // Draw arrowheads - glBegin(GL_TRIANGLES); - // Start angle arrowhead - glVertex2f(startArrowBase[0], startArrowBase[1]); - glVertex2f(startArrowLeft[0], startArrowLeft[1]); - glVertex2f(startArrowRight[0], startArrowRight[1]); - - // End angle arrowhead - glVertex2f(endArrowBase[0], endArrowBase[1]); - glVertex2f(endArrowLeft[0], endArrowLeft[1]); - glVertex2f(endArrowRight[0], endArrowRight[1]); - glEnd(); + drawAngle(points, angle, textOffset); } else if (this->datumtype.getValue() == SYMMETRIC) { - - SbVec3f p1 = points[0]; - SbVec3f p2 = points[1]; - - SbVec3f dir = (p2-p1); - dir.normalize(); - SbVec3f normal (-dir[1],dir[0],0); - - float margin = this->imgHeight / 4.0F; - - // Calculate coordinates for the first arrow - SbVec3f ar0 = p1 + dir * 4 * margin; // Tip of Arrow - SbVec3f ar1 = ar0 - dir * 0.866F * 2 * margin; - SbVec3f ar2 = ar1 + normal * margin; - ar1 -= normal * margin; - - glBegin(GL_LINES); - glVertex3f(p1[0], p1[1], ZCONSTR); - glVertex3f(ar0[0], ar0[1], ZCONSTR); - glVertex3f(ar0[0], ar0[1], ZCONSTR); - glVertex3f(ar1[0], ar1[1], ZCONSTR); - glVertex3f(ar0[0], ar0[1], ZCONSTR); - glVertex3f(ar2[0], ar2[1], ZCONSTR); - glEnd(); - - // Calculate coordinates for the second arrow - SbVec3f ar3 = p2 - dir * 4 * margin; // Tip of 2nd Arrow - SbVec3f ar4 = ar3 + dir * 0.866F * 2 * margin; - SbVec3f ar5 = ar4 + normal * margin; - ar4 -= normal * margin; - - glBegin(GL_LINES); - glVertex3f(p2[0], p2[1], ZCONSTR); - glVertex3f(ar3[0], ar3[1], ZCONSTR); - glVertex3f(ar3[0], ar3[1], ZCONSTR); - glVertex3f(ar4[0], ar4[1], ZCONSTR); - glVertex3f(ar3[0], ar3[1], ZCONSTR); - glVertex3f(ar5[0], ar5[1], ZCONSTR); - glEnd(); + drawSymmetric(points); } else if (this->datumtype.getValue() == ARCLENGTH) { - SbVec3f ctr = points[0]; - SbVec3f p1 = points[1]; - SbVec3f p2 = points[2]; - float length = this->param1.getValue(); + drawArcLength(points, angle, textOffset); + } - float margin = this->imgHeight / 3.0F; + if (hasText) { + drawText(state, srcw, srch, angle, textOffset); + } - // Angles calculations - SbVec3f vc1 = (p1 - ctr); - SbVec3f vc2 = (p2 - ctr); + glPopAttrib(); + state->pop(); +} - float startangle = atan2f(vc1[1], vc1[0]); - float endangle = atan2f(vc2[1], vc2[0]); - if (endangle < startangle) { - endangle += 2. * M_PI; +bool SoDatumLabel::hasDatumText() const +{ + const SbString* s = string.getValues(0); + return (s->getLength() > 0); +} + +void SoDatumLabel::getDimension(float scale, int& srcw, int& srch) +{ + SbVec2s imgsize; + int nc {}; + + if (!this->glimagevalid) { + drawImage(); + this->glimagevalid = true; + } + + const unsigned char * dataptr = this->image.getValue(imgsize, nc); + if (!dataptr) { // no image + return; + } + + srcw = imgsize[0]; + srch = imgsize[1]; + + float aspectRatio = (float) srcw / (float) srch; + this->imgHeight = scale * (float) (srch); + this->imgWidth = aspectRatio * (float) this->imgHeight; +} + +void SoDatumLabel::drawDistance(const SbVec3f* points, float scale, int srch, float& angle, SbVec3f& textOffset) +{ + float length = this->param1.getValue(); + float length2 = this->param2.getValue(); + + SbVec3f p1 = points[0]; + SbVec3f p2 = points[1]; + + SbVec3f dir; + if (this->datumtype.getValue() == DISTANCE) { + dir = (p2-p1); + } else if (this->datumtype.getValue() == DISTANCEX) { + dir = SbVec3f( (p2[0] - p1[0] >= FLT_EPSILON) ? 1 : -1, 0, 0); + } else if (this->datumtype.getValue() == DISTANCEY) { + dir = SbVec3f(0, (p2[1] - p1[1] >= FLT_EPSILON) ? 1 : -1, 0); + } + + dir.normalize(); + SbVec3f normal = SbVec3f (-dir[1],dir[0],0); + + // when the datum line is not parallel to p1-p2 the projection of + // p1-p2 on normal is not zero, p2 is considered as reference and p1 + // is replaced by its projection p1_ + float normproj12 = (p2-p1).dot(normal); + SbVec3f p1_ = p1 + normproj12 * normal; + + SbVec3f midpos = (p1_ + p2)/2; + + float offset1 = ((length + normproj12 < 0) ? -1.F : 1.F) * srch; + float offset2 = ((length < 0) ? -1 : 1)*srch; + + // Get magnitude of angle between horizontal + angle = atan2f(dir[1],dir[0]); + if (angle > M_PI_2+M_PI/12) { + angle -= (float)M_PI; + } else if (angle <= -M_PI_2+M_PI/12) { + angle += (float)M_PI; + } + + textOffset = midpos + normal * length + dir * length2; + + // Get the colour + const SbColor& t = textColor.getValue(); + + // Set GL Properties + glLineWidth(this->lineWidth.getValue()); + glColor3f(t[0], t[1], t[2]); + float margin = this->imgHeight / 3.0F; + + + SbVec3f perp1 = p1_ + normal * (length + offset1 * scale); + SbVec3f perp2 = p2 + normal * (length + offset2 * scale); + + // Calculate the coordinates for the parallel datum lines + SbVec3f par1 = p1_ + normal * length; + SbVec3f par2 = midpos + normal * length + dir * (length2 - this->imgWidth / 2 - margin); + SbVec3f par3 = midpos + normal * length + dir * (length2 + this->imgWidth / 2 + margin); + SbVec3f par4 = p2 + normal * length; + + bool flipTriang = false; + + if ((par3-par1).dot(dir) > (par4 - par1).length()) { + // Increase Margin to improve visibility + float tmpMargin = this->imgHeight /0.75F; + par3 = par4; + if ((par2-par1).dot(dir) > (par4 - par1).length()) { + par3 = par2; + par2 = par1 - dir * tmpMargin; + flipTriang = true; + } + } + else if ((par2-par1).dot(dir) < 0.F) { + float tmpMargin = this->imgHeight /0.75F; + par2 = par1; + if((par3-par1).dot(dir) < 0.F) { + par2 = par3; + par3 = par4 + dir * tmpMargin; + flipTriang = true; + } + } + // Perp Lines + glBegin(GL_LINES); + if (length != 0.) { + glVertex2f(p1[0], p1[1]); + glVertex2f(perp1[0], perp1[1]); + + glVertex2f(p2[0], p2[1]); + glVertex2f(perp2[0], perp2[1]); } - float radius = vc1.length(); + glVertex2f(par1[0], par1[1]); + glVertex2f(par2[0], par2[1]); - float range = endangle - startangle; + glVertex2f(par3[0], par3[1]); + glVertex2f(par4[0], par4[1]); + glEnd(); - //Text orientation - SbVec3f dir = (p2 - p1); - dir.normalize(); - // Get magnitude of angle between horizontal - angle = atan2f(dir[1],dir[0]); - if (angle > M_PI_2+M_PI/12) { - angle -= (float)M_PI; - } else if (angle <= -M_PI_2+M_PI/12) { - angle += (float)M_PI; + float arrowWidth = margin * 0.5F; + + SbVec3f ar1 = par1 + ((flipTriang) ? -1 : 1) * dir * 0.866F * 2 * margin; + SbVec3f ar2 = ar1 + normal * arrowWidth; + ar1 -= normal * arrowWidth; + + SbVec3f ar3 = par4 - ((flipTriang) ? -1 : 1) * dir * 0.866F * 2 * margin; + SbVec3f ar4 = ar3 + normal * arrowWidth; + ar3 -= normal * arrowWidth; + + // Draw the arrowheads + glBegin(GL_TRIANGLES); + glVertex2f(par1[0], par1[1]); + glVertex2f(ar1[0], ar1[1]); + glVertex2f(ar2[0], ar2[1]); + + glVertex2f(par4[0], par4[1]); + glVertex2f(ar3[0], ar3[1]); + glVertex2f(ar4[0], ar4[1]); + glEnd(); + + + if (this->datumtype.getValue() == DISTANCE) { + drawDistance(points); + } +} + +void SoDatumLabel::drawDistance(const SbVec3f* points) +{ + // Draw arc helpers if needed + float range1 = this->param4.getValue(); + if (range1 != 0.0) { + float startangle1 = this->param3.getValue(); + float radius1 = this->param5.getValue(); + SbVec3f center = points[2]; + int countSegments = std::max(6, abs(int(50.0 * range1 / (2 * M_PI)))); + double segment = range1 / (countSegments - 1); + + glBegin(GL_LINE_STRIP); + for (int i = 0; i < countSegments; i++) { + double theta = startangle1 + segment * i; + SbVec3f v1 = center + SbVec3f(radius1 * cos(theta), radius1 * sin(theta), 0); + glVertex2f(v1[0], v1[1]); } + glEnd(); + } + float range2 = this->param7.getValue(); + if (range2 != 0.0) { + float startangle2 = this->param6.getValue(); + float radius2 = this->param8.getValue(); + SbVec3f center = points[3]; + int countSegments = std::max(6, abs(int(50.0 * range2 / (2 * M_PI)))); + double segment = range2 / (countSegments - 1); - // Text location - SbVec3f vm = (p1+p2)/2 - ctr; - vm.normalize(); - textOffset = ctr + vm * (length + this->imgHeight); + glBegin(GL_LINE_STRIP); + for (int i = 0; i < countSegments; i++) { + double theta = startangle2 + segment * i; + SbVec3f v1 = center + SbVec3f(radius2 * cos(theta), radius2 * sin(theta), 0); + glVertex2f(v1[0], v1[1]); + } + glEnd(); + } +} +void SoDatumLabel::drawRadiusOrDiameter(const SbVec3f* points, float& angle, SbVec3f& textOffset) +{ + // Get the Points + SbVec3f p1 = points[0]; + SbVec3f p2 = points[1]; + + SbVec3f dir = (p2-p1); + SbVec3f center = p1; + double radius = (p2 - p1).length(); + if (this->datumtype.getValue() == DIAMETER) { + center = (p1 + p2) / 2; + radius = radius / 2; + } + + dir.normalize(); + SbVec3f normal (-dir[1],dir[0],0); + + float length = this->param1.getValue(); + SbVec3f pos = p2 + length*dir; + + // Get magnitude of angle between horizontal + angle = atan2f(dir[1],dir[0]); + if (angle > M_PI_2+M_PI/12) { + angle -= (float)M_PI; + } else if (angle <= -M_PI_2+M_PI/12) { + angle += (float)M_PI; + } + + textOffset = pos; + + float margin = this->imgHeight / 3.0F; + + // Create the arrowhead + float arrowWidth = margin * 0.5F; + SbVec3f ar0 = p2; + SbVec3f ar1 = p2 - dir * 0.866F * 2 * margin; + SbVec3f ar2 = ar1 + normal * arrowWidth; + ar1 -= normal * arrowWidth; + + SbVec3f p3 = pos + dir * (this->imgWidth / 2 + margin); + if ((p3-p1).length() > (p2-p1).length()) { + p2 = p3; + } + + // Calculate the points + SbVec3f pnt1 = pos - dir * (margin + this->imgWidth / 2); + SbVec3f pnt2 = pos + dir * (margin + this->imgWidth / 2); + + // Draw the Lines + glBegin(GL_LINES); + glVertex2f(p1[0], p1[1]); + glVertex2f(pnt1[0], pnt1[1]); + + glVertex2f(pnt2[0], pnt2[1]); + glVertex2f(p2[0], p2[1]); + glEnd(); + + glBegin(GL_TRIANGLES); + glVertex2f(ar0[0], ar0[1]); + glVertex2f(ar1[0], ar1[1]); + glVertex2f(ar2[0], ar2[1]); + glEnd(); + + if (this->datumtype.getValue() == DIAMETER) { + // create second arrowhead + SbVec3f ar0_1 = p1; + SbVec3f ar1_1 = p1 + dir * 0.866F * 2 * margin; + SbVec3f ar2_1 = ar1_1 + normal * arrowWidth; + ar1_1 -= normal * arrowWidth; + + glBegin(GL_TRIANGLES); + glVertex2f(ar0_1[0], ar0_1[1]); + glVertex2f(ar1_1[0], ar1_1[1]); + glVertex2f(ar2_1[0], ar2_1[1]); + glEnd(); + } + + // Draw arc helper if needed + float startangle = this->param3.getValue(); + float range = this->param4.getValue(); + if (range != 0.0) { int countSegments = std::max(6, abs(int(50.0 * range / (2 * M_PI)))); double segment = range / (countSegments - 1); - // Draw arc glBegin(GL_LINE_STRIP); - - for (int i=0; i < countSegments; i++) { - double theta = startangle + segment*i; - SbVec3f v1 = ctr + radius * SbVec3f(cos(theta),sin(theta),0) + (length-radius) * vm; - glVertex2f(v1[0],v1[1]); + for (int i = 0; i < countSegments; i++) { + double theta = startangle + segment * i; + SbVec3f v1 = center + SbVec3f(radius * cos(theta), radius * sin(theta), 0); + glVertex2f(v1[0], v1[1]); } glEnd(); + } +} - //Draw lines - SbVec3f pnt1 = p1; - SbVec3f pnt2 = p1 + (length-radius) * vm; - SbVec3f pnt3 = p2; - SbVec3f pnt4 = p2 + (length-radius) * vm; +void SoDatumLabel::drawAngle(const SbVec3f* points, float& angle, SbVec3f& textOffset) +{ + // Only the angle intersection point is needed + SbVec3f p0 = points[0]; - glBegin(GL_LINES); + float margin = this->imgHeight / 3.0F; + + // Load the Parameters + float length = this->param1.getValue(); + float startangle = this->param2.getValue(); + float range = this->param3.getValue(); + float endangle = startangle + range; + float endLineLength1 = std::max(this->param4.getValue(), margin); + float endLineLength2 = std::max(this->param5.getValue(), margin); + float endLineLength12 = std::max(- this->param4.getValue(), margin); + float endLineLength22 = std::max(- this->param5.getValue(), margin); + + + float r = 2*length; + + // Set the Text label angle to zero + angle = 0.F; + + // Useful Information + // v0 - vector for text position + // p0 - vector for angle intersect + SbVec3f v0(cos(startangle+range/2),sin(startangle+range/2),0); + + // leave some space for the text + if (range >= 0) { + range = std::max(0.2F*range, range - this->imgWidth/(2*r)); + } + else { + range = std::min(0.2F*range, range + this->imgWidth/(2*r)); + } + + int countSegments = std::max(6, abs(int(50.0 * range / (2 * M_PI)))); + double segment = range / (2*countSegments-2); + + textOffset = p0 + v0 * r; + + + // Draw + glBegin(GL_LINE_STRIP); + + for (int i=0; i < countSegments; i++) { + double theta = startangle + segment*i; + SbVec3f v1 = p0+SbVec3f(r*cos(theta),r*sin(theta),0); + glVertex2f(v1[0],v1[1]); + } + glEnd(); + + glBegin(GL_LINE_STRIP); + for (int i=0; i < countSegments; i++) { + double theta = endangle - segment*i; + SbVec3f v1 = p0+SbVec3f(r*cos(theta),r*sin(theta),0); + glVertex2f(v1[0],v1[1]); + } + glEnd(); + + // Direction vectors for start and end lines + SbVec3f v1(cos(startangle),sin(startangle),0); + SbVec3f v2(cos(endangle),sin(endangle),0); + + SbVec3f pnt1 = p0 + (r - endLineLength1) * v1; + SbVec3f pnt2 = p0 + (r + endLineLength12) * v1; + SbVec3f pnt3 = p0 + (r - endLineLength2) * v2; + SbVec3f pnt4 = p0 + (r + endLineLength22) * v2; + + glBegin(GL_LINES); glVertex2f(pnt1[0],pnt1[1]); glVertex2f(pnt2[0],pnt2[1]); glVertex2f(pnt3[0],pnt3[1]); glVertex2f(pnt4[0],pnt4[1]); - glEnd(); + glEnd(); - // Create the arrowheads - // Direction vectors at arc start and end - SbVec3f v1(cos(startangle),sin(startangle),0); - SbVec3f v2(cos(endangle),sin(endangle),0); - float arrowLength = margin * 2; - float arrowWidth = margin * 0.5F; + // Create the arrowheads + float arrowLength = margin * 2; + float arrowWidth = margin * 0.5F; - // Normals for the arrowheads - SbVec3f dirStart(v1[1], -v1[0], 0); - SbVec3f dirEnd(-v2[1], v2[0], 0); + // Normals for the arrowheads + SbVec3f dirStart(v1[1], -v1[0], 0); + SbVec3f dirEnd(-v2[1], v2[0], 0); - // Calculate arrowhead points for start angle - SbVec3f startArrowBase = pnt2; - SbVec3f startArrowLeft = startArrowBase - arrowLength * dirStart + arrowWidth * v1; - SbVec3f startArrowRight = startArrowBase - arrowLength * dirStart - arrowWidth * v1; + // Calculate arrowhead points for start angle + SbVec3f startArrowBase = p0 + r * v1; + SbVec3f startArrowLeft = startArrowBase - arrowLength * dirStart + arrowWidth * v1; + SbVec3f startArrowRight = startArrowBase - arrowLength * dirStart - arrowWidth * v1; - // Calculate arrowhead points for end angle - SbVec3f endArrowBase = pnt4; - SbVec3f endArrowLeft = endArrowBase - arrowLength * dirEnd + arrowWidth * v2; - SbVec3f endArrowRight = endArrowBase - arrowLength * dirEnd - arrowWidth * v2; + // Calculate arrowhead points for end angle + SbVec3f endArrowBase = p0 + r * v2; + SbVec3f endArrowLeft = endArrowBase - arrowLength * dirEnd + arrowWidth * v2; + SbVec3f endArrowRight = endArrowBase - arrowLength * dirEnd - arrowWidth * v2; - // Draw arrowheads - glBegin(GL_TRIANGLES); - // Start angle arrowhead - glVertex2f(startArrowBase[0], startArrowBase[1]); - glVertex2f(startArrowLeft[0], startArrowLeft[1]); - glVertex2f(startArrowRight[0], startArrowRight[1]); + // Draw arrowheads + glBegin(GL_TRIANGLES); + // Start angle arrowhead + glVertex2f(startArrowBase[0], startArrowBase[1]); + glVertex2f(startArrowLeft[0], startArrowLeft[1]); + glVertex2f(startArrowRight[0], startArrowRight[1]); - // End angle arrowhead - glVertex2f(endArrowBase[0], endArrowBase[1]); - glVertex2f(endArrowLeft[0], endArrowLeft[1]); - glVertex2f(endArrowRight[0], endArrowRight[1]); - glEnd(); + // End angle arrowhead + glVertex2f(endArrowBase[0], endArrowBase[1]); + glVertex2f(endArrowLeft[0], endArrowLeft[1]); + glVertex2f(endArrowRight[0], endArrowRight[1]); + glEnd(); +} + +void SoDatumLabel::drawSymmetric(const SbVec3f* points) +{ + SbVec3f p1 = points[0]; + SbVec3f p2 = points[1]; + + SbVec3f dir = (p2-p1); + dir.normalize(); + SbVec3f normal (-dir[1],dir[0],0); + + float margin = this->imgHeight / 4.0F; + + // Calculate coordinates for the first arrow + SbVec3f ar0 = p1 + dir * 4 * margin; // Tip of Arrow + SbVec3f ar1 = ar0 - dir * 0.866F * 2 * margin; + SbVec3f ar2 = ar1 + normal * margin; + ar1 -= normal * margin; + + glBegin(GL_LINES); + glVertex3f(p1[0], p1[1], ZCONSTR); + glVertex3f(ar0[0], ar0[1], ZCONSTR); + glVertex3f(ar0[0], ar0[1], ZCONSTR); + glVertex3f(ar1[0], ar1[1], ZCONSTR); + glVertex3f(ar0[0], ar0[1], ZCONSTR); + glVertex3f(ar2[0], ar2[1], ZCONSTR); + glEnd(); + + // Calculate coordinates for the second arrow + SbVec3f ar3 = p2 - dir * 4 * margin; // Tip of 2nd Arrow + SbVec3f ar4 = ar3 + dir * 0.866F * 2 * margin; + SbVec3f ar5 = ar4 + normal * margin; + ar4 -= normal * margin; + + glBegin(GL_LINES); + glVertex3f(p2[0], p2[1], ZCONSTR); + glVertex3f(ar3[0], ar3[1], ZCONSTR); + glVertex3f(ar3[0], ar3[1], ZCONSTR); + glVertex3f(ar4[0], ar4[1], ZCONSTR); + glVertex3f(ar3[0], ar3[1], ZCONSTR); + glVertex3f(ar5[0], ar5[1], ZCONSTR); + glEnd(); +} + +void SoDatumLabel::drawArcLength(const SbVec3f* points, float& angle, SbVec3f& textOffset) +{ + SbVec3f ctr = points[0]; + SbVec3f p1 = points[1]; + SbVec3f p2 = points[2]; + float length = this->param1.getValue(); + + float margin = this->imgHeight / 3.0F; + + // Angles calculations + SbVec3f vc1 = (p1 - ctr); + SbVec3f vc2 = (p2 - ctr); + + float startangle = atan2f(vc1[1], vc1[0]); + float endangle = atan2f(vc2[1], vc2[0]); + if (endangle < startangle) { + endangle += 2. * M_PI; } - if (hasText) { - const unsigned char * dataptr = this->image.getValue(imgsize, nc); + float radius = vc1.length(); - //Get the camera z-direction - const SbViewVolume & vv = SoViewVolumeElement::get(state); - SbVec3f z = vv.zVector(); + float range = endangle - startangle; - bool flip = norm.getValue().dot(z) > FLT_EPSILON; - - static bool init = false; - static bool npot = false; - if (!init) { - init = true; - std::string ext = reinterpret_cast(glGetString(GL_EXTENSIONS)); // NOLINT - npot = (ext.find("GL_ARB_texture_non_power_of_two") != std::string::npos); - } - - int w = srcw; - int h = srch; - if (!npot) { - // make power of two - if ((w & (w-1)) != 0) { - int i=1; - while (i < 8) { - if ((w >> i) == 0) { - break; - } - i++; - } - w = (1 << i); - } - // make power of two - if ((h & (h-1)) != 0) { - int i=1; - while (i < 8) { - if ((h >> i) == 0) { - break; - } - i++; - } - h = (1 << i); - } - } - - glDisable(GL_DEPTH_TEST); - glEnable(GL_TEXTURE_2D); // Enable Textures - glEnable(GL_BLEND); - - // glGenTextures/glBindTexture was commented out but it must be active, see: - // #0000971: Tracing over a background image in Sketcher: image is overwritten by first dimensional constraint text - // #0001185: Planer image changes to number graphic when a part design constraint is made after the planar image - // - // Copy the text bitmap into memory and bind - GLuint myTexture {}; - // generate a texture - glGenTextures(1, &myTexture); - glBindTexture(GL_TEXTURE_2D, myTexture); - - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - - if (!npot) { - QImage imagedata(w, h,QImage::Format_ARGB32_Premultiplied); - imagedata.fill(0x00000000); - int sx = (w - srcw)/2; - int sy = (h - srch)/2; - glTexImage2D(GL_TEXTURE_2D, 0, nc, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid*)imagedata.bits()); - glTexSubImage2D(GL_TEXTURE_2D, 0, sx, sy, srcw, srch, GL_RGBA, GL_UNSIGNED_BYTE,(const GLvoid*) dataptr); - } - else { - glTexImage2D(GL_TEXTURE_2D, 0, nc, srcw, srch, 0, GL_RGBA, GL_UNSIGNED_BYTE,(const GLvoid*) dataptr); - } - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - - // Apply a rotation and translation matrix - glTranslatef(textOffset[0],textOffset[1], textOffset[2]); - glRotatef((GLfloat) angle * 180 / M_PI, 0,0,1); - glBegin(GL_QUADS); - - glColor3f(1.F, 1.F, 1.F); - - glTexCoord2f(flip ? 0.F : 1.F, 1.F); glVertex2f( -this->imgWidth / 2, this->imgHeight / 2); - glTexCoord2f(flip ? 0.F : 1.F, 0.F); glVertex2f( -this->imgWidth / 2, -this->imgHeight / 2); - glTexCoord2f(flip ? 1.F : 0.F, 0.F); glVertex2f( this->imgWidth / 2, -this->imgHeight / 2); - glTexCoord2f(flip ? 1.F : 0.F, 1.F); glVertex2f( this->imgWidth / 2, this->imgHeight / 2); - - glEnd(); - - // Reset the Mode - glPopMatrix(); - - // wmayer: see bug report below which is caused by generating but not - // deleting the texture. - // #0000721: massive memory leak when dragging an unconstrained model - glDeleteTextures(1, &myTexture); + //Text orientation + SbVec3f dir = (p2 - p1); + dir.normalize(); + // Get magnitude of angle between horizontal + angle = atan2f(dir[1],dir[0]); + if (angle > M_PI_2+M_PI/12) { + angle -= (float)M_PI; + } else if (angle <= -M_PI_2+M_PI/12) { + angle += (float)M_PI; } - glPopAttrib(); - state->pop(); + // Text location + SbVec3f vm = (p1+p2)/2 - ctr; + vm.normalize(); + textOffset = ctr + vm * (length + this->imgHeight); + + int countSegments = std::max(6, abs(int(50.0 * range / (2 * M_PI)))); + double segment = range / (countSegments - 1); + + // Draw arc + glBegin(GL_LINE_STRIP); + + for (int i=0; i < countSegments; i++) { + double theta = startangle + segment*i; + SbVec3f v1 = ctr + radius * SbVec3f(cos(theta),sin(theta),0) + (length-radius) * vm; + glVertex2f(v1[0],v1[1]); + } + glEnd(); + + //Draw lines + SbVec3f pnt1 = p1; + SbVec3f pnt2 = p1 + (length-radius) * vm; + SbVec3f pnt3 = p2; + SbVec3f pnt4 = p2 + (length-radius) * vm; + + glBegin(GL_LINES); + glVertex2f(pnt1[0],pnt1[1]); + glVertex2f(pnt2[0],pnt2[1]); + + glVertex2f(pnt3[0],pnt3[1]); + glVertex2f(pnt4[0],pnt4[1]); + glEnd(); + + // Create the arrowheads + // Direction vectors at arc start and end + SbVec3f v1(cos(startangle),sin(startangle),0); + SbVec3f v2(cos(endangle),sin(endangle),0); + float arrowLength = margin * 2; + float arrowWidth = margin * 0.5F; + + // Normals for the arrowheads + SbVec3f dirStart(v1[1], -v1[0], 0); + SbVec3f dirEnd(-v2[1], v2[0], 0); + + // Calculate arrowhead points for start angle + SbVec3f startArrowBase = pnt2; + SbVec3f startArrowLeft = startArrowBase - arrowLength * dirStart + arrowWidth * v1; + SbVec3f startArrowRight = startArrowBase - arrowLength * dirStart - arrowWidth * v1; + + // Calculate arrowhead points for end angle + SbVec3f endArrowBase = pnt4; + SbVec3f endArrowLeft = endArrowBase - arrowLength * dirEnd + arrowWidth * v2; + SbVec3f endArrowRight = endArrowBase - arrowLength * dirEnd - arrowWidth * v2; + + // Draw arrowheads + glBegin(GL_TRIANGLES); + // Start angle arrowhead + glVertex2f(startArrowBase[0], startArrowBase[1]); + glVertex2f(startArrowLeft[0], startArrowLeft[1]); + glVertex2f(startArrowRight[0], startArrowRight[1]); + + // End angle arrowhead + glVertex2f(endArrowBase[0], endArrowBase[1]); + glVertex2f(endArrowLeft[0], endArrowLeft[1]); + glVertex2f(endArrowRight[0], endArrowRight[1]); + glEnd(); +} + +// NOLINTNEXTLINE +void SoDatumLabel::drawText(SoState *state, int srcw, int srch, float angle, const SbVec3f& textOffset) +{ + SbVec2s imgsize; + int nc {}; + const unsigned char * dataptr = this->image.getValue(imgsize, nc); + + //Get the camera z-direction + const SbViewVolume & vv = SoViewVolumeElement::get(state); + SbVec3f z = vv.zVector(); + + bool flip = norm.getValue().dot(z) > FLT_EPSILON; + + static bool init = false; + static bool npot = false; + if (!init) { + init = true; + std::string ext = reinterpret_cast(glGetString(GL_EXTENSIONS)); // NOLINT + npot = (ext.find("GL_ARB_texture_non_power_of_two") != std::string::npos); + } + + int w = srcw; + int h = srch; + if (!npot) { + // make power of two + if ((w & (w-1)) != 0) { + int i=1; + while (i < 8) { + if ((w >> i) == 0) { + break; + } + i++; + } + w = (1 << i); + } + // make power of two + if ((h & (h-1)) != 0) { + int i=1; + while (i < 8) { + if ((h >> i) == 0) { + break; + } + i++; + } + h = (1 << i); + } + } + + glDisable(GL_DEPTH_TEST); + glEnable(GL_TEXTURE_2D); // Enable Textures + glEnable(GL_BLEND); + + // glGenTextures/glBindTexture was commented out but it must be active, see: + // #0000971: Tracing over a background image in Sketcher: image is overwritten by first dimensional constraint text + // #0001185: Planer image changes to number graphic when a part design constraint is made after the planar image + // + // Copy the text bitmap into memory and bind + GLuint myTexture {}; + // generate a texture + glGenTextures(1, &myTexture); + glBindTexture(GL_TEXTURE_2D, myTexture); + + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + + if (!npot) { + QImage imagedata(w, h,QImage::Format_ARGB32_Premultiplied); + imagedata.fill(0x00000000); + int sx = (w - srcw)/2; + int sy = (h - srch)/2; + glTexImage2D(GL_TEXTURE_2D, 0, nc, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, (const GLvoid*)imagedata.bits()); + glTexSubImage2D(GL_TEXTURE_2D, 0, sx, sy, srcw, srch, GL_RGBA, GL_UNSIGNED_BYTE,(const GLvoid*) dataptr); + } + else { + glTexImage2D(GL_TEXTURE_2D, 0, nc, srcw, srch, 0, GL_RGBA, GL_UNSIGNED_BYTE,(const GLvoid*) dataptr); + } + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glMatrixMode(GL_MODELVIEW); + glPushMatrix(); + + // Apply a rotation and translation matrix + glTranslatef(textOffset[0], textOffset[1], textOffset[2]); + glRotatef((GLfloat) angle * 180 / M_PI, 0,0,1); + glBegin(GL_QUADS); + + glColor3f(1.F, 1.F, 1.F); + + glTexCoord2f(flip ? 0.F : 1.F, 1.F); glVertex2f( -this->imgWidth / 2, this->imgHeight / 2); + glTexCoord2f(flip ? 0.F : 1.F, 0.F); glVertex2f( -this->imgWidth / 2, -this->imgHeight / 2); + glTexCoord2f(flip ? 1.F : 0.F, 0.F); glVertex2f( this->imgWidth / 2, -this->imgHeight / 2); + glTexCoord2f(flip ? 1.F : 0.F, 1.F); glVertex2f( this->imgWidth / 2, this->imgHeight / 2); + + glEnd(); + + // Reset the Mode + glPopMatrix(); + + // wmayer: see bug report below which is caused by generating but not + // deleting the texture. + // #0000721: massive memory leak when dragging an unconstrained model + glDeleteTextures(1, &myTexture); } void SoDatumLabel::setPoints(SbVec3f p1, SbVec3f p2) diff --git a/src/Gui/SoDatumLabel.h b/src/Gui/SoDatumLabel.h index d2b75844ed..70aa8c8b96 100644 --- a/src/Gui/SoDatumLabel.h +++ b/src/Gui/SoDatumLabel.h @@ -105,6 +105,15 @@ private: SbVec3f getLabelTextCenterDiameter(const SbVec3f&, const SbVec3f&); SbVec3f getLabelTextCenterAngle(const SbVec3f&); SbVec3f getLabelTextCenterArcLength(const SbVec3f&, const SbVec3f&, const SbVec3f&); + bool hasDatumText() const; + void getDimension(float scale, int& srcw, int& srch); + void drawDistance(const SbVec3f* points, float scale, int srch, float& angle, SbVec3f& textOffset); + void drawDistance(const SbVec3f* points); + void drawRadiusOrDiameter(const SbVec3f* points, float& angle, SbVec3f& textOffset); + void drawAngle(const SbVec3f* points, float& angle, SbVec3f& textOffset); + void drawSymmetric(const SbVec3f* points); + void drawArcLength(const SbVec3f* points, float& angle, SbVec3f& textOffset); + void drawText(SoState *state, int srcw, int srch, float angle, const SbVec3f& textOffset); private: void drawImage(); From f662357537b89e302d9e57852a6e5d760f907945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Fri, 17 May 2024 09:09:46 +0200 Subject: [PATCH 14/58] Change PartDesign Pad and Revolution tree icons Use the same icons as the toolbar buttons. --- .../PartDesign/Gui/Resources/PartDesign.qrc | 2 - .../Resources/icons/Tree_PartDesign_Pad.svg | 143 ------------------ .../icons/Tree_PartDesign_Revolution.svg | 125 --------------- src/Mod/PartDesign/Gui/ViewProviderPad.cpp | 2 +- .../PartDesign/Gui/ViewProviderRevolution.cpp | 2 +- 5 files changed, 2 insertions(+), 272 deletions(-) delete mode 100644 src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Pad.svg delete mode 100644 src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Revolution.svg diff --git a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc index fcfb16c4f9..5b16e198f1 100644 --- a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc +++ b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc @@ -59,7 +59,5 @@ icons/PartDesign_SubtractiveWedge.svg icons/PartDesign_Thickness.svg icons/PartDesignWorkbench.svg - icons/Tree_PartDesign_Pad.svg - icons/Tree_PartDesign_Revolution.svg diff --git a/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Pad.svg b/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Pad.svg deleted file mode 100644 index c136fa332e..0000000000 --- a/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Pad.svg +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - [jmaustpc] - - - Tree_PartDesign_Pad - 2013-03-17 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Pad.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - - - - - - diff --git a/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Revolution.svg b/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Revolution.svg deleted file mode 100644 index 243eaaabc2..0000000000 --- a/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Revolution.svg +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - [jmaustpc] - - - Tree_PartDesign_Revolution - 2013-03-17 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/PartDesign/Gui/Resources/icons/Tree_PartDesign_Revolution.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - - - diff --git a/src/Mod/PartDesign/Gui/ViewProviderPad.cpp b/src/Mod/PartDesign/Gui/ViewProviderPad.cpp index 0fbbd8e519..1d538990fd 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderPad.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderPad.cpp @@ -36,7 +36,7 @@ PROPERTY_SOURCE(PartDesignGui::ViewProviderPad,PartDesignGui::ViewProviderSketch ViewProviderPad::ViewProviderPad() { - sPixmap = "Tree_PartDesign_Pad.svg"; + sPixmap = "PartDesign_Pad.svg"; } ViewProviderPad::~ViewProviderPad() = default; diff --git a/src/Mod/PartDesign/Gui/ViewProviderRevolution.cpp b/src/Mod/PartDesign/Gui/ViewProviderRevolution.cpp index 1187d00eb9..30cea1cf29 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderRevolution.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderRevolution.cpp @@ -36,7 +36,7 @@ PROPERTY_SOURCE(PartDesignGui::ViewProviderRevolution,PartDesignGui::ViewProvide ViewProviderRevolution::ViewProviderRevolution() { - sPixmap = "Tree_PartDesign_Revolution.svg"; + sPixmap = "PartDesign_Revolution.svg"; } ViewProviderRevolution::~ViewProviderRevolution() = default; From 86a865e7e0396d3710ca65dc45334a2e5baf0e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Sat, 18 May 2024 19:01:20 +0200 Subject: [PATCH 15/58] Make "Sketch" in Pad icon red In other icons the support geometry is red and this mirrors the other icons --- .../Gui/Resources/icons/PartDesign_Pad.svg | 379 +++++++++++++----- 1 file changed, 277 insertions(+), 102 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Pad.svg b/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Pad.svg index d606170165..457542341a 100644 --- a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Pad.svg +++ b/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Pad.svg @@ -1,114 +1,264 @@ - - - - - + + + + + + - - - + + + - - - + + + - - - + + + - - - - - - + + + + - - - - - + + + + - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - + + + + - - - - + + + - - - - - - - - - - - + + + - - - - - + + + + - - - - - + + + + - - - + + + - - - - + - + image/svg+xml - - + [wmayer] @@ -137,15 +287,40 @@ - - - - - - - - - + + + + + + + + + From 9b4c4ce60c4994dab42f79cc39cec5168c56b234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Sat, 18 May 2024 19:26:48 +0200 Subject: [PATCH 16/58] Replace the yellow Part primitive toolbar icons with the blue tree icons --- src/Mod/Part/BasicShapes/CommandShapes.py | 2 +- src/Mod/Part/Gui/Command.cpp | 6 +- src/Mod/Part/Gui/CommandParametric.cpp | 10 +- src/Mod/Part/Gui/CommandSimple.cpp | 2 +- src/Mod/Part/Gui/Resources/Part.qrc | 6 - .../Gui/Resources/icons/create/Part_Box.svg | 70 -------- .../Gui/Resources/icons/create/Part_Cone.svg | 62 ------- .../Resources/icons/create/Part_Cylinder.svg | 65 -------- .../Resources/icons/create/Part_Sphere.svg | 71 -------- .../Gui/Resources/icons/create/Part_Torus.svg | 104 ------------ .../Gui/Resources/icons/create/Part_Tube.svg | 152 ------------------ src/Mod/PartDesign/Gui/Workbench.cpp | 24 +-- src/Mod/TemplatePyMod/TaskPanel.py | 2 +- 13 files changed, 23 insertions(+), 553 deletions(-) delete mode 100644 src/Mod/Part/Gui/Resources/icons/create/Part_Box.svg delete mode 100644 src/Mod/Part/Gui/Resources/icons/create/Part_Cone.svg delete mode 100644 src/Mod/Part/Gui/Resources/icons/create/Part_Cylinder.svg delete mode 100644 src/Mod/Part/Gui/Resources/icons/create/Part_Sphere.svg delete mode 100644 src/Mod/Part/Gui/Resources/icons/create/Part_Torus.svg delete mode 100644 src/Mod/Part/Gui/Resources/icons/create/Part_Tube.svg diff --git a/src/Mod/Part/BasicShapes/CommandShapes.py b/src/Mod/Part/BasicShapes/CommandShapes.py index 03c776f427..8c0086b531 100644 --- a/src/Mod/Part/BasicShapes/CommandShapes.py +++ b/src/Mod/Part/BasicShapes/CommandShapes.py @@ -44,7 +44,7 @@ class CommandTube: return {'MenuText': Qt.QT_TRANSLATE_NOOP("Part_Tube","Create tube"), 'Accel': "", 'CmdType': "AlterDoc:Alter3DView:AlterSelection", - 'Pixmap': "Part_Tube", + 'Pixmap': "Part_Tube_Parametric", 'ToolTip': Qt.QT_TRANSLATE_NOOP("Part_Tube","Creates a tube")} def Activated(self): diff --git a/src/Mod/Part/Gui/Command.cpp b/src/Mod/Part/Gui/Command.cpp index 422daa40da..4290cf30c7 100644 --- a/src/Mod/Part/Gui/Command.cpp +++ b/src/Mod/Part/Gui/Command.cpp @@ -131,7 +131,7 @@ CmdPartBox2::CmdPartBox2() sToolTipText = QT_TR_NOOP("Create a box solid without dialog"); sWhatsThis = "Part_Box2"; sStatusTip = sToolTipText; - sPixmap = "Part_Box"; + sPixmap = "Part_Box_Parametric"; } void CmdPartBox2::activated(int iMsg) @@ -172,7 +172,7 @@ CmdPartBox3::CmdPartBox3() sToolTipText = QT_TR_NOOP("Create a box solid without dialog"); sWhatsThis = "Part_Box3"; sStatusTip = sToolTipText; - sPixmap = "Part_Box"; + sPixmap = "Part_Box_Parametric"; } void CmdPartBox3::activated(int iMsg) @@ -1059,7 +1059,7 @@ CmdPartImportCurveNet::CmdPartImportCurveNet() sToolTipText= QT_TR_NOOP("Import a curve network"); sWhatsThis = "Part_ImportCurveNet"; sStatusTip = sToolTipText; - sPixmap = "Part_Box"; + sPixmap = "Part_Box_Parametric"; } void CmdPartImportCurveNet::activated(int iMsg) diff --git a/src/Mod/Part/Gui/CommandParametric.cpp b/src/Mod/Part/Gui/CommandParametric.cpp index 815b69617e..262f611597 100644 --- a/src/Mod/Part/Gui/CommandParametric.cpp +++ b/src/Mod/Part/Gui/CommandParametric.cpp @@ -66,7 +66,7 @@ CmdPartCylinder::CmdPartCylinder() sToolTipText = QT_TR_NOOP("Create a Cylinder"); sWhatsThis = "Part_Cylinder"; sStatusTip = sToolTipText; - sPixmap = "Part_Cylinder"; + sPixmap = "Part_Cylinder_Parametric"; } void CmdPartCylinder::activated(int iMsg) @@ -108,7 +108,7 @@ CmdPartBox::CmdPartBox() sToolTipText = QT_TR_NOOP("Create a cube solid"); sWhatsThis = "Part_Box"; sStatusTip = sToolTipText; - sPixmap = "Part_Box"; + sPixmap = "Part_Box_Parametric"; } void CmdPartBox::activated(int iMsg) @@ -150,7 +150,7 @@ CmdPartSphere::CmdPartSphere() sToolTipText = QT_TR_NOOP("Create a sphere solid"); sWhatsThis = "Part_Sphere"; sStatusTip = sToolTipText; - sPixmap = "Part_Sphere"; + sPixmap = "Part_Sphere_Parametric"; } void CmdPartSphere::activated(int iMsg) @@ -192,7 +192,7 @@ CmdPartCone::CmdPartCone() sToolTipText = QT_TR_NOOP("Create a cone solid"); sWhatsThis = "Part_Cone"; sStatusTip = sToolTipText; - sPixmap = "Part_Cone"; + sPixmap = "Part_Cone_Parametric"; } void CmdPartCone::activated(int iMsg) @@ -234,7 +234,7 @@ CmdPartTorus::CmdPartTorus() sToolTipText = QT_TR_NOOP("Create a torus solid"); sWhatsThis = "Part_Torus"; sStatusTip = sToolTipText; - sPixmap = "Part_Torus"; + sPixmap = "Part_Torus_Parametric"; } void CmdPartTorus::activated(int iMsg) diff --git a/src/Mod/Part/Gui/CommandSimple.cpp b/src/Mod/Part/Gui/CommandSimple.cpp index 16e9936fe0..fb156b524d 100644 --- a/src/Mod/Part/Gui/CommandSimple.cpp +++ b/src/Mod/Part/Gui/CommandSimple.cpp @@ -57,7 +57,7 @@ CmdPartSimpleCylinder::CmdPartSimpleCylinder() sToolTipText = QT_TR_NOOP("Create a Cylinder"); sWhatsThis = "Part_SimpleCylinder"; sStatusTip = sToolTipText; - sPixmap = "Part_Cylinder"; + sPixmap = "Part_Cylinder_Parametric"; } void CmdPartSimpleCylinder::activated(int iMsg) diff --git a/src/Mod/Part/Gui/Resources/Part.qrc b/src/Mod/Part/Gui/Resources/Part.qrc index e4b86645ea..d9cdb30c36 100644 --- a/src/Mod/Part/Gui/Resources/Part.qrc +++ b/src/Mod/Part/Gui/Resources/Part.qrc @@ -21,14 +21,8 @@ icons/booleans/Part_XOR.svg - icons/create/Part_Box.svg - icons/create/Part_Cone.svg - icons/create/Part_Cylinder.svg icons/create/Part_Primitives.svg icons/create/Part_Shapebuilder.svg - icons/create/Part_Sphere.svg - icons/create/Part_Torus.svg - icons/create/Part_Tube.svg icons/parametric/Part_Box_Parametric.svg diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Box.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Box.svg deleted file mode 100644 index 35d69df517..0000000000 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Box.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - [wmayer] - - - Part_Box - 2011-10-10 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Box.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - - diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Cone.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Cone.svg deleted file mode 100644 index 10f8f5990e..0000000000 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Cone.svg +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - [wmayer] - - - Part_Cone - 2011-10-10 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Cone.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Cylinder.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Cylinder.svg deleted file mode 100644 index 005992a355..0000000000 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Cylinder.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - [wmayer] - - - Part_Cylinder - 2011-10-10 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Cylinder.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Sphere.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Sphere.svg deleted file mode 100644 index 39a603b566..0000000000 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Sphere.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - [wmayer] - - - Part_Sphere - 2011-10-10 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Sphere.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Torus.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Torus.svg deleted file mode 100644 index ee69daf84e..0000000000 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Torus.svg +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - [wmayer] - - - Part_Torus - 2011-10-10 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Torus.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Tube.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Tube.svg deleted file mode 100644 index 62fbe9c215..0000000000 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Tube.svg +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - [wmayer] - - - - 2011-10-10 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Part/Gui/Resources/icons/Part_Cylinder.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - - diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index 539f856705..d65f7f3913 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -279,7 +279,7 @@ void Workbench::activated() "SELECT Part::Feature SUBELEMENT Vertex COUNT 1..", Vertex, "Vertex tools", - "Part_Box" + "Part_Box_Parametric" )); const char* Edge[] = { @@ -294,7 +294,7 @@ void Workbench::activated() "SELECT Part::Feature SUBELEMENT Edge COUNT 1..", Edge, "Edge tools", - "Part_Box" + "Part_Box_Parametric" )); const char* Face[] = { @@ -312,7 +312,7 @@ void Workbench::activated() "SELECT Part::Feature SUBELEMENT Face COUNT 1", Face, "Face tools", - "Part_Box" + "Part_Box_Parametric" )); const char* Body[] = { @@ -322,7 +322,7 @@ void Workbench::activated() "SELECT PartDesign::Body COUNT 1", Body, "Start Body", - "Part_Box" + "Part_Box_Parametric" )); const char* Body2[] = { @@ -332,7 +332,7 @@ void Workbench::activated() "SELECT PartDesign::Body COUNT 1..", Body2, "Start Boolean", - "Part_Box" + "Part_Box_Parametric" )); const char* Plane1[] = { @@ -346,7 +346,7 @@ void Workbench::activated() "SELECT App::Plane COUNT 1", Plane1, "Start Part", - "Part_Box" + "Part_Box_Parametric" )); const char* Plane2[] = { "PartDesign_NewSketch", @@ -359,7 +359,7 @@ void Workbench::activated() "SELECT PartDesign::Plane COUNT 1", Plane2, "Start Part", - "Part_Box" + "Part_Box_Parametric" )); const char* Line[] = { @@ -371,7 +371,7 @@ void Workbench::activated() "SELECT PartDesign::Line COUNT 1", Line, "Start Part", - "Part_Box" + "Part_Box_Parametric" )); const char* Point[] = { @@ -384,7 +384,7 @@ void Workbench::activated() "SELECT PartDesign::Point COUNT 1", Point, "Start Part", - "Part_Box" + "Part_Box_Parametric" )); const char* NoSel[] = { @@ -393,7 +393,7 @@ void Workbench::activated() Watcher.push_back(new Gui::TaskView::TaskWatcherCommandsEmptySelection( NoSel, "Start Part", - "Part_Box" + "Part_Box_Parametric" )); const char* Faces[] = { @@ -406,7 +406,7 @@ void Workbench::activated() "SELECT Part::Feature SUBELEMENT Face COUNT 2..", Faces, "Face tools", - "Part_Box" + "Part_Box_Parametric" )); const char* Sketch[] = { @@ -427,7 +427,7 @@ void Workbench::activated() "SELECT Sketcher::SketchObject COUNT 1", Sketch, "Sketch tools", - "Part_Box" + "Part_Box_Parametric" )); const char* Transformed[] = { diff --git a/src/Mod/TemplatePyMod/TaskPanel.py b/src/Mod/TemplatePyMod/TaskPanel.py index cc8e301aaa..f18b1167aa 100644 --- a/src/Mod/TemplatePyMod/TaskPanel.py +++ b/src/Mod/TemplatePyMod/TaskPanel.py @@ -30,7 +30,7 @@ class TaskWatcherFilter: self.commands = ["Sketcher_NewSketch", "PartDesign_Fillet", "PartDesign_Chamfer"] self.filter = "SELECT Part::Feature SUBELEMENT Face COUNT 1" self.title = "Face tools" - self.icon = "Part_Box" + self.icon = "Part_Box_Parametric" class TaskPanel: def __init__(self): From 234bad1d0b32845a9cda7ed9fcf41fc01ce592ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Sun, 19 May 2024 12:12:33 +0200 Subject: [PATCH 17/58] Replace remaining yellow Part icons with blue ones --- .../icons/create/Part_Primitives.svg | 444 ++++++++++--- .../icons/create/Part_Shapebuilder.svg | 594 +++++++++++++++--- 2 files changed, 875 insertions(+), 163 deletions(-) diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Primitives.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Primitives.svg index 92860972c3..0554e7a470 100644 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Primitives.svg +++ b/src/Mod/Part/Gui/Resources/icons/create/Part_Primitives.svg @@ -1,75 +1,311 @@ - - - - - - + + + + + + - - - + + + - - - + + + - - - - - + + + - - - - - - + + + - - - - + + + + + - - - - - - - + + + + + - - - - - + + + + - - - - + + + + + + + - - - - - + + + + + - - + + + + + + + + + + + + + - - - - + - + image/svg+xml - - + [wmayer] @@ -98,27 +334,85 @@ - - - - - - - + + + + + + + - - - - + + + + - - - + + + - - - - + + + + diff --git a/src/Mod/Part/Gui/Resources/icons/create/Part_Shapebuilder.svg b/src/Mod/Part/Gui/Resources/icons/create/Part_Shapebuilder.svg index e16b676d13..0fc67ebe51 100644 --- a/src/Mod/Part/Gui/Resources/icons/create/Part_Shapebuilder.svg +++ b/src/Mod/Part/Gui/Resources/icons/create/Part_Shapebuilder.svg @@ -1,89 +1,365 @@ - - - - + + + + + - - - - + + + + - - - + + + - - - + + + - - - - - + + + + + - - - - - - + + + + + + - - - - + + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - + - + image/svg+xml - - + [wmayer] - Part_Shapebuilder 2011-10-24 https://www.freecad.org/wiki/index.php?title=Artwork @@ -106,36 +382,178 @@ - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - + + + - - - + + + - - - + + + From 428b8ba0bc9a0d2c141d7c002d0f417321793119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Sun, 19 May 2024 12:16:56 +0200 Subject: [PATCH 18/58] Remove unused icons --- .../PartDesign/Gui/Resources/PartDesign.qrc | 2 - .../Resources/icons/PartDesign_Body_old.svg | 155 ------ .../icons/PartDesign_InvoluteGear.svg | 440 ------------------ 3 files changed, 597 deletions(-) delete mode 100644 src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_old.svg delete mode 100644 src/Mod/PartDesign/Gui/Resources/icons/PartDesign_InvoluteGear.svg diff --git a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc index 5b16e198f1..fa8d6b1a01 100644 --- a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc +++ b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc @@ -14,7 +14,6 @@ icons/PartDesign_BaseFeature.svg icons/PartDesign_Body.svg icons/PartDesign_Body.svg - icons/PartDesign_Body_old.svg icons/PartDesign_Body_Tree.svg icons/PartDesign_Boolean.svg icons/PartDesign_Chamfer.svg @@ -26,7 +25,6 @@ icons/PartDesign_Groove.svg icons/PartDesign_Hole.svg icons/PartDesign_InternalExternalGear.svg - icons/PartDesign_InvoluteGear.svg icons/PartDesign_Line.svg icons/PartDesign_LinearPattern.svg icons/PartDesign_Migrate.svg diff --git a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_old.svg b/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_old.svg deleted file mode 100644 index 1e59202bd9..0000000000 --- a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_old.svg +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - [jrheinlaender] - - - PartDesign_Body - 2013-05-22 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - - - - diff --git a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_InvoluteGear.svg b/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_InvoluteGear.svg deleted file mode 100644 index 2deabea9d3..0000000000 --- a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_InvoluteGear.svg +++ /dev/null @@ -1,440 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - [maxwxyz] - - - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Sketcher/Gui/Resources/icons/Sketcher_CreateArc.svg - - - FreeCAD LGPL2+ - - - 2023-12-19 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 458d53c027ed56f0a62658b1012efab26ed7042d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Sun, 19 May 2024 12:17:16 +0200 Subject: [PATCH 19/58] Use Body toolbar icon for the tree --- .../PartDesign/Gui/Resources/PartDesign.qrc | 1 - .../Resources/icons/PartDesign_Body_Tree.svg | 322 ------------------ src/Mod/PartDesign/Gui/ViewProviderBody.cpp | 2 +- 3 files changed, 1 insertion(+), 324 deletions(-) delete mode 100644 src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_Tree.svg diff --git a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc index fa8d6b1a01..30e408fb50 100644 --- a/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc +++ b/src/Mod/PartDesign/Gui/Resources/PartDesign.qrc @@ -14,7 +14,6 @@ icons/PartDesign_BaseFeature.svg icons/PartDesign_Body.svg icons/PartDesign_Body.svg - icons/PartDesign_Body_Tree.svg icons/PartDesign_Boolean.svg icons/PartDesign_Chamfer.svg icons/PartDesign_Clone.svg diff --git a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_Tree.svg b/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_Tree.svg deleted file mode 100644 index 2b2c4cda7e..0000000000 --- a/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Body_Tree.svg +++ /dev/null @@ -1,322 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - Path-Stock - 2015-07-04 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Path/Gui/Resources/icons/Path-Stock.svg - - - FreeCAD LGPL2+ - - - https://www.gnu.org/copyleft/lesser.html - - - [agryson] Alexander Gryson - - - - - - - - - - - - - - - - - diff --git a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp index 874c49bc4b..68f47a28f5 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderBody.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderBody.cpp @@ -66,7 +66,7 @@ ViewProviderBody::ViewProviderBody() ADD_PROPERTY(DisplayModeBody,((long)0)); DisplayModeBody.setEnums(BodyModeEnum); - sPixmap = "PartDesign_Body_Tree.svg"; + sPixmap = "PartDesign_Body.svg"; Gui::ViewProviderOriginGroupExtension::initExtension(this); } From e3d4bcef3ddfd73038b9573c0e80da20c99f6ea4 Mon Sep 17 00:00:00 2001 From: Pieter Hijma Date: Thu, 25 Apr 2024 21:09:46 +0200 Subject: [PATCH 20/58] Gui: Rearrange the property view context menu --- src/Gui/propertyeditor/PropertyEditor.cpp | 111 +++++++++++++--------- 1 file changed, 65 insertions(+), 46 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index f9dc427a47..a4fb1105ac 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -651,18 +651,11 @@ enum MenuAction { void PropertyEditor::contextMenuEvent(QContextMenuEvent *) { QMenu menu; - QAction *autoExpand = menu.addAction(tr("Auto expand")); - autoExpand->setCheckable(true); - autoExpand->setChecked(autoexpand); - autoExpand->setData(QVariant(MA_AutoExpand)); - - QAction *showAll = menu.addAction(tr("Show all")); - showAll->setCheckable(true); - showAll->setChecked(PropertyView::showAll()); - showAll->setData(QVariant(MA_ShowAll)); + QAction *autoExpand = nullptr; auto contextIndex = currentIndex(); + // acquiring the selected properties std::unordered_set props; const auto indexes = selectedIndexes(); for(const auto& index : indexes) { @@ -678,49 +671,70 @@ void PropertyEditor::contextMenuEvent(QContextMenuEvent *) { } } - if(props.size() == 1) { - auto item = static_cast(contextIndex.internalPointer()); - auto prop = *props.begin(); - if(item->isBound() - && !prop->isDerivedFrom(App::PropertyExpressionEngine::getClassTypeId()) - && !prop->isReadOnly() - && !prop->testStatus(App::Property::Immutable) - && !(prop->getType() & App::Prop_ReadOnly)) + // add property + if(!props.empty()) { + menu.addAction(tr("Add property"))->setData(QVariant(MA_AddProp)); + if (std::all_of(props.begin(), props.end(), [](auto prop) { + return prop->testStatus(App::Property::PropDynamic) + && !boost::starts_with(prop->getName(),prop->getGroup()); + })) { - contextIndex = propertyModel->buddy(contextIndex); - setCurrentIndex(contextIndex); - menu.addSeparator(); - menu.addAction(tr("Expression..."))->setData(QVariant(MA_Expression)); + menu.addAction(tr("Rename property group"))->setData(QVariant(MA_EditPropGroup)); } } + // remove property + bool canRemove = !props.empty(); + unsigned long propType = 0; + unsigned long propStatus = 0xffffffff; + for(auto prop : props) { + propType |= prop->getType(); + propStatus &= prop->getStatus(); + if(!prop->testStatus(App::Property::PropDynamic) + || prop->testStatus(App::Property::LockDynamic)) + { + canRemove = false; + } + } + if(canRemove) + menu.addAction(tr("Remove property"))->setData(QVariant(MA_RemoveProp)); + + // add a separator between adding/removing properties and the rest + if (!props.empty() || canRemove) { + menu.addSeparator(); + } + + // show all + QAction *showAll = menu.addAction(tr("Show all")); + showAll->setCheckable(true); + showAll->setChecked(PropertyView::showAll()); + showAll->setData(QVariant(MA_ShowAll)); + if(PropertyView::showAll()) { - if(!props.empty()) { - menu.addAction(tr("Add property"))->setData(QVariant(MA_AddProp)); - if (std::all_of(props.begin(), props.end(), [](auto prop) { - return prop->testStatus(App::Property::PropDynamic) - && !boost::starts_with(prop->getName(),prop->getGroup()); - })) + // auto expand + autoExpand = menu.addAction(tr("Auto expand")); + autoExpand->setCheckable(true); + autoExpand->setChecked(autoexpand); + autoExpand->setData(QVariant(MA_AutoExpand)); + + // expression + if(props.size() == 1) { + auto item = static_cast(contextIndex.internalPointer()); + auto prop = *props.begin(); + if(item->isBound() + && !prop->isDerivedFrom(App::PropertyExpressionEngine::getClassTypeId()) + && !prop->isReadOnly() + && !prop->testStatus(App::Property::Immutable) + && !(prop->getType() & App::Prop_ReadOnly)) { - menu.addAction(tr("Rename property group"))->setData(QVariant(MA_EditPropGroup)); + contextIndex = propertyModel->buddy(contextIndex); + setCurrentIndex(contextIndex); + // menu.addSeparator(); + menu.addAction(tr("Expression..."))->setData(QVariant(MA_Expression)); } } - bool canRemove = !props.empty(); - unsigned long propType = 0; - unsigned long propStatus = 0xffffffff; - for(auto prop : props) { - propType |= prop->getType(); - propStatus &= prop->getStatus(); - if(!prop->testStatus(App::Property::PropDynamic) - || prop->testStatus(App::Property::LockDynamic)) - { - canRemove = false; - } - } - if(canRemove) - menu.addAction(tr("Remove property"))->setData(QVariant(MA_RemoveProp)); - + // the various flags if(!props.empty()) { menu.addSeparator(); @@ -759,9 +773,14 @@ void PropertyEditor::contextMenuEvent(QContextMenuEvent *) { switch(action->data().toInt()) { case MA_AutoExpand: - autoexpand = autoExpand->isChecked(); - if (autoexpand) - expandAll(); + if (autoExpand) { + // Variable autoExpand should not be null when we arrive here, but + // since we explicitly initialize the variable to nullptr, a check + // nonetheless. + autoexpand = autoExpand->isChecked(); + if (autoexpand) + expandAll(); + } return; case MA_ShowAll: PropertyView::setShowAll(action->isChecked()); From 0202305ced763e7df42a9134b16334623d140e6d Mon Sep 17 00:00:00 2001 From: Pieter Hijma Date: Sat, 18 May 2024 22:13:08 +0200 Subject: [PATCH 21/58] AddonManager: Adapt to Qt6/PySide6 QtNetwork.QNetworkRequest has a small API change that is addressed in this commit. --- src/Mod/AddonManager/NetworkManager.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Mod/AddonManager/NetworkManager.py b/src/Mod/AddonManager/NetworkManager.py index 2970d8a3aa..6478da064e 100644 --- a/src/Mod/AddonManager/NetworkManager.py +++ b/src/Mod/AddonManager/NetworkManager.py @@ -104,7 +104,17 @@ if HAVE_QTNETWORK: # Added in Qt 5.15 if hasattr(QtNetwork.QNetworkRequest, "DefaultTransferTimeoutConstant"): - default_timeout = QtNetwork.QNetworkRequest.DefaultTransferTimeoutConstant + timeoutConstant = QtNetwork.QNetworkRequest.DefaultTransferTimeoutConstant + if hasattr(timeoutConstant, "value"): + # Qt 6 changed the timeout constant to have a 'value' attribute. + # The function setTransferTimeout does not accept + # DefaultTransferTimeoutConstant of type + # QtNetwork.QNetworkRequest.TransferTimeoutConstant any + # longer but only an int. + default_timeout = timeoutConstant.value + else: + # In Qt 5.15 we can use the timeoutConstant as is. + default_timeout = timeoutConstant else: default_timeout = 30000 @@ -428,6 +438,11 @@ if HAVE_QTNETWORK: ) if hasattr(request, "setTransferTimeout"): # Added in Qt 5.15 + # In Qt 5, the function setTransferTimeout seems to accept + # DefaultTransferTimeoutConstant of type + # PySide2.QtNetwork.QNetworkRequest.TransferTimeoutConstant, + # whereas in Qt 6, the function seems to only accept an + # integer. request.setTransferTimeout(timeout_ms) return request From f814ef63aa6dce9067b507da3fc34c8cc017d882 Mon Sep 17 00:00:00 2001 From: Max Wilfinger Date: Fri, 17 May 2024 15:53:20 +0200 Subject: [PATCH 22/58] update addon manager icons for legibility on dark themes --- .../Resources/icons/compact_view.svg | 228 +++++++++++++++-- .../Resources/icons/composite_view.svg | 230 +++++++++++++++-- .../Resources/icons/expanded_view.svg | 237 ++++++++++++++++-- .../Resources/icons/sort_ascending.svg | 178 +++++++------ .../Resources/icons/sort_descending.svg | 178 +++++++------ 5 files changed, 867 insertions(+), 184 deletions(-) diff --git a/src/Mod/AddonManager/Resources/icons/compact_view.svg b/src/Mod/AddonManager/Resources/icons/compact_view.svg index 9923da9443..93ad359ef6 100644 --- a/src/Mod/AddonManager/Resources/icons/compact_view.svg +++ b/src/Mod/AddonManager/Resources/icons/compact_view.svg @@ -1,15 +1,215 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/AddonManager/Resources/icons/composite_view.svg b/src/Mod/AddonManager/Resources/icons/composite_view.svg index 4c3e7f773b..10a62d0a9b 100644 --- a/src/Mod/AddonManager/Resources/icons/composite_view.svg +++ b/src/Mod/AddonManager/Resources/icons/composite_view.svg @@ -1,15 +1,217 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/AddonManager/Resources/icons/expanded_view.svg b/src/Mod/AddonManager/Resources/icons/expanded_view.svg index ad0464a876..40c94243a0 100644 --- a/src/Mod/AddonManager/Resources/icons/expanded_view.svg +++ b/src/Mod/AddonManager/Resources/icons/expanded_view.svg @@ -1,15 +1,224 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Mod/AddonManager/Resources/icons/sort_ascending.svg b/src/Mod/AddonManager/Resources/icons/sort_ascending.svg index d1c399a150..c7d42ad5cb 100644 --- a/src/Mod/AddonManager/Resources/icons/sort_ascending.svg +++ b/src/Mod/AddonManager/Resources/icons/sort_ascending.svg @@ -2,81 +2,117 @@ - - - + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - - - + id="defs2871"> + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + - - + id="layer3" + style="display:inline"> + + + + + + diff --git a/src/Mod/AddonManager/Resources/icons/sort_descending.svg b/src/Mod/AddonManager/Resources/icons/sort_descending.svg index 265a58c20a..08566e8d87 100644 --- a/src/Mod/AddonManager/Resources/icons/sort_descending.svg +++ b/src/Mod/AddonManager/Resources/icons/sort_descending.svg @@ -2,81 +2,117 @@ - - - + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - - - + id="defs2871"> + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + + + - - + id="layer3" + style="display:inline"> + + + + + + From 94312fe8cf65a972a169c7bc163d9369635bd0b8 Mon Sep 17 00:00:00 2001 From: Pieter Hijma Date: Sun, 19 May 2024 22:53:05 +0200 Subject: [PATCH 23/58] Gui: Make one level + status submenu Based on a discussion in the PR, make the menu such that there is only one level except for the status flags. This makes showall unambiguous only meaning that it shows the hidden properties instead of showing all the hidden properties and all options of the menu. "Show all" has therefore been renamed to "Show hidden". --- src/Gui/propertyeditor/PropertyEditor.cpp | 135 +++++++++++----------- 1 file changed, 67 insertions(+), 68 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index a4fb1105ac..a93b76424d 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -634,7 +634,7 @@ void PropertyEditor::removeProperty(const App::Property& prop) enum MenuAction { MA_AutoExpand, - MA_ShowAll, + MA_ShowHidden, MA_Expression, MA_RemoveProp, MA_AddProp, @@ -672,15 +672,13 @@ void PropertyEditor::contextMenuEvent(QContextMenuEvent *) { } // add property - if(!props.empty()) { - menu.addAction(tr("Add property"))->setData(QVariant(MA_AddProp)); - if (std::all_of(props.begin(), props.end(), [](auto prop) { - return prop->testStatus(App::Property::PropDynamic) - && !boost::starts_with(prop->getName(),prop->getGroup()); - })) - { - menu.addAction(tr("Rename property group"))->setData(QVariant(MA_EditPropGroup)); - } + menu.addAction(tr("Add property"))->setData(QVariant(MA_AddProp)); + if (!props.empty() && std::all_of(props.begin(), props.end(), [](auto prop) { + return prop->testStatus(App::Property::PropDynamic) + && !boost::starts_with(prop->getName(),prop->getGroup()); + })) + { + menu.addAction(tr("Rename property group"))->setData(QVariant(MA_EditPropGroup)); } // remove property @@ -700,71 +698,72 @@ void PropertyEditor::contextMenuEvent(QContextMenuEvent *) { menu.addAction(tr("Remove property"))->setData(QVariant(MA_RemoveProp)); // add a separator between adding/removing properties and the rest - if (!props.empty() || canRemove) { - menu.addSeparator(); - } + menu.addSeparator(); // show all - QAction *showAll = menu.addAction(tr("Show all")); - showAll->setCheckable(true); - showAll->setChecked(PropertyView::showAll()); - showAll->setData(QVariant(MA_ShowAll)); + QAction *showHidden = menu.addAction(tr("Show hidden")); + showHidden->setCheckable(true); + showHidden->setChecked(PropertyView::showAll()); + showHidden->setData(QVariant(MA_ShowHidden)); - if(PropertyView::showAll()) { - // auto expand - autoExpand = menu.addAction(tr("Auto expand")); - autoExpand->setCheckable(true); - autoExpand->setChecked(autoexpand); - autoExpand->setData(QVariant(MA_AutoExpand)); + // auto expand + autoExpand = menu.addAction(tr("Auto expand")); + autoExpand->setCheckable(true); + autoExpand->setChecked(autoexpand); + autoExpand->setData(QVariant(MA_AutoExpand)); - // expression - if(props.size() == 1) { - auto item = static_cast(contextIndex.internalPointer()); - auto prop = *props.begin(); - if(item->isBound() - && !prop->isDerivedFrom(App::PropertyExpressionEngine::getClassTypeId()) - && !prop->isReadOnly() - && !prop->testStatus(App::Property::Immutable) - && !(prop->getType() & App::Prop_ReadOnly)) - { - contextIndex = propertyModel->buddy(contextIndex); - setCurrentIndex(contextIndex); - // menu.addSeparator(); - menu.addAction(tr("Expression..."))->setData(QVariant(MA_Expression)); - } + // expression + if(props.size() == 1) { + auto item = static_cast(contextIndex.internalPointer()); + auto prop = *props.begin(); + if(item->isBound() + && !prop->isDerivedFrom(App::PropertyExpressionEngine::getClassTypeId()) + && !prop->isReadOnly() + && !prop->testStatus(App::Property::Immutable) + && !(prop->getType() & App::Prop_ReadOnly)) + { + contextIndex = propertyModel->buddy(contextIndex); + setCurrentIndex(contextIndex); + // menu.addSeparator(); + menu.addAction(tr("Expression..."))->setData(QVariant(MA_Expression)); } + } - // the various flags - if(!props.empty()) { - menu.addSeparator(); + // the various flags + if(!props.empty()) { + menu.addSeparator(); - QAction *action; - QString text; -#define _ACTION_SETUP(_name) do {\ - text = tr(#_name);\ - action = menu.addAction(text);\ - action->setData(QVariant(MA_##_name));\ - action->setCheckable(true);\ - if(propStatus & (1<setChecked(true);\ - }while(0) -#define ACTION_SETUP(_name) do {\ - _ACTION_SETUP(_name);\ - if(propType & App::Prop_##_name) {\ - action->setText(text + QString::fromLatin1(" *"));\ - action->setChecked(true);\ - }\ - }while(0) + // the subMenu is allocated on the heap but managed by menu. + auto subMenu = new QMenu(QString::fromLatin1("Status"), &menu); - ACTION_SETUP(Hidden); - ACTION_SETUP(Output); - ACTION_SETUP(NoRecompute); - ACTION_SETUP(ReadOnly); - ACTION_SETUP(Transient); - _ACTION_SETUP(Touched); - _ACTION_SETUP(EvalOnRestore); - _ACTION_SETUP(CopyOnChange); - } + QAction *action; + QString text; +#define _ACTION_SETUP(_name) do { \ + text = tr(#_name); \ + action = subMenu->addAction(text); \ + action->setData(QVariant(MA_##_name)); \ + action->setCheckable(true); \ + if(propStatus & (1<setChecked(true); \ + }while(0) +#define ACTION_SETUP(_name) do { \ + _ACTION_SETUP(_name); \ + if(propType & App::Prop_##_name) { \ + action->setText(text + QString::fromLatin1(" *")); \ + action->setChecked(true); \ + } \ + }while(0) + + ACTION_SETUP(Hidden); + ACTION_SETUP(Output); + ACTION_SETUP(NoRecompute); + ACTION_SETUP(ReadOnly); + ACTION_SETUP(Transient); + _ACTION_SETUP(Touched); + _ACTION_SETUP(EvalOnRestore); + _ACTION_SETUP(CopyOnChange); + + menu.addMenu(subMenu); } auto action = menu.exec(QCursor::pos()); @@ -782,7 +781,7 @@ void PropertyEditor::contextMenuEvent(QContextMenuEvent *) { expandAll(); } return; - case MA_ShowAll: + case MA_ShowHidden: PropertyView::setShowAll(action->isChecked()); return; #define ACTION_CHECK(_name) \ From 194e5943e71e793f38fc0ab02dae888be566af00 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 20 May 2024 10:34:10 -0500 Subject: [PATCH 24/58] Gui: Add privacy policy to About (#13987) --- src/Gui/Icons/resource.qrc | 1 + src/Gui/Splashscreen.cpp | 26 ++++++++++++++++++++++++++ src/Gui/Splashscreen.h | 1 + 3 files changed, 28 insertions(+) diff --git a/src/Gui/Icons/resource.qrc b/src/Gui/Icons/resource.qrc index f6823e5069..19ea65f9b3 100644 --- a/src/Gui/Icons/resource.qrc +++ b/src/Gui/Icons/resource.qrc @@ -290,5 +290,6 @@ ../../Doc/CONTRIBUTORS + ../../../PRIVACY_POLICY.md diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 54d2d8fb49..15e868b62c 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -341,6 +341,7 @@ AboutDialog::AboutDialog(bool showLic, QWidget* parent) showLicenseInformation(); showLibraryInformation(); showCollectionInformation(); + showPrivacyPolicy(); showOrHideImage(rect); } @@ -767,6 +768,31 @@ void AboutDialog::showCollectionInformation() textField->setSource(path); } +void AboutDialog::showPrivacyPolicy() +{ + auto policyFileURL = QLatin1String(":/doc/PRIVACY_POLICY"); + QFile policyFile(policyFileURL); + + if (!policyFile.open(QIODevice::ReadOnly | QIODevice::Text)) { + return; + } + auto text = QString::fromUtf8(policyFile.readAll()); + auto tabPrivacyPolicy = new QWidget(); + tabPrivacyPolicy->setObjectName(QString::fromLatin1("tabPrivacyPolicy")); + ui->tabWidget->addTab(tabPrivacyPolicy, tr("Privacy Policy")); + auto hLayout = new QVBoxLayout(tabPrivacyPolicy); + auto textField = new QTextBrowser(tabPrivacyPolicy); + textField->setOpenExternalLinks(true); + hLayout->addWidget(textField); + +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) + // We can't actually render the markdown, so just display it as text + textField->setText(text); +#else + textField->setMarkdown(text); +#endif +} + void AboutDialog::linkActivated(const QUrl& link) { auto licenseView = new LicenseView(); diff --git a/src/Gui/Splashscreen.h b/src/Gui/Splashscreen.h index d967c7f99b..9455cdb8e0 100644 --- a/src/Gui/Splashscreen.h +++ b/src/Gui/Splashscreen.h @@ -107,6 +107,7 @@ protected: QString getAdditionalLicenseInformation() const; void showLibraryInformation(); void showCollectionInformation(); + void showPrivacyPolicy(); void showOrHideImage(const QRect& rect); protected: From 8adb57d75f5e56ee35285bd16198c6f381fcf8af Mon Sep 17 00:00:00 2001 From: Max Wilfinger Date: Tue, 7 May 2024 15:38:01 +0200 Subject: [PATCH 25/58] Unify document icons according to artwork guidelines --- src/Gui/Icons/Document.svg | 1438 ++----------------- src/Gui/Icons/MacroEditor.svg | 159 +- src/Gui/Icons/Std_Export.svg | 443 ++---- src/Gui/Icons/Std_HideObjects.svg | 473 +----- src/Gui/Icons/Std_Import.svg | 465 ++---- src/Gui/Icons/Std_MergeProjects.svg | 704 ++------- src/Gui/Icons/Std_PrintPdf.svg | 425 +----- src/Gui/Icons/Std_RecentFiles.svg | 773 ++-------- src/Gui/Icons/Std_RecentMacros.svg | 303 ++-- src/Gui/Icons/Std_SaveAll.svg | 689 ++------- src/Gui/Icons/Std_SaveCopy.svg | 669 ++------- src/Gui/Icons/Std_ShowObjects.svg | 618 +++----- src/Gui/Icons/Std_ToggleObjects.svg | 497 ++----- src/Gui/Icons/TextDocument.svg | 297 ++-- src/Gui/Icons/document-new.svg | 461 +----- src/Gui/Icons/document-open.svg | 569 +------- src/Gui/Icons/document-package.svg | 946 +++--------- src/Gui/Icons/document-print-preview.svg | 813 +++-------- src/Gui/Icons/document-print.svg | 636 ++------ src/Gui/Icons/document-properties.svg | 646 ++------- src/Gui/Icons/document-python.svg | 504 ++----- src/Gui/Icons/document-save-as.svg | 737 ++-------- src/Gui/Icons/document-save.svg | 666 ++------- src/Gui/Icons/freecad-doc.svg | 530 ++----- src/Gui/Icons/list-add.svg | 78 +- src/Gui/Icons/list-remove.svg | 78 +- src/Gui/Icons/preferences-import-export.svg | 1099 +++----------- src/Gui/Icons/preferences-workbenches.svg | 946 +++--------- src/Gui/Icons/process-stop.svg | 116 +- src/Gui/Icons/zoom-all.svg | 788 ++-------- 30 files changed, 3228 insertions(+), 14338 deletions(-) diff --git a/src/Gui/Icons/Document.svg b/src/Gui/Icons/Document.svg index 7fc0cf4acb..9a863e801c 100644 --- a/src/Gui/Icons/Document.svg +++ b/src/Gui/Icons/Document.svg @@ -2,31 +2,50 @@ + id="svg2869" + version="1.1" + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - - Lapo Calamandrei + [maxwxyz] - - - - media - stop - playback - video - music - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> + + + - - - + id="g4011" + transform="matrix(0.79051929,0,0,0.79362693,6.7551722,20.555482)" + style="display:inline;stroke-width:1.26251"> + + - - - - - - - - - - - - - - - - + style="display:inline;stroke-width:4.41879;stroke-miterlimit:4;stroke-dasharray:none" + id="g3060" + transform="matrix(0.53017895,0,0,0.43687851,-57.203348,-1.7027788)"> + id="path3150-7" + d="M 181.76846,74.564006 V 110.8957 l -17.89251,14.53268 v -36.3317 z" + style="fill:#204a87;stroke:none;stroke-width:4.41879" /> + id="path3930" + d="M 163.87595,121.79521 183.2595,103.62936" + style="fill:none;stroke:#3465a4;stroke-width:4.15565;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Gui/Icons/MacroEditor.svg b/src/Gui/Icons/MacroEditor.svg index 5e8b861d38..6f325a0177 100644 --- a/src/Gui/Icons/MacroEditor.svg +++ b/src/Gui/Icons/MacroEditor.svg @@ -2,25 +2,29 @@ + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + - - - - + id="metadata2874"> image/svg+xml - + + + [maxwxyz] + + + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + + + + + + diff --git a/src/Gui/Icons/Std_Export.svg b/src/Gui/Icons/Std_Export.svg index 4bde8aaf8c..4a3d285343 100644 --- a/src/Gui/Icons/Std_Export.svg +++ b/src/Gui/Icons/Std_Export.svg @@ -1,232 +1,114 @@ + + - Std_Export + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient5"> + id="stop19" /> + id="stop20" /> - + id="swatch18"> + id="stop18" /> + + + style="stop-color:#3d0000;stop-opacity:1;" + offset="0" + id="stop15" /> + + + + id="stop6" /> - + id="linearGradient3836-9"> + id="stop3838-8" /> + id="stop3840-1" /> - - - - - + id="linearGradient3836-9-3"> + id="stop3838-8-5" /> - - + style="stop-color:#ef2929;stop-opacity:1" + offset="1" + id="stop3840-1-6" /> + + + id="stop1" /> - - - - + style="stop-color:#8ae234;stop-opacity:1;" + offset="1" + id="stop2" /> - - - + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + id="linearGradient3765"> + style="stop-color:#d3d7cf;stop-opacity:1;" + offset="0" + id="stop3767" /> - + style="stop-color:#ffffff;stop-opacity:1" + offset="1" + id="stop3769" /> - - - - - + id="metadata2874"> image/svg+xml - Std_Export - [bitacovir] + [maxwxyz] - - - - - Based on Jakub Steiner's work - - - 2020/11/31 - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - https://www.freecad.org/wiki/index.php?title=Artwork - - - red arrow - document - - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="layer3" + style="display:inline"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> - - + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + + style="display:inline;fill:url(#linearGradient3012);fill-opacity:1;fill-rule:evenodd;stroke:#ef2929;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 47.629277,38.105469 v 3.742187 H 31.000371 v 5.470703 h 16.628906 v 3.742188 l 8.863281,-6.478516 z" + id="path1" /> diff --git a/src/Gui/Icons/Std_HideObjects.svg b/src/Gui/Icons/Std_HideObjects.svg index 2453750545..a9d1b2850a 100644 --- a/src/Gui/Icons/Std_HideObjects.svg +++ b/src/Gui/Icons/Std_HideObjects.svg @@ -1,19 +1,59 @@ + + - Std_HideObjects + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - Std_HideObjects - 2020/12/25 - [bitacovir] + [maxwxyz] - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - - - eye - box - page - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="layer3" + style="display:inline"> + + + + style="fill:url(#radialGradient3820-0-2);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + + - Std_Import + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient5"> + id="stop19" /> + id="stop20" /> - + id="swatch18"> - - + id="stop18" /> - + id="swatch15"> + id="stop15" /> + + + - - - - - - - - - - - - - - - - - + id="stop6" /> + id="linearGradient3836-9"> + style="stop-color:#a40000;stop-opacity:1" + offset="0" + id="stop3838-8" /> + style="stop-color:#ef2929;stop-opacity:1" + offset="1" + id="stop3840-1" /> - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> + + + + + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.73269922,0,0,0.5925111,-11.267912,24.513214)" + x1="48.014042" + y1="26.323408" + x2="43.478561" + y2="42.076672" /> + id="stop3808" /> + id="stop3810" /> + id="metadata2874"> image/svg+xml - Std_Import - [bitacovir] + [maxwxyz] - - - - - Based on Jakub Steiner's work - - - 2020/11/31 - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - https://www.freecad.org/wiki/index.php?title=Artwork - - - green arrow - document - - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + + + diff --git a/src/Gui/Icons/Std_MergeProjects.svg b/src/Gui/Icons/Std_MergeProjects.svg index c91f8ac79d..068676a67e 100644 --- a/src/Gui/Icons/Std_MergeProjects.svg +++ b/src/Gui/Icons/Std_MergeProjects.svg @@ -1,388 +1,49 @@ + + - Std_MergeProjects + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + id="stop3767" /> - - - - - - + id="stop3769" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" /> + + id="metadata2874"> image/svg+xml - Std_MergeProjects - [bitacovir] + [maxwxyz] - - - - - Work based o Jakub Steiner design - - - 2020/11/31 - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - https://www.freecad.org/wiki/index.php?title=Artwork - - - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> - + id="g5" + transform="matrix(0.88681323,0,0,0.88889159,10.527509,0.33465048)" + style="stroke-width:1.12632"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/src/Gui/Icons/Std_PrintPdf.svg b/src/Gui/Icons/Std_PrintPdf.svg index 6dfb28e6a5..f5017b2fdc 100644 --- a/src/Gui/Icons/Std_PrintPdf.svg +++ b/src/Gui/Icons/Std_PrintPdf.svg @@ -1,161 +1,39 @@ + + - Std_PrintPdf + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + id="stop3767" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="stop3769" /> @@ -173,251 +51,86 @@ id="stop12514" /> - - - - - - - - + cx="55" + cy="125" + fx="55" + fy="125" + r="14.375" + gradientTransform="matrix(0.86956519,0,0,0.86956519,0.15426863,-90.195652)" /> + id="metadata2874"> image/svg+xml - Std_PrintPdf - [bitacovir] + [maxwxyz] - - - - - Based on Jakub Steiner's work - - - 2020/11/31 - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - https://www.freecad.org/wiki/index.php?title=Artwork - - - loop - document - - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="layer3-3" + style="display:inline"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + - - + style="display:inline;stroke-width:1.25271" + transform="matrix(0.80709805,0,0,0.78953592,7.0030889,2.0691109)"> + transform="rotate(-6.8384364,21.868543,48.868543)" + style="stroke-width:1.25271"> + style="fill:none;stroke:#cc0000;stroke-width:3.13178;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + diff --git a/src/Gui/Icons/Std_RecentFiles.svg b/src/Gui/Icons/Std_RecentFiles.svg index 5dbe9f91f0..bb3ee8034e 100644 --- a/src/Gui/Icons/Std_RecentFiles.svg +++ b/src/Gui/Icons/Std_RecentFiles.svg @@ -1,728 +1,139 @@ + + - Std_RecentFiles + id="svg2869" + version="1.1" + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - + id="linearGradient3765"> + id="stop3767" /> + id="stop3769" /> - - - - - + gradientTransform="translate(-60,-988.36218)" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" /> + id="metadata2874"> image/svg+xml - Std_RecentFiles - 2020-11-12 - [bitacovir] + [maxwxyz] - - - documents - clock - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Based on Andreas Nilsson's work + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> - - - - - - - - + id="g5" + transform="matrix(0.88681323,0,0,0.88889159,10.527509,0.33465048)" + style="stroke-width:1.12632;opacity:0.6"> + + + + id="g9" + transform="matrix(0.88681323,0,0,0.88889159,-3.283556,6.77627)" + style="stroke-width:1.12632"> - + style="fill:url(#linearGradient9);fill-opacity:1;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path7" /> + style="fill:none;stroke:#ffffff;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path8" /> + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path9" /> + + - + id="g3" + transform="translate(16.727535,4.2195563)"> + - - - + style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:#d3d7cf;fill-opacity:1;fill-rule:evenodd;stroke:#eeeeec;stroke-width:2.00001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1" + id="circle2" + transform="scale(-1,1)" + d="m 2.3964844,-3.015625 c 6.6173018,0 11.9999996,5.3826982 11.9999996,12 0,6.617302 -5.3826978,12 -11.9999996,12 -6.6173018,0 -12,-5.382698 -12,-12 0,-6.6173018 5.3826982,-12 12,-12 z" /> - - - + style="fill:none;stroke:#2e3436;stroke-width:2.00001;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="m 3.3502036,8.984375 h -5.746688 V 0.58691898" + id="path966" /> - - diff --git a/src/Gui/Icons/Std_RecentMacros.svg b/src/Gui/Icons/Std_RecentMacros.svg index c60f189222..b4365fb658 100644 --- a/src/Gui/Icons/Std_RecentMacros.svg +++ b/src/Gui/Icons/Std_RecentMacros.svg @@ -1,195 +1,144 @@ - - Std_RecentFiles - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + image/svg+xml - - Std_RecentFiles - 2020-11-12 + - [bitacovir] + [maxwxyz] - - - documents - clock - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Based on Andreas Nilsson's work + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - + + + + + - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - diff --git a/src/Gui/Icons/Std_SaveAll.svg b/src/Gui/Icons/Std_SaveAll.svg index 79810f5e81..d84a61b032 100644 --- a/src/Gui/Icons/Std_SaveAll.svg +++ b/src/Gui/Icons/Std_SaveAll.svg @@ -1,605 +1,180 @@ + + - Std_SaveAll + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient2"> + id="stop1" /> + id="stop2" /> - + id="linearGradient6"> + id="stop7" /> - + id="stop8" /> + gradientTransform="translate(1.0000011)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(1.0000011)" + x1="11.761719" + y1="55" + x2="11.730469" + y2="9.0234375" /> + id="metadata2874"> image/svg+xml - Std_SaveAll - [bitacovr] + [maxwxyz] - - - hdd - hard drive - save - io - store - - - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Based on Jakub Steiner's work + FreeCAD - - 2020/12/06 + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="g16" + style="display:inline" + transform="translate(4,-2)"> + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="fill:#729fcf;fill-rule:evenodd;stroke:#204a87;stroke-width:2.00001;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + id="rect16" + width="26.636181" + height="5.4541898" + x="18.68214" + y="46.167206" /> + id="layer3-3" + style="display:inline" + transform="translate(-4,2)"> + style="fill:#babdb6;fill-opacity:1;fill-rule:nonzero;stroke:#2e3436;stroke-width:2;stroke-dasharray:none;stroke-opacity:1" + d="m 46.969644,5.0000007 c -1.016659,0.00167 -36.241296,0.023583 -36.241296,0.023583 -2.2376263,0.0025 -4.0482274,1.8163761 -4.0482274,4.0525194 l 0.030083,45.8765159 c 0,2.237085 1.8159095,4.050186 4.0526024,4.047377 l 42.508917,-0.02617 c 2.236618,-8.34e-4 4.051502,-1.815676 4.048152,-4.052836 0,0 -0.024,-39.562746 -0.024,-40.10958 C 57.294175,13.929073 57.083067,13.202314 56.5137,12.635605 56.147091,12.270547 52.136589,8.2656611 50.075358,6.2044389 49.34977,5.483076 47.985444,5.0000007 46.969644,5.0000007 Z" + id="path2" /> + style="fill:url(#linearGradient8);fill-opacity:1;fill-rule:nonzero;stroke:#d3d7cf;stroke-width:2;stroke-dasharray:none;stroke-opacity:1" + d="m 55.294717,14.611042 -3.28e-4,-0.0032 c 0.0047,6.580947 0.01274,21.853798 0.02592,40.317964 0.0017,1.11961 -0.928889,2.04841 -2.050781,2.048828 L 10.76172,57.000004 C 9.6407231,57.001404 8.7109392,56.073536 8.7109386,54.951176 L 8.6796886,9.0761712 c 0,-1.122432 0.9275825,-2.0514794 2.0507814,-2.0527345 17.70908,-0.011603 30.337148,-0.018565 36.420303,-0.022568 -0.0025,-2.731e-4 -0.005,-5.412e-4 -0.0075,-8.043e-4 -0.170096,5.58e-5 -0.239149,4.11e-5 -0.174522,-6.52e-5 0.539605,0 1.40169,0.3291821 1.693359,0.6191406 2.061938,2.0619294 6.067557,6.0613262 6.441407,6.4335932 0.02999,0.02985 0.190469,0.273705 0.191406,0.757813 0,0.03115 -7.4e-5,-0.04282 -2.06e-4,-0.199504 z" + id="path5" /> + style="fill:#eeeeec;fill-opacity:1;fill-rule:nonzero;stroke:#555753;stroke-width:2;stroke-dasharray:none;stroke-opacity:1" + d="m 44.021216,9.0020721 0.0094,12.3869269 c 0,1.204367 -1.237967,2.357126 -2.442018,2.359001 l -17.601769,0.01117 c -1.202576,0.0017 -2.33016,-1.150418 -2.33016,-2.354868 L 21.645439,9.0171471 Z" + id="path1" /> + + + + + + diff --git a/src/Gui/Icons/Std_SaveCopy.svg b/src/Gui/Icons/Std_SaveCopy.svg index e6043bc081..149ae8677c 100644 --- a/src/Gui/Icons/Std_SaveCopy.svg +++ b/src/Gui/Icons/Std_SaveCopy.svg @@ -1,633 +1,162 @@ + + - Std_SaveCopy + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient5"> + id="stop19" /> + id="stop20" /> - + id="swatch18"> + id="stop18" /> + + + style="stop-color:#3d0000;stop-opacity:1;" + offset="0" + id="stop15" /> + + + + id="stop6" /> - + id="linearGradient3836-9"> + id="stop3838-8" /> - - - - - - - - - - - - - - - - - + id="stop3840-1" /> + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + style="stop-color:#d3d7cf;stop-opacity:1;" + offset="0" + id="stop3767" /> + style="stop-color:#ffffff;stop-opacity:1" + offset="1" + id="stop3769" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" /> + id="metadata2874"> image/svg+xml - Std_SaveCopy - [bitacovir] + [maxwxyz] - - - - - Work based o Jakub Steiner design - - - 2020/11/31 - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - https://www.freecad.org/wiki/index.php?title=Artwork - - - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="g5" + transform="matrix(0.88681323,0,0,0.88889159,10.527509,0.33465048)" + style="stroke-width:1.12632"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> - - - - - - - - - - - - - - + id="g9" + transform="matrix(0.88681323,0,0,0.88889159,-3.283556,6.77627)" + style="stroke-width:1.12632"> + style="fill:url(#linearGradient9);fill-opacity:1;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path7" /> + style="fill:none;stroke:#ffffff;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path8" /> - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path9" /> - diff --git a/src/Gui/Icons/Std_ShowObjects.svg b/src/Gui/Icons/Std_ShowObjects.svg index d00f63b68e..7c03bd96e6 100644 --- a/src/Gui/Icons/Std_ShowObjects.svg +++ b/src/Gui/Icons/Std_ShowObjects.svg @@ -1,19 +1,137 @@ + + - Std_ShowObjects + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - Std_ShowObjects - 2020/12/25 - [bitacovir] + [maxwxyz] - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - - - eye - cube - page - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 + id="layer3" + style="display:inline"> + + + + transform="translate(0.56099874,0.30599931)" + id="g929"> - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="stroke-width:3.03469;stroke-miterlimit:4;stroke-dasharray:none"> + style="fill:url(#radialGradient3820);fill-opacity:1;stroke:#2e3436;stroke-width:3.03469;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="fill:url(#radialGradient3868);fill-opacity:1;fill-rule:evenodd;stroke:#204a87;stroke-width:3.03469;stroke-miterlimit:4;stroke-dasharray:none" /> + style="fill:#2e3436;fill-opacity:1;fill-rule:evenodd;stroke:#2e3436;stroke-width:3.03469;stroke-miterlimit:4;stroke-dasharray:none" /> + style="fill:none;stroke:#888a85;stroke-width:3.03469;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + cx="32" + id="path3808-0" + style="fill:none;stroke:#729fcf;stroke-width:3.03469;stroke-miterlimit:4;stroke-dasharray:none" /> + + - Std_ToggleObjects + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + id="linearGradient5"> + id="stop19" /> + id="stop20" /> + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + id="linearGradient3862"> + id="stop3864" /> - + id="stop3866" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - Std_ToggleObjects - 2020/12/25 - [bitacovir] + [maxwxyz] - - - FreeCAD LGPL2+ - - + https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - - - eye - page - - + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="layer3" + style="display:inline"> + + + diff --git a/src/Gui/Icons/TextDocument.svg b/src/Gui/Icons/TextDocument.svg index 5735b436ba..9cb06fcc08 100644 --- a/src/Gui/Icons/TextDocument.svg +++ b/src/Gui/Icons/TextDocument.svg @@ -1,230 +1,151 @@ + + - + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + id="linearGradient5"> - - - - - - + id="stop19" /> + id="stop20" /> + id="swatch18"> - + id="stop18" /> - + id="swatch15"> - + id="stop15" /> + id="linearGradient5-1"> + + + + id="linearGradient3836-9"> + + + + gradientTransform="translate(-60,-988.36218)" /> + + + + + id="metadata2874"> image/svg+xml - - 2005-10-15 - Andreas Nilsson + [maxwxyz] - - - edit - copy - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - + id="layer3" + style="display:inline"> + + + + + + + + diff --git a/src/Gui/Icons/document-new.svg b/src/Gui/Icons/document-new.svg index 742732100c..d17145f821 100644 --- a/src/Gui/Icons/document-new.svg +++ b/src/Gui/Icons/document-new.svg @@ -1,174 +1,39 @@ + + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + id="stop3767" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="stop3769" /> @@ -186,261 +51,69 @@ id="stop12514" /> - - - - - + cx="55" + cy="125" + fx="55" + fy="125" + r="14.375" + gradientTransform="matrix(0.86956519,0,0,0.86956519,0.15426863,-90.195652)" /> - + id="metadata2874"> image/svg+xml - New Document - Jakub Steiner + [maxwxyz] - http://jimmac.musichall.cz - + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> - + id="layer3-3" + style="display:inline"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/Gui/Icons/document-open.svg b/src/Gui/Icons/document-open.svg index f38716dd2a..21d912ec3f 100644 --- a/src/Gui/Icons/document-open.svg +++ b/src/Gui/Icons/document-open.svg @@ -1,533 +1,120 @@ + + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + id="stop3767" /> + id="stop3769" /> - + xlink:href="#linearGradient8" + id="linearGradient9" + x1="32" + y1="64" + x2="32" + y2="14.419661" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(0,2)" /> + + id="stop8" /> - + id="stop9" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - Folder Icon Accept - 2005-01-31 - Jakub Steiner + [maxwxyz] - - http://jimmac.musichall.cz - Active state - when files are being dragged to. + https://www.freecad.org/wiki/index.php?title=Artwork - Novell, Inc. + FreeCAD + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + + - + id="layer3-3" + style="display:inline"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> - + + diff --git a/src/Gui/Icons/document-package.svg b/src/Gui/Icons/document-package.svg index 370abc9f77..335f0ac0d0 100644 --- a/src/Gui/Icons/document-package.svg +++ b/src/Gui/Icons/document-package.svg @@ -2,150 +2,144 @@ + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + id="linearGradient5"> - - - - - - + id="stop19" /> + id="stop20" /> + id="swatch18"> - + id="stop18" /> + + + + + + + + + + + + + + + + gradientTransform="translate(-60,-988.36218)" /> + id="linearGradient3765"> + id="stop3767" /> + id="stop3769" /> + id="linearGradient3835" + xlink:href="#linearGradient3813" /> - - + id="linearGradient3813"> + style="stop-color:#e9b96e;stop-opacity:1" /> + style="stop-color:#c17d11;stop-opacity:1" /> + y2="47" + x2="53" + y1="23" + x1="47" + gradientUnits="userSpaceOnUse" + id="linearGradient3881" + xlink:href="#linearGradient3839-1" /> + + style="stop-color:#c17d11;stop-opacity:1" /> + style="stop-color:#8f5902;stop-opacity:1" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - - 2005-10-15 - Andreas Nilsson + [maxwxyz] - - - edit - copy - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> - + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> - + id="layer1-2" + transform="matrix(0.45189445,0,0,0.45189445,17.539378,16.634975)"> - - - - - - - - - - + transform="matrix(1.2639858,0,0,1.2579771,-10.015954,-10.290134)" + id="g3851" + style="stroke-width:0.900545"> + id="g3821" + transform="matrix(0.8782269,0,0,0.88301047,5.1375817,7.8341081)" + style="stroke-width:0.900545"> + + + + + + + + + + - - - - - + id="layer1-4" + transform="translate(-6e-6,-0.36363683)" + style="stroke-width:0.900545"> + + + + + + + diff --git a/src/Gui/Icons/document-print-preview.svg b/src/Gui/Icons/document-print-preview.svg index d3501ac154..50188432d8 100644 --- a/src/Gui/Icons/document-print-preview.svg +++ b/src/Gui/Icons/document-print-preview.svg @@ -1,703 +1,248 @@ + + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - - + id="defs2871"> + id="linearGradient5"> + id="stop5" /> + id="stop6" /> - + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + id="stop3767" /> - + id="stop3769" /> + gradientTransform="translate(0,-10)" /> + + id="linearGradient3857"> + id="stop3859" /> + style="stop-color:#06989a;stop-opacity:1" + offset="1" + id="stop3861" /> - - - - - + id="linearGradient3863"> + id="stop3865" /> - - - - - - - - - - - - - - - - - + id="stop3867" /> + xlink:href="#linearGradient3857" + id="radialGradient3163" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1.0434787,1.0434783,-1.6856187,1.6856188,-23.582326,-69.974294)" + cx="43.783218" + cy="41.446495" + fx="43.783218" + fy="41.446495" + r="12.458333" /> + + id="linearGradient8662"> + id="stop8664" + offset="0" + style="stop-color:#000000;stop-opacity:1;" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - Print Preview - Jakub Steiner + [maxwxyz] - - http://jimmac.musichall.cz - - - printer - local - laser - bubblejet - inkjet - print - output - cups - lpd - preview - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Corey Woodworth + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - + id="layer3" + style="display:inline"> - + id="layer3-3" + style="display:inline"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> - - - - - - - - - - - - - - - - - - - - - + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + id="rect1" + style="fill:#d3d7cf;fill-rule:evenodd;stroke:#2e3436;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none" + d="m 9,17.564453 c -2.7699972,0 -5,2.230003 -5,5 V 40 c 0,2.769997 2.2300028,5 5,5 h 2 V 33.376953 H 53 V 45 h 2 c 2.769997,0 5,-2.230003 5,-5 V 22.564453 c 0,-2.769997 -2.230003,-5 -5,-5 z" /> + style="fill:none;fill-rule:evenodd;stroke:#888a85;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none" + d="M 16.204604,44.26769 H 37.483376" + id="path2" /> - + style="fill:none;fill-rule:evenodd;stroke:#888a85;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none" + d="M 16.204604,49.26769 H 45.776642" + id="path3" /> + style="fill:none;fill-rule:evenodd;stroke:#888a85;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none" + d="M 16.204604,54.26769 H 33.391305" + id="path4" /> + id="path5" + style="display:inline;fill:url(#linearGradient6);fill-rule:evenodd;stroke:#d3d7cf;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none" + d="m 9,19.564453 h 46 c 1.663036,0 3,1.336964 3,3 V 40 c 0,1.663036 -1.336964,3 -3,3 V 31.376953 H 9 V 43 C 7.3369634,43 6,41.663036 6,40 V 22.564453 c 0,-1.663036 1.3369634,-3 3,-3 z" /> + + + + + + + + + + diff --git a/src/Gui/Icons/document-print.svg b/src/Gui/Icons/document-print.svg index bb3d43df5f..2215dfe1ee 100644 --- a/src/Gui/Icons/document-print.svg +++ b/src/Gui/Icons/document-print.svg @@ -1,530 +1,210 @@ + + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient5"> + id="stop5" /> - - - - - - + id="stop6" /> + gradientTransform="translate(-60,-988.36218)" /> + id="linearGradient3765"> + id="stop3767" /> + id="stop3769" /> + + + + + + + id="linearGradient3863"> - - - - - - - - - - - - - - - - - - - - - - + id="stop3865" /> - - - - - - - - - - - - - - - + id="stop3867" /> + gradientTransform="matrix(1.0434787,1.0434783,-1.6856187,1.6856188,-23.582326,-69.974294)" + cx="43.783218" + cy="41.446495" + fx="43.783218" + fy="41.446495" + r="12.458333" /> + - - - - - - - + id="linearGradient8662"> + + + - + id="metadata2874"> image/svg+xml - Print Document - Jakub Steiner + [maxwxyz] - - http://jimmac.musichall.cz - - - document - lpr - print - local - laser - bubblejet - inkjet - print - output - cups - lpd - - + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> - + id="layer3-3" + style="display:inline"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + + + + + + + + - - - - - - - - - - - - - - - - - - - - diff --git a/src/Gui/Icons/document-properties.svg b/src/Gui/Icons/document-properties.svg index e9ea32bddc..5bd4263c6d 100644 --- a/src/Gui/Icons/document-properties.svg +++ b/src/Gui/Icons/document-properties.svg @@ -1,574 +1,162 @@ + + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient5"> + id="stop19" /> - - - - - - + id="stop20" /> + id="swatch18"> + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - Document Properties - - - document - settings - preferences - properties - tweak - - - - Jakub Steiner + [maxwxyz] - http://jimmac.musichall.cz + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="layer3-3" + style="display:inline"> + + + + + + - diff --git a/src/Gui/Icons/document-python.svg b/src/Gui/Icons/document-python.svg index bd67c19d1b..58d627f7b5 100644 --- a/src/Gui/Icons/document-python.svg +++ b/src/Gui/Icons/document-python.svg @@ -2,496 +2,186 @@ + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + id="linearGradient5"> - - - - - - + id="stop19" /> + id="stop20" /> + id="swatch18"> - + id="stop18" /> - + id="swatch15"> - + id="stop15" /> - - - + id="linearGradient5-1"> + id="stop5" /> + id="stop6" /> - - - - - - - - - + id="linearGradient3836-9"> + id="stop3838-8" /> + id="stop3840-1" /> - - + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + id="stop3767" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="stop3769" /> + xlink:href="#linearGradient4671" /> + style="stop-color:#c4a000;stop-opacity:1" /> + style="stop-color:#fce94f;stop-opacity:1" /> + id="linearGradient3063" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.33228796,0,0,0.335496,-9.6861333,-6.1047203)" + x1="26.648937" + y1="20.603781" + x2="135.66525" + y2="114.39767" /> + style="stop-color:#729fcf;stop-opacity:1" /> + style="stop-color:#204a87;stop-opacity:1" /> - - + id="metadata2874"> image/svg+xml - - 2005-10-15 - Andreas Nilsson + [maxwxyz] - - - edit - copy - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> - + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - - - - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + + + + diff --git a/src/Gui/Icons/document-save-as.svg b/src/Gui/Icons/document-save-as.svg index 09fa340a59..147fc4f59b 100644 --- a/src/Gui/Icons/document-save-as.svg +++ b/src/Gui/Icons/document-save-as.svg @@ -1,661 +1,142 @@ + + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient6"> + id="stop7" /> + id="stop8" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(1.0000011)" /> - + id="metadata2874"> image/svg+xml - Save As - Jakub Steiner + [maxwxyz] - - - hdd - hard drive - save as - io - store - - - - - http://jimmac.musichall.cz + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> + + + + + - - + style="display:inline;fill:#eeeeec;fill-rule:evenodd;stroke:#204a87;stroke-width:2;stroke-linecap:square;stroke-linejoin:round" + id="rect16" + width="28.636192" + height="17.675844" + x="17.682135" + y="34.318714" /> + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Gui/Icons/document-save.svg b/src/Gui/Icons/document-save.svg index 6be29c42f2..e9509c35de 100644 --- a/src/Gui/Icons/document-save.svg +++ b/src/Gui/Icons/document-save.svg @@ -1,617 +1,115 @@ + + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="defs2871"> + id="linearGradient6"> + id="stop7" /> + id="stop8" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(1.0000011)" /> - + id="metadata2874"> image/svg+xml - Save - Jakub Steiner + [maxwxyz] - - - hdd - hard drive - save - io - store - - - - - http://jimmac.musichall.cz + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> + + + + + + + + - - + style="fill:#729fcf;fill-rule:evenodd;stroke:#204a87;stroke-width:2.00001;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + id="rect8" + width="26.636181" + height="5.4541898" + x="18.68214" + y="46.167206" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Gui/Icons/freecad-doc.svg b/src/Gui/Icons/freecad-doc.svg index 9d2f52b331..eeb389bc97 100644 --- a/src/Gui/Icons/freecad-doc.svg +++ b/src/Gui/Icons/freecad-doc.svg @@ -2,150 +2,95 @@ + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + id="linearGradient5"> - - - - - - + id="stop19" /> + id="stop20" /> + id="swatch18"> - + id="stop18" /> + + + + + + + + + + + + gradientTransform="translate(-60,-988.36218)" /> + id="linearGradient3765"> + id="stop3767" /> + id="stop3769" /> - - - - - - - - - - - + y2="26.520763" + x2="-157.32494" + y1="58.261547" + x1="-146.74467" + id="linearGradient3808" + xlink:href="#linearGradient3864-9" /> + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - - 2005-10-15 - Andreas Nilsson + [maxwxyz] - - - edit - copy - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> - + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + id="layer1-2" + transform="matrix(0.45189445,0,0,0.45189445,17.539378,16.634975)"> - - - - - + id="layer1-6" + transform="matrix(0.86672161,0,0,0.86672161,4.2649058,6.2662659)"> + + + + + + + + + diff --git a/src/Gui/Icons/list-add.svg b/src/Gui/Icons/list-add.svg index 1e82560392..e52fb483a2 100644 --- a/src/Gui/Icons/list-add.svg +++ b/src/Gui/Icons/list-add.svg @@ -2,20 +2,16 @@ + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - - - - @@ -150,7 +103,6 @@ image/svg+xml - [wmayer] @@ -180,31 +132,15 @@ - + id="layer1"> diff --git a/src/Gui/Icons/list-remove.svg b/src/Gui/Icons/list-remove.svg index 1c4efa60f7..8b09fde3be 100644 --- a/src/Gui/Icons/list-remove.svg +++ b/src/Gui/Icons/list-remove.svg @@ -2,20 +2,16 @@ + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - - - - @@ -150,7 +103,6 @@ image/svg+xml - [wmayer] @@ -180,31 +132,15 @@ - + id="layer1"> diff --git a/src/Gui/Icons/preferences-import-export.svg b/src/Gui/Icons/preferences-import-export.svg index bfa83670ad..2882b11a5b 100644 --- a/src/Gui/Icons/preferences-import-export.svg +++ b/src/Gui/Icons/preferences-import-export.svg @@ -2,654 +2,99 @@ + id="svg2869" + version="1.1" + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - + id="linearGradient3765"> + id="stop3767" /> + id="stop3769" /> + gradientTransform="translate(-60,-988.36218)" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" /> + id="linearGradient1014"> + id="stop1010" /> + id="stop1012" /> + id="linearGradient951-4" + xlink:href="#linearGradient1014" /> + + + + + + + + + + - - - + id="metadata2874"> image/svg+xml - - 2005-10-15 - Andreas Nilsson + [maxwxyz] - - - edit - copy - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> - - - - - - - - + id="g5" + transform="matrix(0.88681323,0,0,0.88889159,10.527509,0.33465048)" + style="stroke-width:1.12632"> + + + + id="g9" + transform="matrix(0.88681323,0,0,0.88889159,-3.283556,6.77627)" + style="stroke-width:1.12632"> - + style="fill:url(#linearGradient9);fill-opacity:1;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path7" /> + style="fill:none;stroke:#ffffff;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path8" /> + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2.25263;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path9" /> + + + + + + + + + + + + + + id="g6" + transform="matrix(0.63333334,0,0,0.63333334,-18.823923,19.168122)"> + style="color:#000000;display:block;overflow:visible;visibility:visible;fill:url(#linearGradient3034-4);fill-opacity:1;fill-rule:nonzero;stroke:#0c1522;stroke-width:2.63333;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" + d="M -0.97718465,15.226518 C 5.945782,47.768375 -29.096848,59.994404 -59.646916,36.098716 l -9.004006,9.801047 0.18052,-32.036605 28.217689,0.02881 c 0,0 -9.392193,10.468891 -9.392193,10.468891 21.485154,16.14438 49.00179745,14.93583 48.66772135,-9.134338 z" + id="path1880-2" /> - - - - - - - - - - - - - - - - - - - - - - - - + id="path2807-5" + d="m -3.862789,30.789612 c -1.8217732,12.739136 -27.163116,25.718425 -55.993604,1.451342 l -6.041968,6.362253 0.255604,-21.981734 19.222582,-0.0062 -7.286947,7.931195 c 17.807901,14.295225 40.08457,18.165192 49.844333,6.243129 z" + style="color:#000000;display:block;overflow:visible;visibility:visible;fill:none;stroke:#729fcf;stroke-width:2.63333;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:21;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none" /> diff --git a/src/Gui/Icons/preferences-workbenches.svg b/src/Gui/Icons/preferences-workbenches.svg index 370abc9f77..335f0ac0d0 100644 --- a/src/Gui/Icons/preferences-workbenches.svg +++ b/src/Gui/Icons/preferences-workbenches.svg @@ -2,150 +2,144 @@ + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + id="linearGradient5"> - - - - - - + id="stop19" /> + id="stop20" /> + id="swatch18"> - + id="stop18" /> + + + + + + + + + + + + + + + + gradientTransform="translate(-60,-988.36218)" /> + id="linearGradient3765"> + id="stop3767" /> + id="stop3769" /> + id="linearGradient3835" + xlink:href="#linearGradient3813" /> - - + id="linearGradient3813"> + style="stop-color:#e9b96e;stop-opacity:1" /> + style="stop-color:#c17d11;stop-opacity:1" /> + y2="47" + x2="53" + y1="23" + x1="47" + gradientUnits="userSpaceOnUse" + id="linearGradient3881" + xlink:href="#linearGradient3839-1" /> + + style="stop-color:#c17d11;stop-opacity:1" /> + style="stop-color:#8f5902;stop-opacity:1" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="metadata2874"> image/svg+xml - - 2005-10-15 - Andreas Nilsson + [maxwxyz] - - - edit - copy - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> - + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> - + id="layer1-2" + transform="matrix(0.45189445,0,0,0.45189445,17.539378,16.634975)"> - - - - - - - - - - + transform="matrix(1.2639858,0,0,1.2579771,-10.015954,-10.290134)" + id="g3851" + style="stroke-width:0.900545"> + id="g3821" + transform="matrix(0.8782269,0,0,0.88301047,5.1375817,7.8341081)" + style="stroke-width:0.900545"> + + + + + + + + + + - - - - - + id="layer1-4" + transform="translate(-6e-6,-0.36363683)" + style="stroke-width:0.900545"> + + + + + + + diff --git a/src/Gui/Icons/process-stop.svg b/src/Gui/Icons/process-stop.svg index 6cf7df6fae..54a1cbc5fe 100644 --- a/src/Gui/Icons/process-stop.svg +++ b/src/Gui/Icons/process-stop.svg @@ -2,22 +2,16 @@ + version="1.1" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> - - - - - - + id="linearGradient15762"> + xlink:href="#linearGradient15762" /> - - - @@ -269,7 +192,6 @@ image/svg+xml - 2005-10-16 @@ -304,40 +226,22 @@ - + style="fill:url(#radialGradient3042);fill-opacity:1;fill-rule:evenodd;stroke:#ef2929;stroke-width:1.46266699;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> diff --git a/src/Gui/Icons/zoom-all.svg b/src/Gui/Icons/zoom-all.svg index 7ab0296dd8..0bca8915e9 100644 --- a/src/Gui/Icons/zoom-all.svg +++ b/src/Gui/Icons/zoom-all.svg @@ -2,577 +2,87 @@ + height="64" + id="svg2869" + version="1.1" + viewBox="0 0 64 64" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs2871"> + id="linearGradient5"> + id="stop19" /> + id="stop20" /> - + id="swatch18"> + id="stop18" /> + + + + + + - - - - - + id="stop6" /> + id="linearGradient3836-9"> + id="stop3838-8" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="stop3840-1" /> - - - - + gradientTransform="translate(-60,-988.36218)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="linearGradient3765"> + id="stop3767" /> + id="stop3769" /> - - - - - - - + id="linearGradient3857"> + + + - - - + id="metadata2874"> @@ -636,103 +114,73 @@ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - Martin Ruskov + [maxwxyz] - http://commons.wikimedia.org/wiki/Tango_icon - + https://www.freecad.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - - - + id="layer3" + style="display:inline"> + id="layer3-3" + style="display:inline"> + style="fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - - - - - - + style="fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + + + + + + + + From e30138e110009bfc7c817b50b3772853f79c11aa Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Mon, 20 May 2024 10:36:16 -0500 Subject: [PATCH 26/58] Update PRIVACY_POLICY.md to mention macros (#13986) * Update PRIVACY_POLICY.md to mention macros * Address review comment --- PRIVACY_POLICY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PRIVACY_POLICY.md b/PRIVACY_POLICY.md index 374cf9312f..eae400742b 100644 --- a/PRIVACY_POLICY.md +++ b/PRIVACY_POLICY.md @@ -19,6 +19,8 @@ The FreeCAD eco system includes user developed workbenches. These workbenches c FreeCAD is meant to manipulate CAD files which may contain metadata. It is your responsibility to verify the metadata contained in your files before you share them with others. These files may contain local directory paths which could reveal user names if the user name forms part of the path - as in “C:\MrsCAD\Documents\myFreeCADFile.FCstd”. +FreeCAD can also be used to create and run macros. These are Python scripts that can perform any action that the user can perform on a system. When running a macro from an outside source, it is your responsibility to ensure you trust the author. + While running and for subsequent runs, FreeCAD uses local persistent storage for logs, configuration files, cache, thumbnails, recently accessed files and other information which may contain private data. This stays on local storage. When reading the online version of the User Manual within FreeCAD, manual contents is requested through HTTPS connections. From dd012f366a91f1972adc1f625c1e0a3c820b3fd3 Mon Sep 17 00:00:00 2001 From: Max Wilfinger Date: Sun, 5 May 2024 14:10:10 +0200 Subject: [PATCH 27/58] Update Part Design toolbars. Command group for datum. Removed ShapeBinder. Added CheckGeometry. --- src/Mod/PartDesign/Gui/Command.cpp | 61 ++++++++++++++++++++++++++++ src/Mod/PartDesign/Gui/Workbench.cpp | 43 ++++++++++---------- 2 files changed, 83 insertions(+), 21 deletions(-) diff --git a/src/Mod/PartDesign/Gui/Command.cpp b/src/Mod/PartDesign/Gui/Command.cpp index 862f2a4825..345531c578 100644 --- a/src/Mod/PartDesign/Gui/Command.cpp +++ b/src/Mod/PartDesign/Gui/Command.cpp @@ -2394,6 +2394,65 @@ bool CmdPartDesignBoolean::isActive() return false; } +// Command group for datums ============================================= + +class CmdPartDesignCompDatums: public Gui::GroupCommand +{ +public: + CmdPartDesignCompDatums() + : GroupCommand("PartDesign_CompDatums") + { + sAppModule = "PartDesign"; + sGroup = "PartDesign"; + sMenuText = QT_TR_NOOP("Create datum"); + sToolTipText = QT_TR_NOOP("Create a datum object or local coordinate system"); + sWhatsThis = "PartDesign_CompDatums"; + sStatusTip = sToolTipText; + eType = ForEdit; + + setCheckable(false); + + addCommand("PartDesign_Plane"); + addCommand("PartDesign_Line"); + addCommand("PartDesign_Point"); + addCommand("PartDesign_CoordinateSystem"); + } + + const char* className() const override + { + return "CmdPartDesignCompDatums"; + } +}; + +// Command group for datums ============================================= + +class CmdPartDesignCompSketches: public Gui::GroupCommand +{ +public: + CmdPartDesignCompSketches() + : GroupCommand("PartDesign_CompSketches") + { + sAppModule = "PartDesign"; + sGroup = "PartDesign"; + sMenuText = QT_TR_NOOP("Create datum"); + sToolTipText = QT_TR_NOOP("Create a datum object or local coordinate system"); + sWhatsThis = "PartDesign_CompDatums"; + sStatusTip = sToolTipText; + eType = ForEdit; + + setCheckable(false); + setRememberLast(false); + + addCommand("PartDesign_NewSketch"); + addCommand("Sketcher_MapSketch"); + addCommand("Sketcher_EditSketch"); + } + + const char* className() const override + { + return "CmdPartDesignCompSketches"; + } +}; //=========================================================================== // Initialization @@ -2437,4 +2496,6 @@ void CreatePartDesignCommands() rcCmdMgr.addCommand(new CmdPartDesignMultiTransform()); rcCmdMgr.addCommand(new CmdPartDesignBoolean()); + rcCmdMgr.addCommand(new CmdPartDesignCompDatums()); + rcCmdMgr.addCommand(new CmdPartDesignCompSketches()); } diff --git a/src/Mod/PartDesign/Gui/Workbench.cpp b/src/Mod/PartDesign/Gui/Workbench.cpp index 539f856705..74e1f24d54 100644 --- a/src/Mod/PartDesign/Gui/Workbench.cpp +++ b/src/Mod/PartDesign/Gui/Workbench.cpp @@ -551,7 +551,6 @@ Gui::MenuItem* Workbench::setupMenuBar() const << "Separator" << datums << "PartDesign_CoordinateSystem" - << "PartDesign_ShapeBinder" << "PartDesign_SubShapeBinder" << "PartDesign_Clone" << "Separator" @@ -567,6 +566,8 @@ Gui::MenuItem* Workbench::setupMenuBar() const << "Separator" << "PartDesign_Boolean" << "Separator" + << "Part_CheckGeometry" + << "Separator" << "PartDesign_Migrate" << "PartDesign_Sprocket"; @@ -604,18 +605,12 @@ Gui::ToolBarItem* Workbench::setupToolBars() const part->setCommand("Part Design Helper"); *part << "PartDesign_Body" - << "PartDesign_NewSketch" - << "Sketcher_EditSketch" - << "Sketcher_MapSketch" + << "PartDesign_CompSketches" << "Sketcher_ValidateSketch" - << "Separator" - << "PartDesign_Point" - << "PartDesign_Line" - << "PartDesign_Plane" - << "PartDesign_CoordinateSystem" - << "PartDesign_ShapeBinder" + << "Part_CheckGeometry" << "PartDesign_SubShapeBinder" - << "PartDesign_Clone"; + << "PartDesign_Clone" + << "PartDesign_CompDatums"; part = new Gui::ToolBarItem(root); part->setCommand("Part Design Modeling"); @@ -635,18 +630,24 @@ Gui::ToolBarItem* Workbench::setupToolBars() const << "PartDesign_SubtractiveHelix" << "PartDesign_CompPrimitiveSubtractive" << "Separator" - << "PartDesign_Mirrored" - << "PartDesign_LinearPattern" - << "PartDesign_PolarPattern" -// << "PartDesign_Scaled" - << "PartDesign_MultiTransform" - << "Separator" - << "PartDesign_Fillet" + << "PartDesign_Boolean"; + + part = new Gui::ToolBarItem(root); + + part->setCommand("Part Design Dressup"); + *part << "PartDesign_Fillet" << "PartDesign_Chamfer" << "PartDesign_Draft" - << "PartDesign_Thickness" - << "Separator" - << "PartDesign_Boolean"; + << "PartDesign_Thickness"; + + part = new Gui::ToolBarItem(root); + part->setCommand("Part Design Patterns"); + + *part << "PartDesign_Mirrored" + << "PartDesign_LinearPattern" + << "PartDesign_PolarPattern" + // << "PartDesign_Scaled" + << "PartDesign_MultiTransform"; return root; } From 26300e0d4e4f2fc5a23a91f59644d1342c571391 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Sun, 12 May 2024 15:42:36 +0200 Subject: [PATCH 28/58] Gui: Add Std_ReloadStyleSheet command This adds a command that will reload currently active stylesheet - a must have for stylesheet developers --- src/Gui/Application.cpp | 1 + src/Gui/CommandStd.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 38f66706d3..e8e14cb233 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -2188,6 +2188,7 @@ void Application::setStyleSheet(const QString& qssFile, bool tiledBackground) } mw->setProperty("fc_currentStyleSheet", qssFile); + mw->setProperty("fc_tiledBackground", tiledBackground); if (!qssFile.isEmpty()) { // Search for stylesheet in user-defined search paths. diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index c5d50cb2ac..2c6035b577 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -952,6 +952,33 @@ bool StdCmdUserEditMode::isActive() return true; } +//=========================================================================== +// Std_ReloadStylesheet +//=========================================================================== +DEF_STD_CMD(StdCmdReloadStyleSheet) + +StdCmdReloadStyleSheet::StdCmdReloadStyleSheet() + : Command("Std_ReloadStyleSheet") +{ + sGroup = "View"; + sMenuText = QT_TR_NOOP("&Reload stylesheet"); + sToolTipText = QT_TR_NOOP("Reloads the current stylesheet"); + sWhatsThis = "Std_ReloadStyleSheet"; + sStatusTip = QT_TR_NOOP("Reloads the current stylesheet"); + sPixmap = "view-refresh"; + sWhatsThis = "Std_ReloadStyleSheet"; +} + +void StdCmdReloadStyleSheet::activated(int iMsg) +{ + auto mw = getMainWindow(); + + auto qssFile = mw->property("fc_currentStyleSheet").toString(); + auto tiledBackground = mw->property("fc_tiledBackground").toBool(); + + Gui::Application::Instance->setStyleSheet(qssFile, tiledBackground); +} + namespace Gui { void CreateStdCommands() @@ -983,6 +1010,7 @@ void CreateStdCommands() rcCmdMgr.addCommand(new StdCmdTextDocument()); rcCmdMgr.addCommand(new StdCmdUnitsCalculator()); rcCmdMgr.addCommand(new StdCmdUserEditMode()); + rcCmdMgr.addCommand(new StdCmdReloadStyleSheet()); //rcCmdMgr.addCommand(new StdCmdMeasurementSimple()); //rcCmdMgr.addCommand(new StdCmdDownloadOnlineHelp()); //rcCmdMgr.addCommand(new StdCmdDescription()); From db3701193b2657002bd4159f2338df0d03a49242 Mon Sep 17 00:00:00 2001 From: David Carter Date: Mon, 13 May 2024 22:41:54 -0400 Subject: [PATCH 29/58] Material: Material API fixes Corrects an issue in the API where a new material may not have a UUID. Corrected the test case to reflect the changes and better document the process. Added a test case for material filters. --- src/Mod/Material/App/MaterialFilter.cpp | 6 + src/Mod/Material/App/MaterialFilter.h | 2 + src/Mod/Material/App/Materials.cpp | 6 +- src/Mod/Material/CMakeLists.txt | 17 -- .../materialtests/TestMaterialCreation.py | 24 +- tests/src/Mod/Material/App/CMakeLists.txt | 23 ++ .../App}/Materials/TestAcrylicLegacy.FCMat | 1 + .../Materials/TestAluminumAppearance.FCMat | 0 .../App}/Materials/TestAluminumMixed.FCMat | 0 .../App}/Materials/TestAluminumPhysical.FCMat | 2 +- .../App}/Materials/TestBrassAppearance.FCMat | 0 .../Mod/Material/App/TestMaterialFilter.cpp | 244 ++++++++++++++++++ .../Mod/Material/App/TestMaterialFilter.py | 104 ++++++++ 13 files changed, 404 insertions(+), 25 deletions(-) rename {src/Mod/Material/materialtests => tests/src/Mod/Material/App}/Materials/TestAcrylicLegacy.FCMat (95%) rename {src/Mod/Material/materialtests => tests/src/Mod/Material/App}/Materials/TestAluminumAppearance.FCMat (100%) rename {src/Mod/Material/materialtests => tests/src/Mod/Material/App}/Materials/TestAluminumMixed.FCMat (100%) rename {src/Mod/Material/materialtests => tests/src/Mod/Material/App}/Materials/TestAluminumPhysical.FCMat (97%) rename {src/Mod/Material/materialtests => tests/src/Mod/Material/App}/Materials/TestBrassAppearance.FCMat (100%) create mode 100644 tests/src/Mod/Material/App/TestMaterialFilter.cpp create mode 100644 tests/src/Mod/Material/App/TestMaterialFilter.py diff --git a/src/Mod/Material/App/MaterialFilter.cpp b/src/Mod/Material/App/MaterialFilter.cpp index 60fdc18e35..3efe8087f7 100644 --- a/src/Mod/Material/App/MaterialFilter.cpp +++ b/src/Mod/Material/App/MaterialFilter.cpp @@ -108,3 +108,9 @@ void MaterialFilter::addRequiredComplete(const QString& uuid) } _requiredComplete.insert(uuid); } + +void MaterialFilter::clear() +{ + _required.clear(); + _requiredComplete.clear(); +} diff --git a/src/Mod/Material/App/MaterialFilter.h b/src/Mod/Material/App/MaterialFilter.h index 44285a2d94..0d2b5d7b21 100644 --- a/src/Mod/Material/App/MaterialFilter.h +++ b/src/Mod/Material/App/MaterialFilter.h @@ -184,6 +184,8 @@ public: return &_requiredComplete; } + void clear(); + private: QString _name; QSet _required; diff --git a/src/Mod/Material/App/Materials.cpp b/src/Mod/Material/App/Materials.cpp index c4c5e5daab..5c199240ca 100644 --- a/src/Mod/Material/App/Materials.cpp +++ b/src/Mod/Material/App/Materials.cpp @@ -448,7 +448,10 @@ Material::Material() : _dereferenced(false) , _oldFormat(false) , _editState(ModelEdit_None) -{} +{ + // Create an initial UUID + newUuid(); +} Material::Material(const std::shared_ptr& library, const QString& directory, @@ -1439,7 +1442,6 @@ void Material::save(QTextStream& stream, bool overwrite, bool saveAsCopy, bool s if (materialManager.exists(_uuid) && !overwrite) { // Make a new version based on the current setParentUUID(_uuid); - // newUuid(); } } diff --git a/src/Mod/Material/CMakeLists.txt b/src/Mod/Material/CMakeLists.txt index de9a075915..fc6113bd21 100644 --- a/src/Mod/Material/CMakeLists.txt +++ b/src/Mod/Material/CMakeLists.txt @@ -297,23 +297,6 @@ fc_target_copy_resource(MaterialTest ${CMAKE_BINARY_DIR}/Mod/Material ${MaterialTest_Files}) -set(MaterialTestData_Files - materialtests/Materials/TestAcrylicLegacy.FCMat - materialtests/Materials/TestAluminumAppearance.FCMat - materialtests/Materials/TestAluminumMixed.FCMat - materialtests/Materials/TestAluminumPhysical.FCMat - materialtests/Materials/TestBrassAppearance.FCMat -) - -ADD_CUSTOM_TARGET(MaterialTestData ALL - SOURCES ${MaterialTestData_Files} -) - -fc_target_copy_resource(MaterialTestData - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/Mod/Material - ${MaterialTestData_Files}) - ADD_CUSTOM_TARGET(MaterialScripts ALL SOURCES ${MaterialScripts_Files} ${Material_Ui_Files} ${Material_QRC_SRCS} ) diff --git a/src/Mod/Material/materialtests/TestMaterialCreation.py b/src/Mod/Material/materialtests/TestMaterialCreation.py index faf1a48f38..3b9d4ff48a 100644 --- a/src/Mod/Material/materialtests/TestMaterialCreation.py +++ b/src/Mod/Material/materialtests/TestMaterialCreation.py @@ -57,7 +57,7 @@ class MaterialCreationTestCases(unittest.TestCase): def checkNewMaterial(self, material): """ Check the state of a newly created material """ - self.assertEqual(len(material.UUID), 0) + self.assertEqual(len(material.UUID), 36) self.assertEqual(len(material.Name), 0) self.assertEqual(len(material.Author), 0) self.assertEqual(len(material.License), 0) @@ -79,8 +79,9 @@ class MaterialCreationTestCases(unittest.TestCase): material.URL = "https://www.example.com" material.Reference = "ISBN 978-1673287882" - # UUID isn't valid until the file is saved - self.assertEqual(material.UUID, '') + # Ensure a valid UUID + self.assertEqual(len(material.UUID), 36) + uuid = material.UUID self.assertEqual(material.Name, "Frankenstein") self.assertEqual(material.Author, "Mary Shelley") @@ -127,11 +128,24 @@ class MaterialCreationTestCases(unittest.TestCase): self.assertEqual(material.getPhysicalValue("Density").UserString, parseQuantity("99.90 kg/m^3").UserString) # MaterialManager is unaware of the material until it is saved - self.MaterialManager.save("User", material, "Example/Frakenstein.FCMat") + # + # When initially creating the material, setting overwrite=True preserves the UUID. This should not + # be used when saving after properties have been edited as this could adversely affect other + # documents or parts using the same material. Setting overwrite=False, or omitting it, will change + # the UUID. It will also fail if the material file already exists. + # + # Similarly, saveAsCopy=True preserves the UUID and should be used carefully. It will save an + # identical copy of the original but in a different location. + # + # The third optional parameter is saveInherited. When set to true it will mark models and properties + # as inherited without duplicating them. When false, they will be copied as uninherited. Avoid + # self-inheritance as this creates an invalid model. It will have a different UUID than the original. + # + self.MaterialManager.save("User", material, "Example/Frakenstein.FCMat", overwrite=True) # Now the UUID is valid - uuid = material.UUID self.assertEqual(len(material.UUID), 36) + self.assertEqual(material.UUID, uuid) self.assertIn(uuid, self.MaterialManager.Materials) self.assertIsNotNone(self.MaterialManager.getMaterialByPath("Example/Frakenstein.FCMat", "User")) self.assertIsNotNone(self.MaterialManager.getMaterial(uuid)) diff --git a/tests/src/Mod/Material/App/CMakeLists.txt b/tests/src/Mod/Material/App/CMakeLists.txt index a53373a5a9..53345f1fd7 100644 --- a/tests/src/Mod/Material/App/CMakeLists.txt +++ b/tests/src/Mod/Material/App/CMakeLists.txt @@ -3,6 +3,7 @@ target_sources( Material_tests_run PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/TestMaterialCards.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/TestMaterialFilter.cpp ${CMAKE_CURRENT_SOURCE_DIR}/TestMaterialProperties.cpp ${CMAKE_CURRENT_SOURCE_DIR}/TestMaterials.cpp ${CMAKE_CURRENT_SOURCE_DIR}/TestMaterialValue.cpp @@ -13,3 +14,25 @@ target_sources( target_include_directories(Material_tests_run PUBLIC ${QtCore_INCLUDE_DIRS} ) + +set(MaterialTestData_Files + Materials/TestAcrylicLegacy.FCMat + Materials/TestAluminumAppearance.FCMat + Materials/TestAluminumMixed.FCMat + Materials/TestAluminumPhysical.FCMat + Materials/TestBrassAppearance.FCMat +) + +ADD_CUSTOM_TARGET(MaterialTestData ALL + SOURCES ${MaterialTestData_Files} +) + +fc_target_copy_resource(MaterialTestData + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/tests + ${MaterialTestData_Files}) + +# INSTALL( +# FILES ${MaterialTest_Files} +# DESTINATION Mod/Material/materialtests +# ) diff --git a/src/Mod/Material/materialtests/Materials/TestAcrylicLegacy.FCMat b/tests/src/Mod/Material/App/Materials/TestAcrylicLegacy.FCMat similarity index 95% rename from src/Mod/Material/materialtests/Materials/TestAcrylicLegacy.FCMat rename to tests/src/Mod/Material/App/Materials/TestAcrylicLegacy.FCMat index 2ee4db5583..a25c1f3e04 100644 --- a/src/Mod/Material/materialtests/Materials/TestAcrylicLegacy.FCMat +++ b/tests/src/Mod/Material/App/Materials/TestAcrylicLegacy.FCMat @@ -10,3 +10,4 @@ KindOfMaterial = Solid [Mechanical] Density = 1190.0 kg/m^3 +Hardness = 10 diff --git a/src/Mod/Material/materialtests/Materials/TestAluminumAppearance.FCMat b/tests/src/Mod/Material/App/Materials/TestAluminumAppearance.FCMat similarity index 100% rename from src/Mod/Material/materialtests/Materials/TestAluminumAppearance.FCMat rename to tests/src/Mod/Material/App/Materials/TestAluminumAppearance.FCMat diff --git a/src/Mod/Material/materialtests/Materials/TestAluminumMixed.FCMat b/tests/src/Mod/Material/App/Materials/TestAluminumMixed.FCMat similarity index 100% rename from src/Mod/Material/materialtests/Materials/TestAluminumMixed.FCMat rename to tests/src/Mod/Material/App/Materials/TestAluminumMixed.FCMat diff --git a/src/Mod/Material/materialtests/Materials/TestAluminumPhysical.FCMat b/tests/src/Mod/Material/App/Materials/TestAluminumPhysical.FCMat similarity index 97% rename from src/Mod/Material/materialtests/Materials/TestAluminumPhysical.FCMat rename to tests/src/Mod/Material/App/Materials/TestAluminumPhysical.FCMat index 9173fcac1a..97312c28e6 100644 --- a/src/Mod/Material/materialtests/Materials/TestAluminumPhysical.FCMat +++ b/tests/src/Mod/Material/App/Materials/TestAluminumPhysical.FCMat @@ -19,7 +19,7 @@ Models: Density: "2700 kg/m^3" PoissonRatio: "0.3" ShearModulus: "27000 MPa" - UltimateStrain: "5" + # UltimateStrain: "5" UltimateTensileStrength: "250 MPa" YieldStrength: "180 MPa" YoungsModulus: "70000 MPa" diff --git a/src/Mod/Material/materialtests/Materials/TestBrassAppearance.FCMat b/tests/src/Mod/Material/App/Materials/TestBrassAppearance.FCMat similarity index 100% rename from src/Mod/Material/materialtests/Materials/TestBrassAppearance.FCMat rename to tests/src/Mod/Material/App/Materials/TestBrassAppearance.FCMat diff --git a/tests/src/Mod/Material/App/TestMaterialFilter.cpp b/tests/src/Mod/Material/App/TestMaterialFilter.cpp new file mode 100644 index 0000000000..2d27cd464b --- /dev/null +++ b/tests/src/Mod/Material/App/TestMaterialFilter.cpp @@ -0,0 +1,244 @@ +// SPDX-License-Identifier: LGPL-2.1-or-later +/*************************************************************************** + * Copyright (c) 2023 David Carter * + * * + * This file is part of FreeCAD. * + * * + * FreeCAD is free software: you can redistribute it and/or modify it * + * under the terms of the GNU Lesser General Public License as * + * published by the Free Software Foundation, either version 2.1 of the * + * License, or (at your option) any later version. * + * * + * FreeCAD is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * Lesser General Public License for more details. * + * * + * You should have received a copy of the GNU Lesser General Public * + * License along with FreeCAD. If not, see * + * . * + * * + **************************************************************************/ + +#include "gtest/gtest.h" + +#include +#ifndef _PreComp_ +#endif + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// clang-format off + +class TestMaterialFilter : public ::testing::Test { +protected: + static void SetUpTestSuite() { + if (App::Application::GetARGC() == 0) { + tests::initApplication(); + } + } + + void SetUp() override { + _modelManager = new Materials::ModelManager(); + _materialManager = new Materials::MaterialManager(); + + // Use our test files as a custom directory + ParameterGrp::handle hGrp = + App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Material/Resources"); + + _customDir = hGrp->GetASCII("CustomMaterialsDir", ""); + _useBuiltInDir = hGrp->GetBool("UseBuiltInMaterials", true); + _useWorkbenchDir = hGrp->GetBool("UseMaterialsFromWorkbenches", true); + _useUserDir = hGrp->GetBool("UseMaterialsFromConfigDir", true); + _useCustomDir = hGrp->GetBool("UseMaterialsFromCustomDir", false); + + std::string testPath = App::Application::getHomePath() + "/tests/Materials/"; + hGrp->SetASCII("CustomMaterialsDir", testPath); + hGrp->SetBool("UseBuiltInMaterials", false); + hGrp->SetBool("UseMaterialsFromWorkbenches", false); + hGrp->SetBool("UseMaterialsFromConfigDir", false); + hGrp->SetBool("UseMaterialsFromCustomDir", true); + + _materialManager->refresh(); + + _library = _materialManager->getLibrary(QLatin1String("Custom")); + } + + void TearDown() override { + ParameterGrp::handle hGrp = + App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Mod/Material/Resources"); + + // Restore preferences + hGrp->SetASCII("CustomMaterialsDir", _customDir); + hGrp->SetBool("UseBuiltInMaterials", _useBuiltInDir); + hGrp->SetBool("UseMaterialsFromWorkbenches", _useWorkbenchDir); + hGrp->SetBool("UseMaterialsFromConfigDir", _useUserDir); + hGrp->SetBool("UseMaterialsFromCustomDir", _useCustomDir); + + _materialManager->refresh(); + } + + Materials::ModelManager* _modelManager; + Materials::MaterialManager* _materialManager; + std::shared_ptr _library; + QString _testMaterialUUID; + + std::string _customDir; + bool _useBuiltInDir; + bool _useWorkbenchDir; + bool _useUserDir; + bool _useCustomDir; + + const char* UUIDAcrylicLegacy = ""; // This can't be known until it is loaded + const char* UUIDAluminumAppearance = "3c6d0407-66b3-48ea-a2e8-ee843edf0311"; + const char* UUIDAluminumMixed = "5f546608-fcbb-40db-98d7-d8e104eb33ce"; + const char* UUIDAluminumPhysical = "a8e60089-550d-4370-8e7e-1734db12a3a9"; + const char* UUIDBrassAppearance = "fff3d5c8-98c3-4ee2-8fe5-7e17403c48fcc"; +}; + +TEST_F(TestMaterialFilter, TestFilters) +{ + ASSERT_NE(_modelManager, nullptr); + + // First check that our materials are loading + auto material = _materialManager->getMaterial(QString::fromLatin1(UUIDAluminumAppearance)); + ASSERT_TRUE(material); + ASSERT_EQ(material->getName(), QString::fromLatin1("TestAluminumAppearance")); + ASSERT_EQ(material->getUUID(), QString::fromLatin1(UUIDAluminumAppearance)); + + material = _materialManager->getMaterial(QString::fromLatin1(UUIDAluminumMixed)); + ASSERT_TRUE(material); + ASSERT_EQ(material->getName(), QString::fromLatin1("TestAluminumMixed")); + ASSERT_EQ(material->getUUID(), QString::fromLatin1(UUIDAluminumMixed)); + + material = _materialManager->getMaterial(QString::fromLatin1(UUIDAluminumPhysical)); + ASSERT_TRUE(material); + ASSERT_EQ(material->getName(), QString::fromLatin1("TestAluminumPhysical")); + ASSERT_EQ(material->getUUID(), QString::fromLatin1(UUIDAluminumPhysical)); + + material = _materialManager->getMaterial(QString::fromLatin1(UUIDBrassAppearance)); + ASSERT_TRUE(material); + ASSERT_EQ(material->getName(), QString::fromLatin1("TestBrassAppearance")); + ASSERT_EQ(material->getUUID(), QString::fromLatin1(UUIDBrassAppearance)); + + material = _materialManager->getMaterialByPath(QString::fromLatin1("TestAcrylicLegacy.FCMat"), + QString::fromLatin1("Custom")); + ASSERT_TRUE(material); + ASSERT_EQ(material->getName(), QString::fromLatin1("TestAcrylicLegacy")); + ASSERT_EQ(material->getUUID().size(), 36); // We don't know the UUID + + // Create an empty filter + auto filter = std::make_shared(); + Materials::MaterialFilterOptions options; + ASSERT_TRUE(_library); + + auto tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 4); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 5); + + // Create a basic rendering filter + filter->setName(QLatin1String("Basic Appearance")); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Rendering_Basic); + options.setIncludeLegacy(false); + + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 3); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 3); + + // Create an advanced rendering filter + filter->clear(); + filter->setName(QLatin1String("Advanced Appearance")); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Rendering_Advanced); + options.setIncludeLegacy(false); + + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 0); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 0); + + // Create a Density filter + filter->clear(); + filter->setName(QLatin1String("Density")); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Mechanical_Density); + options.setIncludeLegacy(false); + + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 2); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 3); + + // Create a Hardness filter + filter->clear(); + filter->setName(QLatin1String("Hardness")); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Mechanical_Hardness); + options.setIncludeLegacy(false); + + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 0); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 0); + + // Create a Density and Basic Rendering filter + filter->clear(); + filter->setName(QLatin1String("Density and Basic Rendering")); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Rendering_Basic); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Mechanical_Density); + options.setIncludeLegacy(false); + + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 1); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 1); + + // Create a Linear Elastic filter + filter->clear(); + filter->setName(QLatin1String("Linear Elastic")); + filter->addRequiredComplete(Materials::ModelUUIDs::ModelUUID_Mechanical_LinearElastic); + options.setIncludeLegacy(false); + + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 0); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 0); + + filter->clear(); + filter->setName(QLatin1String("Linear Elastic")); + filter->addRequired(Materials::ModelUUIDs::ModelUUID_Mechanical_LinearElastic); + options.setIncludeLegacy(false); + + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 2); + + options.setIncludeLegacy(true); + tree = _materialManager->getMaterialTree(_library, filter, options); + ASSERT_EQ(tree->size(), 2); +} diff --git a/tests/src/Mod/Material/App/TestMaterialFilter.py b/tests/src/Mod/Material/App/TestMaterialFilter.py new file mode 100644 index 0000000000..7b5fa85675 --- /dev/null +++ b/tests/src/Mod/Material/App/TestMaterialFilter.py @@ -0,0 +1,104 @@ +# ************************************************************************** +# Copyright (c) 2023 David Carter * +# * +# This file is part of the FreeCAD CAx development system. * +# * +# This program is free software; you can redistribute it and/or modify * +# it under the terms of the GNU Lesser General Public License (LGPL) * +# as published by the Free Software Foundation; either version 2 of * +# the License, or (at your option) any later version. * +# for detail see the LICENCE text file. * +# * +# FreeCAD is distributed in the hope that it will be useful, * +# but WITHOUT ANY WARRANTY; without even the implied warranty of * +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# GNU Library General Public License for more details. * +# * +# You should have received a copy of the GNU Library General Public * +# License along with FreeCAD; if not, write to the Free Software * +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# USA * +# ************************************************************************** + +""" +Test module for FreeCAD material cards and APIs +""" +import os + +import unittest +import FreeCAD +import Materials + +parseQuantity = FreeCAD.Units.parseQuantity + +UUIDAcrylicLegacy = "" # This can't be known until it is loaded +UUIDAluminumAppearance = "3c6d0407-66b3-48ea-a2e8-ee843edf0311" +UUIDAluminumMixed = "5f546608-fcbb-40db-98d7-d8e104eb33ce" +UUIDAluminumPhysical = "a8e60089-550d-4370-8e7e-1734db12a3a9" +UUIDBrassAppearance = "fff3d5c8-98c3-4ee2-8fe5-7e17403c48fcc" + + +class MaterialFilterTestCases(unittest.TestCase): + """ + Test class for FreeCAD material cards and APIs + """ + + def setUp(self): + """Setup function to initialize test data""" + self.ModelManager = Materials.ModelManager() + self.MaterialManager = Materials.MaterialManager() + self.uuids = Materials.UUIDs() + + # Use our test files as a custom directory + param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources") + self.customDir = param.GetString("CustomMaterialsDir", "") + self.useBuiltInDir = param.GetBool("UseBuiltInMaterials", False) + self.useWorkbenchDir = param.GetBool("UseMaterialsFromWorkbenches", False) + self.useUserDir = param.GetBool("UseMaterialsFromConfigDir", False) + self.useCustomDir = param.GetBool("UseMaterialsFromCustomDir", False) + + filePath = os.path.dirname(__file__) + os.sep + testPath = filePath + "Materials" + param.SetString("CustomMaterialsDir", testPath) + param.SetBool("UseBuiltInMaterials", False) + param.SetBool("UseMaterialsFromWorkbenches", False) + param.SetBool("UseMaterialsFromConfigDir", False) + param.SetBool("UseMaterialsFromCustomDir", True) + + self.MaterialManager.refresh() + + def tearDown(self): + param = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Material/Resources") + + # Restore preferences + param.SetString("CustomMaterialsDir", self.customDir) + param.SetBool("UseBuiltInMaterials", self.useBuiltInDir) + param.SetBool("UseMaterialsFromWorkbenches", self.useWorkbenchDir) + param.SetBool("UseMaterialsFromConfigDir", self.useUserDir) + param.SetBool("UseMaterialsFromCustomDir", self.useCustomDir) + + self.MaterialManager.refresh() + + def testFilter(self): + """Test that our filter returns the correct materials""" + + # First check that our materials are loading + material = self.MaterialManager.getMaterial(UUIDAluminumAppearance) + self.assertIsNotNone(material) + self.assertEqual(material.Name, "TestAluminumAppearance") + self.assertEqual(material.UUID, UUIDAluminumAppearance) + + material = self.MaterialManager.getMaterial(UUIDAluminumMixed) + self.assertIsNotNone(material) + self.assertEqual(material.Name, "TestAluminumMixed") + self.assertEqual(material.UUID, UUIDAluminumMixed) + + material = self.MaterialManager.getMaterial(UUIDAluminumPhysical) + self.assertIsNotNone(material) + self.assertEqual(material.Name, "TestAluminumPhysical") + self.assertEqual(material.UUID, UUIDAluminumPhysical) + + material = self.MaterialManager.getMaterial(UUIDBrassAppearance) + self.assertIsNotNone(material) + self.assertEqual(material.Name, "TestBrassAppearance") + self.assertEqual(material.UUID, UUIDBrassAppearance) From 748306dcaf658e65be1968192d58dd779eb37297 Mon Sep 17 00:00:00 2001 From: Max Wilfinger Date: Tue, 7 May 2024 12:12:13 +0200 Subject: [PATCH 30/58] Update assembly icons to be consistent with main updates. Add commands to menu/toolbar. --- .../Resources/icons/Assembly_ExplodedView.svg | 154 +-- .../icons/Assembly_ExplodedViewGroup.svg | 785 ++++----------- .../Resources/icons/Assembly_ExportASMT.svg | 937 ++++-------------- .../Resources/icons/Assembly_JointGroup.svg | 571 +---------- .../icons/Assembly_SolveAssembly.svg | 230 +---- src/Mod/Assembly/InitGui.py | 14 +- src/Mod/Assembly/JointObject.py | 15 +- 7 files changed, 530 insertions(+), 2176 deletions(-) diff --git a/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedView.svg b/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedView.svg index 9a388a0b4a..5168ff5754 100644 --- a/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedView.svg +++ b/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedView.svg @@ -5,44 +5,16 @@ version="1.1" viewBox="0 0 64 64" id="svg96" - sodipodi:docname="Assembly_ExplodedView4.svg" - inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient1"> image/svg+xml - - Path-Stock 2015-07-04 https://www.freecad.org/wiki/index.php?title=Artwork @@ -233,90 +198,46 @@ + style="fill:url(#linearGradient3);stroke:#302b00;stroke-linejoin:round" /> + style="fill:url(#linearGradient4);stroke:#302b00;stroke-linejoin:round" /> + style="fill:url(#linearGradient5);stroke:#302b00;stroke-linejoin:round" /> + style="fill:none;stroke:#fce94f;stroke-width:2" /> - + id="g8"> + style="color:#000000;fill:#cc0000;stroke:#650707;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" + d="m 24.478541,15.553224 a 1.4365924,1.4365924 0 0 0 -1.436592,1.436592 l 0.0029,2.466338 a 1.4365924,1.4365924 0 0 0 1.439398,1.436592 1.4365924,1.4365924 0 0 0 1.433787,-1.439398 l -0.0029,-2.466337 a 1.4365924,1.4365924 0 0 0 -1.436593,-1.433787 z m 0.0056,6.776115 a 1.4365924,1.4365924 0 0 0 -1.436592,1.436592 l 0.0029,2.873185 a 1.4365924,1.4365924 0 0 0 1.439398,1.436592 1.4365924,1.4365924 0 0 0 1.433787,-1.439398 l -0.0029,-2.873185 a 1.4365924,1.4365924 0 0 0 -1.436593,-1.433786 z m 0.0056,7.182962 a 1.4365924,1.4365924 0 0 0 -1.433787,1.436592 v 2.873185 a 1.4365924,1.4365924 0 0 0 1.439398,1.436592 1.4365924,1.4365924 0 0 0 1.433787,-1.439398 v -2.873185 a 1.4365924,1.4365924 0 0 0 -1.439381,-1.433786 z m 0.0056,7.182962 a 1.4365924,1.4365924 0 0 0 -1.433786,1.436592 l 0.0029,2.873185 a 1.4365924,1.4365924 0 0 0 1.436592,1.436592 1.4365924,1.4365924 0 0 0 1.436593,-1.439398 l -0.0029,-2.873185 a 1.4365924,1.4365924 0 0 0 -1.439372,-1.433786 z" + id="path6" /> + style="fill:none;fill-rule:evenodd;stroke:#ef2929;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 24.915491,23.656877 v 3.057837" + id="path8" /> + style="fill:none;fill-rule:evenodd;stroke:#ef2929;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 24.915491,38.063657 v 3.057837" + id="path4" /> - - - - - - - - - - + style="fill:none;fill-rule:evenodd;stroke:#ef2929;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 24.915491,30.860267 v 3.057837" + id="path7" /> + d="M -17,40 V 26 L 2,10.0001 2.0000003,23 Z" /> + style="fill:none;stroke:#fce94f;stroke-width:2;stroke-opacity:1" /> + + style="fill:url(#linearGradient69709);stroke:#0b1521;stroke-width:2;stroke-linejoin:round" /> + style="fill:url(#linearGradient69717);stroke:#0b1521;stroke-width:2;stroke-linejoin:round" /> + + diff --git a/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedViewGroup.svg b/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedViewGroup.svg index 0119fe3a54..a5d715635a 100644 --- a/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedViewGroup.svg +++ b/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExplodedViewGroup.svg @@ -5,44 +5,16 @@ version="1.1" viewBox="0 0 64 64" id="svg96" - sodipodi:docname="Assembly_ExplodedViewGroup.svg" - inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient1"> - - - - + xlink:href="#linearGradient4383" + id="linearGradient9" + x1="32" + y1="64" + x2="32" + y2="14.419661" + gradientUnits="userSpaceOnUse" /> - - + y2="31.5" /> - - - - - + gradientTransform="translate(-1.2435,-2.5881)" + x1="20.244" + y1="37.588" + x2="17.244" + y2="27.588" /> - - - - - - - - + gradientTransform="translate(-12.714,-17.586)" + x1="48.714" + y1="45.586" + x2="44.714" + y2="34.586" /> - - - + gradientTransform="translate(-41.2435,-2.5881)" + x1="20.243999" + y1="37.588001" + x2="17.243999" + y2="27.587999" /> - - - + gradientTransform="translate(-52.714,-17.586)" + x1="48.714001" + y1="45.585999" + x2="44.714001" + y2="34.585999" /> - - - + gradientTransform="matrix(1,-0.026667,0,1,81.696,-5.3735)" + x1="20.244" + y1="37.588" + x2="17.244" + y2="27.588" /> - - - + gradientTransform="translate(61.2256,1.0356)" + x1="50.714" + y1="25.586" + x2="48.714" + y2="20.586" /> + @@ -333,7 +177,6 @@ image/svg+xml - Path-Stock 2015-07-04 https://www.freecad.org/wiki/index.php?title=Artwork @@ -357,377 +200,157 @@ + id="layer3" + style="display:inline"> + + + + + + - + id="g40-3" + style="stroke-width:2" + transform="matrix(0.80408661,0,0,0.80408661,3.6084445,-50.31302)"> + d="M 9,49 V 35 l 28,10 v 14 z" + id="path30-3" + style="font-variation-settings:normal;opacity:1;fill:url(#linearGradient21);fill-opacity:1;stroke:#302b00;stroke-width:1.99978;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;stop-color:#000000;stop-opacity:1" /> + d="M 37,59 V 45 L 55,28 v 13 z" + id="path32-5" + style="fill:url(#linearGradient13);stroke:#302b00;stroke-width:1.99978;stroke-linejoin:round;stroke-dasharray:none" /> + + + + + + + + + + + + + + + + + + + + + + + style="color:#000000;fill:#cc0000;stroke:#650707;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" + d="m 26.441831,-47.827151 a 1.3954961,1.4210831 0 0 0 -1.762541,0.906679 1.3954961,1.4210831 0 0 0 0.892953,1.792215 l 2.652896,0.885533 a 1.3954961,1.4210831 0 0 0 1.759944,-0.90668 1.3954961,1.4210831 0 0 0 -0.892951,-1.792215 z m 6.629645,2.212511 a 1.3954961,1.4210831 0 0 0 -1.759946,0.906681 1.3954961,1.4210831 0 0 0 0.890356,1.794858 l 2.652897,0.885533 a 1.3954961,1.4210831 0 0 0 1.759946,-0.909324 1.3954961,1.4210831 0 0 0 -0.890356,-1.792214 z m 6.629644,2.215156 a 1.3954961,1.4210831 0 0 0 -1.759944,0.906681 1.3954961,1.4210831 0 0 0 0.890355,1.792213 l 2.652897,0.885534 a 1.3954961,1.4210831 0 0 0 1.759945,-0.906681 1.3954961,1.4210831 0 0 0 -0.890356,-1.792213 z m 6.629646,2.212511 a 1.3954961,1.4210831 0 0 0 -1.759946,0.906681 1.3954961,1.4210831 0 0 0 0.890356,1.794858 l 2.652895,0.885534 a 1.3954961,1.4210831 0 0 0 1.759946,-0.909324 1.3954961,1.4210831 0 0 0 -0.890356,-1.792215 z" + id="path5-6" /> - - - - - - - - - - - - - - - + style="fill:none;fill-rule:evenodd;stroke:#ef2929;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 39.300532,-42.479528 2.818448,0.918371" + id="path3" /> + id="g943-9" + transform="matrix(0.72287451,0,0,0.72287451,-25.415947,-58.269988)"> + d="m 91,33.5 -0.02739,-14.214 12.967,4.3352 v 14.5 z" + id="path54-5" + style="fill:url(#linearGradient19);stroke:#0b1521;stroke-width:2;stroke-linejoin:round" /> + + + + + style="fill:none;fill-rule:evenodd;stroke:#ef2929;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 26.000232,-46.880657 2.818449,0.918371" + id="path1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + style="fill:none;fill-rule:evenodd;stroke:#ef2929;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 32.65834,-44.672757 2.818448,0.918371" + id="path2" /> diff --git a/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExportASMT.svg b/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExportASMT.svg index 50b1905bd0..f64fc5e402 100644 --- a/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExportASMT.svg +++ b/src/Mod/Assembly/Gui/Resources/icons/Assembly_ExportASMT.svg @@ -1,18 +1,12 @@ + + + id="defs2871"> + id="linearGradient5"> - - - - - - + id="stop19" /> + id="stop20" /> + id="swatch18"> - + id="stop18" /> - + id="swatch15"> - + id="stop15" /> - - - + id="linearGradient5-1"> + id="stop5" /> + id="stop6" /> - - - - - - - - - + id="linearGradient3836-9"> + id="stop3838-8" /> + id="stop3840-1" /> - - + id="linearGradient3836-9-3"> + id="stop3838-8-5" /> + id="stop3840-1-6" /> + id="linearGradient2"> + id="stop1" /> + id="stop2" /> + xlink:href="#linearGradient3765" + id="linearGradient3771" + x1="98" + y1="1047.3622" + x2="81" + y2="993.36218" + gradientUnits="userSpaceOnUse" + gradientTransform="translate(-60,-988.36218)" /> + + id="stop3767" /> - + id="stop3769" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.73269922,0,0,0.5925111,13.613318,24.513214)" + x1="48.014042" + y1="26.323408" + x2="43.478561" + y2="42.076672" /> + id="linearGradient3806"> + id="stop3808" /> + id="stop3810" /> + + + id="stop3" /> - - - + id="metadata2874"> image/svg+xml - 2005-10-15 - Andreas Nilsson + [maxwxyz] - - - edit - copy - - - - + https://www.freecad.org/wiki/index.php?title=Artwork + - Jakub Steiner + FreeCAD - + + FreeCAD/src/ + + + FreeCAD LGPL2+ + + + 2024 - - - - - - - - + id="layer3" + style="display:inline"> + + + + id="g40" + style="display:inline;stroke-width:2" + transform="matrix(0.71696222,0,0,0.71696222,9.057209,8.9822968)"> - + d="M 9,49 V 35 l 28,10 v 14 z" + id="path30" + style="fill:url(#linearGradient13);stroke:#302b00;stroke-linejoin:round" /> + d="M 37,59 V 45 L 55,28 v 13 z" + id="path32" + style="fill:url(#linearGradient14);stroke:#302b00;stroke-linejoin:round" /> + d="M 11.008,47.606 11,37.9997 l 24,8 0.0081,10.185 z" + id="path34" + style="fill:none;stroke:#fce94f" /> + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + id="g943" + transform="matrix(0.71696222,0,0,0.71696222,-33.960524,8.9822968)" + style="display:inline"> + + + + + + + id="g963" + transform="matrix(0.71696222,0,0,0.71696222,37.735698,8.9822968)" + style="display:inline"> + + + + + + style="fill:url(#linearGradient920);fill-opacity:1;stroke:#172a04;stroke-width:2;stroke-linejoin:round" + id="path912" + d="M -31,35 V 21 l 14,5 v 14 z" /> + style="fill:#fce94f;fill-opacity:1;stroke:#172a04;stroke-width:2;stroke-linejoin:round;stroke-opacity:1" + id="path914" + d="M -31,21 -11.415,5.209 2,10.0001 l -19,16 z" /> + + + diff --git a/src/Mod/Assembly/Gui/Resources/icons/Assembly_JointGroup.svg b/src/Mod/Assembly/Gui/Resources/icons/Assembly_JointGroup.svg index ee7e62d2a4..7a1a2df59a 100644 --- a/src/Mod/Assembly/Gui/Resources/icons/Assembly_JointGroup.svg +++ b/src/Mod/Assembly/Gui/Resources/icons/Assembly_JointGroup.svg @@ -3,13 +3,7 @@ width="64px" height="64px" id="svg2821" - sodipodi:version="0.32" - inkscape:version="1.1-beta1 (77e7b44db3, 2021-03-28)" - sodipodi:docname="Assembly_JointGroup.svg" - inkscape:output_extension="org.inkscape.output.svg.inkscape" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -19,7 +13,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + xlink:href="#linearGradient4" + id="linearGradient9" + x1="32" + y1="64" + x2="32" + y2="14.419661" + gradientUnits="userSpaceOnUse" /> - - - @@ -356,7 +76,6 @@ [wmayer] - Part_Cylinder 2011-10-10 https://www.freecad.org/wiki/index.php?title=Artwork @@ -380,235 +99,49 @@ + id="layer1"> - - - - - + id="layer3" + style="display:inline"> + style="fill:#204a87;fill-opacity:1;stroke:#0c1522;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" + id="path4" + d="M 29.921921,10.073012 26.993293,6.1977395 C 26.21651,5.1698698 25.163057,4.5924975 24.064598,4.5924975 H 5.0714589 c -1.1437425,0 -2.0708717,1.2268134 -2.0708717,2.740257 V 58.484215 c 0,0.504481 0.309043,0.913419 0.6902905,0.913419 H 60.294706 c 0.381247,0 0.690291,-0.408938 0.690291,-0.913419 V 12.813269 c 0,-1.513445 -0.927129,-2.740257 -2.070872,-2.740257 z" /> + style="fill:#204a87;fill-opacity:1;stroke:#3465a4;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" + id="path7" + d="M 5.2089844,6.5917969 H 24.064453 c 0.375444,0 0.874561,0.2026195 1.333984,0.8105468 l 3.527344,4.6699223 h 29.84961 c 0.0082,0.01044 0.01784,0.02289 0.02734,0.03711 0.01056,0.0158 0.02193,0.03237 0.0332,0.05273 0.08049,0.145363 0.148438,0.361331 0.148438,0.650391 v 44.58594 H 5 V 7.3320312 C 5,7.0436394 5.0678061,6.828994 5.1484375,6.6835937 c 0.011294,-0.020366 0.022609,-0.038859 0.033203,-0.054687 0.00953,-0.014245 0.019073,-0.026632 0.027344,-0.03711 z" /> + style="fill:#729fcf;fill-opacity:1;stroke:#0c1522;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" + id="path6" + d="m 29.919347,14.419661 -2.927223,3.534545 C 26.215716,18.891703 25.16247,19.41831 24.064012,19.41831 H 3.0000008 l 0.015588,39.156085 c 2.171e-4,0.460126 0.3093777,0.833108 0.6906252,0.833108 h 56.603828 c 0.381248,0 0.690139,-0.372982 0.689957,-0.833108 L 60.983419,16.918986 C 60.982865,15.538609 60.055293,14.419661 58.91155,14.419661 H 29.919344 Z" /> - - - - - - - - - - - - - - - - - - - + style="fill:url(#linearGradient9);fill-opacity:1;stroke:#729fcf;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal" + id="path8" + d="m 30.861328,16.419922 h 28.050781 c 0,0 0.07225,0.463543 0.07227,0.5 L 59,57.408203 H 5.015625 L 5,21.417969 h 19.064453 c 1.756119,0 3.349555,-0.836095 4.46875,-2.1875 z" /> + transform="matrix(0.61183741,0,0,0.61123957,12.4212,17.998573)" + style="stroke-width:0.854151"> + transform="translate(3.6192085e-6,-0.89630564)" + style="stroke-width:0.854151"> + id="path2994-3" /> + id="path2994-3-6" /> + id="path2994-3-6-9" /> + transform="matrix(0.96000015,0,0,0.96000015,1.2799944,2.2388113)" /> + style="fill:#729fcf;fill-opacity:1;stroke:#302b00;stroke-width:1.7083;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-dashoffset:20.4;stroke-opacity:1" + id="path1-6" /> + transform="translate(3.6192085e-6,-20.496033)" + style="stroke-width:0.854151"> + id="path1" /> + style="fill:url(#linearGradient3);fill-opacity:1;stroke:#729fcf;stroke-width:2.45283;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4.5;stroke-dasharray:none;stroke-dashoffset:20.4;stroke-opacity:1" + d="m 53.627745,51.867574 c 0,3.124022 -6.064364,5.779939 -14.514788,6.752122 v 9.88738 c 0,0 -3.337936,0.817369 -6.483138,0.809873 -3.145202,-0.0075 -6.427599,-0.809873 -6.427599,-0.809873 V 58.755519 C 17.072982,57.918034 10.372256,55.151416 10.372256,51.867574 l -1e-6,-15.676047 h 43.25549 z" + id="path2" /> + id="path3" /> - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -353,70 +245,26 @@ style="fill:none;stroke:#babdb6;stroke-width:2;stroke-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - + + + + + + diff --git a/src/Mod/Assembly/InitGui.py b/src/Mod/Assembly/InitGui.py index f4090de97f..5ece952744 100644 --- a/src/Mod/Assembly/InitGui.py +++ b/src/Mod/Assembly/InitGui.py @@ -78,6 +78,7 @@ class AssemblyWorkbench(Workbench): "Assembly_CreateAssembly", "Assembly_InsertLink", "Assembly_SolveAssembly", + "Assembly_CreateView", ] cmdListMenuOnly = [ @@ -93,17 +94,12 @@ class AssemblyWorkbench(Workbench): "Assembly_CreateJointSlider", "Assembly_CreateJointBall", "Assembly_CreateJointDistance", + "Separator", + "Assembly_CreateJointRackPinion", + "Assembly_CreateJointScrew", + "Assembly_CreateJointGearBelt", ] - if Preferences.preferences().GetBool("ExperimentalFeatures", False): - cmdList = cmdList + ["Assembly_CreateView"] - cmdListJoints = cmdListJoints + [ - "Separator", - "Assembly_CreateJointRackPinion", - "Assembly_CreateJointScrew", - "Assembly_CreateJointGearBelt", - ] - self.appendToolbar(QT_TRANSLATE_NOOP("Workbench", "Assembly"), cmdList) self.appendToolbar(QT_TRANSLATE_NOOP("Workbench", "Assembly Joints"), cmdListJoints) diff --git a/src/Mod/Assembly/JointObject.py b/src/Mod/Assembly/JointObject.py index feaa4f977d..ebfec7975a 100644 --- a/src/Mod/Assembly/JointObject.py +++ b/src/Mod/Assembly/JointObject.py @@ -57,16 +57,6 @@ TranslatedJointTypes = [ translate("Assembly", "Belt"), ] -TranslatedJointTypesNoExperimental = [ - translate("Assembly", "Fixed"), - translate("Assembly", "Revolute"), - translate("Assembly", "Cylindrical"), - translate("Assembly", "Slider"), - translate("Assembly", "Ball"), - translate("Assembly", "Distance"), -] - - JointTypes = [ "Fixed", "Revolute", @@ -1186,10 +1176,7 @@ class TaskAssemblyCreateJoint(QtCore.QObject): self.form.setWindowTitle("Match parts") self.form.jointType.hide() - if Preferences.preferences().GetBool("ExperimentalFeatures", True): - self.form.jointType.addItems(TranslatedJointTypes) - else: - self.form.jointType.addItems(TranslatedJointTypesNoExperimental) + self.form.jointType.addItems(TranslatedJointTypes) self.form.jointType.setCurrentIndex(jointTypeIndex) self.form.jointType.currentIndexChanged.connect(self.onJointTypeChanged) From 908bbfeb210ea4983641f32bb2dc6b6214a2f98e Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Wed, 15 May 2024 17:12:16 +0200 Subject: [PATCH 31/58] Tree Context menu: add 'go to linked object' action for links. Fixes #12167 --- src/Gui/ViewProviderLink.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Gui/ViewProviderLink.cpp b/src/Gui/ViewProviderLink.cpp index 61a68d6465..c36441a41d 100644 --- a/src/Gui/ViewProviderLink.cpp +++ b/src/Gui/ViewProviderLink.cpp @@ -55,6 +55,7 @@ #include #include +#include "Action.h" #include "MainWindow.h" #include "ViewProviderLink.h" #include "ViewProviderLinkPy.h" @@ -2619,6 +2620,9 @@ void ViewProviderLink::_setupContextMenu( act->setData(QVariant((int)ViewProvider::Color)); } } + + auto cmd = Application::Instance->commandManager().getCommandByName("Std_LinkSelectLinked"); + menu->addAction(cmd->getAction()->action()); } bool ViewProviderLink::initDraggingPlacement() { From b40fe64db38930e1f52807ddbb3a11c63d331acb Mon Sep 17 00:00:00 2001 From: hlorus <64740362+hlorus@users.noreply.github.com> Date: Thu, 16 May 2024 13:00:57 +0200 Subject: [PATCH 32/58] PartGui: Remove remaining measure "clear all" and "toggle delta" commands --- src/Gui/CommandView.cpp | 60 ------------------- src/Gui/PreferencePackTemplates/Shortcuts.cfg | 2 - src/Gui/Workbench.cpp | 10 +--- 3 files changed, 2 insertions(+), 70 deletions(-) diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index f4cb50cd8c..8e39ce0a8a 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -3311,64 +3311,6 @@ void StdCmdDemoMode::activated(int iMsg) dlg->show(); } -//=========================================================================== -// Part_Measure_Clear_All -//=========================================================================== - -DEF_STD_CMD(CmdViewMeasureClearAll) - -CmdViewMeasureClearAll::CmdViewMeasureClearAll() - : Command("View_Measure_Clear_All") -{ - sGroup = "Measure"; - sMenuText = QT_TR_NOOP("Clear measurement"); - sToolTipText = QT_TR_NOOP("Clear all visible measurements"); - sWhatsThis = "View_Measure_Clear_All"; - sStatusTip = sToolTipText; - sPixmap = "Part_Measure_Clear_All"; -} - -void CmdViewMeasureClearAll::activated(int iMsg) -{ - Q_UNUSED(iMsg); - auto view = dynamic_cast(Gui::Application::Instance-> - activeDocument()->getActiveView()); - if (!view) - return; - Gui::View3DInventorViewer *viewer = view->getViewer(); - if (!viewer) - return; - viewer->eraseAllDimensions(); -} - -//=========================================================================== -// Part_Measure_Toggle_All -//=========================================================================== - -DEF_STD_CMD(CmdViewMeasureToggleAll) - -CmdViewMeasureToggleAll::CmdViewMeasureToggleAll() - : Command("View_Measure_Toggle_All") -{ - sGroup = "Measure"; - sMenuText = QT_TR_NOOP("Toggle measurement"); - sToolTipText = QT_TR_NOOP("Turn on or off the display of all measurements"); - sWhatsThis = "View_Measure_Toggle_All"; - sStatusTip = sToolTipText; - sPixmap = "Part_Measure_Toggle_All"; -} - -void CmdViewMeasureToggleAll::activated(int iMsg) -{ - Q_UNUSED(iMsg); - ParameterGrp::handle group = App::GetApplication().GetUserParameter(). - GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("View"); - bool visibility = group->GetBool("DimensionsVisible", true); - if (visibility) - group->SetBool("DimensionsVisible", false); - else - group->SetBool("DimensionsVisible", true); -} //=========================================================================== // Std_SelBack @@ -4156,8 +4098,6 @@ void CreateViewStdCommands() rcCmdMgr.addCommand(new StdCmdDemoMode()); rcCmdMgr.addCommand(new StdCmdToggleNavigation()); rcCmdMgr.addCommand(new StdCmdAxisCross()); - rcCmdMgr.addCommand(new CmdViewMeasureClearAll()); - rcCmdMgr.addCommand(new CmdViewMeasureToggleAll()); rcCmdMgr.addCommand(new StdCmdSelBoundingBox()); rcCmdMgr.addCommand(new StdCmdTreeViewActions()); rcCmdMgr.addCommand(new StdCmdDockOverlay()); diff --git a/src/Gui/PreferencePackTemplates/Shortcuts.cfg b/src/Gui/PreferencePackTemplates/Shortcuts.cfg index 666df29c14..089b2a81c0 100644 --- a/src/Gui/PreferencePackTemplates/Shortcuts.cfg +++ b/src/Gui/PreferencePackTemplates/Shortcuts.cfg @@ -947,8 +947,6 @@ - - diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index dcc97d9561..f7049aa52f 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -590,13 +590,8 @@ void StdWorkbench::setupContextMenu(const char* recipient, MenuItem* item) const << "Std_ViewRear" << "Std_ViewBottom" << "Std_ViewLeft" << "Separator" << "Std_ViewRotateLeft" << "Std_ViewRotateRight"; - auto measure = new MenuItem(); - measure->setCommand("Measure"); - *measure << "View_Measure_Toggle_All" << "View_Measure_Clear_All"; - - *item << "Std_ViewFitAll" << "Std_ViewFitSelection" << "Std_DrawStyle" - << StdViews << measure << "Separator" + << StdViews << "Separator" << "Std_ViewDockUndockFullscreen"; if (Gui::Selection().countObjectsOfType(App::DocumentObject::getClassTypeId()) > 0) { @@ -684,8 +679,7 @@ MenuItem* StdWorkbench::setupMenuBar() const *visu << "Std_ToggleVisibility" << "Std_ShowSelection" << "Std_HideSelection" << "Std_SelectVisibleObjects" << "Separator" << "Std_ToggleObjects" << "Std_ShowObjects" << "Std_HideObjects" - << "Separator" << "Std_ToggleSelectability" - << "Separator" << "View_Measure_Toggle_All" << "View_Measure_Clear_All"; + << "Separator" << "Std_ToggleSelectability"; // View auto view = new MenuItem( menuBar ); From a73d081a4602ece8c88cd62ff0a98b3739952a46 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Wed, 15 May 2024 01:20:59 -0300 Subject: [PATCH 33/58] Fem: Load heat flux from CalculiX results - fixes #12117 --- src/Mod/Fem/App/FemVTKTools.cpp | 1 + src/Mod/Fem/feminout/importCcxFrdResults.py | 21 +++++++++++++++++++ src/Mod/Fem/feminout/importToolsFem.py | 5 +++++ src/Mod/Fem/femobjects/result_mechanical.py | 10 +++++++++ .../femsolver/calculix/write_step_output.py | 9 +++++--- .../data/calculix/thermomech_bimetall.inp | 2 +- 6 files changed, 44 insertions(+), 4 deletions(-) diff --git a/src/Mod/Fem/App/FemVTKTools.cpp b/src/Mod/Fem/App/FemVTKTools.cpp index fd5df42bc9..fbb6175913 100644 --- a/src/Mod/Fem/App/FemVTKTools.cpp +++ b/src/Mod/Fem/App/FemVTKTools.cpp @@ -659,6 +659,7 @@ std::map _getFreeCADMechResultVectorProperties() resFCVecProp["PS1Vector"] = "Major Principal Stress Vector"; resFCVecProp["PS2Vector"] = "Intermediate Principal Stress Vector"; resFCVecProp["PS3Vector"] = "Minor Principal Stress Vector"; + resFCVecProp["HeatFlux"] = "Heat Flux"; return resFCVecProp; } diff --git a/src/Mod/Fem/feminout/importCcxFrdResults.py b/src/Mod/Fem/feminout/importCcxFrdResults.py index e2d4f63699..effc473f87 100644 --- a/src/Mod/Fem/feminout/importCcxFrdResults.py +++ b/src/Mod/Fem/feminout/importCcxFrdResults.py @@ -311,6 +311,7 @@ def read_frd_result( mode_strain = {} mode_peeq = {} mode_temp = {} + mode_heatflux = {} mode_massflow = {} mode_networkpressure = {} @@ -322,6 +323,7 @@ def read_frd_result( mode_strain_found = False mode_peeq_found = False mode_temp_found = False + mode_heatflux_found = False mode_massflow_found = False mode_networkpressure_found = False end_of_section_found = False @@ -641,6 +643,19 @@ def read_frd_result( temperature = float(line[13:25]) mode_temp[elem] = (temperature) + # Check if we found heat flux section + if line[5:9] == "FLUX": + mode_heatflux_found = True + if mode_heatflux_found and (line[1:3] == "-1"): + # we found a heat_flux line + elem = int(line[4:13]) + mode_heatflux_x = float(line[13:25]) + mode_heatflux_y = float(line[25:37]) + mode_heatflux_z = float(line[37:49]) + mode_heatflux[elem] = FreeCAD.Vector(mode_heatflux_x, mode_heatflux_y, mode_heatflux_z) + + + # Check if we found a mass flow section if line[5:11] == "MAFLOW": mode_massflow_found = True @@ -713,6 +728,12 @@ def read_frd_result( mode_temp_found = False node_element_section = False + if mode_heatflux_found: + mode_results["heatflux"] = mode_heatflux + mode_heatflux = {} + mode_heatflux_found = False + node_element_section = False + if mode_massflow_found: mode_results["mflow"] = mode_massflow mode_massflow = {} diff --git a/src/Mod/Fem/feminout/importToolsFem.py b/src/Mod/Fem/feminout/importToolsFem.py index 09d39ca32d..2c0aa9c671 100644 --- a/src/Mod/Fem/feminout/importToolsFem.py +++ b/src/Mod/Fem/feminout/importToolsFem.py @@ -455,6 +455,11 @@ def fill_femresult_mechanical( res_obj.Temperature = list(map((lambda x: x), Temperature.values())) res_obj.Time = step_time + if "heatflux" in result_set: + HeatFlux = result_set["heatflux"] + if HeatFlux: + res_obj.HeatFlux = list(map((lambda x: x), HeatFlux.values())) + # fill res_obj.MassFlow if "mflow" in result_set: MassFlow = result_set["mflow"] diff --git a/src/Mod/Fem/femobjects/result_mechanical.py b/src/Mod/Fem/femobjects/result_mechanical.py index d23cf72d87..6887b09679 100644 --- a/src/Mod/Fem/femobjects/result_mechanical.py +++ b/src/Mod/Fem/femobjects/result_mechanical.py @@ -230,6 +230,16 @@ class ResultMechanical(base_fempythonobject.BaseFemPythonObject): "Temperature field", True ) + obj.addProperty( + "App::PropertyVectorList", + "HeatFlux", + "NodeData", + "List of heat flux vectors", + True + ) + obj.setPropertyStatus("HeatFlux", "LockDynamic") + + obj.setPropertyStatus("Temperature", "LockDynamic") obj.addProperty( "App::PropertyFloatList", diff --git a/src/Mod/Fem/femsolver/calculix/write_step_output.py b/src/Mod/Fem/femsolver/calculix/write_step_output.py index e03bb9293c..2ad190e3cc 100644 --- a/src/Mod/Fem/femsolver/calculix/write_step_output.py +++ b/src/Mod/Fem/femsolver/calculix/write_step_output.py @@ -51,10 +51,13 @@ def write_step_output(f, ccxwriter): f.write("U\n") if not ccxwriter.member.geos_fluidsection: f.write("*EL FILE\n") + variables = "S, E" + if ccxwriter.analysis_type == "thermomech": + variables += ", HFL" if ccxwriter.solver_obj.MaterialNonlinearity == "nonlinear": - f.write("S, E, PEEQ\n") - else: - f.write("S, E\n") + variables += ", PEEQ" + + f.write(variables + "\n") # dat file # reaction forces: freecad.org/tracker/view.php?id=2934 diff --git a/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp b/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp index 5954c13b35..6f638b535b 100644 --- a/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp +++ b/src/Mod/Fem/femtest/data/calculix/thermomech_bimetall.inp @@ -7111,7 +7111,7 @@ ConstraintTemperatureNormal,11,11,273.0 *NODE FILE U, NT *EL FILE -S, E +S, E, HFL ** outputs --> dat file ** reaction forces for Constraint fixed *NODE PRINT, NSET=ConstraintFixed, TOTALS=ONLY From 33e4a5baede0b9bc92e1ef87ec478212a2a483e1 Mon Sep 17 00:00:00 2001 From: marioalexis84 <53127171+marioalexis84@users.noreply.github.com> Date: Mon, 20 May 2024 13:00:48 -0300 Subject: [PATCH 34/58] Fem: Improve constraint section print (#14046) Co-authored-by: Chris Hennes --- src/Mod/Fem/Gui/CMakeLists.txt | 1 + .../symbols/ConstraintSectionPrint.iv | 19 +++++++++++ .../Resources/ui/ConstraintSectionPrint.ui | 34 ++++++++++++++----- .../Fem/femobjects/constraint_sectionprint.py | 28 +++++++++++++++ .../calculix/write_constraint_sectionprint.py | 10 +++++- .../task_constraint_sectionprint.py | 27 ++++++++++++--- .../view_constraint_sectionprint.py | 10 ++++++ 7 files changed, 114 insertions(+), 15 deletions(-) create mode 100644 src/Mod/Fem/Gui/Resources/symbols/ConstraintSectionPrint.iv diff --git a/src/Mod/Fem/Gui/CMakeLists.txt b/src/Mod/Fem/Gui/CMakeLists.txt index 65d871e137..b86972b82a 100755 --- a/src/Mod/Fem/Gui/CMakeLists.txt +++ b/src/Mod/Fem/Gui/CMakeLists.txt @@ -361,6 +361,7 @@ SET(FemGuiSymbol_IV Resources/symbols/ConstraintPlaneRotation.iv Resources/symbols/ConstraintPressure.iv Resources/symbols/ConstraintRigidBody.iv + Resources/symbols/ConstraintSectionPrint.iv Resources/symbols/ConstraintSpring.iv Resources/symbols/ConstraintTemperature.iv Resources/symbols/ConstraintTie.iv diff --git a/src/Mod/Fem/Gui/Resources/symbols/ConstraintSectionPrint.iv b/src/Mod/Fem/Gui/Resources/symbols/ConstraintSectionPrint.iv new file mode 100644 index 0000000000..ddcb93fae9 --- /dev/null +++ b/src/Mod/Fem/Gui/Resources/symbols/ConstraintSectionPrint.iv @@ -0,0 +1,19 @@ +#Inventor V2.1 ascii + + +Separator { + + Separator { + + Translation { + translation 0 0.05 0 + + } + Cube { + width 0.75 + height 0.1 + depth 0.75 + + } + } +} diff --git a/src/Mod/Fem/Gui/Resources/ui/ConstraintSectionPrint.ui b/src/Mod/Fem/Gui/Resources/ui/ConstraintSectionPrint.ui index bdcc1d2c55..3e40f33bb6 100644 --- a/src/Mod/Fem/Gui/Resources/ui/ConstraintSectionPrint.ui +++ b/src/Mod/Fem/Gui/Resources/ui/ConstraintSectionPrint.ui @@ -15,17 +15,33 @@ - - - Qt::Vertical + + + + 0 + 0 + - - - 20 - 40 - + + Parameter - + + + + + + + Variable + + + + + + + + + + diff --git a/src/Mod/Fem/femobjects/constraint_sectionprint.py b/src/Mod/Fem/femobjects/constraint_sectionprint.py index ce3a816bed..8fbbeee087 100644 --- a/src/Mod/Fem/femobjects/constraint_sectionprint.py +++ b/src/Mod/Fem/femobjects/constraint_sectionprint.py @@ -31,6 +31,7 @@ __url__ = "https://www.freecad.org" from . import base_fempythonobject +_PropHelper = base_fempythonobject._PropHelper class ConstraintSectionPrint(base_fempythonobject.BaseFemPythonObject): """ @@ -41,3 +42,30 @@ class ConstraintSectionPrint(base_fempythonobject.BaseFemPythonObject): def __init__(self, obj): super(ConstraintSectionPrint, self).__init__(obj) + + for prop in self._get_properties(): + prop.add_to_object(obj) + + + def _get_properties(self): + prop = [] + + prop.append(_PropHelper( + type = "App::PropertyEnumeration", + name = "Variable", + group = "Constraint Section Print", + doc = "Set facial variable", + value = ["Section Force", "Heat Flux", "Drag Stress"] + ) + ) + + return prop + + + def onDocumentRestored(self, obj): + # update old project with new properties + for prop in self._get_properties(): + try: + obj.getPropertyByName(prop.name) + except: + prop.add_to_object(obj) diff --git a/src/Mod/Fem/femsolver/calculix/write_constraint_sectionprint.py b/src/Mod/Fem/femsolver/calculix/write_constraint_sectionprint.py index d791f14dfd..079385e8f6 100644 --- a/src/Mod/Fem/femsolver/calculix/write_constraint_sectionprint.py +++ b/src/Mod/Fem/femsolver/calculix/write_constraint_sectionprint.py @@ -64,8 +64,16 @@ def write_constraint(f, femobj, sectionprint_obj, ccxwriter): # floats read from ccx should use {:.13G}, see comment in writer module + variable = sectionprint_obj.Variable + if variable == "Section Force": + key = "SOF, SOM, SOAREA" + elif variable == "Heat Flux": + key = "FLUX" + elif variable == "Drag Stress": + key = "DRAG" + f.write( "*SECTION PRINT, SURFACE=SECTIONFACE{}, NAME=SECTIONPRINT{}\n" .format(sectionprint_obj.Name, sectionprint_obj.Name) ) - f.write("SOF, SOM, SOAREA\n") + f.write(key + "\n") diff --git a/src/Mod/Fem/femtaskpanels/task_constraint_sectionprint.py b/src/Mod/Fem/femtaskpanels/task_constraint_sectionprint.py index 6948b4ba7c..b9ff745306 100644 --- a/src/Mod/Fem/femtaskpanels/task_constraint_sectionprint.py +++ b/src/Mod/Fem/femtaskpanels/task_constraint_sectionprint.py @@ -29,6 +29,7 @@ __url__ = "https://www.freecad.org" # \ingroup FEM # \brief task panel for constraint section print object +from PySide import QtCore from PySide import QtGui import FreeCAD @@ -52,6 +53,14 @@ class _TaskPanel: FreeCAD.getHomePath() + "Mod/Fem/Resources/ui/ConstraintSectionPrint.ui" ) + self.init_parameter_widget() + + QtCore.QObject.connect( + self.parameterWidget.cb_variable, + QtCore.SIGNAL("currentIndexChanged(int)"), + self.variable_changed + ) + # geometry selection widget self.selectionWidget = selection_widgets.GeometryElementsSelection( obj.References, @@ -61,15 +70,11 @@ class _TaskPanel: ) # form made from param and selection widget - self.form = [self.parameterWidget, self.selectionWidget] + self.form = [self.selectionWidget, self.parameterWidget] def accept(self): # check values items = len(self.selectionWidget.references) - FreeCAD.Console.PrintMessage( - "Task panel: found references: {}\n{}\n" - .format(items, self.selectionWidget.references) - ) if items != 1: msgBox = QtGui.QMessageBox() @@ -87,6 +92,8 @@ class _TaskPanel: return False elif msgBox.clickedButton() == ignoreButton: pass + + self.obj.Variable = self.variable self.obj.References = self.selectionWidget.references self.recompute_and_set_back_all() return True @@ -102,3 +109,13 @@ class _TaskPanel: if self.selectionWidget.sel_server: FreeCADGui.Selection.removeObserver(self.selectionWidget.sel_server) doc.resetEdit() + + def init_parameter_widget(self): + self.variable = self.obj.Variable + self.variable_enum = self.obj.getEnumerationsOfProperty("Variable") + self.parameterWidget.cb_variable.addItems(self.variable_enum) + index = self.variable_enum.index(self.variable) + self.parameterWidget.cb_variable.setCurrentIndex(index) + + def variable_changed(self, index): + self.variable = self.variable_enum[index] diff --git a/src/Mod/Fem/femviewprovider/view_constraint_sectionprint.py b/src/Mod/Fem/femviewprovider/view_constraint_sectionprint.py index ea71654b17..f4f5f703d5 100644 --- a/src/Mod/Fem/femviewprovider/view_constraint_sectionprint.py +++ b/src/Mod/Fem/femviewprovider/view_constraint_sectionprint.py @@ -38,6 +38,12 @@ class VPConstraintSectionPrint(view_base_femconstraint.VPBaseFemConstraint): A View Provider for the ConstraintSectionPrint object """ + def __init__(self, vobj): + super().__init__(vobj) + mat = vobj.ShapeAppearance[0] + mat.DiffuseColor = (0.0, 0.165, 1.0, 0.0) + vobj.ShapeAppearance = mat + def setEdit(self, vobj, mode=0): view_base_femconstraint.VPBaseFemConstraint.setEdit( self, @@ -45,3 +51,7 @@ class VPConstraintSectionPrint(view_base_femconstraint.VPBaseFemConstraint): mode, task_constraint_sectionprint._TaskPanel ) + + def attach(self, vobj): + super().attach(vobj) + vobj.loadSymbol(self.resource_symbol_dir + "ConstraintSectionPrint.iv") From 7c34978f0bc5515586f69899f15650a10ebe15d6 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Thu, 16 May 2024 01:28:18 -0300 Subject: [PATCH 35/58] Fem: Highlight active Analysis according to user defined color --- src/Mod/Fem/Gui/AppFemGuiPy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Fem/Gui/AppFemGuiPy.cpp b/src/Mod/Fem/Gui/AppFemGuiPy.cpp index 04ee5bd2c3..a68ad07f9d 100644 --- a/src/Mod/Fem/Gui/AppFemGuiPy.cpp +++ b/src/Mod/Fem/Gui/AppFemGuiPy.cpp @@ -96,7 +96,7 @@ private: FemGui::ActiveAnalysisObserver::instance()->setActiveObject( static_cast(obj)); FemGui::ActiveAnalysisObserver::instance()->highlightActiveObject( - Gui::HighlightMode::Blue, + Gui::HighlightMode::UserDefined, true); } From a09dcd917ac51faf871a06242158595147f8335a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Althaus?= Date: Fri, 17 May 2024 09:24:55 +0200 Subject: [PATCH 36/58] Gray out all columns in the tree if an item is invisible --- src/Gui/Tree.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 958aacf170..9062db63f8 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -5287,14 +5287,18 @@ void DocumentObjectItem::testStatus(bool resetStatus, QIcon& icon1, QIcon& icon2 // to black which will lead to unreadable text if the system background // hss already a dark color. // However, it works if we set the appropriate role to an empty QVariant(). - this->setData(0, Qt::ForegroundRole, QVariant()); + for (int column = 0; column < this->columnCount(); ++column) { + this->setData(column, Qt::ForegroundRole, QVariant()); + } } else { // invisible QStyleOptionViewItem opt; // it can happen that a tree item is not attached to the tree widget (#0003025) if (this->treeWidget()) opt.initFrom(this->treeWidget()); - this->setForeground(0, opt.palette.color(QPalette::Disabled, QPalette::Text)); + for (int column = 0; column < this->columnCount(); ++column) { + this->setForeground(column, opt.palette.color(QPalette::Disabled, QPalette::Text)); + } mode = QIcon::Disabled; } From 0c53340746abfee39be4726b8e8ce92bff171a05 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Fri, 17 May 2024 13:11:55 +0200 Subject: [PATCH 37/58] Sketcher: Fix distance arc helper : should appear only if constraining the edge. --- src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp index dcc8b65f91..3a4827273e 100644 --- a/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp +++ b/src/Mod/Sketcher/Gui/EditModeConstraintCoinManager.cpp @@ -944,12 +944,11 @@ Restart: } // Check if arc helpers are needed - if (Constr->Second != GeoEnum::GeoUndef - && Constr->SecondPos == Sketcher::PointPos::none) { + if (Constr->Second != GeoEnum::GeoUndef) { auto geo1 = geolistfacade.getGeometryFromGeoId(Constr->First); auto geo2 = geolistfacade.getGeometryFromGeoId(Constr->Second); - if (isArcOfCircle(*geo1)) { + if (isArcOfCircle(*geo1) && Constr->FirstPos == Sketcher::PointPos::none) { auto arc = static_cast(geo1); // NOLINT radius1 = arc->getRadius(); center1 = arc->getCenter(); @@ -976,7 +975,7 @@ Restart: numPoints++; } } - if (isArcOfCircle(*geo2)) { + if (isArcOfCircle(*geo2) && Constr->SecondPos == Sketcher::PointPos::none) { auto arc = static_cast(geo2); // NOLINT radius2 = arc->getRadius(); center2 = arc->getCenter(); From f040c0820c330edadb02927f0cd17af89de28030 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Tue, 14 May 2024 19:53:00 +0200 Subject: [PATCH 38/58] Gui: Fix ToolBarManager review remarks --- src/Gui/ToolBarManager.cpp | 5 +++-- src/Gui/ToolBarManager.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Gui/ToolBarManager.cpp b/src/Gui/ToolBarManager.cpp index 49adfca233..04876e39b3 100644 --- a/src/Gui/ToolBarManager.cpp +++ b/src/Gui/ToolBarManager.cpp @@ -189,7 +189,8 @@ public: void addWidget(QWidget *widget) { - if (_layout->indexOf(widget) > 0) { + // if widget already exist don't do anything + if (_layout->indexOf(widget) >= 0) { return; } @@ -311,7 +312,7 @@ public: widget->setVisible(visible); } } - }; + } private: QHBoxLayout *_layout; diff --git a/src/Gui/ToolBarManager.h b/src/Gui/ToolBarManager.h index f5ee13cc6f..5f26693911 100644 --- a/src/Gui/ToolBarManager.h +++ b/src/Gui/ToolBarManager.h @@ -43,7 +43,7 @@ namespace Gui { // Qt treats area as Flag so in theory toolbar could be in multiple areas at once. // We don't do that here so simple enum should suffice. -enum GuiExport ToolBarArea { +enum class ToolBarArea { NoToolBarArea, LeftToolBarArea, RightToolBarArea, From 7075e3c1d5534a682ec2c14f4f51b6394fe5c104 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Fri, 17 May 2024 16:41:32 +0200 Subject: [PATCH 39/58] Sketcher: Fix line to arc point distance movement problem --- src/Mod/Sketcher/Gui/ViewProviderSketch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index 03ecc61253..1b7d7932b3 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -1766,7 +1766,7 @@ void ViewProviderSketch::moveConstraint(Sketcher::Constraint* Constr, int constN const Part::Geometry *geo2 = GeoList::getGeometryFromGeoId (geomlist, Constr->Second); if (isLineSegment(*geo2)) { - if (isCircleOrArc(*geo1)){ + if (isCircleOrArc(*geo1) && Constr->FirstPos == Sketcher::PointPos::none){ std::swap(geo1, geo2); // see below } else { @@ -1818,7 +1818,7 @@ void ViewProviderSketch::moveConstraint(Sketcher::Constraint* Constr, int constN p2 = lineSeg->getEndPoint(); } else if (geo->is()) { - const Part::GeomArcOfCircle* arc = static_cast(geo); + auto* arc = static_cast(geo); double radius = arc->getRadius(); Base::Vector3d center = arc->getCenter(); double startangle, endangle; From 3e3c9d36b148fa5dbaa4f4137eff80258aaa104a Mon Sep 17 00:00:00 2001 From: Max Wilfinger Date: Fri, 17 May 2024 19:58:37 +0200 Subject: [PATCH 40/58] make the smart dimension tool the default one --- src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp | 2 +- src/Mod/TechDraw/Gui/Workbench.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp index 3369da18f1..1b0c99a248 100644 --- a/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp +++ b/src/Mod/TechDraw/Gui/DlgPrefsTechDrawDimensionsImp.cpp @@ -167,7 +167,7 @@ void DlgPrefsTechDrawDimensionsImp::loadSettings() ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( "User parameter:BaseApp/Preferences/Mod/TechDraw/dimensioning"); bool singleTool = hGrp->GetBool("SingleDimensioningTool", true); - bool SeparatedTools = hGrp->GetBool("SeparatedDimensioningTools", true); + bool SeparatedTools = hGrp->GetBool("SeparatedDimensioningTools", false); int index = SeparatedTools ? (singleTool ? 2 : 1) : 0; ui->dimensioningMode->setCurrentIndex(index); setProperty("dimensioningMode", index); diff --git a/src/Mod/TechDraw/Gui/Workbench.cpp b/src/Mod/TechDraw/Gui/Workbench.cpp index 6e06e4f1e2..6108b67af5 100644 --- a/src/Mod/TechDraw/Gui/Workbench.cpp +++ b/src/Mod/TechDraw/Gui/Workbench.cpp @@ -311,7 +311,7 @@ Gui::ToolBarItem* Workbench::setupToolBars() const ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath( "User parameter:BaseApp/Preferences/Mod/TechDraw/dimensioning"); - bool separatedTools = hGrp->GetBool("SeparatedDimensioningTools", true); + bool separatedTools = hGrp->GetBool("SeparatedDimensioningTools", false); if (hGrp->GetBool("SingleDimensioningTool", true)) { if (separatedTools) { *dims << "TechDraw_Dimension"; From 42a660a89334373f8f610d5c344fdccf008d57bc Mon Sep 17 00:00:00 2001 From: Florian Foinant-Willig Date: Thu, 16 May 2024 13:35:50 +0200 Subject: [PATCH 41/58] Gui: fix SoDatumLabel arrow disappear --- src/Gui/SoDatumLabel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Gui/SoDatumLabel.cpp b/src/Gui/SoDatumLabel.cpp index 1cd1d21007..256e9d14cd 100644 --- a/src/Gui/SoDatumLabel.cpp +++ b/src/Gui/SoDatumLabel.cpp @@ -997,6 +997,7 @@ void SoDatumLabel::GLRender(SoGLRenderAction * action) //Set General OpenGL Properties glPushAttrib(GL_ENABLE_BIT | GL_PIXEL_MODE_BIT | GL_COLOR_BUFFER_BIT); glDisable(GL_LIGHTING); + glDisable(GL_CULL_FACE); //Enable Anti-alias if (action->isSmoothing()) { From f937d4579ae3f49399dffa8ee35c9c43d0023d5f Mon Sep 17 00:00:00 2001 From: wandererfan Date: Sat, 18 May 2024 14:15:29 -0400 Subject: [PATCH 42/58] [TD]allow custom format for hidden lines --- src/Mod/TechDraw/Gui/QGIViewPart.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/Mod/TechDraw/Gui/QGIViewPart.cpp b/src/Mod/TechDraw/Gui/QGIViewPart.cpp index 2ccdf2e9e1..1bcb575c27 100644 --- a/src/Mod/TechDraw/Gui/QGIViewPart.cpp +++ b/src/Mod/TechDraw/Gui/QGIViewPart.cpp @@ -413,19 +413,20 @@ void QGIViewPart::drawAllEdges() item->setWidth(Rez::guiX(gf->m_format.m_weight)); showItem = gf->m_format.m_visible; } else { - // unformatted line, draw as continuous line - item->setLinePen(m_dashedLineGenerator->getLinePen(1, vp->LineWidth.getValue())); - item->setWidth(Rez::guiX(vp->LineWidth.getValue())); + if (!(*itGeom)->getHlrVisible()) { + // hidden line without a format + item->setLinePen(m_dashedLineGenerator->getLinePen(Preferences::HiddenLineStyle(), + vp->LineWidth.getValue())); + item->setWidth(Rez::guiX(vp->HiddenWidth.getValue())); //thin + item->setZValue(ZVALUE::HIDEDGE); + } else { + // unformatted visible line, draw as continuous line + item->setLinePen(m_dashedLineGenerator->getLinePen(1, vp->LineWidth.getValue())); + item->setWidth(Rez::guiX(vp->LineWidth.getValue())); + } } } - if (!(*itGeom)->getHlrVisible()) { - item->setLinePen(m_dashedLineGenerator->getLinePen(Preferences::HiddenLineStyle(), - vp->LineWidth.getValue())); - item->setWidth(Rez::guiX(vp->HiddenWidth.getValue())); //thin - item->setZValue(ZVALUE::HIDEDGE); - } - if ((*itGeom)->getClassOfEdge() == ecUVISO) { // we don't have a style option for iso-parametric lines so draw continuous item->setLinePen(m_dashedLineGenerator->getLinePen(1, vp->IsoWidth.getValue())); From 935bdf9a0f1a93707518cc984a67090c99c1f979 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Sat, 11 May 2024 13:35:18 +0200 Subject: [PATCH 43/58] PartDesign: Refactor single-solid rule enforcement This refactors a single solid rule checking code from using the solid count directly to using well abstracted `isSingleSolidRuleSatisfied` method. This makes code easier to read and is the basis for next step which is allowing users to disable this checks. --- src/Mod/PartDesign/App/Feature.cpp | 6 ++++++ src/Mod/PartDesign/App/Feature.h | 5 +++++ src/Mod/PartDesign/App/FeatureBoolean.cpp | 3 +-- src/Mod/PartDesign/App/FeatureChamfer.cpp | 5 +++-- src/Mod/PartDesign/App/FeatureDraft.cpp | 3 +-- src/Mod/PartDesign/App/FeatureFillet.cpp | 3 +-- src/Mod/PartDesign/App/FeatureGroove.cpp | 6 ++---- src/Mod/PartDesign/App/FeatureHelix.cpp | 11 +++++------ src/Mod/PartDesign/App/FeatureHole.cpp | 5 +---- src/Mod/PartDesign/App/FeatureLoft.cpp | 12 ++++++++---- src/Mod/PartDesign/App/FeaturePad.cpp | 6 ++---- src/Mod/PartDesign/App/FeaturePipe.cpp | 6 ++---- src/Mod/PartDesign/App/FeaturePocket.cpp | 6 ++---- src/Mod/PartDesign/App/FeaturePrimitive.cpp | 7 +++---- src/Mod/PartDesign/App/FeatureTransformed.cpp | 3 +-- 15 files changed, 43 insertions(+), 44 deletions(-) diff --git a/src/Mod/PartDesign/App/Feature.cpp b/src/Mod/PartDesign/App/Feature.cpp index 45d53c5faf..0b283a3383 100644 --- a/src/Mod/PartDesign/App/Feature.cpp +++ b/src/Mod/PartDesign/App/Feature.cpp @@ -151,6 +151,12 @@ int Feature::countSolids(const TopoDS_Shape& shape, TopAbs_ShapeEnum type) return result; } +bool Feature::isSingleSolidRuleSatisfied(const TopoDS_Shape& shape, TopAbs_ShapeEnum type) +{ + int solidCount = countSolids(shape, type); + + return solidCount <= 1; +} const gp_Pnt Feature::getPointFromFace(const TopoDS_Face& f) diff --git a/src/Mod/PartDesign/App/Feature.h b/src/Mod/PartDesign/App/Feature.h index 05f860a0e6..91e1b9189a 100644 --- a/src/Mod/PartDesign/App/Feature.h +++ b/src/Mod/PartDesign/App/Feature.h @@ -100,6 +100,11 @@ protected: TopoShape getSolid(const TopoShape&); static int countSolids(const TopoDS_Shape&, TopAbs_ShapeEnum type = TopAbs_SOLID); + /** + * Checks if the single-solid body rule is fulfilled. + */ + static bool isSingleSolidRuleSatisfied(const TopoDS_Shape&, TopAbs_ShapeEnum type = TopAbs_SOLID); + /// Grab any point from the given face static const gp_Pnt getPointFromFace(const TopoDS_Face& f); /// Make a shape from a base plane (convenience method) diff --git a/src/Mod/PartDesign/App/FeatureBoolean.cpp b/src/Mod/PartDesign/App/FeatureBoolean.cpp index 50451cd2a7..d3e05d644d 100644 --- a/src/Mod/PartDesign/App/FeatureBoolean.cpp +++ b/src/Mod/PartDesign/App/FeatureBoolean.cpp @@ -153,8 +153,7 @@ App::DocumentObjectExecReturn *Boolean::execute() result = refineShapeIfActive(result); - int solidCount = countSolids(result); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(result)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeatureChamfer.cpp b/src/Mod/PartDesign/App/FeatureChamfer.cpp index 9f9a956099..c2833871b5 100644 --- a/src/Mod/PartDesign/App/FeatureChamfer.cpp +++ b/src/Mod/PartDesign/App/FeatureChamfer.cpp @@ -270,10 +270,11 @@ App::DocumentObjectExecReturn *Chamfer::execute() return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is invalid")); } } - int solidCount = countSolids(shape); - if (solidCount > 1) { + + if (!isSingleSolidRuleSatisfied(shape)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } + shape = refineShapeIfActive(shape); this->Shape.setValue(getSolid(shape)); return App::DocumentObject::StdReturn; diff --git a/src/Mod/PartDesign/App/FeatureDraft.cpp b/src/Mod/PartDesign/App/FeatureDraft.cpp index cc2e32f394..a297f2c397 100644 --- a/src/Mod/PartDesign/App/FeatureDraft.cpp +++ b/src/Mod/PartDesign/App/FeatureDraft.cpp @@ -318,8 +318,7 @@ App::DocumentObjectExecReturn *Draft::execute() if (shape.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is null")); - int solidCount = countSolids(shape); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(shape)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeatureFillet.cpp b/src/Mod/PartDesign/App/FeatureFillet.cpp index e38f88b168..bf4d1e7453 100644 --- a/src/Mod/PartDesign/App/FeatureFillet.cpp +++ b/src/Mod/PartDesign/App/FeatureFillet.cpp @@ -193,8 +193,7 @@ App::DocumentObjectExecReturn *Fillet::execute() } } - int solidCount = countSolids(shape); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(shape)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeatureGroove.cpp b/src/Mod/PartDesign/App/FeatureGroove.cpp index 8f15912f57..b1db6d5d8d 100644 --- a/src/Mod/PartDesign/App/FeatureGroove.cpp +++ b/src/Mod/PartDesign/App/FeatureGroove.cpp @@ -188,8 +188,7 @@ App::DocumentObjectExecReturn *Groove::execute() TopoDS_Shape subshape = refineShapeIfActive(mkCut.Shape()); this->AddSubShape.setValue(subshape); - int resultCount = countSolids(result); - if (resultCount > 1) { + if (!isSingleSolidRuleSatisfied(result)) { return new App::DocumentObjectExecReturn("Groove: Result has multiple solids. This is not supported at this time."); } @@ -221,8 +220,7 @@ App::DocumentObjectExecReturn *Groove::execute() solRes = refineShapeIfActive(solRes); this->Shape.setValue(getSolid(solRes)); - int solidCount = countSolids(solRes); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(solRes)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } } diff --git a/src/Mod/PartDesign/App/FeatureHelix.cpp b/src/Mod/PartDesign/App/FeatureHelix.cpp index 05a932e377..a50e2cdf31 100644 --- a/src/Mod/PartDesign/App/FeatureHelix.cpp +++ b/src/Mod/PartDesign/App/FeatureHelix.cpp @@ -251,10 +251,10 @@ App::DocumentObjectExecReturn* Helix::execute() if (getAddSubType() == FeatureAddSub::Subtractive) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: There is nothing to subtract")); - int solidCount = countSolids(result); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(result)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result has multiple solids")); } + Shape.setValue(getSolid(result)); return App::DocumentObject::StdReturn; } @@ -271,8 +271,8 @@ App::DocumentObjectExecReturn* Helix::execute() if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result has multiple solids")); } @@ -301,8 +301,7 @@ App::DocumentObjectExecReturn* Helix::execute() if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result has multiple solids")); } diff --git a/src/Mod/PartDesign/App/FeatureHole.cpp b/src/Mod/PartDesign/App/FeatureHole.cpp index 2dd745a03c..dd5b6ba2a1 100644 --- a/src/Mod/PartDesign/App/FeatureHole.cpp +++ b/src/Mod/PartDesign/App/FeatureHole.cpp @@ -1900,10 +1900,7 @@ App::DocumentObjectExecReturn* Hole::execute() return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); base = refineShapeIfActive(base); - - - int solidCount = countSolids(base.getShape()); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(base.getShape())) { return new App::DocumentObjectExecReturn( QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeatureLoft.cpp b/src/Mod/PartDesign/App/FeatureLoft.cpp index 46958c5b43..121d294db7 100644 --- a/src/Mod/PartDesign/App/FeatureLoft.cpp +++ b/src/Mod/PartDesign/App/FeatureLoft.cpp @@ -288,13 +288,15 @@ App::DocumentObjectExecReturn *Loft::execute() BRepAlgoAPI_Fuse mkFuse(base, result); if (!mkFuse.IsDone()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Loft: Adding the loft failed")); + // we have to get the solids (fuse sometimes creates compounds) TopoDS_Shape boolOp = this->getSolid(mkFuse.Shape()); + // lets check if the result is a solid if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } @@ -306,13 +308,15 @@ App::DocumentObjectExecReturn *Loft::execute() BRepAlgoAPI_Cut mkCut(base, result); if (!mkCut.IsDone()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Loft: Subtracting the loft failed")); + // we have to get the solids (fuse sometimes creates compounds) TopoDS_Shape boolOp = this->getSolid(mkCut.Shape()); + // lets check if the result is a solid if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeaturePad.cpp b/src/Mod/PartDesign/App/FeaturePad.cpp index cbff42e895..4a9d29bb0d 100644 --- a/src/Mod/PartDesign/App/FeaturePad.cpp +++ b/src/Mod/PartDesign/App/FeaturePad.cpp @@ -235,8 +235,7 @@ App::DocumentObjectExecReturn *Pad::execute() if (solRes.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(result); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(result)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } @@ -244,8 +243,7 @@ App::DocumentObjectExecReturn *Pad::execute() this->Shape.setValue(getSolid(solRes)); } else { - int solidCount = countSolids(prism); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(prism)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeaturePipe.cpp b/src/Mod/PartDesign/App/FeaturePipe.cpp index 42ff8c26d6..b4b9ccf5cb 100644 --- a/src/Mod/PartDesign/App/FeaturePipe.cpp +++ b/src/Mod/PartDesign/App/FeaturePipe.cpp @@ -398,8 +398,7 @@ App::DocumentObjectExecReturn *Pipe::execute() if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } @@ -418,8 +417,7 @@ App::DocumentObjectExecReturn *Pipe::execute() if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeaturePocket.cpp b/src/Mod/PartDesign/App/FeaturePocket.cpp index aaae33f138..9183fe9551 100644 --- a/src/Mod/PartDesign/App/FeaturePocket.cpp +++ b/src/Mod/PartDesign/App/FeaturePocket.cpp @@ -194,8 +194,7 @@ App::DocumentObjectExecReturn *Pocket::execute() TopoDS_Shape result = refineShapeIfActive(mkCut.Shape()); this->AddSubShape.setValue(result); - int prismCount = countSolids(prism); - if (prismCount > 1) { + if (!isSingleSolidRuleSatisfied(result)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } @@ -229,8 +228,7 @@ App::DocumentObjectExecReturn *Pocket::execute() if (solRes.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(result); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(result)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } diff --git a/src/Mod/PartDesign/App/FeaturePrimitive.cpp b/src/Mod/PartDesign/App/FeaturePrimitive.cpp index 47b9ffe277..a0b07ba9b1 100644 --- a/src/Mod/PartDesign/App/FeaturePrimitive.cpp +++ b/src/Mod/PartDesign/App/FeaturePrimitive.cpp @@ -145,12 +145,12 @@ App::DocumentObjectExecReturn* FeaturePrimitive::execute(const TopoDS_Shape& pri return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Adding the primitive failed")); // we have to get the solids (fuse sometimes creates compounds) boolOp = this->getSolid(mkFuse.Shape()); + // lets check if the result is a solid if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } } @@ -165,8 +165,7 @@ App::DocumentObjectExecReturn* FeaturePrimitive::execute(const TopoDS_Shape& pri if (boolOp.IsNull()) return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid")); - int solidCount = countSolids(boolOp); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(boolOp)) { return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported.")); } } diff --git a/src/Mod/PartDesign/App/FeatureTransformed.cpp b/src/Mod/PartDesign/App/FeatureTransformed.cpp index 5f3dbcce7f..7656e15d7d 100644 --- a/src/Mod/PartDesign/App/FeatureTransformed.cpp +++ b/src/Mod/PartDesign/App/FeatureTransformed.cpp @@ -327,8 +327,7 @@ App::DocumentObjectExecReturn *Transformed::execute() support = refineShapeIfActive(support); - int solidCount = countSolids(support); - if (solidCount > 1) { + if (!isSingleSolidRuleSatisfied(support)) { Base::Console().Warning("Transformed: Result has multiple solids. Only keeping the first.\n"); } From f8c47b55cb92e14ac74c32b0e1f9865f66eb3539 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Sat, 11 May 2024 14:17:02 +0200 Subject: [PATCH 44/58] PartDesign: Introduce ability to disable single-solid rule This adds "SingleSolidRuleMode" enum that controls if PartDesign will enforce singular solid. By default the single-solid is enforced so nothing changes for the user, it must be explicitly disabled by setting new Allow Compound boolean property on a given body. Default for this value is controled using user parameter under Mod/PartDesign/AllowCompoundDefault --- src/Mod/Part/App/BodyBase.h | 3 +-- src/Mod/PartDesign/App/Body.cpp | 30 ++++++++++++++++++++------ src/Mod/PartDesign/App/Body.h | 1 + src/Mod/PartDesign/App/Feature.cpp | 34 ++++++++++++++++++++++++++---- src/Mod/PartDesign/App/Feature.h | 7 ++++-- 5 files changed, 61 insertions(+), 14 deletions(-) diff --git a/src/Mod/Part/App/BodyBase.h b/src/Mod/Part/App/BodyBase.h index 0ac0c9c056..f9edbcf991 100644 --- a/src/Mod/Part/App/BodyBase.h +++ b/src/Mod/Part/App/BodyBase.h @@ -47,9 +47,8 @@ public: /** * The final feature of the body it is associated with. * Note: tip may either point to the BaseFeature or to some feature inside the Group list. - * in case it points to the model the PartDesign::Body guaranties that it is a solid. */ - App::PropertyLink Tip; + App::PropertyLink Tip; /** * A base object of the body, serves as a base object for the first feature of the body. diff --git a/src/Mod/PartDesign/App/Body.cpp b/src/Mod/PartDesign/App/Body.cpp index 0e41160ca7..ff92107892 100644 --- a/src/Mod/PartDesign/App/Body.cpp +++ b/src/Mod/PartDesign/App/Body.cpp @@ -40,7 +40,17 @@ using namespace PartDesign; PROPERTY_SOURCE(PartDesign::Body, Part::BodyBase) Body::Body() { - _GroupTouched.setStatus(App::Property::Output,true); + ADD_PROPERTY_TYPE(AllowCompound, (false), "Experimental", App::Prop_None, "Allow multiple solids in Body (experimental)"); + + _GroupTouched.setStatus(App::Property::Output, true); + + static Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp/Preferences/Mod/PartDesign"); + + auto allowCompoundDefaultValue = hGrp->GetBool("AllowCompoundDefault", false); + + ADD_PROPERTY(AllowCompound, (allowCompoundDefaultValue)); } /* @@ -428,7 +438,7 @@ void Body::onSettingDocument() { Part::BodyBase::onSettingDocument(); } -void Body::onChanged (const App::Property* prop) { +void Body::onChanged(const App::Property* prop) { // we neither load a project nor perform undo/redo if (!this->isRestoring() && this->getDocument() @@ -438,7 +448,6 @@ void Body::onChanged (const App::Property* prop) { auto first = Group.getValues().empty() ? nullptr : Group.getValues().front(); if (BaseFeature.getValue()) { - //setup the FeatureBase if needed if (!first || !first->isDerivedFrom(FeatureBase::getClassTypeId())) { bf = static_cast(getDocument()->addObject("PartDesign::FeatureBase", "BaseFeature")); @@ -452,17 +461,26 @@ void Body::onChanged (const App::Property* prop) { } } - if (bf && (bf->BaseFeature.getValue() != BaseFeature.getValue())) + if (bf && (bf->BaseFeature.getValue() != BaseFeature.getValue())) { bf->BaseFeature.setValue(BaseFeature.getValue()); + } } - else if( prop == &Group ) { - + else if (prop == &Group) { //if the FeatureBase was deleted we set the BaseFeature link to nullptr if (BaseFeature.getValue() && (Group.getValues().empty() || !Group.getValues().front()->isDerivedFrom(FeatureBase::getClassTypeId()))) { BaseFeature.setValue(nullptr); } } + else if (prop == &AllowCompound) { + // As disallowing compounds can break the model we need to recompute the whole tree. + // This will inform user about first place where there is more than one solid. + if (!AllowCompound.getValue()) { + for (auto feature : getFullModel()) { + feature->enforceRecompute(); + } + } + } } Part::BodyBase::onChanged(prop); diff --git a/src/Mod/PartDesign/App/Body.h b/src/Mod/PartDesign/App/Body.h index fbb8ae879b..e36f751960 100644 --- a/src/Mod/PartDesign/App/Body.h +++ b/src/Mod/PartDesign/App/Body.h @@ -41,6 +41,7 @@ class PartDesignExport Body : public Part::BodyBase PROPERTY_HEADER_WITH_OVERRIDE(PartDesign::Body); public: + App::PropertyBool AllowCompound; /// True if this body feature is active or was active when the document was last closed //App::PropertyBool IsActive; diff --git a/src/Mod/PartDesign/App/Feature.cpp b/src/Mod/PartDesign/App/Feature.cpp index 0b283a3383..fe6e1eeadd 100644 --- a/src/Mod/PartDesign/App/Feature.cpp +++ b/src/Mod/PartDesign/App/Feature.cpp @@ -91,10 +91,17 @@ short Feature::mustExecute() const // TODO: Toponaming April 2024 Deprecated in favor of TopoShape method. Remove when possible. TopoDS_Shape Feature::getSolid(const TopoDS_Shape& shape) { - if (shape.IsNull()) + if (shape.IsNull()) { Standard_Failure::Raise("Shape is null"); + } + + // If single solid rule is not enforced we simply return the shape as is + if (singleSolidRuleMode() != Feature::SingleSolidRuleMode::Enforced) { + return shape; + } + TopExp_Explorer xp; - xp.Init(shape,TopAbs_SOLID); + xp.Init(shape, TopAbs_SOLID); if (xp.More()) { return xp.Current(); } @@ -107,12 +114,19 @@ TopoShape Feature::getSolid(const TopoShape& shape) if (shape.isNull()) { throw Part::NullShapeException("Null shape"); } + + // If single solid rule is not enforced we simply return the shape as is + if (singleSolidRuleMode() != Feature::SingleSolidRuleMode::Enforced) { + return shape; + } + int count = shape.countSubShapes(TopAbs_SOLID); - if(count) { - auto res = shape.getSubTopoShape(TopAbs_SOLID,1); + if (count) { + auto res = shape.getSubTopoShape(TopAbs_SOLID, 1); res.fixSolidOrientation(); return res; } + return shape; } @@ -153,12 +167,24 @@ int Feature::countSolids(const TopoDS_Shape& shape, TopAbs_ShapeEnum type) bool Feature::isSingleSolidRuleSatisfied(const TopoDS_Shape& shape, TopAbs_ShapeEnum type) { + if (singleSolidRuleMode() == Feature::SingleSolidRuleMode::Disabled) { + return true; + } + int solidCount = countSolids(shape, type); return solidCount <= 1; } +Feature::SingleSolidRuleMode Feature::singleSolidRuleMode() +{ + auto body = getFeatureBody(); + auto areCompoundSolidsAllowed = body->AllowCompound.getValue(); + + return areCompoundSolidsAllowed ? SingleSolidRuleMode::Disabled : SingleSolidRuleMode::Enforced; +} + const gp_Pnt Feature::getPointFromFace(const TopoDS_Face& f) { if (!f.Infinite()) { diff --git a/src/Mod/PartDesign/App/Feature.h b/src/Mod/PartDesign/App/Feature.h index 91e1b9189a..916aa03100 100644 --- a/src/Mod/PartDesign/App/Feature.h +++ b/src/Mod/PartDesign/App/Feature.h @@ -52,6 +52,8 @@ class PartDesignExport Feature : public Part::Feature, public App::SuppressibleE public: Feature(); + enum SingleSolidRuleMode { Disabled = 0, Enforced = 1 }; + /// Base feature which this feature will be fused into or cut out of App::PropertyLink BaseFeature; App::PropertyLinkHidden _Body; @@ -96,14 +98,15 @@ protected: * Get a solid of the given shape. If no solid is found an exception is raised. */ // TODO: Toponaming April 2024 Deprecated in favor of TopoShape method. Remove when possible. - static TopoDS_Shape getSolid(const TopoDS_Shape&); + TopoDS_Shape getSolid(const TopoDS_Shape&); TopoShape getSolid(const TopoShape&); static int countSolids(const TopoDS_Shape&, TopAbs_ShapeEnum type = TopAbs_SOLID); /** * Checks if the single-solid body rule is fulfilled. */ - static bool isSingleSolidRuleSatisfied(const TopoDS_Shape&, TopAbs_ShapeEnum type = TopAbs_SOLID); + bool isSingleSolidRuleSatisfied(const TopoDS_Shape&, TopAbs_ShapeEnum type = TopAbs_SOLID); + SingleSolidRuleMode singleSolidRuleMode(); /// Grab any point from the given face static const gp_Pnt getPointFromFace(const TopoDS_Face& f); From 3f2d5b83b5de4f5ee9ac65e0f058de9638079f8f Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Sat, 11 May 2024 16:46:32 +0200 Subject: [PATCH 45/58] Gui: Add ability to disable single-solid rule by default --- .../PreferencePages/DlgSettingsGeneral.cpp | 2 +- src/Mod/Part/Gui/DlgSettingsGeneral.cpp | 2 + src/Mod/Part/Gui/DlgSettingsGeneral.ui | 53 ++++++++++++++++--- src/Mod/PartDesign/App/Feature.cpp | 6 +++ 4 files changed, 56 insertions(+), 7 deletions(-) diff --git a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp index 24c632801a..4e367e6c71 100644 --- a/src/Gui/PreferencePages/DlgSettingsGeneral.cpp +++ b/src/Gui/PreferencePages/DlgSettingsGeneral.cpp @@ -712,4 +712,4 @@ void DlgSettingsGeneral::attachObserver() handlers.addHandler(ParamKey(hDockWindows->GetGroup("DAGView"), "Enabled"), applyDockWidget); } -#include "moc_DlgSettingsGeneral.cpp" +#include "moc_DlgSettingsGeneral.cpp" \ No newline at end of file diff --git a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp index f9b9545005..f02345f2c9 100644 --- a/src/Mod/Part/Gui/DlgSettingsGeneral.cpp +++ b/src/Mod/Part/Gui/DlgSettingsGeneral.cpp @@ -60,6 +60,7 @@ void DlgSettingsGeneral::saveSettings() ui->checkBooleanRefine->onSave(); ui->checkSketchBaseRefine->onSave(); ui->checkObjectNaming->onSave(); + ui->checkAllowCompoundBody->onSave(); } void DlgSettingsGeneral::loadSettings() @@ -68,6 +69,7 @@ void DlgSettingsGeneral::loadSettings() ui->checkBooleanRefine->onRestore(); ui->checkSketchBaseRefine->onRestore(); ui->checkObjectNaming->onRestore(); + ui->checkAllowCompoundBody->onRestore(); } /** diff --git a/src/Mod/Part/Gui/DlgSettingsGeneral.ui b/src/Mod/Part/Gui/DlgSettingsGeneral.ui index 8e7e540da7..931175dff1 100644 --- a/src/Mod/Part/Gui/DlgSettingsGeneral.ui +++ b/src/Mod/Part/Gui/DlgSettingsGeneral.ui @@ -13,8 +13,8 @@ General - - + + Model settings @@ -62,14 +62,17 @@ - + - - Object naming + + true false + + Object naming + @@ -87,7 +90,45 @@ - + + + + true + + + Experimental + + + false + + + + + + These settings are experimental and may result in decreased stability, more problems and undefined behaviors. + + + true + + + + + + + Allow multiple solids in Part Design Body by default (experimental) + + + AllowCompoundDefault + + + Mod/PartDesign + + + + + + + Qt::Vertical diff --git a/src/Mod/PartDesign/App/Feature.cpp b/src/Mod/PartDesign/App/Feature.cpp index fe6e1eeadd..d3c24e76d3 100644 --- a/src/Mod/PartDesign/App/Feature.cpp +++ b/src/Mod/PartDesign/App/Feature.cpp @@ -180,6 +180,12 @@ bool Feature::isSingleSolidRuleSatisfied(const TopoDS_Shape& shape, TopAbs_Shape Feature::SingleSolidRuleMode Feature::singleSolidRuleMode() { auto body = getFeatureBody(); + + // When the feature is not part of an body (which should not happen) let's stay with the default + if (!body) { + return SingleSolidRuleMode::Enforced; + } + auto areCompoundSolidsAllowed = body->AllowCompound.getValue(); return areCompoundSolidsAllowed ? SingleSolidRuleMode::Disabled : SingleSolidRuleMode::Enforced; From 90a77789a374585adfc6c130fa4e229ade4d6219 Mon Sep 17 00:00:00 2001 From: Kacper Donat Date: Tue, 14 May 2024 22:45:11 +0200 Subject: [PATCH 46/58] chore: Add myself (kadet) as Contributor --- src/Doc/CONTRIBUTORS | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Doc/CONTRIBUTORS b/src/Doc/CONTRIBUTORS index 0302e89445..11cf90980f 100644 --- a/src/Doc/CONTRIBUTORS +++ b/src/Doc/CONTRIBUTORS @@ -98,6 +98,7 @@ Jose Alfredo Murcia Andrés Jose Luis Cercos Pita (sanguinariojoe) jreinhardt Jürgen Riegel +Kacper Donat (kadet) kazan417 kbwbe Keith Sloan From 0c6ae9672d00ab34531a0713bcac7c171723cdef Mon Sep 17 00:00:00 2001 From: FEA-eng <59876896+FEA-eng@users.noreply.github.com> Date: Sat, 18 May 2024 14:06:30 +0200 Subject: [PATCH 47/58] Update TaskFemConstraintRigidBody.ui --- src/Mod/Fem/Gui/TaskFemConstraintRigidBody.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.ui b/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.ui index c255931ae2..ac004e91f5 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.ui +++ b/src/Mod/Fem/Gui/TaskFemConstraintRigidBody.ui @@ -17,7 +17,7 @@ - Select multiple face(s), click Add or Remove + Click Add or Remove and select geometric element(s) From 6786fed0676892cea7c8d1771bb0ab8fcf7fb62d Mon Sep 17 00:00:00 2001 From: FEA-eng <59876896+FEA-eng@users.noreply.github.com> Date: Sat, 18 May 2024 14:28:24 +0200 Subject: [PATCH 48/58] Update checksanalysis.py --- src/Mod/Fem/femtools/checksanalysis.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Mod/Fem/femtools/checksanalysis.py b/src/Mod/Fem/femtools/checksanalysis.py index f41244a5df..afb7252813 100644 --- a/src/Mod/Fem/femtools/checksanalysis.py +++ b/src/Mod/Fem/femtools/checksanalysis.py @@ -214,12 +214,11 @@ def check_member_for_solver_calculix(analysis, solver, mesh, member): # which analysis needs which constraints # no check in the regard of loads existence (constraint force, pressure, self weight) - # is done, because an analysis without loads at all is an valid analysis too + # is done, because an analysis without loads at all is a valid analysis too if solver.AnalysisType == "static": - if not (member.cons_fixed or member.cons_displacement): + if not (member.cons_fixed or member.cons_displacement or member.cons_rigidbody): message += ( - "Static analysis: Neither constraint fixed nor " - "constraint displacement defined.\n" + "Static analysis: No mechanical boundary conditions defined.\n" ) if solver.AnalysisType == "thermomech": if not member.cons_initialtemperature: @@ -257,7 +256,7 @@ def check_member_for_solver_calculix(analysis, solver, mesh, member): items += len(reference[1]) if items != 2: message += ( - "{} doesn't references exactly two needed faces.\n" + "{} doesn't reference exactly two needed faces.\n" .format(c["Object"].Name) ) # sectionprint From 5690eb8c75fef68cd3e9e32ba44e3c9dda1e8c70 Mon Sep 17 00:00:00 2001 From: Florian Foinant-Willig Date: Fri, 17 May 2024 22:15:18 +0200 Subject: [PATCH 49/58] PartDesign: hide Suppressed property with FC_USE_TNP_FIX flag --- src/Mod/PartDesign/App/Feature.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/PartDesign/App/Feature.cpp b/src/Mod/PartDesign/App/Feature.cpp index d3c24e76d3..18330a374c 100644 --- a/src/Mod/PartDesign/App/Feature.cpp +++ b/src/Mod/PartDesign/App/Feature.cpp @@ -61,7 +61,9 @@ Feature::Feature() BaseFeature.setStatus(App::Property::Hidden, true); App::SuppressibleExtension::initExtension(this); - Suppressed.setStatus(App::Property::Status::Hidden, true); //Todo: remove when TNP fixed +#ifndef FC_USE_TNP_FIX + Suppressed.setStatus(App::Property::Status::Hidden, true); +#endif } App::DocumentObjectExecReturn* Feature::recompute() From 6f76ccfb8340daafd5405b96f87033f7bc2b6c3b Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 18 May 2024 15:59:54 +0200 Subject: [PATCH 50/58] Gui: Restore previous width when closing task dialog This fixes #11016 --- src/Gui/MainWindow.cpp | 12 ++++++++++-- src/Gui/TaskView/TaskView.cpp | 31 +++++++++++++++++++++++++++++++ src/Gui/TaskView/TaskView.h | 8 ++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 1f454358ab..9d7d991fe1 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -599,9 +599,17 @@ bool MainWindow::setupTaskView() { // Task view if (d->hiddenDockWindows.find("Std_TaskView") == std::string::npos) { + // clang-format off + auto group = App::GetApplication().GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("DockWindows") + ->GetGroup("TaskView"); + // clang-format on auto taskView = new Gui::TaskView::TaskView(this); - taskView->setObjectName - (QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Tasks"))); + bool restore = group->GetBool("RestoreWidth", taskView->shouldRestoreWidth()); + taskView->setRestoreWidth(restore); + taskView->setObjectName(QString::fromLatin1(QT_TRANSLATE_NOOP("QDockWidget","Tasks"))); taskView->setMinimumWidth(210); DockWindowManager* pDockMgr = DockWindowManager::instance(); diff --git a/src/Gui/TaskView/TaskView.cpp b/src/Gui/TaskView/TaskView.cpp index 0dbb9fccc9..ae231262bc 100644 --- a/src/Gui/TaskView/TaskView.cpp +++ b/src/Gui/TaskView/TaskView.cpp @@ -27,6 +27,7 @@ # include # include # include +# include # include # include # include @@ -558,6 +559,7 @@ void TaskView::showDialog(TaskDialog *dlg) ActiveDialog->open(); + saveCurrentWidth(); getMainWindow()->updateActions(); triggerMinimumSizeHint(); @@ -602,6 +604,7 @@ void TaskView::removeDialog() delete remove; } + tryRestoreWidth(); triggerMinimumSizeHint(); } @@ -713,6 +716,34 @@ void TaskView::addTaskWatcher() taskPanel->setScheme(QSint::FreeCADPanelScheme::defaultScheme()); } +void TaskView::saveCurrentWidth() +{ + if (shouldRestoreWidth()) { + if (auto parent = qobject_cast(parentWidget())) { + currentWidth = parent->width(); + } + } +} + +void TaskView::tryRestoreWidth() +{ + if (shouldRestoreWidth()) { + if (auto parent = qobject_cast(parentWidget())) { + Gui::getMainWindow()->resizeDocks({parent}, {currentWidth}, Qt::Horizontal); + } + } +} + +void TaskView::setRestoreWidth(bool on) +{ + restoreWidth = on; +} + +bool TaskView::shouldRestoreWidth() const +{ + return restoreWidth; +} + void TaskView::removeTaskWatcher() { // In case a child of the TaskView has the focus and get hidden we have diff --git a/src/Gui/TaskView/TaskView.h b/src/Gui/TaskView/TaskView.h index 3504cb1c99..7b58e76aa3 100644 --- a/src/Gui/TaskView/TaskView.h +++ b/src/Gui/TaskView/TaskView.h @@ -163,6 +163,10 @@ public: QSize minimumSizeHint() const override; + // Restore width before opening a task panel + void setRestoreWidth(bool on); + bool shouldRestoreWidth() const; + Q_SIGNALS: void taskUpdate(); @@ -175,6 +179,8 @@ protected Q_SLOTS: private: void triggerMinimumSizeHint(); void adjustMinimumSizeHint(); + void saveCurrentWidth(); + void tryRestoreWidth(); protected: void keyPressEvent(QKeyEvent* event) override; @@ -199,6 +205,8 @@ protected: QSint::ActionPanel* taskPanel; TaskDialog *ActiveDialog; TaskEditControl *ActiveCtrl; + bool restoreWidth = false; + int currentWidth = 0; Connection connectApplicationActiveDocument; Connection connectApplicationDeleteDocument; From 27b1caa82b59c6da9c52e8b25641151cc1ecc76a Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 18 May 2024 20:30:17 +0200 Subject: [PATCH 51/58] Sketch: Refactor Sketch::updateGeometry() --- src/Mod/Sketcher/App/Sketch.cpp | 372 ++++++++++++++++++-------------- src/Mod/Sketcher/App/Sketch.h | 17 +- 2 files changed, 225 insertions(+), 164 deletions(-) diff --git a/src/Mod/Sketcher/App/Sketch.cpp b/src/Mod/Sketcher/App/Sketch.cpp index fd29941145..a12383efe2 100644 --- a/src/Mod/Sketcher/App/Sketch.cpp +++ b/src/Mod/Sketcher/App/Sketch.cpp @@ -4315,168 +4315,10 @@ Base::Vector3d Sketch::calculateNormalAtPoint(int geoIdCurve, double px, double bool Sketch::updateGeometry() { int i = 0; - for (std::vector::const_iterator it = Geoms.begin(); it != Geoms.end(); ++it, i++) { + for (const GeoDef& it : Geoms) { try { - if (it->type == Point) { - GeomPoint* point = static_cast(it->geo); - auto pointf = GeometryFacade::getFacade(point); - - point->setPoint( - Vector3d(*Points[it->startPointId].x, *Points[it->startPointId].y, 0.0)); - } - else if (it->type == Line) { - GeomLineSegment* lineSeg = static_cast(it->geo); - lineSeg->setPoints(Vector3d(*Lines[it->index].p1.x, *Lines[it->index].p1.y, 0.0), - Vector3d(*Lines[it->index].p2.x, *Lines[it->index].p2.y, 0.0)); - } - else if (it->type == Arc) { - GCS::Arc& myArc = Arcs[it->index]; - // the following 4 lines are redundant since these equations are already included in - // the arc constraints *myArc.start.x = *myArc.center.x + *myArc.rad * - // cos(*myArc.startAngle); *myArc.start.y = *myArc.center.y + *myArc.rad * - // sin(*myArc.startAngle); *myArc.end.x = *myArc.center.x + *myArc.rad * - // cos(*myArc.endAngle); *myArc.end.y = *myArc.center.y + *myArc.rad * - // sin(*myArc.endAngle); - GeomArcOfCircle* aoc = static_cast(it->geo); - aoc->setCenter(Vector3d(*Points[it->midPointId].x, *Points[it->midPointId].y, 0.0)); - aoc->setRadius(*myArc.rad); - aoc->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCW=*/true); - } - else if (it->type == ArcOfEllipse) { - GCS::ArcOfEllipse& myArc = ArcsOfEllipse[it->index]; - - GeomArcOfEllipse* aoe = static_cast(it->geo); - - Base::Vector3d center = - Vector3d(*Points[it->midPointId].x, *Points[it->midPointId].y, 0.0); - Base::Vector3d f1 = Vector3d(*myArc.focus1.x, *myArc.focus1.y, 0.0); - double radmin = *myArc.radmin; - - Base::Vector3d fd = f1 - center; - double radmaj = sqrt(fd * fd + radmin * radmin); - - aoe->setCenter(center); - // ensure that ellipse's major radius is always larger than minor radius... may - // still cause problems with degenerates. - if (radmaj >= aoe->getMinorRadius()) { - aoe->setMajorRadius(radmaj); - aoe->setMinorRadius(radmin); - } - else { - aoe->setMinorRadius(radmin); - aoe->setMajorRadius(radmaj); - } - aoe->setMajorAxisDir(fd); - aoe->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCW=*/true); - } - else if (it->type == Circle) { - GeomCircle* circ = static_cast(it->geo); - circ->setCenter( - Vector3d(*Points[it->midPointId].x, *Points[it->midPointId].y, 0.0)); - circ->setRadius(*Circles[it->index].rad); - } - else if (it->type == Ellipse) { - - GeomEllipse* ellipse = static_cast(it->geo); - - Base::Vector3d center = - Vector3d(*Points[it->midPointId].x, *Points[it->midPointId].y, 0.0); - Base::Vector3d f1 = - Vector3d(*Ellipses[it->index].focus1.x, *Ellipses[it->index].focus1.y, 0.0); - double radmin = *Ellipses[it->index].radmin; - - Base::Vector3d fd = f1 - center; - double radmaj = sqrt(fd * fd + radmin * radmin); - - ellipse->setCenter(center); - // ensure that ellipse's major radius is always larger than minor radius... may - // still cause problems with degenerates. - if (radmaj >= ellipse->getMinorRadius()) { - ellipse->setMajorRadius(radmaj); - ellipse->setMinorRadius(radmin); - } - else { - ellipse->setMinorRadius(radmin); - ellipse->setMajorRadius(radmaj); - } - ellipse->setMajorAxisDir(fd); - } - else if (it->type == ArcOfHyperbola) { - GCS::ArcOfHyperbola& myArc = ArcsOfHyperbola[it->index]; - - GeomArcOfHyperbola* aoh = static_cast(it->geo); - - Base::Vector3d center = - Vector3d(*Points[it->midPointId].x, *Points[it->midPointId].y, 0.0); - Base::Vector3d f1 = Vector3d(*myArc.focus1.x, *myArc.focus1.y, 0.0); - double radmin = *myArc.radmin; - - Base::Vector3d fd = f1 - center; - double radmaj = sqrt(fd * fd - radmin * radmin); - - aoh->setCenter(center); - if (radmaj >= aoh->getMinorRadius()) { - aoh->setMajorRadius(radmaj); - aoh->setMinorRadius(radmin); - } - else { - aoh->setMinorRadius(radmin); - aoh->setMajorRadius(radmaj); - } - aoh->setMajorAxisDir(fd); - aoh->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCW=*/true); - } - else if (it->type == ArcOfParabola) { - GCS::ArcOfParabola& myArc = ArcsOfParabola[it->index]; - - GeomArcOfParabola* aop = static_cast(it->geo); - - Base::Vector3d vertex = - Vector3d(*Points[it->midPointId].x, *Points[it->midPointId].y, 0.0); - Base::Vector3d f1 = Vector3d(*myArc.focus1.x, *myArc.focus1.y, 0.0); - - Base::Vector3d fd = f1 - vertex; - - aop->setXAxisDir(fd); - aop->setCenter(vertex); - aop->setFocal(fd.Length()); - aop->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCW=*/true); - } - else if (it->type == BSpline) { - GCS::BSpline& mybsp = BSplines[it->index]; - - GeomBSplineCurve* bsp = static_cast(it->geo); - - std::vector poles; - std::vector weights; - - std::vector::const_iterator it1; - std::vector::const_iterator it2; - - for (it1 = mybsp.poles.begin(), it2 = mybsp.weights.begin(); - it1 != mybsp.poles.end() && it2 != mybsp.weights.end(); - ++it1, ++it2) { - poles.emplace_back(*(*it1).x, *(*it1).y, 0.0); - weights.push_back(*(*it2)); - } - - bsp->setPoles(poles, weights); - - std::vector knots; - std::vector mult; - - // This is the code that should be here when/if b-spline gets its full - // implementation in the solver. - /*std::vector::const_iterator it3; - std::vector::const_iterator it4; - - for( it3 = mybsp.knots.begin(), it4 = mybsp.mult.begin(); it3 != mybsp.knots.end() - && it4 != mybsp.mult.end(); ++it3, ++it4) { knots.push_back(*(*it3)); - mult.push_back((*it4)); - } - - bsp->setKnots(knots,mult);*/ - } + updateGeometry(it); + ++i; } catch (Base::Exception& e) { Base::Console().Error("Updating geometry: Error build geometry(%d): %s\n", i, e.what()); @@ -4486,6 +4328,214 @@ bool Sketch::updateGeometry() return true; } +void Sketch::tryUpdateGeometry() +{ + for (const GeoDef& it : Geoms) { + updateGeometry(it); + } +} + +void Sketch::updateGeometry(const GeoDef& it) +{ + if (it.type == Point) { + updatePoint(it); + } + else if (it.type == Line) { + updateLineSegment(it); + } + else if (it.type == Arc) { + updateArcOfCircle(it); + } + else if (it.type == ArcOfEllipse) { + updateArcOfEllipse(it); + } + else if (it.type == Circle) { + updateCircle(it); + } + else if (it.type == Ellipse) { + updateEllipse(it); + } + else if (it.type == ArcOfHyperbola) { + updateArcOfHyperbola(it); + } + else if (it.type == ArcOfParabola) { + updateArcOfParabola(it); + } + else if (it.type == BSpline) { + updateBSpline(it); + } +} + +void Sketch::updatePoint(const GeoDef& def) +{ + GeomPoint* point = static_cast(def.geo); + auto pointf = GeometryFacade::getFacade(point); + + point->setPoint(Vector3d(*Points[def.startPointId].x, *Points[def.startPointId].y, 0.0)); +} + +void Sketch::updateLineSegment(const GeoDef& def) +{ + GeomLineSegment* lineSeg = static_cast(def.geo); + lineSeg->setPoints(Vector3d(*Lines[def.index].p1.x, *Lines[def.index].p1.y, 0.0), + Vector3d(*Lines[def.index].p2.x, *Lines[def.index].p2.y, 0.0)); +} + +void Sketch::updateArcOfCircle(const GeoDef& def) +{ + GCS::Arc& myArc = Arcs[def.index]; + // the following 4 lines are redundant since these equations are already included in + // the arc constraints *myArc.start.x = *myArc.center.x + *myArc.rad * + // cos(*myArc.startAngle); *myArc.start.y = *myArc.center.y + *myArc.rad * + // sin(*myArc.startAngle); *myArc.end.x = *myArc.center.x + *myArc.rad * + // cos(*myArc.endAngle); *myArc.end.y = *myArc.center.y + *myArc.rad * + // sin(*myArc.endAngle); + GeomArcOfCircle* aoc = static_cast(def.geo); + aoc->setCenter(Vector3d(*Points[def.midPointId].x, *Points[def.midPointId].y, 0.0)); + aoc->setRadius(*myArc.rad); + aoc->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCWXY=*/true); +} + +void Sketch::updateArcOfEllipse(const GeoDef& def) +{ + GCS::ArcOfEllipse& myArc = ArcsOfEllipse[def.index]; + + GeomArcOfEllipse* aoe = static_cast(def.geo); + + Base::Vector3d center = Vector3d(*Points[def.midPointId].x, *Points[def.midPointId].y, 0.0); + Base::Vector3d f1 = Vector3d(*myArc.focus1.x, *myArc.focus1.y, 0.0); + double radmin = *myArc.radmin; + + Base::Vector3d fd = f1 - center; + double radmaj = sqrt(fd * fd + radmin * radmin); + + aoe->setCenter(center); + // ensure that ellipse's major radius is always larger than minor radius... may + // still cause problems with degenerates. + if (radmaj >= aoe->getMinorRadius()) { + aoe->setMajorRadius(radmaj); + aoe->setMinorRadius(radmin); + } + else { + aoe->setMinorRadius(radmin); + aoe->setMajorRadius(radmaj); + } + aoe->setMajorAxisDir(fd); + aoe->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCWXY=*/true); +} + +void Sketch::updateArcOfHyperbola(const GeoDef& def) +{ + GCS::ArcOfHyperbola& myArc = ArcsOfHyperbola[def.index]; + + GeomArcOfHyperbola* aoh = static_cast(def.geo); + + Base::Vector3d center = Vector3d(*Points[def.midPointId].x, *Points[def.midPointId].y, 0.0); + Base::Vector3d f1 = Vector3d(*myArc.focus1.x, *myArc.focus1.y, 0.0); + double radmin = *myArc.radmin; + + Base::Vector3d fd = f1 - center; + double radmaj = sqrt(fd * fd - radmin * radmin); + + aoh->setCenter(center); + if (radmaj >= aoh->getMinorRadius()) { + aoh->setMajorRadius(radmaj); + aoh->setMinorRadius(radmin); + } + else { + aoh->setMinorRadius(radmin); + aoh->setMajorRadius(radmaj); + } + aoh->setMajorAxisDir(fd); + aoh->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCWXY=*/true); +} + +void Sketch::updateArcOfParabola(const GeoDef& def) +{ + GCS::ArcOfParabola& myArc = ArcsOfParabola[def.index]; + + GeomArcOfParabola* aop = static_cast(def.geo); + + Base::Vector3d vertex = Vector3d(*Points[def.midPointId].x, *Points[def.midPointId].y, 0.0); + Base::Vector3d f1 = Vector3d(*myArc.focus1.x, *myArc.focus1.y, 0.0); + + Base::Vector3d fd = f1 - vertex; + + aop->setXAxisDir(fd); + aop->setCenter(vertex); + aop->setFocal(fd.Length()); + aop->setRange(*myArc.startAngle, *myArc.endAngle, /*emulateCCWXY=*/true); +} + +void Sketch::updateCircle(const GeoDef& def) +{ + GeomCircle* circ = static_cast(def.geo); + circ->setCenter(Vector3d(*Points[def.midPointId].x, *Points[def.midPointId].y, 0.0)); + circ->setRadius(*Circles[def.index].rad); +} + +void Sketch::updateEllipse(const GeoDef& def) +{ + GeomEllipse* ellipse = static_cast(def.geo); + + Base::Vector3d center = Vector3d(*Points[def.midPointId].x, *Points[def.midPointId].y, 0.0); + Base::Vector3d f1 = Vector3d(*Ellipses[def.index].focus1.x, *Ellipses[def.index].focus1.y, 0.0); + double radmin = *Ellipses[def.index].radmin; + + Base::Vector3d fd = f1 - center; + double radmaj = sqrt(fd * fd + radmin * radmin); + + ellipse->setCenter(center); + // ensure that ellipse's major radius is always larger than minor radius... may + // still cause problems with degenerates. + if (radmaj >= ellipse->getMinorRadius()) { + ellipse->setMajorRadius(radmaj); + ellipse->setMinorRadius(radmin); + } + else { + ellipse->setMinorRadius(radmin); + ellipse->setMajorRadius(radmaj); + } + ellipse->setMajorAxisDir(fd); +} + +void Sketch::updateBSpline(const GeoDef& def) +{ + GCS::BSpline& mybsp = BSplines[def.index]; + + GeomBSplineCurve* bsp = static_cast(def.geo); + + std::vector poles; + std::vector weights; + + std::vector::const_iterator it1; + std::vector::const_iterator it2; + + for (it1 = mybsp.poles.begin(), it2 = mybsp.weights.begin(); + it1 != mybsp.poles.end() && it2 != mybsp.weights.end(); + ++it1, ++it2) { + poles.emplace_back(*(*it1).x, *(*it1).y, 0.0); + weights.push_back(*(*it2)); + } + + bsp->setPoles(poles, weights); + + std::vector knots; + std::vector mult; + + // This is the code that should be here when/if b-spline gets its full + // implementation in the solver. + /*std::vector::const_iterator it3; + std::vector::const_iterator it4; + + for( it3 = mybsp.knots.begin(), it4 = mybsp.mult.begin(); it3 != mybsp.knots.end() + && it4 != mybsp.mult.end(); ++it3, ++it4) { knots.push_back(*(*it3)); + mult.push_back((*it4)); + } + + bsp->setKnots(knots,mult);*/ +} + bool Sketch::updateNonDrivingConstraints() { for (std::vector::iterator it = Constrs.begin(); it != Constrs.end(); ++it) { diff --git a/src/Mod/Sketcher/App/Sketch.h b/src/Mod/Sketcher/App/Sketch.h index 9035c7ae23..0ffff0ed26 100644 --- a/src/Mod/Sketcher/App/Sketch.h +++ b/src/Mod/Sketcher/App/Sketch.h @@ -521,7 +521,7 @@ public: BSpline = 9 }; -protected: +private: float SolveTime; bool RecalculateInitialSolutionWhileMovingPoint; @@ -530,7 +530,7 @@ protected: // non-driving constraints) bool resolveAfterGeometryUpdated; -protected: +private: /// container element to store and work with the geometric elements of this sketch struct GeoDef { @@ -712,11 +712,22 @@ public: GCSsys.DL_tolfRedundant = val; } -protected: +private: GCS::DebugMode debugMode; private: bool updateGeometry(); + void tryUpdateGeometry(); + void updateGeometry(const GeoDef&); + void updatePoint(const GeoDef&); + void updateLineSegment(const GeoDef&); + void updateArcOfCircle(const GeoDef&); + void updateArcOfEllipse(const GeoDef&); + void updateArcOfHyperbola(const GeoDef&); + void updateArcOfParabola(const GeoDef&); + void updateCircle(const GeoDef&); + void updateEllipse(const GeoDef&); + void updateBSpline(const GeoDef&); bool updateNonDrivingConstraints(); void calculateDependentParametersElements(); From 8acbeb91b3dbe5da144ff0cf12176830ec87ac04 Mon Sep 17 00:00:00 2001 From: mosfet80 Date: Sun, 19 May 2024 01:02:20 +0200 Subject: [PATCH 52/58] mod: clean ImportOCAF.cpp clean ImportOCAF.cpp --- src/Mod/Import/App/ImportOCAF.cpp | 74 ------------------------------- 1 file changed, 74 deletions(-) diff --git a/src/Mod/Import/App/ImportOCAF.cpp b/src/Mod/Import/App/ImportOCAF.cpp index 8e7710d07a..4fb654eaa1 100644 --- a/src/Mod/Import/App/ImportOCAF.cpp +++ b/src/Mod/Import/App/ImportOCAF.cpp @@ -311,26 +311,6 @@ void ImportOCAF::createShape(const TDF_Label& label, TopoDS_Compound comp; builder.MakeCompound(comp); - /* - std::vector colors; - for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { - Quantity_Color aColor; - App::Color color(0.8f,0.8f,0.8f); - if (aColorTool->GetColor(xp.Current(), XCAFDoc_ColorGen, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorSurf, aColor) || - aColorTool->GetColor(xp.Current(), XCAFDoc_ColorCurv, aColor)) { - color.r = (float)aColor.Red(); - color.g = (float)aColor.Green(); - color.b = (float)aColor.Blue(); - colors.push_back(color); - } - } - - if (colors.size() > 1) { - createShape(label, loc, name, lValue, false); - return; - } - */ for (xp.Init(aShape, TopAbs_SOLID); xp.More(); xp.Next(), ctSolids++) { const TopoDS_Shape& sh = xp.Current(); if (!sh.IsNull()) { @@ -395,19 +375,6 @@ void ImportOCAF::createShape(const TDF_Label& label, // We must add the PartOrigin and the Part itself pcPart->addObjects(localValue); - // Let's compute relative placement of the Part - /* - gp_Trsf trf; - Base::Matrix4D mtrx; - if ( loc.IsIdentity() ) - trf = loc.Transformation(); - else - trf = TopLoc_Location(loc.FirstDatum()).Transformation(); - Part::TopoShape::convertToMatrix(trf, mtrx); - Base::Placement pl; - pl.fromMatrix(mtrx); - pcPart->Placement.setValue(pl); - */ lValue.push_back(pcPart); } @@ -428,7 +395,6 @@ void ImportOCAF::createShape(const TopoDS_Shape& aShape, Part::Feature* part = static_cast(doc->addObject("Part::Feature")); if (!loc.IsIdentity()) { - // part->Shape.setValue(aShape.Moved(TopLoc_Location(loc.FirstDatum()))); part->Shape.setValue(aShape.Moved(loc)); } else { @@ -554,20 +520,7 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna jt = myColorMap.find(Part::ShapeMapHasher {}(shape)); App::Color partColor(0.8f, 0.8f, 0.8f); -#if 0 // TODO - Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); - if (vp && vp->isDerivedFrom(PartGui::ViewProviderPart::getClassTypeId())) { - if (jt != myColorMap.end()) { - App::Color color; - color.r = jt->second.Red(); - color.g = jt->second.Green(); - color.b = jt->second.Blue(); - static_cast(vp)->ShapeAppearance.setDiffuseColor(color); - } - partColor = static_cast(vp)->ShapeAppearance.getDiffuseColor(); - } -#endif // set label name if defined if (setname && !myNameMap.empty()) { @@ -600,15 +553,6 @@ void ImportXCAF::createShape(const TopoDS_Shape& shape, bool perface, bool setna } xp.Next(); } - - if (found_face_color) { -#if 0 // TODO - Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider(part); - if (vp && vp->isDerivedFrom(PartGui::ViewProviderPartExt::getClassTypeId())) { - static_cast(vp)->DiffuseColor.setValues(faceColors); - } -#endif - } } } @@ -616,12 +560,6 @@ void ImportXCAF::loadShapes(const TDF_Label& label) { TopoDS_Shape aShape; if (aShapeTool->GetShape(label, aShape)) { - // if (aShapeTool->IsReference(label)) { - // TDF_Label reflabel; - // if (aShapeTool->GetReferredShape(label, reflabel)) { - // loadShapes(reflabel); - // } - // } if (aShapeTool->IsTopLevel(label)) { int ctSolids = 0, ctShells = 0, ctComps = 0; // add the shapes @@ -688,18 +626,6 @@ void ImportXCAF::loadShapes(const TDF_Label& label) delete[] str; } -#if 0 - // http://www.opencascade.org/org/forum/thread_15174/ - if (aShapeTool->IsAssembly(label)) { - TDF_LabelSequence shapeLabels; - aShapeTool->GetComponents(label, shapeLabels); - Standard_Integer nbShapes = shapeLabels.Length(); - for (Standard_Integer i = 1; i <= nbShapes; i++) { - loadShapes(shapeLabels.Value(i)); - } - } -#endif - if (label.HasChild()) { TDF_ChildIterator it; for (it.Initialize(label); it.More(); it.Next()) { From 7d2599cb7588cc2de6c608c35157eae9127b3a7b Mon Sep 17 00:00:00 2001 From: marcuspollio <131592747+marcuspollio@users.noreply.github.com> Date: Tue, 21 May 2024 04:51:33 +1200 Subject: [PATCH 53/58] UI : Update Spreadsheet icons (#13996) --- .../Gui/Resources/icons/Spreadsheet.svg | 118 +++++-- .../icons/SpreadsheetAlignBottom.svg | 118 +++++-- .../icons/SpreadsheetAlignCenter.svg | 133 ++++++-- .../Resources/icons/SpreadsheetAlignLeft.svg | 131 ++++++-- .../Resources/icons/SpreadsheetAlignRight.svg | 135 ++++++-- .../Resources/icons/SpreadsheetAlignTop.svg | 123 ++++++-- .../icons/SpreadsheetAlignVCenter.svg | 123 ++++++-- .../Resources/icons/SpreadsheetController.svg | 133 ++++++-- .../Gui/Resources/icons/SpreadsheetExport.svg | 298 +++++++++--------- .../Gui/Resources/icons/SpreadsheetImport.svg | 279 ++++++++-------- .../Resources/icons/SpreadsheetMergeCells.svg | 179 ++++++++--- .../Resources/icons/SpreadsheetSplitCell.svg | 182 +++++++---- .../Resources/icons/SpreadsheetWorkbench.svg | 152 ++++----- .../icons/preferences-spreadsheet.svg | 118 +++++-- 14 files changed, 1463 insertions(+), 759 deletions(-) diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/Spreadsheet.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/Spreadsheet.svg index 0926ed5cbf..03c6adbcf5 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/Spreadsheet.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/Spreadsheet.svg @@ -1,36 +1,53 @@ - - - - - + + + + + + - - - - - - - - - + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - Spreadsheet 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -44,21 +61,62 @@ FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignBottom.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignBottom.svg index 2224586c25..ec02e5f975 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignBottom.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignBottom.svg @@ -1,30 +1,50 @@ - - - - - + + + SpreadsheetAlignBottom + + + + - - - - - - - - - + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] @@ -44,19 +64,63 @@ FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignCenter.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignCenter.svg index 379281bba2..4b78131d4c 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignCenter.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignCenter.svg @@ -1,36 +1,62 @@ - - - - - + + + + + + - - - - - - - - - + + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetAlignCenter 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -38,27 +64,72 @@ FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignCenter.svg + FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignLeft.svg FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignLeft.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignLeft.svg index 68c7de44b8..903db7587f 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignLeft.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignLeft.svg @@ -1,36 +1,62 @@ - - - - - + + + + + + - - - - - - - - - + + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetAlignLeft 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -44,21 +70,66 @@ FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignRight.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignRight.svg index 5fde3ec45e..428f8a12ee 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignRight.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignRight.svg @@ -1,36 +1,62 @@ - - - - - + + + + + + - - - - - - - - - + + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetAlignRight 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -38,27 +64,74 @@ FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignRight.svg + FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignLeft.svg FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignTop.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignTop.svg index 72a5ad5c46..3717999fe6 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignTop.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignTop.svg @@ -1,36 +1,56 @@ - - - - - + + + SpreadsheetAlignBottom + + + + - - - - - - - - - + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetAlignTop + SpreadsheetAlignBottom 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -38,25 +58,70 @@ FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignTop.svg + FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignBottom.svg FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignVCenter.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignVCenter.svg index 6497393302..69d9ee809e 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignVCenter.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignVCenter.svg @@ -1,36 +1,56 @@ - - - - - + + + SpreadsheetAlignBottom + + + + - - - - - - - - - + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetAlignVCenter + SpreadsheetAlignBottom 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -38,25 +58,70 @@ FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignVCenter.svg + FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetAlignBottom.svg FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetController.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetController.svg index 7eb55d138e..e48bc4d6b3 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetController.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetController.svg @@ -1,36 +1,53 @@ - - - - - + + + + + + - - - - - - - - - + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetController 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -38,29 +55,79 @@ FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetController.svg + FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/Spreadsheet.svg FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetExport.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetExport.svg index 0368d5432e..c25c0b3c8e 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetExport.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetExport.svg @@ -1,183 +1,173 @@ - - - - - - + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + - + image/svg+xml - - + - Jakub Steiner + [maxwxyz] - - - hdd - hard drive - save - io - store - - - - - http://jimmac.musichall.cz - SpreadsheetExport - 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetExport.svg + FreeCAD/src/ FreeCAD LGPL2+ - - - [agryson] Alexander Gryson - - + 2024 + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - + + + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetImport.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetImport.svg index 444c2047bd..c65baafbdc 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetImport.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetImport.svg @@ -1,152 +1,179 @@ - - - - - - + + + + + + + - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + - + image/svg+xml - - - 2005-01-31 + - Jakub Steiner + [maxwxyz] - - http://jimmac.musichall.cz - Active state - when files are being dragged to + https://www.freecad.org/wiki/index.php?title=Artwork - Novell, Inc. + FreeCAD - SpreadsheetImport - https://www.freecad.org/wiki/index.php?title=Artwork - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetImport.svg + FreeCAD/src/ FreeCAD LGPL2+ - - - [agryson] Alexander Gryson - - + 2024 + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + + + + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetMergeCells.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetMergeCells.svg index b6bedb08da..90e401953e 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetMergeCells.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetMergeCells.svg @@ -1,51 +1,73 @@ - - - - - + + + + + + - - - + + + + - - - - - - - - - - - - - - - - - - - - + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetMergeCells 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -59,29 +81,82 @@ FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetSplitCell.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetSplitCell.svg index ccbd2af0c8..a36e354100 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetSplitCell.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetSplitCell.svg @@ -1,61 +1,53 @@ - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - SpreadsheetSplitCell 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -63,40 +55,92 @@ FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetSplitCell.svg + FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetMergeCells.svg FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetWorkbench.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetWorkbench.svg index 4ce0989a63..03c6adbcf5 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetWorkbench.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetWorkbench.svg @@ -1,77 +1,39 @@ + + + id="svg2860" + version="1.1" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="stop3785" /> + id="stop3787" /> - - - - - - - + x1="38" + y1="58" + x2="21" + y2="5" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(1,0,0,0.77777777,0,7.1111114)" /> @@ -81,66 +43,80 @@ image/svg+xml - - [triplus] + [Eivind Kvedalen] - SpreadsheetWorkbench - 2016-02-26 + 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork FreeCAD - FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/SpreadsheetWorkbench.svg + FreeCAD/src/Mod/Spreadsheet/Gui/Resources/icons/Spreadsheet.svg FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + + width="56" + height="44" + x="4" + y="10" /> + width="54" + height="42" + x="5" + y="11" /> + style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 3,20 H 61" + id="path3790" /> + style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 22,9 V 55" + id="path3792" /> + style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 3,32 H 61" + id="path3794" /> + style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" + d="M 3,44 H 61" + id="path3796" /> diff --git a/src/Mod/Spreadsheet/Gui/Resources/icons/preferences-spreadsheet.svg b/src/Mod/Spreadsheet/Gui/Resources/icons/preferences-spreadsheet.svg index 0926ed5cbf..03c6adbcf5 100644 --- a/src/Mod/Spreadsheet/Gui/Resources/icons/preferences-spreadsheet.svg +++ b/src/Mod/Spreadsheet/Gui/Resources/icons/preferences-spreadsheet.svg @@ -1,36 +1,53 @@ - - - - - + + + + + + - - - - - - - - - + - - - - + - + image/svg+xml - - + [Eivind Kvedalen] - Spreadsheet 2013-09-29 https://www.freecad.org/wiki/index.php?title=Artwork @@ -44,21 +61,62 @@ FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html [agryson] Alexander Gryson + + + + + + + + + - - - - - - - + + + + + + + From 42768a44a59c214f0848329810924c01afa3b454 Mon Sep 17 00:00:00 2001 From: Michael K Johnson Date: Thu, 16 May 2024 20:45:58 -0400 Subject: [PATCH 54/58] Fix typo in TechDraw tooltip --- src/Mod/TechDraw/Gui/CommandCreateDims.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp index db5b2f332d..e1f8814ccd 100644 --- a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp +++ b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp @@ -1405,7 +1405,7 @@ CmdTechDrawDimension::CmdTechDrawDimension() sMenuText = QT_TR_NOOP("Insert Dimension"); sToolTipText = QT_TR_NOOP("Dimension contextually based on your selection.\n" "Depending on your selection you might have several dimensions available. You can cycle through them using the M key.\n" - "Left clicking on empty space will validate the current Dimensiont. Right clicking or pressing Esc will cancel."); + "Left clicking on empty space will validate the current Dimension. Right clicking or pressing Esc will cancel."); sWhatsThis = "TechDraw_Dimension"; sStatusTip = sToolTipText; sPixmap = "TechDraw_Dimension"; From 7e7f9fc6055cef399ea7d7a66b07a32f0a53ae1c Mon Sep 17 00:00:00 2001 From: marcuspollio Date: Mon, 20 May 2024 15:53:08 +1200 Subject: [PATCH 55/58] BIM : update icons with Document element --- .../BIM/Resources/icons/Arch_Project_IFC.svg | 198 +--- .../BIM/Resources/icons/Arch_Reference.svg | 897 +++--------------- .../Resources/icons/BIM_Classification.svg | 412 +------- .../BIM/Resources/icons/BIM_IfcElements.svg | 484 ++-------- .../BIM/Resources/icons/BIM_IfcProperties.svg | 417 +------- .../BIM/Resources/icons/BIM_IfcQuantities.svg | 414 +------- src/Mod/BIM/Resources/icons/BIM_Layers.svg | 536 +++-------- src/Mod/BIM/Resources/icons/BIM_Material.svg | 606 +++--------- src/Mod/BIM/Resources/icons/BIM_Phases.svg | 468 ++------- src/Mod/BIM/Resources/icons/BIM_Preflight.svg | 522 ++-------- src/Mod/BIM/Resources/icons/BIM_Windows.svg | 483 ++-------- src/Mod/BIM/Resources/icons/IFC_document.svg | 494 ++-------- src/Mod/BIM/Resources/icons/Part_document.svg | 253 ++--- 13 files changed, 1056 insertions(+), 5128 deletions(-) diff --git a/src/Mod/BIM/Resources/icons/Arch_Project_IFC.svg b/src/Mod/BIM/Resources/icons/Arch_Project_IFC.svg index 5f89d67db6..dfeabb73bd 100644 --- a/src/Mod/BIM/Resources/icons/Arch_Project_IFC.svg +++ b/src/Mod/BIM/Resources/icons/Arch_Project_IFC.svg @@ -4,204 +4,96 @@ - + id="defs3"> + id="linearGradient3815"> - - - - - - + style="stop-color:#d3d7cf;stop-opacity:1;" /> + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> + id="metadata4"> image/svg+xml - 2005-10-15 - + - Andreas Nilsson + FreeCAD LGPL2+ - - - - edit - copy - - + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork - - - Jakub Steiner - - + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> + id="layer1" + style="display:inline"> + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + transform="matrix(1.2061426,0,0,1.2,3.9725422,7.0000004)"> + + + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="defs3"> + id="linearGradient1"> + id="stop1" /> + id="stop2" /> + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + id="linearGradient3777"> + id="stop3779" /> + id="stop3781" /> + gradientTransform="translate(0,-4)" + xlink:href="#linearGradient3767" + id="linearGradient3773" + x1="39.166134" + y1="61.764099" + x2="3.3382015" + y2="15.331016" + gradientUnits="userSpaceOnUse" /> - - - - - + id="linearGradient3767"> - - - - - - + id="stop3769" /> + id="stop3771" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + xlink:href="#linearGradient1" + id="linearGradient2" + x1="3.3382015" + y1="11.331016" + x2="64.244514" + y2="7.7592402" + gradientUnits="userSpaceOnUse" /> - - - + id="metadata4"> image/svg+xml - - - - [wmayer] - - - Arch_Floor - 2011-10-10 - https://www.freecad.org/wiki/index.php?title=Artwork - - - FreeCAD - - - FreeCAD/src/Mod/Arch/Resources/icons/Arch_ FreeCAD LGPL2+ - https://www.gnu.org/copyleft/lesser.html - + - [agryson] Alexander Gryson + FreeCAD - + + https://www.freecad.org/wiki/index.php?title=Artwork + + + + + + + + + + style="display:inline"> + + + + + + id="layer1-3" + transform="matrix(0.55823442,0,0,0.55994556,13.136501,14.655248)" + style="display:inline;stroke-width:3.57725;stroke-dasharray:none"> - + style="fill:url(#linearGradient2);stroke:#333333;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="M 3.3382015,11.331016 39.166134,18.474567 64.244514,7.75924 28.416933,0.61568843 Z" + id="path2993-0" /> + style="fill:url(#linearGradient3783);fill-opacity:1;stroke:#333333;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="M 64.244514,7.75924 V 47.048774 L 39.166134,57.764101 V 18.474567 Z" + id="path2995" /> - - - - - - - + id="path3825" + d="M 3.3382015,11.331016 39.166134,18.474567 V 57.764101 L 3.3382015,50.62055 Z" + style="display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient3773);fill-opacity:1;fill-rule:evenodd;stroke:#333333;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" /> + + diff --git a/src/Mod/BIM/Resources/icons/BIM_Classification.svg b/src/Mod/BIM/Resources/icons/BIM_Classification.svg index d58505db44..e58cf0fe3d 100644 --- a/src/Mod/BIM/Resources/icons/BIM_Classification.svg +++ b/src/Mod/BIM/Resources/icons/BIM_Classification.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_Classification.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,237 +14,27 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - @@ -261,170 +43,70 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + id="layer2"> + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e5234b;fill-opacity:1;fill-rule:nonzero;stroke:#c00017;stroke-width:2.07234;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> + style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#2b7ac4;fill-opacity:1;fill-rule:nonzero;stroke:#0063a7;stroke-width:2.02863;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" /> diff --git a/src/Mod/BIM/Resources/icons/BIM_IfcElements.svg b/src/Mod/BIM/Resources/icons/BIM_IfcElements.svg index f6a74ceb6a..26ae96b0f3 100644 --- a/src/Mod/BIM/Resources/icons/BIM_IfcElements.svg +++ b/src/Mod/BIM/Resources/icons/BIM_IfcElements.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_IfcElements.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,237 +14,27 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - @@ -261,199 +43,117 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + id="layer3-2" + style="display:inline;stroke:#0063a7;stroke-opacity:1;fill:#2b7ac4;fill-opacity:1" + transform="translate(-9.9997206,12.000001)"> + id="layer1-3-7" + transform="matrix(0.55823442,0,0,0.55994556,13.136501,14.655248)" + style="display:inline;stroke:#0063a7;stroke-width:3.57725;stroke-dasharray:none;stroke-opacity:1;fill:#2b7ac4;fill-opacity:1"> + style="fill:#2b7ac4;stroke:#0063a7;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1" + d="M 21.252168,14.902792 39.166134,18.474567 51.705324,13.116903 33.791709,9.5451275 Z" + id="path2993-0-0" /> + style="fill:#2b7ac4;fill-opacity:1;stroke:#0063a7;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 51.705324,13.116903 v 19.64561 l -12.53919,5.357664 v -19.64561 z" + id="path2995-9" /> + id="path3825-3" + d="m 21.252168,14.902791 17.913966,3.571776 v 19.64561 L 21.252168,34.548401 Z" + style="display:inline;overflow:visible;visibility:visible;fill:#2b7ac4;fill-opacity:1;fill-rule:evenodd;stroke:#0063a7;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" /> + + + + + style="fill:#319db6;stroke:#00829a;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1" + d="M 21.252168,14.902792 39.166134,18.474567 51.705324,13.116903 33.791709,9.5451275 Z" + id="path2993-0-2" /> + style="fill:#319db6;fill-opacity:1;stroke:#00829a;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 51.705324,13.116903 v 19.64561 l -12.53919,5.357664 v -19.64561 z" + id="path2995-6" /> + id="path3825-1" + d="m 21.252168,14.902791 17.913966,3.571776 v 19.64561 L 21.252168,34.548401 Z" + style="display:inline;overflow:visible;visibility:visible;fill:#319db6;fill-opacity:1;fill-rule:evenodd;stroke:#00829a;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" /> + + + + + style="fill:#e5234b;stroke:#c00017;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;fill-opacity:1" + d="M 21.252168,14.902792 39.166134,18.474567 51.705324,13.116903 33.791709,9.5451275 Z" + id="path2993-0" /> + style="fill:#e5234b;fill-opacity:1;stroke:#c00017;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="m 51.705324,13.116903 v 19.64561 l -12.53919,5.357664 v -19.64561 z" + id="path2995" /> + diff --git a/src/Mod/BIM/Resources/icons/BIM_IfcProperties.svg b/src/Mod/BIM/Resources/icons/BIM_IfcProperties.svg index 6d9b1f99cd..4b3314fc5e 100644 --- a/src/Mod/BIM/Resources/icons/BIM_IfcProperties.svg +++ b/src/Mod/BIM/Resources/icons/BIM_IfcProperties.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_IfcProperties2.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,237 +14,27 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - @@ -261,169 +43,68 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + style="display:inline;stroke-width:2;stroke-dasharray:none"> + d="M 38.479,37.783805 44.931045,34.095173 38.479,29.952781 v -4.347318 l 10.520996,7.40654 v 2.517639 L 38.479,42.101848 Z" + id="text1-5" + style="font-weight:800;font-size:25.2764px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans, Ultra-Bold';display:inline;fill:#319db6;fill-opacity:1;fill-rule:evenodd;stroke:#00829a;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;stroke-linecap:round;paint-order:normal" + aria-label="</>" /> + d="M 25.520996,42.101847 15,35.529641 v -2.517639 l 10.520996,-7.40654 v 4.347318 l -6.452045,4.142392 6.452045,3.688632 z" + style="font-weight:800;font-size:25.2764px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans, Ultra-Bold';display:inline;fill:#2b7ac4;fill-opacity:1;fill-rule:evenodd;stroke:#0063a7;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;stroke-linecap:round;paint-order:normal" + id="path1-9" /> + d="M 36.688138,23 31.016583,45.000059 H 27.415926 L 33.087481,23 Z" + style="font-weight:800;font-size:25.2764px;font-family:'Open Sans';-inkscape-font-specification:'Open Sans, Ultra-Bold';display:inline;fill:#e5234b;fill-opacity:1;fill-rule:evenodd;stroke:#c00017;stroke-width:2;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;stroke-linecap:round;paint-order:normal" + id="path1-3" /> diff --git a/src/Mod/BIM/Resources/icons/BIM_IfcQuantities.svg b/src/Mod/BIM/Resources/icons/BIM_IfcQuantities.svg index b129ee2a00..fd4e16baa5 100644 --- a/src/Mod/BIM/Resources/icons/BIM_IfcQuantities.svg +++ b/src/Mod/BIM/Resources/icons/BIM_IfcQuantities.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_IfcQuantities.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,237 +14,27 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - @@ -261,176 +43,76 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + y="20.222908" /> + y="13.64754" /> diff --git a/src/Mod/BIM/Resources/icons/BIM_Layers.svg b/src/Mod/BIM/Resources/icons/BIM_Layers.svg index fe5e1a48fc..dec9d232eb 100644 --- a/src/Mod/BIM/Resources/icons/BIM_Layers.svg +++ b/src/Mod/BIM/Resources/icons/BIM_Layers.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_Layers.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,217 +14,8 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="linearGradient3815"> + xlink:href="#linearGradient3815" /> + id="linearGradient1" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.64426076,0,0,0.63928583,17.931015,5.7297178)" + x1="53.257175" + y1="19.086002" + x2="25.928942" + y2="-1.3815211" /> + id="linearGradient2" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.64426076,0,0,0.63928583,17.931015,13.729721)" + x1="53.257175" + y1="19.086002" + x2="25.928942" + y2="-1.3815211" /> + + + + - @@ -303,195 +97,83 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> - - - - - - - - + id="layer2" + style="display:inline" + transform="translate(0,2.0004285)"> + + + + + + diff --git a/src/Mod/BIM/Resources/icons/BIM_Material.svg b/src/Mod/BIM/Resources/icons/BIM_Material.svg index d4791008eb..4c15002e3a 100644 --- a/src/Mod/BIM/Resources/icons/BIM_Material.svg +++ b/src/Mod/BIM/Resources/icons/BIM_Material.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_Material.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,216 +14,36 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> + gradientTransform="translate(-60,-988.36218)" /> - - - - + xlink:href="#linearGradient3960-4" + id="linearGradient2-3" + gradientUnits="userSpaceOnUse" + x1="37.758171" + y1="57.301327" + x2="21.860462" + y2="22.615412" + gradientTransform="matrix(0.3817509,0,0,0.3817509,10.447852,18.745858)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + id="feGaussianBlur3982-2-5-6" /> - @@ -342,231 +114,131 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + id="layer3" + transform="translate(2)"> - - - - - - - - - - - - - + id="layer2" + style="display:inline" + transform="translate(0,4)"> + + + + + + + + + + + + + + + diff --git a/src/Mod/BIM/Resources/icons/BIM_Phases.svg b/src/Mod/BIM/Resources/icons/BIM_Phases.svg index f5222ed22e..93bb2378b5 100644 --- a/src/Mod/BIM/Resources/icons/BIM_Phases.svg +++ b/src/Mod/BIM/Resources/icons/BIM_Phases.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_Phases2.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,237 +14,27 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - @@ -261,230 +43,112 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + transform="translate(0,2)" + style="stroke-width:2;stroke-dasharray:none"> + style="display:inline;fill:none;fill-rule:evenodd;stroke:#ababab;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 17,14 V 54" + id="path1641-7" /> + style="display:inline;fill:none;fill-rule:evenodd;stroke:#ababab;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 27,14 V 54" + id="path1641-7-7" /> + style="display:inline;fill:none;fill-rule:evenodd;stroke:#ababab;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 37,14 V 54" + id="path1641-7-5" /> + style="display:inline;fill:none;fill-rule:evenodd;stroke:#ababab;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" + d="M 47,14 V 54" + id="path1641-7-7-3" /> + y="16" /> + y="26" /> + y="36" /> + y="46" /> + d="M 16.999993,10 15.5,8 h 3 z" /> + d="M 26.999913,10 25.49992,8 h 3 z" /> - + d="M 36.999993,10 35.5,8 h 3 z" /> diff --git a/src/Mod/BIM/Resources/icons/BIM_Preflight.svg b/src/Mod/BIM/Resources/icons/BIM_Preflight.svg index b51de89394..39f6037f49 100644 --- a/src/Mod/BIM/Resources/icons/BIM_Preflight.svg +++ b/src/Mod/BIM/Resources/icons/BIM_Preflight.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_Preflight2.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,214 +14,26 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> + gradientTransform="matrix(0.88089247,0,0,0.88011875,-58.871845,52.790525)" /> + id="linearGradient3774"> - @@ -282,225 +63,108 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> - - - - - - - - - - - - - - + + + + + + + + diff --git a/src/Mod/BIM/Resources/icons/BIM_Windows.svg b/src/Mod/BIM/Resources/icons/BIM_Windows.svg index 8d084536f4..ab499a8326 100644 --- a/src/Mod/BIM/Resources/icons/BIM_Windows.svg +++ b/src/Mod/BIM/Resources/icons/BIM_Windows.svg @@ -5,15 +5,7 @@ width="64" height="64" id="svg249" - sodipodi:version="0.32" - inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)" - sodipodi:docname="BIM_Windows.svg" - inkscape:export-filename="/home/jimmac/gfx/novell/pdes/trunk/docs/BIGmime-text.png" - inkscape:export-xdpi="240.00000" - inkscape:export-ydpi="240.00000" version="1.1" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" @@ -22,216 +14,27 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> - + id="linearGradient3815"> + style="stop-color:#d3d7cf;stop-opacity:1;" /> - - - - - - + style="stop-color:#ffffff;stop-opacity:1" /> + gradientTransform="translate(-60,-988.36218)" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + id="linearGradient6"> + id="linearGradient3-6"> - - - - - @@ -325,198 +90,94 @@ image/svg+xml - + - Jakub Steiner + FreeCAD LGPL2+ - - http://jimmac.musichall.cz + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - - - - - - - - - - - - + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + style="display:inline" + transform="matrix(1,-0.08748866,0,1,0,2.7996372)"> + d="m -36.712951,42.013755 13.229087,3.397727" + id="path944" /> + style="fill:url(#linearGradient4-3);fill-opacity:1;fill-rule:evenodd;stroke:#333333;stroke-width:1.67609;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal" + d="M -20.176593,47.535019 V 12.283651 L -40.020223,7.1870617 V 42.863187 l 3.307272,0.849431 V 11.434219 l 13.229087,3.397727 v 31.853642 z" + id="path928" /> - + transform="matrix(1.0026321,-0.07167095,0,1.0261938,22.206843,12.904446)" + style="display:inline;stroke-width:1.97171;stroke-dasharray:none"> + style="stroke-width:1.97171;stroke-dasharray:none"> + style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient3823-5);fill-opacity:1;fill-rule:nonzero;stroke:#333333;stroke-width:1.97171;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" + d="M 2.7858244,10.0324 V 37.317724 L 26.72282,44.836255 V 17.551222 Z m 3.9894993,5.150948 5.9842493,1.879706 v 7.795834 L 6.7753237,22.979219 Z m 9.9737483,3.132843 5.984249,1.879705 v 7.795774 l -5.984249,-1.879669 z m -9.9737483,8.560927 5.9842493,1.879669 v 7.795815 L 6.7753237,34.67297 Z m 9.9737483,3.132782 5.984249,1.879669 v 7.795755 l -5.984249,-1.879633 z" + id="path3197-7" /> + diff --git a/src/Mod/BIM/Resources/icons/IFC_document.svg b/src/Mod/BIM/Resources/icons/IFC_document.svg index 83650126d6..dfeabb73bd 100644 --- a/src/Mod/BIM/Resources/icons/IFC_document.svg +++ b/src/Mod/BIM/Resources/icons/IFC_document.svg @@ -2,19 +2,10 @@ + id="defs3"> + id="linearGradient3815"> - - - - - - + style="stop-color:#d3d7cf;stop-opacity:1;" /> + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> - + id="metadata4"> image/svg+xml - 2005-10-15 - + - Andreas Nilsson + FreeCAD LGPL2+ - - - - edit - copy - - + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork - - - Jakub Steiner - - + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> - - - - - - - - - - - - - + style="display:inline"> + + + + + + + + + + + + + + + diff --git a/src/Mod/BIM/Resources/icons/Part_document.svg b/src/Mod/BIM/Resources/icons/Part_document.svg index c4bb6d8f0b..1f252f69c8 100644 --- a/src/Mod/BIM/Resources/icons/Part_document.svg +++ b/src/Mod/BIM/Resources/icons/Part_document.svg @@ -4,271 +4,160 @@ - + id="defs3"> + id="linearGradient3815"> - - - - - - + style="stop-color:#d3d7cf;stop-opacity:1;" /> + style="stop-color:#ffffff;stop-opacity:1" /> - - - - - - - - - - - + gradientTransform="translate(-60,-988.36218)" /> + id="linearGradient3777-6"> + id="stop3779-1" /> + id="stop3781-8" /> + id="linearGradient3767-9"> + id="stop3769-2" /> + id="stop3771-0" /> + id="metadata4"> image/svg+xml - 2005-10-15 - + - Andreas Nilsson + FreeCAD LGPL2+ - - - - edit - copy - - + + + + FreeCAD + + + https://www.freecad.org/wiki/index.php?title=Artwork - - - Jakub Steiner - - + rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" /> + rdf:about="http://creativecommons.org/licenses/by-sa/4.0/"> + rdf:resource="http://creativecommons.org/ns#Reproduction" /> + rdf:resource="http://creativecommons.org/ns#Distribution" /> + rdf:resource="http://creativecommons.org/ns#Notice" /> + rdf:resource="http://creativecommons.org/ns#Attribution" /> + rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /> + rdf:resource="http://creativecommons.org/ns#ShareAlike" /> + id="layer1" + style="display:inline"> + style="display:inline;fill:url(#linearGradient3771);fill-opacity:1;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="m 11,3 v 58.00002 h 42 v -48 L 43,3 Z" + id="path2991" /> + style="display:inline;fill:none;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 13,5 V 59.00002 H 51 V 13.81392 L 41.99741,5 Z" + id="path3763" /> - + style="display:inline;fill:#2e3436;fill-opacity:0.392157;stroke:#2e3436;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1" + d="M 43,3 V 13.00002 H 53 Z" + id="path2993" /> + style="display:inline" + transform="translate(0,1.9995285)"> + style="fill:#729fcf;stroke:#333333;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="M 3.3382015,11.331016 39.166134,18.474567 64.244514,7.75924 28.416933,0.61568843 Z" + id="path2993-0" /> + style="fill:url(#linearGradient3783-2);fill-opacity:1;stroke:#333333;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1" + d="M 64.244514,7.75924 V 47.048774 L 39.166134,57.764101 V 18.474567 Z" + id="path2995" /> - - + d="M 3.3382015,11.331016 39.166134,18.474567 V 57.764101 L 3.3382015,50.62055 Z" + style="display:inline;overflow:visible;visibility:visible;fill:url(#linearGradient3773-7);fill-opacity:1;fill-rule:evenodd;stroke:#333333;stroke-width:3.57725;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" /> + + From 7ee83f9610dcd28302f5c29f6942e7d145193a3a Mon Sep 17 00:00:00 2001 From: marcuspollio Date: Mon, 20 May 2024 18:00:03 +1200 Subject: [PATCH 56/58] BIM : fix typos in UI strings --- src/Mod/BIM/Resources/ui/ArchMultiMaterial.ui | 2 +- src/Mod/BIM/Resources/ui/dialogCreateProject.ui | 2 +- src/Mod/BIM/Resources/ui/dialogImport.ui | 2 +- src/Mod/BIM/Resources/ui/dialogPreflight.ui | 4 ++-- src/Mod/BIM/Resources/ui/dialogSetup.ui | 6 +++--- src/Mod/BIM/Resources/ui/dialogSpaces.ui | 2 +- src/Mod/BIM/Resources/ui/dialogWelcome.ui | 10 ---------- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/Mod/BIM/Resources/ui/ArchMultiMaterial.ui b/src/Mod/BIM/Resources/ui/ArchMultiMaterial.ui index baedf677b8..92266191c8 100644 --- a/src/Mod/BIM/Resources/ui/ArchMultiMaterial.ui +++ b/src/Mod/BIM/Resources/ui/ArchMultiMaterial.ui @@ -11,7 +11,7 @@ - Multimaterial definition + Multi-material definition diff --git a/src/Mod/BIM/Resources/ui/dialogCreateProject.ui b/src/Mod/BIM/Resources/ui/dialogCreateProject.ui index 9a3097a330..d1fb7d546b 100644 --- a/src/Mod/BIM/Resources/ui/dialogCreateProject.ui +++ b/src/Mod/BIM/Resources/ui/dialogCreateProject.ui @@ -17,7 +17,7 @@ - Create a defautl structure (IfcProject, IfcSite, IfcBuilding and IfcBuildingStorey)? Replying "No" will only create an IfcProject. You can then add the structure manually later. + Create a default structure (IfcProject, IfcSite, IfcBuilding and IfcBuildingStorey)? Replying "No" will only create an IfcProject. You can then add the structure manually later. true diff --git a/src/Mod/BIM/Resources/ui/dialogImport.ui b/src/Mod/BIM/Resources/ui/dialogImport.ui index 1c801efccf..c4a787158c 100644 --- a/src/Mod/BIM/Resources/ui/dialogImport.ui +++ b/src/Mod/BIM/Resources/ui/dialogImport.ui @@ -146,7 +146,7 @@ - If this is unchecked, these settings will be applied automatically next time. You can chenge this later under menu Edit -> Preferences -> Import/Export -> Native IFC + If this is unchecked, these settings will be applied automatically next time. You can change this later under menu Edit -> Preferences -> Import/Export -> Native IFC Ask me again next time diff --git a/src/Mod/BIM/Resources/ui/dialogPreflight.ui b/src/Mod/BIM/Resources/ui/dialogPreflight.ui index ca2643680b..a653c185a4 100644 --- a/src/Mod/BIM/Resources/ui/dialogPreflight.ui +++ b/src/Mod/BIM/Resources/ui/dialogPreflight.ui @@ -243,7 +243,7 @@ - <html><head/><body><p>Classification systems, such as UniClass or MasterFormat, or even your own custom system, are in some cases an important part of a building project. This test will ensure that all BIM objects and materials found in the model have their standardcode property dutifully filled.</p></body></html> + <html><head/><body><p>Classification systems, such as UniClass or MasterFormat, or even your own custom system, are in some cases an important part of a building project. This test will ensure that all BIM objects and materials found in the model have their standard code property dutifully filled.</p></body></html> Do all BIM objects and materials have a standard classification code defined? @@ -412,7 +412,7 @@ - <html><head/><body><p>When exporting a model to IFC, all BIM objects that are an extrusion of a rectangular profile will use an IfcRectangleProfileDef entity as their extrusion profile. However, Revit won't import these correctly. If you are going to use the IFC file in Revit, we recommend you to disable this behaviour by checking the option under menu <span style=" font-weight:600;">Edit -&gt; Preferences -&gt; Import/Export -&gt; IFC -&gt; Disable IfcRectangularProfileDef</span>.</p><p>When that option is checked, all extrusion profiles will be exported as generic IfcArbitraryProfileDef entities, regardless of if they are rectangular or not, which will contain a little less information, but will open correctly in Revit.</p></body></html> + <html><head/><body><p>When exporting a model to IFC, all BIM objects that are an extrusion of a rectangular profile will use an IfcRectangleProfileDef entity as their extrusion profile. However, Revit won't import these correctly. If you are going to use the IFC file in Revit, we recommend you to disable this behavior by checking the option under menu <span style=" font-weight:600;">Edit -&gt; Preferences -&gt; Import/Export -&gt; IFC -&gt; Disable IfcRectangularProfileDef</span>.</p><p>When that option is checked, all extrusion profiles will be exported as generic IfcArbitraryProfileDef entities, regardless of if they are rectangular or not, which will contain a little less information, but will open correctly in Revit.</p></body></html> Is IfcRectangleProfileDef export disabled? (Revit only) diff --git a/src/Mod/BIM/Resources/ui/dialogSetup.ui b/src/Mod/BIM/Resources/ui/dialogSetup.ui index e656f49cb7..f6b2fc9832 100644 --- a/src/Mod/BIM/Resources/ui/dialogSetup.ui +++ b/src/Mod/BIM/Resources/ui/dialogSetup.ui @@ -75,7 +75,7 @@ - <html><head/><body><p>The default size of texts and dimension texts. Location in preferences: <span style=" font-weight:600;">Draft &gt; Texts and dimensions &gt; Font size, Techdraw &gt; Techdraw 2 &gt; Font size</span></p></body></html> + <html><head/><body><p>The default size of texts and dimension texts. Location in preferences: <span style=" font-weight:600;">Draft &gt; Texts and dimensions &gt; Font size, TechDraw &gt; TechDraw 2 &gt; Font size</span></p></body></html> 0 @@ -389,7 +389,7 @@ - <html><head/><body><p>Check this to make FreeCAD start with a new blank document. Location in preferences: <span style=" font-weight:600;">General &gt; Document &gt; Create new documentat startup</span></p></body></html> + <html><head/><body><p>Check this to make FreeCAD start with a new blank document. Location in preferences: <span style=" font-weight:600;">General &gt; Document &gt; Create new document at startup</span></p></body></html> @@ -561,7 +561,7 @@ - Plain background:: + Plain background: diff --git a/src/Mod/BIM/Resources/ui/dialogSpaces.ui b/src/Mod/BIM/Resources/ui/dialogSpaces.ui index c5298c3f85..640ca185b9 100644 --- a/src/Mod/BIM/Resources/ui/dialogSpaces.ui +++ b/src/Mod/BIM/Resources/ui/dialogSpaces.ui @@ -183,7 +183,7 @@ - Levelname + Level name Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter diff --git a/src/Mod/BIM/Resources/ui/dialogWelcome.ui b/src/Mod/BIM/Resources/ui/dialogWelcome.ui index 9c8b051cb8..d4b554e734 100644 --- a/src/Mod/BIM/Resources/ui/dialogWelcome.ui +++ b/src/Mod/BIM/Resources/ui/dialogWelcome.ui @@ -113,16 +113,6 @@ - - - - <html><head/><body><p>The BIM workbench is a work-in-progress and will change quite often. Make sure you update it regularly via menu <span style=" font-weight:600;">Tools -&gt; Addon Manager</span></p></body></html> - - - true - - - From 7c2a95bb0d24ee527589b367f17cd2909f48d140 Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Tue, 14 May 2024 16:46:48 +0200 Subject: [PATCH 57/58] Assembly: JCS selection: cones surfaces offers the cone's apex. Fixes #13958 --- src/Mod/Assembly/UtilsAssembly.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Mod/Assembly/UtilsAssembly.py b/src/Mod/Assembly/UtilsAssembly.py index f79574e574..759e0a485e 100644 --- a/src/Mod/Assembly/UtilsAssembly.py +++ b/src/Mod/Assembly/UtilsAssembly.py @@ -921,13 +921,15 @@ def findPlacement(obj, part, elt, vtx, ignoreVertex=False): # First we find the translation if vtx_type == "Face" or ignoreVertex: - if surface.TypeId == "Part::GeomCylinder" or surface.TypeId == "Part::GeomCone": + if surface.TypeId == "Part::GeomCylinder": centerOfG = face.CenterOfGravity - surface.Center centerPoint = surface.Center + centerOfG centerPoint = centerPoint + App.Vector().projectToLine(centerOfG, surface.Axis) plc.Base = centerPoint elif surface.TypeId == "Part::GeomTorus" or surface.TypeId == "Part::GeomSphere": plc.Base = surface.Center + elif surface.TypeId == "Part::GeomCone": + plc.Base = surface.Apex else: plc.Base = face.CenterOfGravity elif vtx_type == "Edge": From 1eac717f8f6d9471f88f6af3a3f189cab6fba84c Mon Sep 17 00:00:00 2001 From: bgbsww Date: Mon, 20 May 2024 10:23:14 -0400 Subject: [PATCH 58/58] Toponaming: replace MultiFuse implementation to fix face colors --- src/Mod/Part/App/FeaturePartFuse.cpp | 176 ++++++++++++++++++------ src/Mod/Part/parttests/TopoShapeTest.py | 2 +- 2 files changed, 133 insertions(+), 45 deletions(-) diff --git a/src/Mod/Part/App/FeaturePartFuse.cpp b/src/Mod/Part/App/FeaturePartFuse.cpp index 82f4a423b4..448a2f0578 100644 --- a/src/Mod/Part/App/FeaturePartFuse.cpp +++ b/src/Mod/Part/App/FeaturePartFuse.cpp @@ -35,7 +35,7 @@ #include #include "FeaturePartFuse.h" -#include "TopoShapeOpCode.h" +#include "TopoShape.h" #include "modelRefine.h" #include "TopoShapeOpCode.h" @@ -91,42 +91,42 @@ short MultiFuse::mustExecute() const App::DocumentObjectExecReturn *MultiFuse::execute() { #ifndef FC_USE_TNP_FIX - std::vector s; + std::vector shapes; std::vector obj = Shapes.getValues(); std::vector::iterator it; for (it = obj.begin(); it != obj.end(); ++it) { - s.push_back(Feature::getShape(*it)); + shapes.push_back(Feature::getShape(*it)); } bool argumentsAreInCompound = false; TopoDS_Shape compoundOfArguments; //if only one source shape, and it is a compound - fuse children of the compound - if (s.size() == 1){ - compoundOfArguments = s[0]; + if (shapes.size() == 1){ + compoundOfArguments = shapes[0]; if (compoundOfArguments.ShapeType() == TopAbs_COMPOUND){ - s.clear(); + shapes.clear(); TopoDS_Iterator it2(compoundOfArguments); for (; it2.More(); it2.Next()) { const TopoDS_Shape& aChild = it2.Value(); - s.push_back(aChild); + shapes.push_back(aChild); } argumentsAreInCompound = true; } } - if (s.size() >= 2) { + if (shapes.size() >= 2) { try { std::vector history; BRepAlgoAPI_Fuse mkFuse; TopTools_ListOfShape shapeArguments,shapeTools; - const TopoDS_Shape& shape = s.front(); + const TopoDS_Shape& shape = shapes.front(); if (shape.IsNull()) throw Base::RuntimeError("Input shape is null"); shapeArguments.Append(shape); - for (auto it2 = s.begin()+1; it2 != s.end(); ++it2) { + for (auto it2 = shapes.begin()+1; it2 != shapes.end(); ++it2) { if (it2->IsNull()) throw Base::RuntimeError("Input shape is null"); shapeTools.Append(*it2); @@ -139,7 +139,7 @@ App::DocumentObjectExecReturn *MultiFuse::execute() throw Base::RuntimeError("MultiFusion failed"); TopoDS_Shape resShape = mkFuse.Shape(); - for (const auto & it2 : s) { + for (const auto & it2 : shapes) { history.push_back(buildHistory(mkFuse, TopAbs_FACE, resShape, it2)); } if (resShape.IsNull()) @@ -179,7 +179,7 @@ App::DocumentObjectExecReturn *MultiFuse::execute() for (std::size_t iChild = 0; iChild < history.size(); iChild++){ //loop over children of source compound //for each face of a child, find the inex of the face in compound, and assign the corresponding right-hand-size of the history TopTools_IndexedMapOfShape facesOfChild; - TopExp::MapShapes(s[iChild], type, facesOfChild); + TopExp::MapShapes(shapes[iChild], type, facesOfChild); for(std::pair &histitem: history[iChild].shapeMap){ //loop over elements of history - that is - over faces of the child of source compound int iFaceInChild = histitem.first; ShapeHistory::List &iFacesInResult = histitem.second; @@ -204,44 +204,132 @@ App::DocumentObjectExecReturn *MultiFuse::execute() return App::DocumentObject::StdReturn; #else std::vector shapes; - for (auto obj : Shapes.getValues()) { - TopoShape sh = Feature::getTopoShape(obj); - if (sh.isNull()) { - return new App::DocumentObjectExecReturn("Input shape is null"); + std::vector obj = Shapes.getValues(); + + std::vector::iterator it; + for (it = obj.begin(); it != obj.end(); ++it) { + shapes.push_back(Feature::getTopoShape(*it)); + } + + bool argumentsAreInCompound = false; + TopoShape compoundOfArguments; + + // if only one source shape, and it is a compound - fuse children of the compound + if (shapes.size() == 1) { + compoundOfArguments = shapes[0]; + if (compoundOfArguments.getShape().ShapeType() == TopAbs_COMPOUND) { + shapes.clear(); + shapes = compoundOfArguments.getSubTopoShapes(); + argumentsAreInCompound = true; } - if (!sh.hasSubShape(TopAbs_SOLID)) { - if (FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) { - FC_WARN("fusion of non solid: " << obj->getFullName()); + } + + if (shapes.size() >= 2) { + try { + std::vector history; + BRepAlgoAPI_Fuse mkFuse; + TopTools_ListOfShape shapeArguments, shapeTools; + const TopoShape& shape = shapes.front(); + if (shape.isNull()) { + throw Base::RuntimeError("Input shape is null"); } - else { - FC_MSG("fusion of non solid: " << obj->getFullName()); + shapeArguments.Append(shape.getShape()); + + for (auto it2 = shapes.begin() + 1; it2 != shapes.end(); ++it2) { + if (it2->isNull()) { + throw Base::RuntimeError("Input shape is null"); + } + shapeTools.Append(it2->getShape()); } + + mkFuse.SetArguments(shapeArguments); + mkFuse.SetTools(shapeTools); + mkFuse.Build(); + + if (!mkFuse.IsDone()) { + throw Base::RuntimeError("MultiFusion failed"); + } + + // TopoDS_Shape resShape = mkFuse.Shape(); + TopoShape res(0); + res.makeShapeWithElementMap(mkFuse.Shape(), MapperMaker(mkFuse), shapes, OpCodes::Fuse); + + for (const auto& it2 : shapes) { + history.push_back( + buildHistory(mkFuse, TopAbs_FACE, res.getShape(), it2.getShape())); + } + if (res.isNull()) { + throw Base::RuntimeError("Resulting shape is null"); + } + + Base::Reference hGrp = App::GetApplication() + .GetUserParameter() + .GetGroup("BaseApp") + ->GetGroup("Preferences") + ->GetGroup("Mod/Part/Boolean"); + if (hGrp->GetBool("CheckModel", false)) { + BRepCheck_Analyzer aChecker(res.getShape()); + if (!aChecker.IsValid()) { + return new App::DocumentObjectExecReturn("Resulting shape is invalid"); + } + } + if (this->Refine.getValue()) { + try { + TopoDS_Shape oldShape = res.getShape(); + BRepBuilderAPI_RefineModel mkRefine(oldShape); + res.setShape(mkRefine.Shape()); + ShapeHistory hist = + buildHistory(mkRefine, TopAbs_FACE, res.getShape(), oldShape); + for (auto& jt : history) { + jt = joinHistory(jt, hist); + } + } + catch (Standard_Failure&) { + // do nothing + } + } + + if (argumentsAreInCompound) { + // combine histories of every child of source compound into one + ShapeHistory overallHist; + TopTools_IndexedMapOfShape facesOfCompound; + TopAbs_ShapeEnum type = TopAbs_FACE; + TopExp::MapShapes(compoundOfArguments.getShape(), type, facesOfCompound); + for (std::size_t iChild = 0; iChild < history.size(); + iChild++) { // loop over children of source compound + // for each face of a child, find the inex of the face in compound, and assign + // the corresponding right-hand-size of the history + TopTools_IndexedMapOfShape facesOfChild; + TopExp::MapShapes(shapes[iChild].getShape(), type, facesOfChild); + for (std::pair& histitem : + history[iChild].shapeMap) { // loop over elements of history - that is - + // over faces of the child of source compound + int iFaceInChild = histitem.first; + ShapeHistory::List& iFacesInResult = histitem.second; + const TopoDS_Shape& srcFace = facesOfChild( + iFaceInChild + + 1); //+1 to convert our 0-based to OCC 1-bsed conventions + int iFaceInCompound = facesOfCompound.FindIndex(srcFace) - 1; + overallHist.shapeMap[iFaceInCompound] = + iFacesInResult; // this may overwrite existing info if the same face is + // used in several children of compound. This shouldn't + // be a problem, because the histories should match + // anyway... + } + } + history.clear(); + history.push_back(overallHist); + } + this->Shape.setValue(res); + this->History.setValues(history); + return Part::Feature::execute(); } - shapes.push_back(sh); - } - - TopoShape res(0); - res.makeElementBoolean(Part::OpCodes::Fuse, shapes); - if (res.isNull()) { - throw Base::RuntimeError("Resulting shape is null"); - } - - Base::Reference hGrp = App::GetApplication() - .GetUserParameter() - .GetGroup("BaseApp") - ->GetGroup("Preferences") - ->GetGroup("Mod/Part/Boolean"); - if (hGrp->GetBool("CheckModel", false)) { - BRepCheck_Analyzer aChecker(res.getShape()); - if (!aChecker.IsValid()) { - return new App::DocumentObjectExecReturn("Resulting shape is invalid"); + catch (Standard_Failure& e) { + return new App::DocumentObjectExecReturn(e.GetMessageString()); } } - - if (this->Refine.getValue()) { - res = res.makeElementRefine(); + else { + throw Base::CADKernelError("Not enough shape objects linked"); } - this->Shape.setValue(res); - return Part::Feature::execute(); #endif } diff --git a/src/Mod/Part/parttests/TopoShapeTest.py b/src/Mod/Part/parttests/TopoShapeTest.py index 0234e4e66b..c5cc6b21e7 100644 --- a/src/Mod/Part/parttests/TopoShapeTest.py +++ b/src/Mod/Part/parttests/TopoShapeTest.py @@ -375,7 +375,7 @@ class TopoShapeTest(unittest.TestCase, TopoShapeAssertions): # Assert elementMap if surface1.ElementMapVersion != "": # Should be '4' as of Mar 2023. self.assertEqual(surface1.ElementMapSize, 6) - self.assertBounds(surface1, App.BoundBox(-5, -5, 0, 5, 5, 10)) + self.assertBounds(surface1, App.BoundBox(-5, -5, 0, 5, 5, 10), precision=2) else: # Todo: WHY is the actual sweep different? That's BAD. However, the "New" approach # above, which uses BRepOffsetAPI_MakePipe appears to be correct over the older