From 3b47599e43481d695f8b9ea01bde04dee2c2d664 Mon Sep 17 00:00:00 2001 From: tritao Date: Mon, 13 Jan 2025 18:34:47 +0000 Subject: [PATCH] Gui: Minor cleanups. --- src/Base/Interpreter.cpp | 2 +- src/Gui/Selection/Selection.h | 4 ++-- src/Gui/View3DInventorViewer.cpp | 4 +--- src/Gui/ViewProvider.cpp | 5 +++-- src/Gui/ViewProvider.h | 2 +- src/Gui/ViewProviderExtension.h | 4 +--- src/Mod/BIM/ArchBuildingPart.py | 1 - src/Mod/BIM/bimcommands/BimViews.py | 2 +- src/Mod/Draft/draftguitools/gui_trackers.py | 2 +- 9 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/Base/Interpreter.cpp b/src/Base/Interpreter.cpp index 2bdc54ccff..41f592e4b8 100644 --- a/src/Base/Interpreter.cpp +++ b/src/Base/Interpreter.cpp @@ -557,7 +557,7 @@ const char* InterpreterSingleton::init(int argc, char* argv[]) PyRun_SimpleString( "# Check for virtualenv, and activate if present.\n" "# See " - "https://virtualenv.pypa.io/en/latest/userguide/" + "https://virtualenv.pypa.io/en/latest/" "#using-virtualenv-without-bin-python\n" "import os\n" "import sys\n" diff --git a/src/Gui/Selection/Selection.h b/src/Gui/Selection/Selection.h index de63f161b8..49975458b1 100644 --- a/src/Gui/Selection/Selection.h +++ b/src/Gui/Selection/Selection.h @@ -439,7 +439,7 @@ public: * * @param pDocName: document name. If no document name is given the objects * of the active are returned. If nothing for this Document is selected an - * empty vector is returned. If document name is "*", then all document is + * empty vector is returned. If document name is "*", then all documents are * considered. * @param typeId: specify the type of object to be returned. * @param resolve: sub-object resolving mode. @@ -447,7 +447,7 @@ public: * 1 resolve sub-object with old style element name * 2 resolve sub-object with new style element name * @param single: if set to true, then it will return an empty vector if - * there is more than one selections. + * there is more than one selection. * * @return The returned vector reflects the sequence of selection. */ diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 7f0d238e5d..cf9db31758 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -486,8 +486,6 @@ void View3DInventorViewer::init() // increase refcount before passing it to setScenegraph(), to avoid // premature destruction pcViewProviderRoot->ref(); - // is not really working with Coin3D. - //redrawOverlayOnSelectionChange(pcSelection); setSceneGraph(pcViewProviderRoot); // Event callback node pEventCallback = new SoEventCallback(); @@ -810,7 +808,7 @@ bool View3DInventorViewer::searchNode(SoNode* node) const searchAction.setInterest(SoSearchAction::FIRST); searchAction.apply(this->getSceneGraph()); SoPath* selectionPath = searchAction.getPath(); - return selectionPath ? true : false; + return selectionPath != nullptr; } bool View3DInventorViewer::hasViewProvider(ViewProvider* pcProvider) const diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index 6609d809af..33abc679ae 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -96,10 +96,10 @@ ViewProvider::ViewProvider() setStatus(UpdateData, true); - // SoFCSeparater and SoFCSelectionRoot can both track render cache setting. + // SoFCSeparator and SoFCSelectionRoot can both track render cache setting. // We change to SoFCSelectionRoot so that we can dynamically change full // selection mode (full highlight vs. boundbox). Note that comparing to - // SoFCSeparater, there are some small overhead with SoFCSelectionRoot for + // SoFCSeparator, there are some small overhead with SoFCSelectionRoot for // selection context tracking. // // pcRoot = new SoFCSeparator(true); @@ -906,6 +906,7 @@ std::vector< App::DocumentObject* > ViewProvider::claimChildren3D() const } return vec; } + bool ViewProvider::getElementPicked(const SoPickedPoint *pp, std::string &subname) const { if(!isSelectable()) return false; diff --git a/src/Gui/ViewProvider.h b/src/Gui/ViewProvider.h index c49c5a12eb..dc3ef78959 100644 --- a/src/Gui/ViewProvider.h +++ b/src/Gui/ViewProvider.h @@ -178,7 +178,7 @@ public: * @param append: If true, pPath will be first appended with the root node and * the mode switch node of this view provider. * - * @return the coint detail of the subelement + * @return the coin detail of the subelement * * If this view provider links to other view provider, then the * implementation of getDetailPath() shall also append all intermediate diff --git a/src/Gui/ViewProviderExtension.h b/src/Gui/ViewProviderExtension.h index 931b4dd534..728acfec11 100644 --- a/src/Gui/ViewProviderExtension.h +++ b/src/Gui/ViewProviderExtension.h @@ -48,8 +48,7 @@ class ViewProviderDocumentObject; */ class GuiExport ViewProviderExtension : public App::Extension { - - //The cass does not have properties itself, but it is important to provide the property access + //The class does not have properties itself, but it is important to provide the property access //functions. EXTENSION_PROPERTY_HEADER_WITH_OVERRIDE(Gui::ViewProviderExtension); @@ -124,7 +123,6 @@ public: private: bool m_ignoreOverlayIcon = false; - //Gui::ViewProviderDocumentObject* m_viewBase = nullptr; }; } //Gui diff --git a/src/Mod/BIM/ArchBuildingPart.py b/src/Mod/BIM/ArchBuildingPart.py index 421f7355c6..9d4f9521fe 100644 --- a/src/Mod/BIM/ArchBuildingPart.py +++ b/src/Mod/BIM/ArchBuildingPart.py @@ -428,7 +428,6 @@ class ViewProviderBuildingPart: def __init__(self,vobj): vobj.addExtension("Gui::ViewProviderGroupExtensionPython") - #vobj.addExtension("Gui::ViewProviderGeoFeatureGroupExtensionPython") vobj.Proxy = self self.setProperties(vobj) vobj.ShapeColor = ArchCommands.getDefaultColor("Helpers") diff --git a/src/Mod/BIM/bimcommands/BimViews.py b/src/Mod/BIM/bimcommands/BimViews.py index 4b3fc36828..6ef5a47d67 100644 --- a/src/Mod/BIM/bimcommands/BimViews.py +++ b/src/Mod/BIM/bimcommands/BimViews.py @@ -292,7 +292,7 @@ class BIM_Views: top.addChild(i) vm.viewtree.addTopLevelItem(top) - # set TreeVinew Item selected if obj is selected + # set TreeView Item selected if obj is selected bold = QtGui.QFont() bold.setBold(True) objSelected = FreeCADGui.Selection.getSelection() diff --git a/src/Mod/Draft/draftguitools/gui_trackers.py b/src/Mod/Draft/draftguitools/gui_trackers.py index aeca0569b2..1ce39fd681 100644 --- a/src/Mod/Draft/draftguitools/gui_trackers.py +++ b/src/Mod/Draft/draftguitools/gui_trackers.py @@ -1446,7 +1446,7 @@ class boxTracker(Tracker): class radiusTracker(Tracker): - """A tracker that displays a transparent sphere to inicate a radius.""" + """A tracker that displays a transparent sphere to indicate a radius.""" def __init__(self, position=FreeCAD.Vector(0, 0, 0), radius=1): self.trans = coin.SoTransform()