From 298c67787377a06aee01d76477ba696b1335307b Mon Sep 17 00:00:00 2001 From: luz paz Date: Wed, 25 Nov 2020 22:03:45 -0500 Subject: [PATCH] Gui: Fix header uniformity, whitespace, and doxygen fixes --- src/Gui/Action.cpp | 34 ++-- src/Gui/Action.h | 18 +- src/Gui/ActiveObjectList.cpp | 10 +- src/Gui/ActiveObjectList.h | 4 +- src/Gui/Application.cpp | 4 +- src/Gui/ApplicationPy.cpp | 26 +-- src/Gui/Assistant.cpp | 2 +- src/Gui/AutoSaver.cpp | 12 +- src/Gui/AxisOrigin.cpp | 2 +- src/Gui/AxisOrigin.h | 6 +- src/Gui/AxisOriginPyImp.cpp | 8 +- src/Gui/BitmapFactory.h | 2 +- src/Gui/BlenderNavigationStyle.cpp | 4 +- src/Gui/Clipping.cpp | 2 +- src/Gui/CoinRiftWidget.cpp | 24 +-- src/Gui/CoinRiftWidget.h | 4 +- src/Gui/ComboView.cpp | 2 +- src/Gui/ComboView.h | 2 +- src/Gui/Command.cpp | 26 +-- src/Gui/Command.h | 62 +++--- src/Gui/CommandDoc.cpp | 12 +- src/Gui/CommandFeat.cpp | 2 +- src/Gui/CommandLink.cpp | 16 +- src/Gui/CommandMacro.cpp | 18 +- src/Gui/CommandStd.cpp | 42 ++-- src/Gui/CommandT.h | 12 +- src/Gui/CommandTest.cpp | 40 ++-- src/Gui/CommandView.cpp | 38 ++-- src/Gui/CommandWindow.cpp | 26 +-- src/Gui/Control.h | 8 +- src/Gui/DemoMode.cpp | 4 +- src/Gui/DlgActionsImp.cpp | 30 +-- src/Gui/DlgActionsImp.h | 2 +- src/Gui/DlgAddProperty.cpp | 6 +- src/Gui/DlgAddProperty.h | 2 +- src/Gui/DlgCustomizeImp.cpp | 10 +- src/Gui/DlgCustomizeImp.h | 8 +- src/Gui/DlgCustomizeSpNavSettings.cpp | 16 +- src/Gui/DlgCustomizeSpNavSettings.h | 2 +- src/Gui/DlgCustomizeSpaceball.cpp | 26 +-- src/Gui/DlgDisplayPropertiesImp.cpp | 8 +- .../DlgEditFileIncludePropertyExternal.cpp | 6 +- src/Gui/DlgEditFileIncludePropertyExternal.h | 6 +- src/Gui/DlgEditorImp.cpp | 30 +-- src/Gui/DlgExpressionInput.cpp | 4 +- src/Gui/DlgExpressionInput.h | 4 +- src/Gui/DlgGeneralImp.cpp | 12 +- src/Gui/DlgMacroExecuteImp.cpp | 2 +- src/Gui/DlgMacroExecuteImp.h | 4 +- src/Gui/DlgMacroRecordImp.cpp | 8 +- src/Gui/DlgObjectSelection.cpp | 4 +- src/Gui/DlgObjectSelection.h | 4 +- src/Gui/DlgOnlineHelpImp.cpp | 6 +- src/Gui/DlgParameterFind.cpp | 2 +- src/Gui/DlgParameterFind.h | 2 +- src/Gui/DlgParameterImp.cpp | 46 ++--- src/Gui/DlgParameterImp.h | 10 +- src/Gui/DlgPreferencesImp.cpp | 4 +- src/Gui/DlgPreferencesImp.h | 16 +- src/Gui/DlgPropertyLink.cpp | 28 +-- src/Gui/DlgReportViewImp.cpp | 6 +- src/Gui/DlgReportViewImp.h | 2 +- src/Gui/DlgRunExternal.cpp | 10 +- src/Gui/DlgRunExternal.h | 2 +- src/Gui/DlgSettings3DViewImp.cpp | 6 +- src/Gui/DlgSettingsDocumentImp.cpp | 10 +- src/Gui/DlgSettingsImageImp.h | 4 +- src/Gui/DlgSettingsMacroImp.cpp | 6 +- src/Gui/DlgSettingsNavigation.cpp | 6 +- src/Gui/DlgSettingsUnitsImp.cpp | 8 +- src/Gui/DlgSettingsViewColor.cpp | 6 +- src/Gui/DlgSettingsViewColor.h | 2 +- src/Gui/DlgToolbarsImp.cpp | 2 +- src/Gui/DlgToolbarsImp.h | 14 +- src/Gui/DlgUndoRedo.cpp | 24 +-- src/Gui/DlgUndoRedo.h | 4 +- src/Gui/DlgUnitsCalculatorImp.h | 2 +- src/Gui/DlgWorkbenchesImp.cpp | 3 +- src/Gui/DlgWorkbenchesImp.h | 3 +- src/Gui/DockWindow.h | 8 +- src/Gui/DockWindowManager.cpp | 6 +- src/Gui/DockWindowManager.h | 6 +- src/Gui/Document.cpp | 92 ++++----- src/Gui/Document.h | 12 +- src/Gui/DocumentModel.cpp | 18 +- src/Gui/DocumentObserverPython.h | 4 +- src/Gui/DocumentPyImp.cpp | 72 +++---- src/Gui/EditorView.cpp | 12 +- src/Gui/ExpressionBinding.cpp | 6 +- src/Gui/ExpressionBinding.h | 8 +- src/Gui/ExpressionCompleter.cpp | 44 +++-- src/Gui/ExpressionCompleter.h | 26 ++- src/Gui/FileDialog.cpp | 28 +-- src/Gui/FileDialog.h | 14 +- src/Gui/Flag.cpp | 8 +- src/Gui/FreeCADGuiInit.py | 14 +- src/Gui/GLPainter.cpp | 2 +- src/Gui/GraphvizView.cpp | 24 +-- src/Gui/GraphvizView.h | 2 +- src/Gui/GuiApplication.cpp | 2 +- src/Gui/GuiApplicationNativeEventAware.cpp | 2 +- src/Gui/GuiApplicationNativeEventAware.h | 2 +- src/Gui/GuiConsole.cpp | 4 +- src/Gui/GuiConsole.h | 6 +- src/Gui/InputField.cpp | 10 +- src/Gui/InputField.h | 42 ++-- src/Gui/InputVector.cpp | 4 +- src/Gui/InventorAll.h | 12 +- src/Gui/InventorNavigationStyle.cpp | 4 +- src/Gui/LinkViewPyImp.cpp | 16 +- src/Gui/MDIView.cpp | 10 +- src/Gui/MDIView.h | 8 +- src/Gui/Macro.cpp | 6 +- src/Gui/Macro.h | 20 +- src/Gui/MainWindow.cpp | 30 +-- src/Gui/MainWindow.h | 10 +- src/Gui/ManualAlignment.cpp | 26 +-- src/Gui/ManualAlignment.h | 2 +- src/Gui/MenuManager.h | 4 +- src/Gui/MergeDocuments.cpp | 2 +- src/Gui/MouseSelection.h | 2 +- src/Gui/NaviCube.cpp | 2 +- src/Gui/NavigationStyle.cpp | 24 +-- src/Gui/NavigationStyle.h | 4 +- src/Gui/NetworkRetriever.cpp | 32 +-- src/Gui/NetworkRetriever.h | 2 +- src/Gui/OnlineDocumentation.cpp | 22 +-- src/Gui/OnlineDocumentation.h | 4 +- src/Gui/Placement.cpp | 2 +- src/Gui/PreCompiled.cpp | 2 +- src/Gui/PreCompiled.h | 2 +- src/Gui/PrefWidgets.cpp | 10 +- src/Gui/PrefWidgets.h | 10 +- src/Gui/ProgressBar.h | 8 +- src/Gui/ProgressDialog.cpp | 4 +- src/Gui/ProjectView.h | 2 +- src/Gui/PropertyPage.cpp | 12 +- src/Gui/PropertyView.cpp | 14 +- src/Gui/PythonConsole.cpp | 66 +++---- src/Gui/PythonConsole.h | 24 +-- src/Gui/PythonConsolePy.cpp | 2 +- src/Gui/PythonConsolePy.h | 14 +- src/Gui/PythonDebugger.cpp | 4 +- src/Gui/PythonDebugger.h | 6 +- src/Gui/PythonEditor.cpp | 20 +- src/Gui/PythonEditor.h | 2 +- src/Gui/QListWidgetCustom.cpp | 2 +- src/Gui/QuantitySpinBox.cpp | 4 +- src/Gui/QuantitySpinBox.h | 8 +- src/Gui/ReportView.cpp | 14 +- src/Gui/ReportView.h | 14 +- src/Gui/RevitNavigationStyle.cpp | 4 +- src/Gui/SceneInspector.cpp | 6 +- src/Gui/Selection.cpp | 3 +- src/Gui/Selection.h | 53 ++--- src/Gui/SelectionFilter.h | 36 ++-- src/Gui/SelectionFilter.l | 27 ++- src/Gui/SelectionFilter.y | 33 +++- src/Gui/SelectionObject.cpp | 2 +- src/Gui/SelectionObject.h | 2 +- src/Gui/SelectionObjectPyImp.cpp | 2 +- src/Gui/SelectionView.h | 2 +- src/Gui/SoAxisCrossKit.cpp | 14 +- src/Gui/SoFCBoundingBox.cpp | 2 +- src/Gui/SoFCBoundingBox.h | 6 +- src/Gui/SoFCCSysDragger.h | 12 +- src/Gui/SoFCColorBar.cpp | 4 +- src/Gui/SoFCDB.cpp | 4 +- src/Gui/SoFCDB.h | 2 +- src/Gui/SoFCOffscreenRenderer.cpp | 24 +-- src/Gui/SoFCOffscreenRenderer.h | 24 +-- src/Gui/SoFCSelection.cpp | 44 ++--- src/Gui/SoFCSelection.h | 2 +- src/Gui/SoFCSelectionAction.cpp | 113 ++++++----- src/Gui/SoFCSelectionAction.h | 16 +- src/Gui/SoFCSelectionContext.cpp | 10 +- src/Gui/SoFCSelectionContext.h | 4 +- src/Gui/SoFCUnifiedSelection.cpp | 90 ++++----- src/Gui/SoFCUnifiedSelection.h | 24 +-- src/Gui/SoFCVectorizeSVGAction.cpp | 20 +- src/Gui/SoFCVectorizeSVGAction.h | 6 +- src/Gui/SoFCVectorizeU3DAction.cpp | 26 +-- src/Gui/SoMouseWheelEvent.cpp | 3 +- src/Gui/SoMouseWheelEvent.h | 3 +- src/Gui/SoNavigationDragger.cpp | 56 +++--- src/Gui/SoNavigationDragger.h | 28 +-- src/Gui/SoNavigationDraggerLayout.h | 22 +++ src/Gui/SoTextLabel.cpp | 4 +- src/Gui/SoTouchEvents.cpp | 7 +- src/Gui/SoTouchEvents.h | 3 +- src/Gui/SpinBox.cpp | 16 +- src/Gui/SpinBox.h | 4 +- src/Gui/Splashscreen.cpp | 8 +- src/Gui/Splashscreen.h | 4 +- src/Gui/SplitView3DInventor.cpp | 6 +- src/Gui/SyntaxHighlighter.cpp | 10 +- src/Gui/TaskCSysDragger.h | 2 +- src/Gui/TaskDlgRelocation.cpp | 10 +- src/Gui/TaskDlgRelocation.h | 6 +- src/Gui/TaskElementColors.cpp | 12 +- src/Gui/TaskElementColors.h | 2 +- src/Gui/TextEdit.cpp | 32 +-- src/Gui/TextEdit.h | 16 +- src/Gui/TextureMapping.cpp | 2 +- src/Gui/Thumbnail.cpp | 4 +- src/Gui/ToolBarManager.h | 4 +- src/Gui/ToolBox.cpp | 12 +- src/Gui/ToolBox.h | 26 +-- src/Gui/ToolBoxManager.h | 6 +- src/Gui/TouchpadNavigationStyle.cpp | 4 +- src/Gui/TransactionObject.cpp | 4 +- src/Gui/Tree.cpp | 184 +++++++++--------- src/Gui/Tree.h | 18 +- src/Gui/TreeView.h | 2 +- src/Gui/Utilities.cpp | 4 +- src/Gui/View.cpp | 2 +- src/Gui/View.h | 12 +- src/Gui/View3DInventor.cpp | 2 +- src/Gui/View3DInventor.h | 4 +- src/Gui/View3DInventorExamples.cpp | 28 +-- src/Gui/View3DInventorRiftViewer.cpp | 14 +- src/Gui/View3DInventorRiftViewer.h | 2 +- src/Gui/View3DInventorViewer.cpp | 34 ++-- src/Gui/View3DInventorViewer.h | 34 ++-- src/Gui/View3DPy.cpp | 24 +-- src/Gui/View3DViewerPy.cpp | 8 +- src/Gui/View3DViewerPy.h | 6 +- src/Gui/ViewParams.cpp | 2 +- src/Gui/ViewParams.h | 4 +- src/Gui/ViewProvider.cpp | 10 +- src/Gui/ViewProvider.h | 14 +- src/Gui/ViewProviderAnnotation.cpp | 18 +- src/Gui/ViewProviderBuilder.cpp | 4 +- src/Gui/ViewProviderDocumentObject.cpp | 16 +- src/Gui/ViewProviderDocumentObject.h | 6 +- src/Gui/ViewProviderDocumentObjectGroup.cpp | 2 +- src/Gui/ViewProviderDocumentObjectGroup.h | 2 +- src/Gui/ViewProviderDocumentObjectPyImp.cpp | 8 +- src/Gui/ViewProviderDragger.cpp | 36 ++-- src/Gui/ViewProviderDragger.h | 2 +- src/Gui/ViewProviderExtension.cpp | 6 +- src/Gui/ViewProviderExtension.h | 14 +- src/Gui/ViewProviderExtern.cpp | 2 +- src/Gui/ViewProviderFeature.cpp | 4 +- src/Gui/ViewProviderFeature.h | 2 +- .../ViewProviderGeoFeatureGroupExtension.cpp | 4 +- src/Gui/ViewProviderGeometryObject.cpp | 10 +- src/Gui/ViewProviderGeometryObject.h | 2 +- src/Gui/ViewProviderGroupExtension.cpp | 12 +- src/Gui/ViewProviderGroupExtension.h | 6 +- src/Gui/ViewProviderLine.cpp | 2 +- src/Gui/ViewProviderLink.cpp | 162 +++++++-------- src/Gui/ViewProviderLink.h | 14 +- src/Gui/ViewProviderLinkPyImp.cpp | 4 +- src/Gui/ViewProviderMaterialObject.cpp | 4 +- src/Gui/ViewProviderMaterialObject.h | 2 +- src/Gui/ViewProviderMeasureDistance.cpp | 4 +- src/Gui/ViewProviderOrigin.h | 2 +- src/Gui/ViewProviderOriginGroup.cpp | 2 +- src/Gui/ViewProviderOriginGroupExtension.cpp | 20 +- src/Gui/ViewProviderOriginGroupExtension.h | 2 +- src/Gui/ViewProviderPart.cpp | 4 +- src/Gui/ViewProviderPlane.cpp | 2 +- src/Gui/ViewProviderPyImp.cpp | 40 ++-- src/Gui/ViewProviderPythonFeature.cpp | 20 +- src/Gui/ViewProviderPythonFeature.h | 8 +- src/Gui/WaitCursor.cpp | 6 +- src/Gui/WaitCursor.h | 10 +- src/Gui/WhatsThis.cpp | 2 +- src/Gui/WidgetFactory.cpp | 10 +- src/Gui/WidgetFactory.h | 40 ++-- src/Gui/Widgets.cpp | 30 +-- src/Gui/Widgets.h | 4 +- src/Gui/Window.cpp | 4 +- src/Gui/Workbench.cpp | 32 +-- src/Gui/Workbench.h | 22 +-- src/Gui/WorkbenchFactory.h | 10 +- src/Gui/WorkbenchManager.cpp | 2 +- src/Gui/WorkbenchManager.h | 6 +- src/Gui/WorkbenchPyImp.cpp | 6 +- src/Gui/core-gui.dox | 4 +- src/Gui/lex.SelectionFilter.c | 84 +++++--- src/Gui/resource.cpp | 2 +- 283 files changed, 2026 insertions(+), 1903 deletions(-) diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index f388e9ee91..cbc94c304a 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -101,7 +101,7 @@ void Action::addTo(QWidget *w) /** * Activates the command. */ -void Action::onActivated () +void Action::onActivated () { _pcCmd->invoke(0,Command::TriggerAction); } @@ -112,7 +112,7 @@ void Action::onActivated () void Action::onToggled(bool b) { _pcCmd->invoke( b ? 1 : 0 , Command::TriggerAction); -} +} void Action::setCheckable(bool b) { @@ -132,7 +132,7 @@ void Action::setCheckable(bool b) void Action::setChecked(bool b, bool no_signal) { bool blocked; - if(no_signal) + if(no_signal) blocked = _action->blockSignals(true); _action->setChecked(b); if(no_signal) @@ -147,12 +147,12 @@ bool Action::isChecked() const /** * Sets whether the action is enabled. */ -void Action::setEnabled(bool b) +void Action::setEnabled(bool b) { _action->setEnabled(b); } -void Action::setVisible(bool b) +void Action::setVisible(bool b) { _action->setVisible(b); } @@ -201,7 +201,7 @@ void Action::setToolTip(const QString & s) { _action->setToolTip(s); } - + QString Action::toolTip() const { return _action->toolTip(); @@ -219,7 +219,7 @@ QString Action::whatsThis() const void Action::setMenuRole(QAction::MenuRole menuRole) { - _action->setMenuRole(menuRole); + _action->setMenuRole(menuRole); } // -------------------------------------------------------------------- @@ -247,7 +247,7 @@ ActionGroup::~ActionGroup() void ActionGroup::addTo(QWidget *w) { // When adding an action that has defined a menu then shortcuts - // of the menu actions don't work. To make this working we must + // of the menu actions don't work. To make this working we must // set the menu explicitly. This means calling QAction::setMenu() // and adding this action to the widget doesn't work. if (_dropDown) { @@ -268,7 +268,7 @@ void ActionGroup::addTo(QWidget *w) //tb->addActions(_group->actions()); } else { - w->addActions(_group->actions()); // no drop-down + w->addActions(_group->actions()); // no drop-down } } else { @@ -343,7 +343,7 @@ void ActionGroup::setCheckedAction(int i) /** * Activates the command. */ -void ActionGroup::onActivated () +void ActionGroup::onActivated () { _pcCmd->invoke(this->property("defaultAction").toInt(), Command::TriggerAction); } @@ -351,12 +351,12 @@ void ActionGroup::onActivated () void ActionGroup::onToggled(bool) { onActivated(); -} +} /** * Activates the command. */ -void ActionGroup::onActivated (QAction* a) +void ActionGroup::onActivated (QAction* a) { int index = _group->actions().indexOf(a); @@ -383,7 +383,7 @@ void ActionGroup::onActivated (QAction* a) _pcCmd->invoke(index, Command::TriggerChildAction); } -void ActionGroup::onHovered (QAction *a) +void ActionGroup::onHovered (QAction *a) { Gui::ToolTip::showText(QCursor::pos(), a->toolTip()); } @@ -416,7 +416,7 @@ private: WorkbenchComboBox::WorkbenchComboBox(WorkbenchGroup* wb, QWidget* parent) : QComboBox(parent), group(wb) { connect(this, SIGNAL(activated(int)), this, SLOT(onActivated(int))); - connect(getMainWindow(), SIGNAL(workbenchActivated(const QString&)), + connect(getMainWindow(), SIGNAL(workbenchActivated(const QString&)), this, SLOT(onWorkbenchActivated(const QString&))); } @@ -702,7 +702,7 @@ void RecentFilesAction::appendFile(const QString& filename) /** * Set the list of recent files. For each item an action object is - * created and added to this action group. + * created and added to this action group. */ void RecentFilesAction::setFiles(const QStringList& files) { @@ -1135,7 +1135,7 @@ void DockWidgetAction::addTo ( QWidget * w ) _action->setMenu(_menu); connect(_menu, SIGNAL(aboutToShow()), getMainWindow(), SLOT(onDockWindowMenuAboutToShow())); } - + w->addAction(_action); } @@ -1158,7 +1158,7 @@ void ToolBarAction::addTo ( QWidget * w ) _action->setMenu(_menu); connect(_menu, SIGNAL(aboutToShow()), getMainWindow(), SLOT(onToolBarMenuAboutToShow())); } - + w->addAction(_action); } diff --git a/src/Gui/Action.h b/src/Gui/Action.h index 5429db732a..e3e7a8673e 100644 --- a/src/Gui/Action.h +++ b/src/Gui/Action.h @@ -28,12 +28,12 @@ #include #include -namespace Gui +namespace Gui { class Command; /** - * The Action class is the link between Qt's QAction class and FreeCAD's + * The Action class is the link between Qt's QAction class and FreeCAD's * command classes (@ref Command). So, it is possible to have all actions * (from toolbars, menus, ...) implemented in classes instead of many slot * methods in the class @ref MainWindow. @@ -74,7 +74,7 @@ public: public Q_SLOTS: virtual void onActivated (); - virtual void onToggled (bool); + virtual void onToggled (bool); protected: QAction* _action; @@ -84,7 +84,7 @@ protected: // -------------------------------------------------------------------- /** - * The ActionGroup class is the link between Qt's QActionGroup class and + * The ActionGroup class is the link between Qt's QActionGroup class and * FreeCAD's command classes (@ref Command). Compared to Action with an * ActionGroup it is possible to implement a single command with a group * of toggable actions where e.g. one is set exclusive. @@ -161,7 +161,7 @@ class GuiExport WorkbenchGroup : public ActionGroup Q_OBJECT public: - /** + /** * Creates an action for the command \a pcCmd to load the workbench \a name * when it gets activated. */ @@ -184,7 +184,7 @@ private: // -------------------------------------------------------------------- /** - * The RecentFilesAction class holds a menu listed with the recent files. + * The RecentFilesAction class holds a menu listed with the recent files. * @author Werner Mayer */ class GuiExport RecentFilesAction : public ActionGroup @@ -207,7 +207,7 @@ private: private: int visibleItems; /**< Number of visible items */ - int maximumItems; /**< Number of maximum items */ + int maximumItems; /**< Number of maximum items */ }; // -------------------------------------------------------------------- @@ -245,7 +245,7 @@ private: // -------------------------------------------------------------------- /** - * The UndoAction class reimplements a special behaviour to make a menu + * The UndoAction class reimplements a special behaviour to make a menu * appearing when the button with the arrow is clicked. * @author Werner Mayer */ @@ -270,7 +270,7 @@ private: // -------------------------------------------------------------------- /** - * The RedoAction class reimplements a special behaviour to make a menu + * The RedoAction class reimplements a special behaviour to make a menu * appearing when the button with the arrow is clicked. * @author Werner Mayer */ diff --git a/src/Gui/ActiveObjectList.cpp b/src/Gui/ActiveObjectList.cpp index e4ed5b4c2b..aff4d1b06b 100644 --- a/src/Gui/ActiveObjectList.cpp +++ b/src/Gui/ActiveObjectList.cpp @@ -109,7 +109,7 @@ Gui::ActiveObjectList::ObjectInfo Gui::ActiveObjectList::getObjectInfo(App::Docu return info; } -bool Gui::ActiveObjectList::hasObject(App::DocumentObject *obj, +bool Gui::ActiveObjectList::hasObject(App::DocumentObject *obj, const char *name, const char *subname) const { auto it = _ObjectMap.find(name); @@ -119,7 +119,7 @@ bool Gui::ActiveObjectList::hasObject(App::DocumentObject *obj, return info.obj==it->second.obj && info.subname==it->second.subname; } -void Gui::ActiveObjectList::setObject(App::DocumentObject* obj, const char* name, +void Gui::ActiveObjectList::setObject(App::DocumentObject* obj, const char* name, const char *subname, const Gui::HighlightMode& mode) { auto it = _ObjectMap.find(name); @@ -132,8 +132,8 @@ void Gui::ActiveObjectList::setObject(App::DocumentObject* obj, const char* name auto info = getObjectInfo(obj,subname); if(!info.obj) { FC_ERR("Cannot set active object " - << obj->getFullName() << '.' << (subname?subname:"") - << " in document '" << _Doc->getDocument()->getName() + << obj->getFullName() << '.' << (subname?subname:"") + << " in document '" << _Doc->getDocument()->getName() << "'. Not found in current selection"); return; } @@ -142,7 +142,7 @@ void Gui::ActiveObjectList::setObject(App::DocumentObject* obj, const char* name setHighlight(info,mode,true); } -bool Gui::ActiveObjectList::hasObject(const char*name)const +bool Gui::ActiveObjectList::hasObject(const char*name)const { return _ObjectMap.find(name) != _ObjectMap.end(); } diff --git a/src/Gui/ActiveObjectList.h b/src/Gui/ActiveObjectList.h index d33f3e240d..2f43fbffee 100644 --- a/src/Gui/ActiveObjectList.h +++ b/src/Gui/ActiveObjectList.h @@ -44,7 +44,7 @@ namespace Gui * @see Gui::MDIViewer * @author Jürgen Riegel */ - class GuiExport ActiveObjectList + class GuiExport ActiveObjectList { public: ActiveObjectList(Document *doc) @@ -85,4 +85,4 @@ namespace Gui static const char PDBODYKEY[] = "pdbody"; static const char PARTKEY[] = "part"; -#endif +#endif diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 5757a328f7..b108d18115 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1089,7 +1089,7 @@ Gui::MDIView* Application::editViewOfNode(SoNode *node) const void Application::setEditDocument(Gui::Document *doc) { if(doc == d->editDocument) return; - if(!doc) + if(!doc) d->editDocument = 0; for(auto &v : d->documents) v.second->_resetEdit(); @@ -2504,7 +2504,7 @@ App::Document *Application::reopen(App::Document *doc) { WaitCursor wc; wc.setIgnoreEvents(WaitCursor::NoEvents); - if(doc->testStatus(App::Document::PartialDoc) + if(doc->testStatus(App::Document::PartialDoc) || doc->testStatus(App::Document::PartialRestore)) { App::GetApplication().openDocument(name.c_str()); diff --git a/src/Gui/ApplicationPy.cpp b/src/Gui/ApplicationPy.cpp index e81b89f648..c1e6ed3e2f 100644 --- a/src/Gui/ApplicationPy.cpp +++ b/src/Gui/ApplicationPy.cpp @@ -198,7 +198,7 @@ PyMethodDef Application::Methods[] = { {"getMarkerIndex", (PyCFunction) Application::sGetMarkerIndex, METH_VARARGS, "Get marker index according to marker size setting"}, - + {"addDocumentObserver", (PyCFunction) Application::sAddDocObserver, METH_VARARGS, "addDocumentObserver() -> None\n\n" "Add an observer to get notified about changes on documents."}, @@ -225,8 +225,8 @@ PyMethodDef Application::Methods[] = { PyObject* Gui::Application::sEditDocument(PyObject * /*self*/, PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception Document *pcDoc = Instance->editDocument(); if (pcDoc) { @@ -270,7 +270,7 @@ PyObject* Gui::Application::sActiveView(PyObject * /*self*/, PyObject *args) Gui::MDIView* mdiView = Instance->activeView(); if (mdiView && (type.isBad() || mdiView->isDerivedFrom(type))) { auto res = Py::asObject(mdiView->getPyObject()); - if(!res.isNone() || !type.isBad()) + if(!res.isNone() || !type.isBad()) return Py::new_reference_to(res); } @@ -899,11 +899,11 @@ PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args) // to be base class for all workbench classes Py::Module module("__main__"); Py::Object baseclass(module.getAttr(std::string("Workbench"))); - + // check whether it is an instance or class object Py::Object object(pcObject); Py::String name; - + if (PyObject_IsSubclass(object.ptr(), baseclass.ptr()) == 1) { // create an instance of this class name = object.getAttr(std::string("__name__")); @@ -928,7 +928,7 @@ PyObject* Application::sAddWorkbenchHandler(PyObject * /*self*/, PyObject *args) Py::Callable(object.getAttr(std::string("GetClassName"))); item = name.as_std_string("ascii"); - PyObject* wb = PyDict_GetItemString(Instance->_pcWorkbenchDictionary,item.c_str()); + PyObject* wb = PyDict_GetItemString(Instance->_pcWorkbenchDictionary,item.c_str()); if (wb) { PyErr_Format(PyExc_KeyError, "'%s' already exists.", item.c_str()); return NULL; @@ -951,7 +951,7 @@ PyObject* Application::sRemoveWorkbenchHandler(PyObject * /*self*/, PyObject *ar if (!PyArg_ParseTuple(args, "s", &psKey)) return NULL; - PyObject* wb = PyDict_GetItemString(Instance->_pcWorkbenchDictionary,psKey); + PyObject* wb = PyDict_GetItemString(Instance->_pcWorkbenchDictionary,psKey); if (!wb) { PyErr_Format(PyExc_KeyError, "No such workbench '%s'", psKey); return NULL; @@ -970,7 +970,7 @@ PyObject* Application::sGetWorkbenchHandler(PyObject * /*self*/, PyObject *args) char* psKey; if (!PyArg_ParseTuple(args, "s", &psKey)) return NULL; - + // get the python workbench object from the dictionary PyObject* pcWorkbench = PyDict_GetItemString(Instance->_pcWorkbenchDictionary, psKey); if (!pcWorkbench) { @@ -1078,7 +1078,7 @@ PyObject* Application::sAddIcon(PyObject * /*self*/, PyObject *args) const char *format = "XPM"; if (!PyArg_ParseTuple(args, "ss#|s", &iconName,&content,&size,&format)) return NULL; - + QPixmap icon; if (BitmapFactory().findPixmapInCache(iconName, icon)) { PyErr_SetString(PyExc_AssertionError, "Icon with this name already registered"); @@ -1109,7 +1109,7 @@ PyObject* Application::sGetIcon(PyObject * /*self*/, PyObject *args) char *iconName; if (!PyArg_ParseTuple(args, "s", &iconName)) return NULL; - + PythonWrapper wrap; wrap.loadGuiModule(); wrap.loadWidgetsModule(); @@ -1124,7 +1124,7 @@ PyObject* Application::sIsIconCached(PyObject * /*self*/, PyObject *args) char *iconName; if (!PyArg_ParseTuple(args, "s", &iconName)) return NULL; - + QPixmap icon; return Py::new_reference_to(Py::Boolean(BitmapFactory().findPixmapInCache(iconName, icon))); } @@ -1330,7 +1330,7 @@ PyObject* Application::sShowPreferences(PyObject * /*self*/, PyObject *args) if (!PyArg_ParseTuple(args, "|si", &pstr, &idx)) return NULL; Gui::Dialog::DlgPreferencesImp cDlg(getMainWindow()); - if (pstr) + if (pstr) cDlg.activateGroupPage(QString::fromUtf8(pstr),idx); WaitCursor wc; wc.restoreCursor(); diff --git a/src/Gui/Assistant.cpp b/src/Gui/Assistant.cpp index 20f6fb2f67..f903c7a28f 100644 --- a/src/Gui/Assistant.cpp +++ b/src/Gui/Assistant.cpp @@ -91,7 +91,7 @@ bool Assistant::startAssistant() QString app = QCoreApplication::applicationDirPath() + QDir::separator(); #else QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator(); -#endif +#endif app += QLatin1String("assistant"); // get the name of the executable and the doc path diff --git a/src/Gui/AutoSaver.cpp b/src/Gui/AutoSaver.cpp index 899de87ba1..c39d9a7aab 100644 --- a/src/Gui/AutoSaver.cpp +++ b/src/Gui/AutoSaver.cpp @@ -77,7 +77,7 @@ AutoSaver* AutoSaver::instance() void AutoSaver::renameFile(QString dirName, QString file, QString tmpFile) { - FC_LOG("auto saver rename " << tmpFile.toUtf8().constData() + FC_LOG("auto saver rename " << tmpFile.toUtf8().constData() << " -> " << file.toUtf8().constData()); QDir dir(dirName); dir.remove(file); @@ -135,8 +135,8 @@ void AutoSaver::saveDocument(const std::string& name, AutoSaveProperty& saver) { Gui::WaitCursor wc; App::Document* doc = App::GetApplication().getDocument(name.c_str()); - if (doc && !doc->testStatus(App::Document::PartialDoc) - && !doc->testStatus(App::Document::TempDoc)) + if (doc && !doc->testStatus(App::Document::PartialDoc) + && !doc->testStatus(App::Document::TempDoc)) { // Set the document's current transient directory std::string dirName = doc->TransientDir.getValue(); @@ -175,7 +175,7 @@ void AutoSaver::saveDocument(const std::string& name, AutoSaveProperty& saver) if (!this->compressed) { RecoveryWriter writer(saver); - // We will be using thread pool if not compressed. + // We will be using thread pool if not compressed. // So, always force binary format because ASCII // is not reentrant. See PropertyPartShape::SaveDocFile writer.setMode("BinaryBrep"); @@ -347,8 +347,8 @@ public: // still chance of crash when we deleted the original and before rename // the new file. So we ask the main thread to do it. There is still // possibility of crash caused by thread other than the main, but - // that's the best we can do for now. - QMetaObject::invokeMethod(AutoSaver::instance(), "renameFile", + // that's the best we can do for now. + QMetaObject::invokeMethod(AutoSaver::instance(), "renameFile", Qt::QueuedConnection, Q_ARG(QString,dirName) ,Q_ARG(QString,fileName),Q_ARG(QString,tmpName)); } diff --git a/src/Gui/AxisOrigin.cpp b/src/Gui/AxisOrigin.cpp index dbb4aa98a4..82b54667f7 100644 --- a/src/Gui/AxisOrigin.cpp +++ b/src/Gui/AxisOrigin.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2019 Zheng, Lei (realthunder) * + * Copyright (c) 2019 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/AxisOrigin.h b/src/Gui/AxisOrigin.h index 0ad2034133..33111e0208 100644 --- a/src/Gui/AxisOrigin.h +++ b/src/Gui/AxisOrigin.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2019 Zheng, Lei (realthunder) * + * Copyright (c) 2019 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -45,7 +45,7 @@ public: /// Get origin point size float getPointSize() const { return pointSize; } - + /// Set the axis line length void setAxisLength(float size); @@ -71,7 +71,7 @@ public: * XZ: XY plane, YZ: YZ plane * * There are default labels for all components. You can also use - * this function to choose which components are hidden, by not + * this function to choose which components are hidden, by not * include the key in the input labels. */ void setLabels(const std::map &labels); diff --git a/src/Gui/AxisOriginPyImp.cpp b/src/Gui/AxisOriginPyImp.cpp index 068e5bb189..824cee7e57 100644 --- a/src/Gui/AxisOriginPyImp.cpp +++ b/src/Gui/AxisOriginPyImp.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2019 Zheng, Lei (realthunder) * + * Copyright (c) 2019 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -57,7 +57,7 @@ PyObject* AxisOriginPy::getElementPicked(PyObject* args) void *ptr = 0; Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPickedPoint", obj, &ptr, 0); SoPickedPoint *pp = reinterpret_cast(ptr); - if(!pp) + if(!pp) throw Base::TypeError("type must be of coin.SoPickedPoint"); std::string name; if(!getAxisOriginPtr()->getElementPicked(pp,name)) @@ -74,7 +74,7 @@ PyObject* AxisOriginPy::getDetailPath(PyObject* args) void *ptr = 0; Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPath", path, &ptr, 0); SoPath *pPath = reinterpret_cast(ptr); - if(!pPath) + if(!pPath) throw Base::TypeError("type must be of coin.SoPath"); SoDetail *det = 0; if(!getAxisOriginPtr()->getDetailPath( @@ -166,5 +166,5 @@ PyObject *AxisOriginPy::getCustomAttributes(const char* /*attr*/) const int AxisOriginPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Gui/BitmapFactory.h b/src/Gui/BitmapFactory.h index aa089fd9c4..d4b2e9d003 100644 --- a/src/Gui/BitmapFactory.h +++ b/src/Gui/BitmapFactory.h @@ -77,7 +77,7 @@ public: QPixmap pixmap(const char* name) const; /** Retrieves a pixmap by name and size created by an * scalable vector graphics (SVG). - * + * * @param colorMapping - a dictionary of substitute colors. * Can be used to customize icon color scheme, e.g. crosshair color */ diff --git a/src/Gui/BlenderNavigationStyle.cpp b/src/Gui/BlenderNavigationStyle.cpp index 2d69e52111..f556b4b137 100644 --- a/src/Gui/BlenderNavigationStyle.cpp +++ b/src/Gui/BlenderNavigationStyle.cpp @@ -221,8 +221,8 @@ SbBool BlenderNavigationStyle::processSoEvent(const SoEvent * const ev) this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise - // the canvas doesn't get any release events - if (this->currentmode != NavigationStyle::ZOOMING && + // the canvas doesn't get any release events + if (this->currentmode != NavigationStyle::ZOOMING && this->currentmode != NavigationStyle::PANNING && this->currentmode != NavigationStyle::DRAGGING) { if (this->isPopupMenuEnabled()) { diff --git a/src/Gui/Clipping.cpp b/src/Gui/Clipping.cpp index e2bdff30b2..1ee10b8a09 100644 --- a/src/Gui/Clipping.cpp +++ b/src/Gui/Clipping.cpp @@ -89,7 +89,7 @@ public: } static void moveCallback(void * data, SoSensor * sensor) { - Q_UNUSED(sensor); + Q_UNUSED(sensor); Private* self = reinterpret_cast(data); if (self->view) { Gui::View3DInventorViewer* view = self->view->getViewer(); diff --git a/src/Gui/CoinRiftWidget.cpp b/src/Gui/CoinRiftWidget.cpp index 174e290130..698362390c 100644 --- a/src/Gui/CoinRiftWidget.cpp +++ b/src/Gui/CoinRiftWidget.cpp @@ -67,7 +67,7 @@ CoinRiftWidget::CoinRiftWidget() : QGLWidget() if (!ovrHmd_ConfigureTracking (hmd, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | - ovrTrackingCap_Position, + ovrTrackingCap_Position, ovrTrackingCap_Orientation | ovrTrackingCap_MagYawCorrection | ovrTrackingCap_Position @@ -98,8 +98,8 @@ CoinRiftWidget::CoinRiftWidget() : QGLWidget() m_sceneManager->setBackgroundColor(SbColor(.0f, .0f, .8f)); #endif basePosition = SbVec3f(0.0f, 0.0f, -2.0f); - - // light handling + + // light handling SoDirectionalLight *light = new SoDirectionalLight(); light->direction.setValue(1,-1,-1); @@ -118,7 +118,7 @@ CoinRiftWidget::CoinRiftWidget() : QGLWidget() camera[eye]->focalDistance.setValue(5.0f); camera[eye]->viewportMapping.setValue(SoCamera::LEAVE_ALONE); rootScene[eye]->addChild(camera[eye]); - rootScene[eye]->addChild(light); + rootScene[eye]->addChild(light); rootScene[eye]->addChild(light2); rootScene[eye]->addChild(scene); } @@ -163,11 +163,11 @@ CoinRiftWidget::CoinRiftWidget() : QGLWidget() DistortionCaps |= ovrDistortionCap_HqDistortion; bool VSyncEnabled(false); // TODO This is a guess. - if (!ovrHmd_ConfigureRendering( hmd, - &cfg.Config, + if (!ovrHmd_ConfigureRendering( hmd, + &cfg.Config, /*(VSyncEnabled ? 0 : ovrHmdCap_NoVSync),*/ - DistortionCaps, - hmd->DefaultEyeFov,//eyes, + DistortionCaps, + hmd->DefaultEyeFov,//eyes, eyeRenderDesc)) { qDebug() << "Could not configure OVR rendering."; throw; @@ -315,7 +315,7 @@ void CoinRiftWidget::initializeGL() void CoinRiftWidget::paintGL() -{ +{ const int ms(1000 / 75 /*fps*/); QTimer::singleShot(ms, this, SLOT(updateGL())); @@ -396,8 +396,8 @@ void CoinRiftWidget::paintGL() //camera[eye]->position.setValue(originalPosition); } - - // Submit the texture for distortion. + + // Submit the texture for distortion. ovrHmd_EndFrame(hmd, eyePose, eyeTexture); // Swap buffers. @@ -438,7 +438,7 @@ void CoinRiftWidget::handlingSafetyWarning(void) // } //} } - + } diff --git a/src/Gui/CoinRiftWidget.h b/src/Gui/CoinRiftWidget.h index 27655405f9..2664ca9cdc 100644 --- a/src/Gui/CoinRiftWidget.h +++ b/src/Gui/CoinRiftWidget.h @@ -36,7 +36,7 @@ #if BUILD_VR -// defines which method to use to render +// defines which method to use to render #define USE_SO_OFFSCREEN_RENDERER //#define USE_FRAMEBUFFER @@ -84,7 +84,7 @@ class CoinRiftWidget : public QGLWidget GLuint frameBufferID[2], depthBufferID[2]; // A SoSceneManager has a SoRenderManager to do the rendering -- should we not use SoRenderManager instead? // We are probably not that interested in events. SoSceneManager::setSceneGraph() searches for the camera - // and sets it in SoRenderManager, but its is actually only used for built-in stereo rendering. + // and sets it in SoRenderManager, but its is actually only used for built-in stereo rendering. // FIXME: We should probably eliminate that search... SoSceneManager *m_sceneManager; #endif diff --git a/src/Gui/ComboView.cpp b/src/Gui/ComboView.cpp index 4b50014c7e..29fda97079 100644 --- a/src/Gui/ComboView.cpp +++ b/src/Gui/ComboView.cpp @@ -52,7 +52,7 @@ ComboView::ComboView(bool showModel, Gui::Document* pcDocument, QWidget *parent) { setWindowTitle(tr("Combo View")); - QGridLayout* pLayout = new QGridLayout(this); + QGridLayout* pLayout = new QGridLayout(this); pLayout->setSpacing( 0 ); pLayout->setMargin ( 0 ); diff --git a/src/Gui/ComboView.h b/src/Gui/ComboView.h index e4385fc776..9ded1fa9dc 100644 --- a/src/Gui/ComboView.h +++ b/src/Gui/ComboView.h @@ -58,7 +58,7 @@ namespace Gui { namespace DockWnd { /** Combo View - * is a combination of a tree, property and TaskPanel for + * is a combination of a tree, property and TaskPanel for * integrated user action. */ class GuiExport ComboView : public Gui::DockWindow diff --git a/src/Gui/Command.cpp b/src/Gui/Command.cpp index 24efce7665..983f423b6d 100644 --- a/src/Gui/Command.cpp +++ b/src/Gui/Command.cpp @@ -93,9 +93,9 @@ using namespace Gui::DockWnd; * * \section wayout Way out * To solve these problems we have introduced the command framework to decouple QAction and MainWindow. The base classes of the framework are - * \a Gui::CommandBase and \a Gui::Action that represent the link between Qt's QAction world and the FreeCAD's command world. + * \a Gui::CommandBase and \a Gui::Action that represent the link between Qt's QAction world and the FreeCAD's command world. * - * The Action class holds a pointer to QAction and CommandBase and acts as a mediator and -- to save memory -- that gets created + * The Action class holds a pointer to QAction and CommandBase and acts as a mediator and -- to save memory -- that gets created * (@ref Gui::CommandBase::createAction()) not before it is added (@ref Gui::Command::addTo()) to a menu or toolbar. * * Now, the implementation of the slots of MainWindow can be done in the method \a activated() of subclasses of Command instead. @@ -482,7 +482,7 @@ void Command::testActive(void) } if (!(eType & ForEdit)) { // special case for commands which are only in some edit modes active - + if ((!Gui::Control().isAllowedAlterDocument() && eType & AlterDoc) || (!Gui::Control().isAllowedAlterView() && eType & Alter3DView) || (!Gui::Control().isAllowedAlterSelection() && eType & AlterSelection)) { @@ -542,8 +542,8 @@ std::string Command::getUniqueObjectName(const char *BaseName, const App::Docume return doc->getUniqueObjectName(BaseName); } -std::string Command::getObjectCmd(const char *Name, const App::Document *doc, - const char *prefix, const char *postfix, bool gui) +std::string Command::getObjectCmd(const char *Name, const App::Document *doc, + const char *prefix, const char *postfix, bool gui) { if(!doc) doc = App::GetApplication().getActiveDocument(); if(!doc || !Name) @@ -551,7 +551,7 @@ std::string Command::getObjectCmd(const char *Name, const App::Document *doc, std::ostringstream str; if(prefix) str << prefix; - str << (gui?"Gui":"App") << ".getDocument('" << doc->getName() + str << (gui?"Gui":"App") << ".getDocument('" << doc->getName() << "').getObject('" << Name << "')"; if(postfix) str << postfix; @@ -559,7 +559,7 @@ std::string Command::getObjectCmd(const char *Name, const App::Document *doc, } std::string Command::getObjectCmd(const App::DocumentObject *obj, - const char *prefix, const char *postfix, bool gui) + const char *prefix, const char *postfix, bool gui) { if(!obj || !obj->getNameInDocument()) return std::string("None"); @@ -651,7 +651,7 @@ void Command::printPyCaller() { if(!FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) return; PyFrameObject* frame = PyEval_GetFrame(); - if(!frame) + if(!frame) return; int line = PyFrame_GetLineNumber(frame); #if PY_MAJOR_VERSION >= 3 @@ -663,7 +663,7 @@ void Command::printPyCaller() { } void Command::printCaller(const char *file, int line) { - if(!FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) + if(!FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) return; std::ostringstream str; #ifdef FC_OS_WIN32 @@ -720,7 +720,7 @@ void Command::addModule(DoCmd_Type eType,const char* sModuleName) std::string Command::_assureWorkbench(const char *file, int line, const char * sName) { - // check if the WB is already open? + // check if the WB is already open? std::string actName = WorkbenchManager::instance()->active()->name(); // if yes, do nothing if(actName == sName) @@ -1039,7 +1039,7 @@ void GroupCommand::languageChange() { void GroupCommand::setup(Action *pcAction) { pcAction->setText(QCoreApplication::translate(className(), getMenuText())); - + int idx = pcAction->property("defaultAction").toInt(); if(idx>=0 && idx<(int)cmds.size() && cmds[idx].first) { auto cmd = cmds[idx].first; @@ -1083,7 +1083,7 @@ MacroCommand::~MacroCommand() void MacroCommand::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QDir d; if (!systemMacro) { @@ -1099,7 +1099,7 @@ void MacroCommand::activated(int iMsg) QString dirstr = QString::fromUtf8(App::GetApplication().getHomePath()) + QString::fromUtf8("Macro"); d = QDir(dirstr); } - + QFileInfo fi(d, QString::fromUtf8(sScriptName)); if (!fi.exists()) { QMessageBox::critical(Gui::getMainWindow(), diff --git a/src/Gui/Command.h b/src/Gui/Command.h index 7b637075cf..c3c76fc39c 100644 --- a/src/Gui/Command.h +++ b/src/Gui/Command.h @@ -40,7 +40,7 @@ * @param _doc: pointer to a document * @param _cmd: command string, streamable * - * Example: + * Example: * @code{.cpp} * _FCMD_DOC_CMD(Gui,doc,"getObject('" << objName << "')"); * @endcode @@ -96,7 +96,7 @@ * @param _obj: pointer to a DocumentObject * @param _cmd: command string, streamable * - * Example: + * Example: * @code{.cpp} * _FCMD_OBJ_CMD(Gui,obj,"Visibility = " << (visible?"True":"False")); * @endcode @@ -135,7 +135,7 @@ * @param _cmd: command string, supporting printf like formatter * @param _obj: pointer to a DocumentObject * - * Example: + * Example: * @code{.cpp} * FCMD_OBJ_CMD2("Visibility = %s", obj, visible?"True":"False"); * @endcode @@ -252,7 +252,7 @@ protected: virtual Action * createAction(void); public: - /// Reassigns QAction stuff after the language has changed. + /// Reassigns QAction stuff after the language has changed. virtual void languageChange() = 0; /// Updates the QAction with respect to the passed mode. virtual void updateAction(int mode) = 0; @@ -338,7 +338,7 @@ public: /// CommandManager is a friend friend class CommandManager; /// Override this method if your Cmd is not always active - virtual bool isActive(void){return true;} + virtual bool isActive(void){return true;} /// Get somtile called to check the state of the command void testActive(void); /// Enables or disables the command @@ -361,7 +361,7 @@ public: * checkable state. * @param trigger: indicate the command triggering source, see TriggerSource. */ - void invoke (int index, TriggerSource trigger=TriggerNone); + void invoke (int index, TriggerSource trigger=TriggerNone); /// adds this command to arbitrary widgets void addTo(QWidget *); void addToGroup(ActionGroup *, bool checkable); @@ -372,8 +372,8 @@ public: /** @name Helper methods to get important classes */ //@{ /// Get pointer to the Application Window - static Application* getGuiApplication(void); - /// Get a reference to the selection + static Application* getGuiApplication(void); + /// Get a reference to the selection static Gui::SelectionSingleton& getSelection(void); /// Get pointer to the active gui document Gui::Document* getActiveGuiDocument(void) const; @@ -388,12 +388,12 @@ public: /// returns the named feature or the active one from the active document or NULL App::DocumentObject* getObject(const char* Name) const; /// returns a python command string to retrieve an object from a document - static std::string getObjectCmd(const char *Name, const App::Document *doc=0, + static std::string getObjectCmd(const char *Name, const App::Document *doc=0, const char *prefix=0, const char *postfix=0, bool gui=false); /// returns a python command string to retrieve the given object - static std::string getObjectCmd(const App::DocumentObject *obj, + static std::string getObjectCmd(const App::DocumentObject *obj, const char *prefix=0, const char *postfix=0, bool gui=false); - /** Get unique Feature name from the active document + /** Get unique Feature name from the active document * * @param BaseName: the base name * @param obj: if not zero, then request the unique name in the document of @@ -475,7 +475,7 @@ public: #define runCommand(_type,_cmd) _runCommand(__FILE__,__LINE__,_type,_cmd) /** Run a command - * + * * @param file: the calling file path (for debugging purpose) * @param line: the calling line number (for debugging purpose) * @param eType: command type, See DoCmd_Type @@ -486,7 +486,7 @@ public: static void _runCommand(const char *file, int line, DoCmd_Type eType,const char* sCmd); /** Run a command - * + * * @param file: the calling file path (for debugging purpose) * @param line: the calling line number (for debugging purpose) * @param eType: command type, See DoCmd_Type @@ -496,7 +496,7 @@ public: */ static void _runCommand(const char *file, int line, DoCmd_Type eType,const QByteArray& sCmd); - /// import an external (or own) module only once + /// import an external (or own) module only once static void addModule(DoCmd_Type eType,const char* sModuleName); /** Convenience macro to assure the switch to a certain workbench @@ -517,7 +517,7 @@ public: */ static std::string _assureWorkbench(const char *file, int line, const char * sName); //@} - + /** @name Methods for copying visiual properties */ //@{ /// Convenience macro to copy visual properties @@ -528,7 +528,7 @@ public: static void _copyVisual(const char *file, int line, const App::DocumentObject *to, const char *attr_to, const App::DocumentObject *from, const char *attr_from); //@} - /// Get Python tuple from object and sub-elements + /// Get Python tuple from object and sub-elements static std::string getPythonTuple(const std::string& name, const std::vector& subnames); /// translate a string to a python string literal (needed e.g. in file names for windows...) const std::string strToPython(const char* Str); @@ -565,8 +565,8 @@ public: const char* getGroupName() const { return sGroup; } void setGroupName(const char*); //@} - - + + /** @name arbitrary helper methods */ //@{ void adjustCameraPosition(); @@ -593,9 +593,9 @@ protected: NoTransaction = 16, /**< Do not setup auto transaction */ }; - /** @name Attributes - * Set by the inherited constructor to set up the most important properties - * of the command. In the Command constructor are set default values! + /** @name Attributes + * Set by the inherited constructor to set up the most important properties + * of the command. In the Command constructor are set default values! * The real values should be set in the constructor of the inhereting class. */ //@{ @@ -649,9 +649,9 @@ protected: }; /** The Python command class - * This is a special type of command class. It's used to bind a Python command class into the + * This is a special type of command class. It's used to bind a Python command class into the * FreeCAD command framework. - * An object of this class gets a reference to the Python command object and manages all the + * An object of this class gets a reference to the Python command object and manages all the * passing between the C++ and the Python world. This includes everything like setting resources such as * bitmaps, activation or bindings to the user interface. * @see CommandManager @@ -679,7 +679,7 @@ protected: public: /** @name Methods to get the properties of the command */ //@{ - /// Reassigns QAction stuff after the language has changed. + /// Reassigns QAction stuff after the language has changed. void languageChange(); const char* className() const { return "PythonCommand"; } @@ -730,7 +730,7 @@ protected: public: /** @name Methods to get the properties of the command */ //@{ - /// Reassigns QAction stuff after the language has changed. + /// Reassigns QAction stuff after the language has changed. void languageChange(); const char* className() const { return "PythonGroupCommand"; } @@ -755,7 +755,7 @@ protected: /** The script command class - * This is a special type of command class. Its used to bind a macro or Python script to the + * This is a special type of command class. Its used to bind a macro or Python script to the * FreeCAD command framework. * An object of this class gets a string to the place where the script is in the file system. * Unlike the other commands the resources can be set by several methods. @@ -781,11 +781,11 @@ protected: public: /// Returns the script name const char* getScriptName () const { return sScriptName; } - /// Ignore when language has changed. + /// Ignore when language has changed. void languageChange() {} const char* className() const { return "Gui::MacroCommand"; } - + /** @name Methods to set the properties of the Script Command */ //@{ /// Sets the script name @@ -806,10 +806,10 @@ protected: }; /** The CommandManager class - * This class manage all available commands in FreeCAD. All + * This class manage all available commands in FreeCAD. All * Commands will registered here, also commands from Application * modules. Also activation / deactivation, Icons Tooltips and so - * on are handles here. Further the Building of Toolbars and (Context) + * on are handles here. Further the Building of Toolbars and (Context) * menus (connecting to a QAction) is done here. * @see Command * @author Jürgen Riegel @@ -830,7 +830,7 @@ public: bool addTo(const char* Name, QWidget* pcWidget); /** Returns all commands of a special App Module - * delivers a vector of all commands in the given application module. When no + * delivers a vector of all commands in the given application module. When no * name is given the standard commands (build in ) are returned. * @see Command */ diff --git a/src/Gui/CommandDoc.cpp b/src/Gui/CommandDoc.cpp index 08e57ccb2b..c2135aa292 100644 --- a/src/Gui/CommandDoc.cpp +++ b/src/Gui/CommandDoc.cpp @@ -565,7 +565,7 @@ StdCmdSaveAll::StdCmdSaveAll() void StdCmdSaveAll::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Gui::Document::saveAll(); } @@ -1050,7 +1050,7 @@ void StdCmdDuplicateSelection::activated(int iMsg) "To link to external objects, the document must be saved at least once.\n" "Do you want to save the document now?"), QMessageBox::Yes,QMessageBox::No); - if(ret == QMessageBox::Yes) + if(ret == QMessageBox::Yes) proceed = Application::Instance->getDocument(doc)->saveAs(); } if(proceed) { @@ -1220,8 +1220,8 @@ void StdCmdDelete::activated(int iMsg) bodyMessageStream << "\n"; } std::string thisDoc = pGuiDoc->getDocument()->getName(); - bodyMessageStream << qApp->translate("Std_Delete", - "These items are selected for deletion, but are not in the active document."); + bodyMessageStream << qApp->translate("Std_Delete", + "These items are selected for deletion, but are not in the active document."); for (const auto ¤tLabel : inactiveLabels) bodyMessageStream << currentLabel << " / " << Base::Tools::fromStdString(thisDoc) << '\n'; } @@ -1620,7 +1620,7 @@ protected: << " (" << obj->Label.getValue() << ')' << std::endl; ss << "##@@"; if(v.second->comment.size()) { - if(v.second->comment[0] == '&' + if(v.second->comment[0] == '&' || v.second->comment.find('\n') != std::string::npos || v.second->comment.find('\r') != std::string::npos) { @@ -1641,7 +1641,7 @@ protected: } void pasteExpressions() { - std::map > > exprs; bool failed = false; diff --git a/src/Gui/CommandFeat.cpp b/src/Gui/CommandFeat.cpp index 52d0a5f859..008534ec76 100644 --- a/src/Gui/CommandFeat.cpp +++ b/src/Gui/CommandFeat.cpp @@ -58,7 +58,7 @@ StdCmdFeatRecompute::StdCmdFeatRecompute() void StdCmdFeatRecompute::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); } //=========================================================================== diff --git a/src/Gui/CommandLink.cpp b/src/Gui/CommandLink.cpp index 1e699caa55..0c28668474 100644 --- a/src/Gui/CommandLink.cpp +++ b/src/Gui/CommandLink.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2017 Zheng, Lei (realthunder) * + * Copyright (c) 2017 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -320,7 +320,7 @@ void StdCmdLinkMakeRelative::activated(int) { ss << "'" << s << "',"; ss << ']'; FCMD_DOC_CMD(doc,"addObject('App::Link','" << name << "').setLink(" - << getObjectCmd(key.first) << ",'" << key.second + << getObjectCmd(key.first) << ",'" << key.second << "'," << ss.str() << ")"); auto link = doc->getObject(name.c_str()); FCMD_OBJ_CMD(link,"LinkTransform = True"); @@ -547,7 +547,7 @@ StdCmdLinkImport::StdCmdLinkImport() sPixmap = "LinkImport"; } -static std::map > getLinkImportSelections() +static std::map > getLinkImportSelections() { std::map > objMap; for(auto &sel : Selection().getCompleteSelection(false)) { @@ -678,7 +678,7 @@ static App::DocumentObject *getSelectedLink(bool finalLink, std::string *subname if(obj->getDocument()!=sels[0].pObject->getDocument()) { if(finalLink) return sobj==obj?0:sobj; - if(subname) + if(subname) *subname = std::string(dot+1); return obj; } @@ -705,7 +705,7 @@ static App::DocumentObject *getSelectedLink(bool finalLink, std::string *subname for(auto &v : linked->getParents()) { if(v.first != sels[0].pObject) continue; - + const char *sub = v.second.c_str(); const char *dot = sub; for(const char *s=sels[0].SubName; *s && *sub==*s; ++s,++sub) { @@ -713,9 +713,9 @@ static App::DocumentObject *getSelectedLink(bool finalLink, std::string *subname dot = sub; } found = true; - if(dot-v.second.c_str() > pre_len - || (dot-v.second.c_str()==pre_len - && v.second.size() pre_len + || (dot-v.second.c_str()==pre_len + && v.second.size()macroManager()->commit(); } @@ -112,7 +112,7 @@ StdCmdDlgMacroExecute::StdCmdDlgMacroExecute() void StdCmdDlgMacroExecute::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Gui::Dialog::DlgMacroExecuteImp cDlg(getMainWindow()); cDlg.exec(); } @@ -142,7 +142,7 @@ StdCmdDlgMacroExecuteDirect::StdCmdDlgMacroExecuteDirect() void StdCmdDlgMacroExecuteDirect::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"Run\")"); } @@ -193,7 +193,7 @@ StdCmdMacroStartDebug::StdCmdMacroStartDebug() void StdCmdMacroStartDebug::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); PythonDebugger* dbg = Application::Instance->macroManager()->debugger(); if (!dbg->isRunning()) doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"StartDebug\")"); @@ -223,7 +223,7 @@ StdCmdMacroStopDebug::StdCmdMacroStopDebug() void StdCmdMacroStopDebug::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Application::Instance->macroManager()->debugger()->tryStop(); } @@ -250,7 +250,7 @@ StdCmdMacroStepOver::StdCmdMacroStepOver() void StdCmdMacroStepOver::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Application::Instance->macroManager()->debugger()->stepOver(); } @@ -277,7 +277,7 @@ StdCmdMacroStepInto::StdCmdMacroStepInto() void StdCmdMacroStepInto::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Application::Instance->macroManager()->debugger()->stepInto(); } @@ -304,7 +304,7 @@ StdCmdToggleBreakpoint::StdCmdToggleBreakpoint() void StdCmdToggleBreakpoint::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); doCommand(Command::Gui,"Gui.SendMsgToActiveView(\"ToggleBreakpoint\")"); } diff --git a/src/Gui/CommandStd.cpp b/src/Gui/CommandStd.cpp index 78bacd0173..d4b773fe21 100644 --- a/src/Gui/CommandStd.cpp +++ b/src/Gui/CommandStd.cpp @@ -106,11 +106,11 @@ void StdCmdWorkbench::activated(int i) int pos = rx.indexIn(msg); if (pos != -1) msg = msg.mid(rx.matchedLength()); - QMessageBox::critical(getMainWindow(), QObject::tr("Cannot load workbench"), msg); + QMessageBox::critical(getMainWindow(), QObject::tr("Cannot load workbench"), msg); } catch(...) { - QMessageBox::critical(getMainWindow(), QObject::tr("Cannot load workbench"), - QObject::tr("A general error occurred while loading the workbench")); + QMessageBox::critical(getMainWindow(), QObject::tr("Cannot load workbench"), + QObject::tr("A general error occurred while loading the workbench")); } } @@ -264,7 +264,7 @@ bool StdCmdAbout::isActive() */ void StdCmdAbout::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); const Gui::Dialog::AboutDialogFactory* f = Gui::Dialog::AboutDialogFactory::defaultFactory(); boost::scoped_ptr dlg(f->create(getMainWindow())); dlg->exec(); @@ -302,7 +302,7 @@ StdCmdAboutQt::StdCmdAboutQt() void StdCmdAboutQt::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); qApp->aboutQt(); } @@ -326,7 +326,7 @@ StdCmdWhatsThis::StdCmdWhatsThis() void StdCmdWhatsThis::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QWhatsThis::enterWhatsThisMode(); } @@ -349,7 +349,7 @@ StdCmdDlgParameter::StdCmdDlgParameter() void StdCmdDlgParameter::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Gui::Dialog::DlgParameterImp cDlg(getMainWindow()); cDlg.resize(QSize(800, 600)); cDlg.exec(); @@ -381,7 +381,7 @@ Action * StdCmdDlgPreferences::createAction(void) void StdCmdDlgPreferences::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Gui::Dialog::DlgPreferencesImp cDlg(getMainWindow()); cDlg.exec(); } @@ -405,7 +405,7 @@ StdCmdDlgCustomize::StdCmdDlgCustomize() void StdCmdDlgCustomize::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); static QPointer dlg = 0; if (!dlg) dlg = new Gui::Dialog::DlgCustomizeImp(getMainWindow()); @@ -432,7 +432,7 @@ StdCmdCommandLine::StdCmdCommandLine() void StdCmdCommandLine::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); bool show = getMainWindow()->isMaximized (); // pop up the Gui command window @@ -481,7 +481,7 @@ StdCmdOnlineHelp::StdCmdOnlineHelp() void StdCmdOnlineHelp::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Gui::getMainWindow()->showDocumentation(QString::fromLatin1("Online_Help_Startpage")); } @@ -504,7 +504,7 @@ StdCmdOnlineHelpWebsite::StdCmdOnlineHelpWebsite() void StdCmdOnlineHelpWebsite::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); std::string defaulturl = QCoreApplication::translate(this->className(),"http://www.freecadweb.org/wiki/Online_Help_Toc").toStdString(); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites"); std::string url = hURLGrp->GetASCII("OnlineHelp", defaulturl.c_str()); @@ -532,7 +532,7 @@ StdCmdFreeCADWebsite::StdCmdFreeCADWebsite() void StdCmdFreeCADWebsite::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); std::string defaulturl = QCoreApplication::translate(this->className(),"http://www.freecadweb.org").toStdString(); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites"); std::string url = hURLGrp->GetASCII("WebPage", defaulturl.c_str()); @@ -560,7 +560,7 @@ StdCmdFreeCADUserHub::StdCmdFreeCADUserHub() void StdCmdFreeCADUserHub::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); std::string defaulturl = QCoreApplication::translate(this->className(),"http://www.freecadweb.org/wiki/User_hub").toStdString(); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites"); std::string url = hURLGrp->GetASCII("Documentation", defaulturl.c_str()); @@ -588,7 +588,7 @@ StdCmdFreeCADPowerUserHub::StdCmdFreeCADPowerUserHub() void StdCmdFreeCADPowerUserHub::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); std::string defaulturl = QCoreApplication::translate(this->className(),"http://www.freecadweb.org/wiki/Power_users_hub").toStdString(); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites"); std::string url = hURLGrp->GetASCII("PowerUsers", defaulturl.c_str()); @@ -616,7 +616,7 @@ StdCmdFreeCADForum::StdCmdFreeCADForum() void StdCmdFreeCADForum::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); std::string defaulturl = QCoreApplication::translate(this->className(),"http://forum.freecadweb.org").toStdString(); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites"); std::string url = hURLGrp->GetASCII("UserForum", defaulturl.c_str()); @@ -644,7 +644,7 @@ StdCmdFreeCADFAQ::StdCmdFreeCADFAQ() void StdCmdFreeCADFAQ::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); std::string defaulturl = QCoreApplication::translate(this->className(),"http://www.freecadweb.org/wiki/FAQ").toStdString(); ParameterGrp::handle hURLGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Websites"); std::string url = hURLGrp->GetASCII("FAQ", defaulturl.c_str()); @@ -672,7 +672,7 @@ StdCmdPythonWebsite::StdCmdPythonWebsite() void StdCmdPythonWebsite::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); OpenURLInBrowser("http://python.org"); } @@ -696,9 +696,9 @@ StdCmdMeasurementSimple::StdCmdMeasurementSimple() void StdCmdMeasurementSimple::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); unsigned int n = getSelection().countObjectsOfType(App::DocumentObject::getClassTypeId()); - + if (n == 1) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Only one object selected. Please select two objects.\n" @@ -786,7 +786,7 @@ StdCmdUnitsCalculator::StdCmdUnitsCalculator() void StdCmdUnitsCalculator::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Gui::Dialog::DlgUnitsCalculator *dlg = new Gui::Dialog::DlgUnitsCalculator( getMainWindow() ); dlg->show(); } diff --git a/src/Gui/CommandT.h b/src/Gui/CommandT.h index 4de1b06a91..ee29102d9f 100644 --- a/src/Gui/CommandT.h +++ b/src/Gui/CommandT.h @@ -65,7 +65,7 @@ public: * @param mod: module name, "Gui" or "App" * @param cmd: command string, streamable * - * Example: + * Example: * @code{.cpp} * _cmdDocument(Gui::Command::Gui, doc, "Gui", std::stringstream() << "getObject('" << objName << "')"); * @endcode @@ -93,7 +93,7 @@ void _cmdDocument(Gui::Command::DoCmd_Type cmdType, const App::Document* doc, co * @param cmd: command string, streamable * @sa _cmdDocument() * - * Example: + * Example: * @code{.cpp} * cmdAppDocument(doc, std::stringstream() << "getObject('" << objName << "')"); * @endcode @@ -115,7 +115,7 @@ inline void cmdAppDocument(const App::Document* doc, T&& cmd) { * @param cmd: command string, streamable * @sa _cmdDocument() * - * Example: + * Example: * @code{.cpp} * cmdGuiDocument(doc, std::stringstream() << "getObject('" << objName << "')"); * @endcode @@ -169,7 +169,7 @@ inline void cmdGuiDocument(const App::DocumentObject* obj, T&& cmd) { * @param mod: module name, "Gui" or "App" * @param cmd: command string, streamable * - * Example: + * Example: * @code{.cpp} * _cmdObject(Command::Gui,obj,"Gui", "Visibility = " << (visible?"True":"False")); * @endcode @@ -245,7 +245,7 @@ inline void cmdSetEdit(const App::DocumentObject* obj) { * @param cmd: command string, supporting printf like formatter * @param obj: pointer to a DocumentObject * - * Example: + * Example: * @code{.cpp} * cmdAppObjectArgs(obj, "Visibility = %s", visible ? "True" : "False"); * @endcode @@ -304,7 +304,7 @@ void cmdGuiObjectArgs(const App::DocumentObject* obj, const std::string& cmd, Ar * @param cmdType: command type * @param cmd: command string, supporting printf like formatter * - * Example: + * Example: * @code{.cpp} * doCommandT(Gui::Command::Gui, "Gui.getDocument(%s).getObject(%s).Visibility = %s", "DocName", "ObjName", visible?"True":"False"); * @endcode diff --git a/src/Gui/CommandTest.cpp b/src/Gui/CommandTest.cpp index db7cc6ee7e..032635011e 100644 --- a/src/Gui/CommandTest.cpp +++ b/src/Gui/CommandTest.cpp @@ -70,7 +70,7 @@ Std_TestQM::Std_TestQM() void Std_TestQM::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QStringList files = QFileDialog::getOpenFileNames(getMainWindow(), QString::fromLatin1("Test translation"), QString(), QString::fromLatin1("Translation (*.qm)")); @@ -108,7 +108,7 @@ Std_TestReloadQM::Std_TestReloadQM() void Std_TestReloadQM::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Translator::instance()->activateLanguage(Translator::instance()->activeLanguage().c_str()); } @@ -131,7 +131,7 @@ FCCmdTest1::FCCmdTest1() void FCCmdTest1::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); } bool FCCmdTest1::isActive(void) @@ -159,7 +159,7 @@ FCCmdTest2::FCCmdTest2() void FCCmdTest2::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); } bool FCCmdTest2::isActive(void) @@ -185,7 +185,7 @@ FCCmdTest3::FCCmdTest3() void FCCmdTest3::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); App::Document *pcDoc = getDocument(); if (!pcDoc) return; } @@ -215,7 +215,7 @@ FCCmdTest4::FCCmdTest4() void FCCmdTest4::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); App::Document *pcDoc = getDocument(); if(!pcDoc) return; } @@ -244,7 +244,7 @@ FCCmdTest5::FCCmdTest5() void FCCmdTest5::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); App::Document *pcDoc = getDocument(); if(!pcDoc) return; } @@ -273,7 +273,7 @@ FCCmdTest6::FCCmdTest6() void FCCmdTest6::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); App::Document *pcDoc = getDocument(); if(!pcDoc) return; } @@ -350,7 +350,7 @@ CmdTestProgress1::CmdTestProgress1() void CmdTestProgress1::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QMutex mutex; QMutexLocker ml(&mutex); try @@ -392,7 +392,7 @@ CmdTestProgress2::CmdTestProgress2() void CmdTestProgress2::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QMutex mutex; QMutexLocker ml(&mutex); @@ -435,10 +435,10 @@ CmdTestProgress3::CmdTestProgress3() void CmdTestProgress3::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QMutex mutex; QMutexLocker ml(&mutex); - + try { // level 1 @@ -505,7 +505,7 @@ CmdTestProgress4::CmdTestProgress4() void CmdTestProgress4::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QMutex mutex; QMutexLocker ml(&mutex); @@ -571,7 +571,7 @@ public: { QMutex mutex; QMutexLocker ml(&mutex); - + try { Base::SequencerLauncher seq("Starting progress bar in thread", steps); @@ -596,7 +596,7 @@ private: void CmdTestProgress5::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QEventLoop loop; BarThread* thr1 = new BarThread(2000); @@ -639,7 +639,7 @@ CmdTestMDI1::CmdTestMDI1() void CmdTestMDI1::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); MDIView* mdi = getMainWindow()->activeWindow(); getMainWindow()->removeWindow(mdi); } @@ -663,7 +663,7 @@ CmdTestMDI2::CmdTestMDI2() void CmdTestMDI2::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QMdiArea* area = getMainWindow()->findChild(); if (area) { MDIView* mdi = getMainWindow()->activeWindow(); @@ -691,11 +691,11 @@ CmdTestMDI3::CmdTestMDI3() void CmdTestMDI3::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); MDIView* mdi = getMainWindow()->activeWindow(); getMainWindow()->removeWindow(mdi); mdi->setParent(0, Qt::Window | Qt::WindowTitleHint | - Qt::WindowSystemMenuHint | + Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); mdi->show(); } @@ -790,7 +790,7 @@ public: void CmdTestConsoleOutput::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); TestConsoleObserver obs; Base::Console().AttachObserver(&obs); QThreadPool::globalInstance()->start(new ConsoleMessageTask); diff --git a/src/Gui/CommandView.cpp b/src/Gui/CommandView.cpp index 8f593e4ae2..207c38d5ee 100644 --- a/src/Gui/CommandView.cpp +++ b/src/Gui/CommandView.cpp @@ -609,7 +609,7 @@ Gui::Action * StdCmdDrawStyle::createAction(void) a1->setCheckable(true); a1->setIcon(BitmapFactory().iconFromTheme("DrawStylePoints")); a1->setObjectName(QString::fromLatin1("Std_DrawStylePoints")); - a1->setShortcut(QKeySequence(QString::fromUtf8("V,2"))); + a1->setShortcut(QKeySequence(QString::fromUtf8("V,2"))); a1->setWhatsThis(QString::fromLatin1(sWhatsThis)); QAction* a2 = pcAction->addAction(QString()); a2->setCheckable(true); @@ -732,7 +732,7 @@ void StdCmdDrawStyle::updateIcon(const MDIView *view) { actionGroup->setCheckedAction(5); return; - } + } if (mode == "Flat Lines") { actionGroup->setCheckedAction(6); @@ -811,7 +811,7 @@ StdCmdToggleVisibility::StdCmdToggleVisibility() void StdCmdToggleVisibility::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Selection().setVisible(SelectionSingleton::VisToggle); } @@ -885,7 +885,7 @@ StdCmdShowSelection::StdCmdShowSelection() void StdCmdShowSelection::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Selection().setVisible(SelectionSingleton::VisShow); } @@ -912,7 +912,7 @@ StdCmdHideSelection::StdCmdHideSelection() void StdCmdHideSelection::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Selection().setVisible(SelectionSingleton::VisHide); } @@ -2554,14 +2554,14 @@ static std::vector getBoxSelection( // check if both two boundary points are inside polygon, only // valid since we know the given polygon is a box. - if(polygon.Contains(Base::Vector2d(bbox.MinX,bbox.MinY)) && - polygon.Contains(Base::Vector2d(bbox.MaxX,bbox.MaxY))) + if(polygon.Contains(Base::Vector2d(bbox.MinX,bbox.MinY)) && + polygon.Contains(Base::Vector2d(bbox.MaxX,bbox.MaxY))) { ret.emplace_back(""); return ret; } - if(!bbox.Intersect(polygon)) + if(!bbox.Intersect(polygon)) return ret; const auto &subs = obj->getSubObjects(App::DocumentObject::GS_SELECT); @@ -2630,7 +2630,7 @@ static std::vector getBoxSelection( std::string childName; Base::Matrix4D smat(mat); auto sobj = obj->resolve(sub.c_str(),&parent,&childName,0,0,&smat,transform,depth+1); - if(!sobj) + if(!sobj) continue; int vis; if(!parent || (vis=parent->isElementVisible(childName.c_str()))<0) @@ -2707,7 +2707,7 @@ static void selectionCallback(void * ud, SoEventCallback * cb) continue; Base::Matrix4D mat; - for(auto &sub : getBoxSelection(vp,selectionMode,selectElement,proj,polygon,mat)) + for(auto &sub : getBoxSelection(vp,selectionMode,selectElement,proj,polygon,mat)) Gui::Selection().addSelection(doc->getName(), obj->getNameInDocument(), sub.c_str()); } } @@ -2757,7 +2757,7 @@ StdBoxElementSelection::StdBoxElementSelection() void StdBoxElementSelection::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); View3DInventor* view = qobject_cast(getMainWindow()->activeWindow()); if (view) { View3DInventorViewer* viewer = view->getViewer(); @@ -2822,7 +2822,7 @@ StdCmdTreeCollapse::StdCmdTreeCollapse() void StdCmdTreeCollapse::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QList tree = Gui::getMainWindow()->findChildren(); for (QList::iterator it = tree.begin(); it != tree.end(); ++it) (*it)->expandSelectedItems(TreeItemMode::CollapseItem); @@ -2847,7 +2847,7 @@ StdCmdTreeExpand::StdCmdTreeExpand() void StdCmdTreeExpand::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); QList tree = Gui::getMainWindow()->findChildren(); for (QList::iterator it = tree.begin(); it != tree.end(); ++it) (*it)->expandSelectedItems(TreeItemMode::ExpandItem); @@ -2885,7 +2885,7 @@ bool StdCmdTreeSelectAllInstances::isActive(void) void StdCmdTreeSelectAllInstances::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); const auto &sels = Selection().getSelectionEx("*",App::DocumentObject::getClassTypeId(),true,true); if(sels.empty()) return; @@ -2894,7 +2894,7 @@ void StdCmdTreeSelectAllInstances::activated(int iMsg) return; auto vpd = dynamic_cast( Application::Instance->getViewProvider(obj)); - if(!vpd) + if(!vpd) return; Selection().selStackPush(); Selection().clearCompleteSelection(); @@ -3161,7 +3161,7 @@ StdCmdSelBack::StdCmdSelBack() void StdCmdSelBack::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Selection().selStackGoBack(); } @@ -3191,7 +3191,7 @@ StdCmdSelForward::StdCmdSelForward() void StdCmdSelForward::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Selection().selStackGoForward(); } @@ -3223,7 +3223,7 @@ bool StdTree##_name::isActive() {\ _pcAction->setChecked(checked,true);\ return true;\ } - + TREEVIEW_DOC_CMD_DEF(SingleDocument,0) StdTreeSingleDocument::StdTreeSingleDocument() @@ -3296,7 +3296,7 @@ bool StdTree##_name::isActive() {\ _pcAction->setChecked(checked,true);\ return true;\ } - + TREEVIEW_CMD_DEF(SyncView) StdTreeSyncView::StdTreeSyncView() diff --git a/src/Gui/CommandWindow.cpp b/src/Gui/CommandWindow.cpp index 9017a2ddbc..73b2f6049a 100644 --- a/src/Gui/CommandWindow.cpp +++ b/src/Gui/CommandWindow.cpp @@ -61,7 +61,7 @@ StdCmdArrangeIcons::StdCmdArrangeIcons() void StdCmdArrangeIcons::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); getMainWindow()->arrangeIcons (); } @@ -89,7 +89,7 @@ StdCmdTileWindows::StdCmdTileWindows() void StdCmdTileWindows::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); getMainWindow()->tile(); } @@ -117,7 +117,7 @@ StdCmdCascadeWindows::StdCmdCascadeWindows() void StdCmdCascadeWindows::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); getMainWindow()->cascade(); } @@ -148,7 +148,7 @@ StdCmdCloseActiveWindow::StdCmdCloseActiveWindow() void StdCmdCloseActiveWindow::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); getMainWindow()->closeActiveWindow(); } @@ -175,7 +175,7 @@ StdCmdCloseAllWindows::StdCmdCloseAllWindows() void StdCmdCloseAllWindows::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); getMainWindow()->closeAllDocuments(); } @@ -204,7 +204,7 @@ StdCmdActivateNextWindow::StdCmdActivateNextWindow() void StdCmdActivateNextWindow::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); getMainWindow()->activateNextWindow(); } @@ -233,7 +233,7 @@ StdCmdActivatePrevWindow::StdCmdActivatePrevWindow() void StdCmdActivatePrevWindow::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); getMainWindow()->activatePreviousWindow(); } @@ -261,7 +261,7 @@ StdCmdWindows::StdCmdWindows() void StdCmdWindows::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); Gui::Dialog::DlgActivateWindowImp dlg( getMainWindow() ); dlg.exec(); } @@ -307,7 +307,7 @@ StdCmdDockViewMenu::StdCmdDockViewMenu() void StdCmdDockViewMenu::activated(int iMsg) { // Handled by the related QAction objects - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); } bool StdCmdDockViewMenu::isActive(void) @@ -343,7 +343,7 @@ StdCmdToolBarMenu::StdCmdToolBarMenu() void StdCmdToolBarMenu::activated(int iMsg) { // Handled by the related QAction objects - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); } bool StdCmdToolBarMenu::isActive(void) @@ -366,7 +366,7 @@ Action * StdCmdToolBarMenu::createAction(void) class FilterStatusBar : public QObject { // Q_OBJECT - + public: FilterStatusBar(Action * action):QObject() {this->action = action;} // virtual ~FilterStatusBar() {} @@ -401,7 +401,7 @@ Action * StdCmdStatusBar::createAction(void) pcAction->setChecked(false, true); FilterStatusBar *fsb = new FilterStatusBar(pcAction); getMainWindow()->statusBar()->installEventFilter(fsb); - + return pcAction; } @@ -443,7 +443,7 @@ StdCmdWindowsMenu::StdCmdWindowsMenu() void StdCmdWindowsMenu::activated(int iMsg) { // already handled by the main window - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); } bool StdCmdWindowsMenu::isActive(void) diff --git a/src/Gui/Control.h b/src/Gui/Control.h index 68288940f6..169ce37bf5 100644 --- a/src/Gui/Control.h +++ b/src/Gui/Control.h @@ -59,7 +59,7 @@ public: static ControlSingleton& instance(void); static void destruct (void); - /** @name dialog handling + /** @name dialog handling * These methods are used to control the TaskDialog stuff. */ //@{ @@ -69,7 +69,7 @@ public: //void closeDialog(); //@} - /** @name task view handling + /** @name task view handling */ //@{ Gui::TaskView::TaskView* taskPanel() const; @@ -99,7 +99,7 @@ public Q_SLOTS: void accept(); void reject(); void closeDialog(); - /// raises the task view panel + /// raises the task view panel void showTaskView(); private Q_SLOTS: @@ -117,7 +117,7 @@ private: std::stack StatusStack; Gui::TaskView::TaskDialog *ActiveDialog; - + private: /// Construction ControlSingleton(); diff --git a/src/Gui/DemoMode.cpp b/src/Gui/DemoMode.cpp index b150311c63..bbd874873c 100644 --- a/src/Gui/DemoMode.cpp +++ b/src/Gui/DemoMode.cpp @@ -189,7 +189,7 @@ void DemoMode::reorientCamera(SoCamera * cam, const SbRotation & rot) void DemoMode::on_speedSlider_valueChanged(int v) { - Q_UNUSED(v); + Q_UNUSED(v); Gui::View3DInventor* view = activeView(); if (view && view->getViewer()->isAnimating()) { startAnimation(view); @@ -257,7 +257,7 @@ void DemoMode::startAnimation(Gui::View3DInventor* view) { if (!view->getViewer()->isAnimationEnabled()) view->getViewer()->setAnimationEnabled(true); - view->getViewer()->startAnimating(getDirection(view), + view->getViewer()->startAnimating(getDirection(view), getSpeed(ui->speedSlider->value())); } diff --git a/src/Gui/DlgActionsImp.cpp b/src/Gui/DlgActionsImp.cpp index 6e3479d76a..9cc3de483c 100644 --- a/src/Gui/DlgActionsImp.cpp +++ b/src/Gui/DlgActionsImp.cpp @@ -97,7 +97,7 @@ DlgCustomActionsImp::~DlgCustomActionsImp() { } -/** +/** * Displays this page. If no macros were found a message box * appears. */ @@ -125,18 +125,18 @@ bool DlgCustomActionsImp::event(QEvent* e) int index = topLevel->metaObject()->indexOfSignal( QMetaObject::normalizedSignature("addMacroAction(const QByteArray&)") ); if ( index >= 0 ) { if ( e->type() == QEvent::ParentChange ) { - connect(this, SIGNAL(addMacroAction( const QByteArray& )), + connect(this, SIGNAL(addMacroAction( const QByteArray& )), topLevel, SIGNAL(addMacroAction( const QByteArray& ))); - connect(this, SIGNAL(removeMacroAction( const QByteArray& )), + connect(this, SIGNAL(removeMacroAction( const QByteArray& )), topLevel, SIGNAL(removeMacroAction( const QByteArray& ))); - connect(this, SIGNAL(modifyMacroAction( const QByteArray& )), + connect(this, SIGNAL(modifyMacroAction( const QByteArray& )), topLevel, SIGNAL(modifyMacroAction( const QByteArray& ))); } else { - disconnect(this, SIGNAL(addMacroAction( const QByteArray& )), + disconnect(this, SIGNAL(addMacroAction( const QByteArray& )), topLevel, SIGNAL(addMacroAction( const QByteArray& ))); - disconnect(this, SIGNAL(removeMacroAction( const QByteArray& )), + disconnect(this, SIGNAL(removeMacroAction( const QByteArray& )), topLevel, SIGNAL(removeMacroAction( const QByteArray& ))); - disconnect(this, SIGNAL(modifyMacroAction( const QByteArray& )), + disconnect(this, SIGNAL(modifyMacroAction( const QByteArray& )), topLevel, SIGNAL(modifyMacroAction( const QByteArray& ))); } } @@ -179,7 +179,7 @@ void DlgCustomActionsImp::showActions() void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *item) { - if (!item) + if (!item) return; // no valid item // search for the command in the manager and if necessary in the temporary created ones @@ -205,7 +205,7 @@ void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *ite if (!bFound) { - QMessageBox::critical(this, tr("Macro not found"), + QMessageBox::critical(this, tr("Macro not found"), tr("Sorry, couldn't find macro file '%1'.").arg(scriptName)); } @@ -263,10 +263,10 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked() if (!ui->actionWhatsThis->text().isEmpty()) macro->setWhatsThis(ui->actionWhatsThis->text().toUtf8()); ui->actionWhatsThis->clear(); - + if (!ui->actionMacros-> currentText().isEmpty()) macro->setScriptName(ui->actionMacros->currentText().toUtf8()); - + if (!ui->actionMenu->text().isEmpty()) macro->setMenuText(ui->actionMenu->text().toUtf8()); ui->actionMenu->clear(); @@ -320,10 +320,10 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked() if (!ui->actionWhatsThis->text().isEmpty()) macro->setWhatsThis(ui->actionWhatsThis->text().toUtf8()); ui->actionWhatsThis->clear(); - + if (!ui->actionMacros-> currentText().isEmpty()) macro->setScriptName(ui->actionMacros->currentText().toUtf8()); - + if (!ui->actionMenu->text().isEmpty()) macro->setMenuText(ui->actionMenu->text().toUtf8()); ui->actionMenu->clear(); @@ -385,7 +385,7 @@ void DlgCustomActionsImp::on_buttonRemoveAction_clicked() { // remove item from list view QTreeWidgetItem* item = ui->actionListWidget->currentItem(); - if (!item) + if (!item) return; int current = ui->actionListWidget->indexOfTopLevelItem(item); ui->actionListWidget->takeTopLevelItem(current); @@ -687,4 +687,4 @@ QStringList IconFolders::getPaths() const return paths; } -#include "moc_DlgActionsImp.cpp" +#include "moc_DlgActionsImp.cpp" diff --git a/src/Gui/DlgActionsImp.h b/src/Gui/DlgActionsImp.h index 2d68725d8c..1f94fb9810 100644 --- a/src/Gui/DlgActionsImp.h +++ b/src/Gui/DlgActionsImp.h @@ -49,7 +49,7 @@ class Ui_DlgCustomActions; * \author Werner Mayer */ class DlgCustomActionsImp : public CustomizeActionPage -{ +{ Q_OBJECT public: diff --git a/src/Gui/DlgAddProperty.cpp b/src/Gui/DlgAddProperty.cpp index d20e7af9b8..9b6ccd21d6 100644 --- a/src/Gui/DlgAddProperty.cpp +++ b/src/Gui/DlgAddProperty.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2019 Zheng, Lei (realthunder) * + * Copyright (c) 2019 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -39,7 +39,7 @@ using namespace Gui; using namespace Gui::Dialog; -DlgAddProperty::DlgAddProperty(QWidget* parent, +DlgAddProperty::DlgAddProperty(QWidget* parent, std::unordered_set &&c) : QDialog( parent ) , containers(std::move(c)) @@ -92,7 +92,7 @@ void DlgAddProperty::accept() { std::string name = ui->edtName->text().toUtf8().constData(); std::string group = ui->edtGroup->text().toUtf8().constData(); - if(name.empty() || group.empty() + if(name.empty() || group.empty() || name != Base::Tools::getIdentifier(name) || group != Base::Tools::getIdentifier(group)) { diff --git a/src/Gui/DlgAddProperty.h b/src/Gui/DlgAddProperty.h index 4f86d4a461..13d2300b24 100644 --- a/src/Gui/DlgAddProperty.h +++ b/src/Gui/DlgAddProperty.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2019 Zheng, Lei (realthunder) * + * Copyright (c) 2019 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/DlgCustomizeImp.cpp b/src/Gui/DlgCustomizeImp.cpp index b9394b546e..694ce54006 100644 --- a/src/Gui/DlgCustomizeImp.cpp +++ b/src/Gui/DlgCustomizeImp.cpp @@ -40,8 +40,8 @@ QList DlgCustomizeImp::_pages; /* TRANSLATOR Gui::Dialog::DlgCustomizeImp */ /** - * Constructs a DlgCustomizeImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgCustomizeImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -51,16 +51,16 @@ DlgCustomizeImp::DlgCustomizeImp(QWidget* parent, Qt::WindowFlags fl) { setModal(false); setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - resize( 690, 365 ); + resize( 690, 365 ); setWindowTitle(tr("Customize")); setSizeGripEnabled( true ); - customLayout = new QGridLayout( this ); + customLayout = new QGridLayout( this ); customLayout->setSpacing( 6 ); customLayout->setMargin( 11 ); - layout = new QHBoxLayout; + layout = new QHBoxLayout; layout->setSpacing( 6 ); layout->setMargin( 0 ); diff --git a/src/Gui/DlgCustomizeImp.h b/src/Gui/DlgCustomizeImp.h index aa1403cffa..d4a47ff72e 100644 --- a/src/Gui/DlgCustomizeImp.h +++ b/src/Gui/DlgCustomizeImp.h @@ -36,9 +36,9 @@ namespace Dialog { /** * Dialog which contains several tab pages to customize * the changeable toolbars and commandbars or to define - * own macro actions. + * own macro actions. * - * You can extend the existing toolbars or commandbars with + * You can extend the existing toolbars or commandbars with * several commands just by drag and drop. * @see DlgCustomCommandsImp * @see DlgCustomToolbarsImp @@ -47,7 +47,7 @@ namespace Dialog { * \author Werner Mayer */ class DlgCustomizeImp : public QDialog -{ +{ Q_OBJECT public: @@ -70,7 +70,7 @@ private: //@{ QPushButton* buttonHelp; /**< the help button */ QPushButton* buttonClose; /**< the cancel button */ - QTabWidget* tabWidget; /**< tab widgets containing all pages */ + QTabWidget* tabWidget; /**< tab widgets containing all pages */ QGridLayout* customLayout; /**< layout */ QHBoxLayout* layout; /** horizontal layout */ static QList _pages; /**< Name of all registered preference pages */ diff --git a/src/Gui/DlgCustomizeSpNavSettings.cpp b/src/Gui/DlgCustomizeSpNavSettings.cpp index 4ffe9760a5..98d1e9186a 100644 --- a/src/Gui/DlgCustomizeSpNavSettings.cpp +++ b/src/Gui/DlgCustomizeSpNavSettings.cpp @@ -147,7 +147,7 @@ void DlgCustomizeSpNavSettings::initialize() void DlgCustomizeSpNavSettings::on_ButtonDefaultSpNavMotions_clicked() { - spaceballMotionGroup()->Clear(); + spaceballMotionGroup()->Clear(); initialize(); } @@ -197,7 +197,7 @@ void DlgCustomizeSpNavSettings::on_SliderGlobal_sliderReleased() } void DlgCustomizeSpNavSettings::on_CBEnablePanLR_clicked() -{ +{ spaceballMotionGroup()->SetBool("PanLREnable", ui->CBEnablePanLR->isChecked()); ui->CBReversePanLR->setEnabled(ui->CBEnablePanLR->isChecked()); @@ -233,7 +233,7 @@ void DlgCustomizeSpNavSettings::on_SliderPanUD_sliderReleased() } void DlgCustomizeSpNavSettings::on_CBEnableZoom_clicked() -{ +{ spaceballMotionGroup()->SetBool("ZoomEnable", ui->CBEnableZoom->isChecked()); ui->CBReverseZoom ->setEnabled(ui->CBEnableZoom->isChecked()); @@ -263,12 +263,12 @@ void DlgCustomizeSpNavSettings::on_CBReverseTilt_clicked() spaceballMotionGroup()->SetBool("TiltReverse", ui->CBReverseTilt->isChecked()); } -void DlgCustomizeSpNavSettings::on_SliderTilt_sliderReleased() +void DlgCustomizeSpNavSettings::on_SliderTilt_sliderReleased() { spaceballMotionGroup()->SetInt("TiltSensitivity", ui->SliderTilt->value()); } -void DlgCustomizeSpNavSettings::on_CBEnableRoll_clicked() +void DlgCustomizeSpNavSettings::on_CBEnableRoll_clicked() { spaceballMotionGroup()->SetBool("RollEnable", ui->CBEnableRoll->isChecked()); @@ -307,19 +307,19 @@ void DlgCustomizeSpNavSettings::on_SliderSpin_sliderReleased() void DlgCustomizeSpNavSettings::onAddMacroAction(const QByteArray ¯oName) { //don't need to do anything here. - Q_UNUSED(macroName); + Q_UNUSED(macroName); } void DlgCustomizeSpNavSettings::onRemoveMacroAction(const QByteArray ¯oName) { //don't need to do anything here. - Q_UNUSED(macroName); + Q_UNUSED(macroName); } void DlgCustomizeSpNavSettings::onModifyMacroAction(const QByteArray ¯oName) { //don't need to do anything here. - Q_UNUSED(macroName); + Q_UNUSED(macroName); } #include "moc_DlgCustomizeSpNavSettings.cpp" diff --git a/src/Gui/DlgCustomizeSpNavSettings.h b/src/Gui/DlgCustomizeSpNavSettings.h index 9db7e3e95b..367964bed9 100644 --- a/src/Gui/DlgCustomizeSpNavSettings.h +++ b/src/Gui/DlgCustomizeSpNavSettings.h @@ -71,7 +71,7 @@ namespace Gui void on_SliderSpin_sliderReleased(); void on_ButtonDefaultSpNavMotions_clicked(); void on_ButtonCalibrate_clicked(); - + protected: void changeEvent(QEvent *e); diff --git a/src/Gui/DlgCustomizeSpaceball.cpp b/src/Gui/DlgCustomizeSpaceball.cpp index 10986edd6a..23c96bcb9b 100644 --- a/src/Gui/DlgCustomizeSpaceball.cpp +++ b/src/Gui/DlgCustomizeSpaceball.cpp @@ -61,7 +61,7 @@ void ButtonView::selectButton(int number) void ButtonView::goSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { - Q_UNUSED(deselected); + Q_UNUSED(deselected); if (selected.indexes().isEmpty()) return; QModelIndex select(selected.indexes().at(0)); @@ -87,7 +87,7 @@ ButtonModel::ButtonModel(QObject *parent) : QAbstractListModel(parent) void ButtonModel::load3DConnexionButtonMapping(boost::property_tree::ptree ButtonMapTree) { spaceballButtonGroup()->Clear(); - + BOOST_FOREACH(const boost::property_tree::ptree::value_type &Map, ButtonMapTree.get_child("Mapping")) { if ("Map" == Map.first) @@ -96,7 +96,7 @@ void ButtonModel::load3DConnexionButtonMapping(boost::property_tree::ptree Butto std::string ButtonCode; std::string ButtonCommand; std::string ButtonDownTime; - + // Inspect Map attributes BOOST_FOREACH(const boost::property_tree::ptree::value_type &kv, Map.second.get_child("")) { @@ -105,7 +105,7 @@ void ButtonModel::load3DConnexionButtonMapping(boost::property_tree::ptree Butto Attribute = kv.first.data(); Value = kv.second.data(); - + if (0 == Attribute.compare("Description")) { ButtonDescription = Value; @@ -123,7 +123,7 @@ void ButtonModel::load3DConnexionButtonMapping(boost::property_tree::ptree Butto ButtonCommand = Value; } } - + // ButtonCode is mandatory, the remaining attributes optional. if (!ButtonCode.empty()) { @@ -145,7 +145,7 @@ void ButtonModel::load3DConnexionButtons(const char *RequiredDeviceName) { boost::property_tree::ptree tree; boost::property_tree::ptree DeviceTree; - + // exception thrown if no file found std::string path = App::Application::getResourceDir(); path += "3Dconnexion/3DConnexion.xml"; @@ -170,7 +170,7 @@ void ButtonModel::load3DConnexionButtons(const char *RequiredDeviceName) { // We found the ButtonMap we want to load up DeviceTree = ButtonMap.second; - } + } } } } @@ -187,10 +187,10 @@ void ButtonModel::load3DConnexionButtons(const char *RequiredDeviceName) Base::Console().Warning("%s\n", e.what()); } } - + int ButtonModel::rowCount (const QModelIndex &parent) const { - Q_UNUSED(parent); + Q_UNUSED(parent); return spaceballButtonGroup()->GetGroups().size(); } @@ -404,7 +404,7 @@ int CommandModel::rowCount(const QModelIndex &parent) const int CommandModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent); + Q_UNUSED(parent); return 1; } @@ -601,13 +601,13 @@ PrintModel::PrintModel(QObject *parent, ButtonModel *buttonModelIn, CommandModel int PrintModel::rowCount(const QModelIndex &parent) const { - Q_UNUSED(parent); + Q_UNUSED(parent); return buttonModel->rowCount(); } int PrintModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent); + Q_UNUSED(parent); return 2; } @@ -871,7 +871,7 @@ void DlgCustomizeSpaceball::onRemoveMacroAction(const QByteArray ¯oName) void DlgCustomizeSpaceball::onModifyMacroAction(const QByteArray ¯oName) { //don't think I need to do anything here. - Q_UNUSED(macroName); + Q_UNUSED(macroName); } QStringList DlgCustomizeSpaceball::getModels() diff --git a/src/Gui/DlgDisplayPropertiesImp.cpp b/src/Gui/DlgDisplayPropertiesImp.cpp index c84eb5d3b4..f3812d158e 100644 --- a/src/Gui/DlgDisplayPropertiesImp.cpp +++ b/src/Gui/DlgDisplayPropertiesImp.cpp @@ -70,8 +70,8 @@ public: }; /** - * Constructs a DlgDisplayPropertiesImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgDisplayPropertiesImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -115,7 +115,7 @@ DlgDisplayPropertiesImp::DlgDisplayPropertiesImp(bool floating, QWidget* parent, (&DlgDisplayPropertiesImp::slotChangedObject, this, bp::_1, bp::_2)); } -/** +/** * Destroys the object and frees any allocated resources */ DlgDisplayPropertiesImp::~DlgDisplayPropertiesImp() @@ -142,7 +142,7 @@ void DlgDisplayPropertiesImp::changeEvent(QEvent *e) void DlgDisplayPropertiesImp::OnChange(Gui::SelectionSingleton::SubjectType &rCaller, Gui::SelectionSingleton::MessageType Reason) { - Q_UNUSED(rCaller); + Q_UNUSED(rCaller); if (Reason.Type == SelectionChanges::AddSelection || Reason.Type == SelectionChanges::RmvSelection || Reason.Type == SelectionChanges::SetSelection || diff --git a/src/Gui/DlgEditFileIncludePropertyExternal.cpp b/src/Gui/DlgEditFileIncludePropertyExternal.cpp index e17dca7555..b9360fc6c1 100644 --- a/src/Gui/DlgEditFileIncludePropertyExternal.cpp +++ b/src/Gui/DlgEditFileIncludePropertyExternal.cpp @@ -37,8 +37,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgEditFileIncludePropertyExternal */ /** - * Constructs a DlgEditFileIncludePropertyExternal which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgEditFileIncludePropertyExternal which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -51,7 +51,7 @@ DlgEditFileIncludePropertyExternal(App::PropertyFileIncluded& Prop, } -/** +/** * Destroys the object and frees any allocated resources */ DlgEditFileIncludePropertyExternal::~DlgEditFileIncludePropertyExternal() diff --git a/src/Gui/DlgEditFileIncludePropertyExternal.h b/src/Gui/DlgEditFileIncludePropertyExternal.h index 2cf6b598dc..92c14f5f36 100644 --- a/src/Gui/DlgEditFileIncludePropertyExternal.h +++ b/src/Gui/DlgEditFileIncludePropertyExternal.h @@ -31,11 +31,11 @@ namespace Gui { namespace Dialog { /** - * + * * \author Jürgen Riegel */ -class GuiExport DlgEditFileIncludePropertyExternal : public DlgRunExternal -{ +class GuiExport DlgEditFileIncludePropertyExternal : public DlgRunExternal +{ Q_OBJECT public: diff --git a/src/Gui/DlgEditorImp.cpp b/src/Gui/DlgEditorImp.cpp index 134985e792..561467b863 100644 --- a/src/Gui/DlgEditorImp.cpp +++ b/src/Gui/DlgEditorImp.cpp @@ -69,63 +69,63 @@ DlgSettingsEditorImp::DlgSettingsEditorImp( QWidget* parent ) d = new DlgSettingsEditorP(); QColor col; - col = Qt::black; + col = Qt::black; unsigned int lText = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Text")), lText)); - col = Qt::cyan; + col = Qt::cyan; unsigned int lBookmarks = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Bookmark")), lBookmarks)); - col = Qt::red; + col = Qt::red; unsigned int lBreakpnts = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Breakpoint")), lBreakpnts)); - col = Qt::blue; + col = Qt::blue; unsigned int lKeywords = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Keyword")), lKeywords)); - col.setRgb(0, 170, 0); + col.setRgb(0, 170, 0); unsigned int lComments = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Comment")), lComments)); - col.setRgb(160, 160, 164); + col.setRgb(160, 160, 164); unsigned int lBlockCom = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Block comment")), lBlockCom)); - col = Qt::blue; + col = Qt::blue; unsigned int lNumbers = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Number")), lNumbers)); - col = Qt::red; + col = Qt::red; unsigned int lStrings = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("String")), lStrings)); - col = Qt::red; + col = Qt::red; unsigned int lCharacter = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Character")), lCharacter)); - col.setRgb(255, 170, 0); + col.setRgb(255, 170, 0); unsigned int lClass = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Class name")), lClass)); - col.setRgb(255, 170, 0); + col.setRgb(255, 170, 0); unsigned int lDefine = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Define name")), lDefine)); - col.setRgb(160, 160, 164); + col.setRgb(160, 160, 164); unsigned int lOperat = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Operator")), lOperat)); - col.setRgb(170, 170, 127); + col.setRgb(170, 170, 127); unsigned int lPyOutput = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Python output")), lPyOutput)); - col = Qt::red; + col = Qt::red; unsigned int lPyError = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Python error")), lPyError)); - col.setRgb(224, 224, 224); + col.setRgb(224, 224, 224); unsigned int lCLine = (col.red() << 24) | (col.green() << 16) | (col.blue() << 8); d->colormap.push_back(QPair (QString::fromLatin1(QT_TR_NOOP("Current line highlight")), lCLine)); diff --git a/src/Gui/DlgExpressionInput.cpp b/src/Gui/DlgExpressionInput.cpp index 637b27e5e4..fdb299c7f2 100644 --- a/src/Gui/DlgExpressionInput.cpp +++ b/src/Gui/DlgExpressionInput.cpp @@ -59,7 +59,7 @@ DlgExpressionInput::DlgExpressionInput(const App::ObjectIdentifier & _path, // Connect signal(s) connect(ui->expression, SIGNAL(textChanged(QString)), this, SLOT(textChanged(QString))); connect(ui->discardBtn, SIGNAL(clicked()), this, SLOT(setDiscarded())); - + if (expression) { ui->expression->setText(Base::Tools::fromStdString(expression->toString())); } @@ -130,7 +130,7 @@ void DlgExpressionInput::textChanged(const QString &text) ui->expression->setMinimumWidth(minimumWidth); else ui->expression->setMinimumWidth(width); - + if(this->width() < ui->expression->minimumWidth()) setMinimumWidth(ui->expression->minimumWidth()); diff --git a/src/Gui/DlgExpressionInput.h b/src/Gui/DlgExpressionInput.h index c6d6d5c34a..9de74f5ec7 100644 --- a/src/Gui/DlgExpressionInput.h +++ b/src/Gui/DlgExpressionInput.h @@ -49,11 +49,11 @@ namespace Dialog { class GuiExport DlgExpressionInput : public QDialog { Q_OBJECT - + public: explicit DlgExpressionInput(const App::ObjectIdentifier & _path, boost::shared_ptr _expression, const Base::Unit &_impliedUnit, QWidget *parent = 0); ~DlgExpressionInput(); - + boost::shared_ptr getExpression() const { return expression; } bool discardedFormula() const { return discarded; } diff --git a/src/Gui/DlgGeneralImp.cpp b/src/Gui/DlgGeneralImp.cpp index 1a09a4a411..37ebac3f3b 100644 --- a/src/Gui/DlgGeneralImp.cpp +++ b/src/Gui/DlgGeneralImp.cpp @@ -44,8 +44,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgGeneralImp */ /** - * Constructs a DlgGeneralImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgGeneralImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -55,7 +55,7 @@ DlgGeneralImp::DlgGeneralImp( QWidget* parent ) , ui(new Ui_DlgGeneral) { ui->setupUi(this); - + // fills the combo box with all available workbenches // sorted by their menu text QStringList work = Application::Instance->workbenches(); @@ -84,7 +84,7 @@ DlgGeneralImp::DlgGeneralImp( QWidget* parent ) } } -/** +/** * Destroys the object and frees any allocated resources */ DlgGeneralImp::~DlgGeneralImp() @@ -115,7 +115,7 @@ void DlgGeneralImp::saveSettings() ui->RecentFiles->onSave(); ui->SplashScreen->onSave(); ui->PythonWordWrap->onSave(); - + QWidget* pc = DockWindowManager::instance()->getDockWindow("Python console"); PythonConsole *pcPython = qobject_cast(pc); if (pcPython) { @@ -222,7 +222,7 @@ void DlgGeneralImp::loadSettings() if (index < 0) { ui->toolbarIconSize->addItem(tr("Custom (%1px)").arg(current), QVariant((int)current)); index = ui->toolbarIconSize->findData(QVariant(current)); - } + } ui->toolbarIconSize->setCurrentIndex(index); ui->treeMode->addItem(tr("Combo View")); diff --git a/src/Gui/DlgMacroExecuteImp.cpp b/src/Gui/DlgMacroExecuteImp.cpp index 7e7607768c..aa1eb4af9b 100644 --- a/src/Gui/DlgMacroExecuteImp.cpp +++ b/src/Gui/DlgMacroExecuteImp.cpp @@ -133,7 +133,7 @@ void DlgMacroExecuteImp::fillUpList(void) } } -/** +/** * Selects a macro file in the list view. */ void DlgMacroExecuteImp::on_userMacroListBox_currentItemChanged(QTreeWidgetItem* item) diff --git a/src/Gui/DlgMacroExecuteImp.h b/src/Gui/DlgMacroExecuteImp.h index 751b3f04ca..be876fad9a 100644 --- a/src/Gui/DlgMacroExecuteImp.h +++ b/src/Gui/DlgMacroExecuteImp.h @@ -36,11 +36,11 @@ class Ui_DlgMacroExecute; /** * The DlgMacroExecuteImp class implements a dialog to execute or edit a - * recorded macro. + * recorded macro. * \author Jürgen Riegel */ class DlgMacroExecuteImp : public QDialog, public Gui::WindowParameter -{ +{ Q_OBJECT public: diff --git a/src/Gui/DlgMacroRecordImp.cpp b/src/Gui/DlgMacroRecordImp.cpp index d6374c68c3..b763675a86 100644 --- a/src/Gui/DlgMacroRecordImp.cpp +++ b/src/Gui/DlgMacroRecordImp.cpp @@ -42,8 +42,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgMacroRecordImp */ /** - * Constructs a DlgMacroRecordImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgMacroRecordImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -70,7 +70,7 @@ DlgMacroRecordImp::DlgMacroRecordImp( QWidget* parent, Qt::WindowFlags fl ) this->macroManager->isOpen() ? ui->buttonStart->setEnabled(false) : ui->buttonStop->setEnabled(false); } -/** +/** * Destroys the object and frees any allocated resources */ DlgMacroRecordImp::~DlgMacroRecordImp() @@ -132,7 +132,7 @@ void DlgMacroRecordImp::on_buttonCancel_clicked() if (this->macroManager->isOpen()) { this->macroManager->cancel(); } - + QDialog::reject(); } diff --git a/src/Gui/DlgObjectSelection.cpp b/src/Gui/DlgObjectSelection.cpp index 127aeef5e7..a017154dea 100644 --- a/src/Gui/DlgObjectSelection.cpp +++ b/src/Gui/DlgObjectSelection.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -196,7 +196,7 @@ App::DocumentObject *DlgObjectSelection::objFromItem(QTreeWidgetItem *item) { } void DlgObjectSelection::onItemExpanded(QTreeWidgetItem * item) { - if(item->childCount()) + if(item->childCount()) return; auto obj = objFromItem(item); if(!obj) diff --git a/src/Gui/DlgObjectSelection.h b/src/Gui/DlgObjectSelection.h index f555546b4d..315ed3126a 100644 --- a/src/Gui/DlgObjectSelection.h +++ b/src/Gui/DlgObjectSelection.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -32,7 +32,7 @@ class GuiExport DlgObjectSelection : public QDialog Q_OBJECT public: - DlgObjectSelection(const std::vector &objs, + DlgObjectSelection(const std::vector &objs, QWidget* parent = 0, Qt::WindowFlags fl = Qt::WindowFlags()); ~DlgObjectSelection(); diff --git a/src/Gui/DlgOnlineHelpImp.cpp b/src/Gui/DlgOnlineHelpImp.cpp index 440da08594..9fef7bb2aa 100644 --- a/src/Gui/DlgOnlineHelpImp.cpp +++ b/src/Gui/DlgOnlineHelpImp.cpp @@ -39,8 +39,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgOnlineHelpImp */ /** - * Constructs a DlgOnlineHelpImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgOnlineHelpImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -57,7 +57,7 @@ DlgOnlineHelpImp::DlgOnlineHelpImp( QWidget* parent ) } } -/** +/** * Destroys the object and frees any allocated resources */ DlgOnlineHelpImp::~DlgOnlineHelpImp() diff --git a/src/Gui/DlgParameterFind.cpp b/src/Gui/DlgParameterFind.cpp index 9503d95691..8d2cc3fd03 100644 --- a/src/Gui/DlgParameterFind.cpp +++ b/src/Gui/DlgParameterFind.cpp @@ -49,7 +49,7 @@ DlgParameterFind::DlgParameterFind(DlgParameterImp* parent) } } -/** +/** * Destroys the object and frees any allocated resources */ DlgParameterFind::~DlgParameterFind() diff --git a/src/Gui/DlgParameterFind.h b/src/Gui/DlgParameterFind.h index fbc031a0a7..20fddd7ff7 100644 --- a/src/Gui/DlgParameterFind.h +++ b/src/Gui/DlgParameterFind.h @@ -36,7 +36,7 @@ class Ui_DlgParameterFind; class DlgParameterImp; class GuiExport DlgParameterFind : public QDialog -{ +{ Q_OBJECT public: diff --git a/src/Gui/DlgParameterImp.cpp b/src/Gui/DlgParameterImp.cpp index 0e49aa38dd..631e9cb6a8 100644 --- a/src/Gui/DlgParameterImp.cpp +++ b/src/Gui/DlgParameterImp.cpp @@ -53,7 +53,7 @@ using namespace Gui::Dialog; /** * Constructs a DlgParameterImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -76,7 +76,7 @@ DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl ) paramGroup->header()->setProperty("showSortIndicator", QVariant(true)); #endif - QStringList valueLabels; + QStringList valueLabels; valueLabels << tr( "Name" ) << tr( "Type" ) << tr( "Value" ); paramValue = new ParameterValue(ui->splitter3); paramValue->setHeaderLabels(valueLabels); @@ -112,9 +112,9 @@ DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl ) if (ui->parameterSet->count() < 2) ui->parameterSet->hide(); - connect(ui->parameterSet, SIGNAL(activated(int)), + connect(ui->parameterSet, SIGNAL(activated(int)), this, SLOT(onChangeParameterSet(int))); - connect(paramGroup, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), + connect(paramGroup, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(onGroupSelected(QTreeWidgetItem*))); onGroupSelected(paramGroup->currentItem()); @@ -133,7 +133,7 @@ DlgParameterImp::DlgParameterImp( QWidget* parent, Qt::WindowFlags fl ) #endif } -/** +/** * Destroys the object and frees any allocated resources */ DlgParameterImp::~DlgParameterImp() @@ -452,7 +452,7 @@ bool validateInput(QWidget* parent, const QString& input) (c < 'A' || c > 'Z') && // Uppercase letters (c < 'a' || c > 'z') && // Lowercase letters (c != ' ')) { // Space - QMessageBox::warning(parent, DlgParameterImp::tr("Invalid input"), + QMessageBox::warning(parent, DlgParameterImp::tr("Invalid input"), DlgParameterImp::tr("Invalid key name '%1'").arg(input)); return false; } @@ -503,7 +503,7 @@ void ParameterGroup::contextMenuEvent ( QContextMenuEvent* event ) void ParameterGroup::keyPressEvent (QKeyEvent* event) { - switch ( tolower(event->key()) ) + switch ( tolower(event->key()) ) { case Qt::Key_Delete: { @@ -520,7 +520,7 @@ void ParameterGroup::onDeleteSelectedItem() if (sel && sel->isSelected() && sel->parent()) { if ( QMessageBox::question(this, tr("Remove group"), tr("Do you really want to remove this parameter group?"), - QMessageBox::Yes, QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) == + QMessageBox::Yes, QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) == QMessageBox::Yes ) { QTreeWidgetItem* parent = sel->parent(); @@ -677,7 +677,7 @@ ParameterValue::ParameterValue( QWidget * parent ) newUlgAct = menuNew->addAction(tr("New unsigned item"), this, SLOT(onCreateUIntItem())); newBlnAct = menuNew->addAction(tr("New Boolean item"), this, SLOT(onCreateBoolItem())); - connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), + connect(this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), this, SLOT(onChangeSelectedItem(QTreeWidgetItem*, int))); } @@ -720,7 +720,7 @@ void ParameterValue::contextMenuEvent ( QContextMenuEvent* event ) void ParameterValue::keyPressEvent (QKeyEvent* event) { - switch ( tolower(event->key()) ) + switch ( tolower(event->key()) ) { case Qt::Key_Delete: { @@ -781,7 +781,7 @@ void ParameterValue::onRenameSelectedItem() void ParameterValue::onCreateTextItem() { bool ok; - QString name = QInputDialog::getText(this, QObject::tr("New text item"), QObject::tr("Enter the name:"), + QString name = QInputDialog::getText(this, QObject::tr("New text item"), QObject::tr("Enter the name:"), QLineEdit::Normal, QString(), &ok); if (!ok || !Gui::validateInput(this, name)) @@ -797,7 +797,7 @@ void ParameterValue::onCreateTextItem() } } - QString val = QInputDialog::getText(this, QObject::tr("New text item"), QObject::tr("Enter your text:"), + QString val = QInputDialog::getText(this, QObject::tr("New text item"), QObject::tr("Enter your text:"), QLineEdit::Normal, QString(), &ok); if ( ok && !val.isEmpty() ) { @@ -810,7 +810,7 @@ void ParameterValue::onCreateTextItem() void ParameterValue::onCreateIntItem() { bool ok; - QString name = QInputDialog::getText(this, QObject::tr("New integer item"), QObject::tr("Enter the name:"), + QString name = QInputDialog::getText(this, QObject::tr("New integer item"), QObject::tr("Enter the name:"), QLineEdit::Normal, QString(), &ok); if (!ok || !Gui::validateInput(this, name)) @@ -840,7 +840,7 @@ void ParameterValue::onCreateIntItem() void ParameterValue::onCreateUIntItem() { bool ok; - QString name = QInputDialog::getText(this, QObject::tr("New unsigned item"), QObject::tr("Enter the name:"), + QString name = QInputDialog::getText(this, QObject::tr("New unsigned item"), QObject::tr("Enter the name:"), QLineEdit::Normal, QString(), &ok); if (!ok || !Gui::validateInput(this, name)) @@ -876,7 +876,7 @@ void ParameterValue::onCreateUIntItem() void ParameterValue::onCreateFloatItem() { bool ok; - QString name = QInputDialog::getText(this, QObject::tr("New float item"), QObject::tr("Enter the name:"), + QString name = QInputDialog::getText(this, QObject::tr("New float item"), QObject::tr("Enter the name:"), QLineEdit::Normal, QString(), &ok); if (!ok || !Gui::validateInput(this, name)) @@ -891,8 +891,8 @@ void ParameterValue::onCreateFloatItem() return; } } - - double val = QInputDialog::getDouble(this, QObject::tr("New float item"), QObject::tr("Enter your number:"), + + double val = QInputDialog::getDouble(this, QObject::tr("New float item"), QObject::tr("Enter your number:"), 0, -2147483647, 2147483647, 12, &ok); if ( ok ) { @@ -905,7 +905,7 @@ void ParameterValue::onCreateFloatItem() void ParameterValue::onCreateBoolItem() { bool ok; - QString name = QInputDialog::getText(this, QObject::tr("New Boolean item"), QObject::tr("Enter the name:"), + QString name = QInputDialog::getText(this, QObject::tr("New Boolean item"), QObject::tr("Enter the name:"), QLineEdit::Normal, QString(), &ok); if (!ok || !Gui::validateInput(this, name)) @@ -991,8 +991,8 @@ void ParameterGroupItem::setData ( int column, int role, const QVariant & value QMessageBox::critical( treeWidget(), QObject::tr("Existing group"), QObject::tr("The group '%1' already exists.").arg( newName ) ); return; - } - else + } + else { // rename the group by adding a new group, copy the content and remove the old group if (!item->_hcGrp->RenameGrp(oldName.toLatin1(), newName.toLatin1())) @@ -1064,7 +1064,7 @@ ParameterText::~ParameterText() void ParameterText::changeValue() { bool ok; - QString txt = QInputDialog::getText(treeWidget(), QObject::tr("Change value"), QObject::tr("Enter your text:"), + QString txt = QInputDialog::getText(treeWidget(), QObject::tr("Change value"), QObject::tr("Enter your text:"), QLineEdit::Normal, text(2), &ok); if ( ok ) { @@ -1205,7 +1205,7 @@ ParameterFloat::~ParameterFloat() void ParameterFloat::changeValue() { bool ok; - double num = QInputDialog::getDouble(treeWidget(), QObject::tr("Change value"), QObject::tr("Enter your number:"), + double num = QInputDialog::getDouble(treeWidget(), QObject::tr("Change value"), QObject::tr("Enter your number:"), text(2).toDouble(), -2147483647, 2147483647, 12, &ok); if ( ok ) { @@ -1249,7 +1249,7 @@ ParameterBool::~ParameterBool() void ParameterBool::changeValue() { bool ok; - QStringList list; list << QString::fromLatin1("true") + QStringList list; list << QString::fromLatin1("true") << QString::fromLatin1("false"); int pos = (text(2) == list[0] ? 0 : 1); diff --git a/src/Gui/DlgParameterImp.h b/src/Gui/DlgParameterImp.h index 9e47758dd2..a783c28d9e 100644 --- a/src/Gui/DlgParameterImp.h +++ b/src/Gui/DlgParameterImp.h @@ -42,7 +42,7 @@ class DlgParameterFind; * \author Jürgen Riegel */ class GuiExport DlgParameterImp : public QDialog -{ +{ Q_OBJECT public: @@ -181,7 +181,7 @@ protected Q_SLOTS: void onCreateFloatItem(); /** Creates and appends a new "boolean" leaf. */ void onCreateBoolItem(); - /** Defines that the first column is editable. + /** Defines that the first column is editable. * @note We need to reimplement this method as QTreeWidgetItem::flags() * doesn't have an int parameter. */ @@ -202,8 +202,8 @@ private: }; /** The link between the Tree and the shown Label. - * Every (shown) Label in the FCDocument class get it - * associated FCTreeLabel which controls the visibility + * Every (shown) Label in the FCDocument class get it + * associated FCTreeLabel which controls the visibility * and the functions of the Label. * * \author Jürgen Riegel @@ -228,7 +228,7 @@ public: /** * The ParameterValueItem class represents items that are added to the ParameterValue * listview. Each item represents a leaf in a parameter group and allows interaction - * with this leaf, such as modifying its name, its value or even remove it from the + * with this leaf, such as modifying its name, its value or even remove it from the * parameter group. * @author Werner Mayer */ diff --git a/src/Gui/DlgPreferencesImp.cpp b/src/Gui/DlgPreferencesImp.cpp index 76d64b045d..6ac6bd973f 100644 --- a/src/Gui/DlgPreferencesImp.cpp +++ b/src/Gui/DlgPreferencesImp.cpp @@ -39,7 +39,7 @@ #endif #include -#include +#include #include #include "DlgPreferencesImp.h" #include "ui_DlgPreferences.h" @@ -94,7 +94,7 @@ void DlgPreferencesImp::setupPages() for (std::list::iterator it = _pages.begin(); it != _pages.end(); ++it) { QTabWidget* tabWidget = new QTabWidget; ui->tabWidgetStack->addWidget(tabWidget); - + QByteArray group = it->first.c_str(); QListWidgetItem *item = new QListWidgetItem(ui->listBox); item->setData(Qt::UserRole, QVariant(group)); diff --git a/src/Gui/DlgPreferencesImp.h b/src/Gui/DlgPreferencesImp.h index 356afab5a1..6b6ff17ee4 100644 --- a/src/Gui/DlgPreferencesImp.h +++ b/src/Gui/DlgPreferencesImp.h @@ -36,29 +36,29 @@ class Ui_DlgPreferences; /** * This class implements a dialog containing several preference pages. - * + * * To append your own page you just have to take note of these points: * * \li Each preference page can be created by the Qt Designer selecting the "Widget" item * in the project dialog. * - * \li To save or load the widgets' settings automatically (e.g. combo boxes, line edits, + * \li To save or load the widgets' settings automatically (e.g. combo boxes, line edits, * check boxes, ...) you can make use of the classes inherited from @ref PrefWidget such as: * PrefSpinBox, PrefLineEdit, PrefComboBox, PrefListBox, PrefCheckBox, PrefRadioButton and * PrefSlider. If you have compiled and installed the library under src/Tools/plugins/widgets - * to QTDIR/plugins/designer you should see the new category "Preferences". - * Moreover you have to make sure to have specified the "prefEntry" and "prefPath" properties for each + * to QTDIR/plugins/designer you should see the new category "Preferences". + * Moreover you have to make sure to have specified the "prefEntry" and "prefPath" properties for each * preference widget you have used inside your form in Qt Designer. * - * \li For each widget inside your page - you want to save or load - you have to call - * \->onSave() or \->onRestore(). The best way to this is either to + * \li For each widget inside your page - you want to save or load - you have to call + * \->onSave() or \->onRestore(). The best way to this is either to * define the protected slots saveSettings() and loadSettings() in your form and overwrite - * them in a subclass or define these slots in this subclass directly. + * them in a subclass or define these slots in this subclass directly. * * See the example below for more details: * * \code - * // This class was created by Qt's uic tool + * // This class was created by Qt's uic tool * class MyPrefPage : public QWidget * { * public: diff --git a/src/Gui/DlgPropertyLink.cpp b/src/Gui/DlgPropertyLink.cpp index 89b577b754..6fb8f2c1f0 100644 --- a/src/Gui/DlgPropertyLink.cpp +++ b/src/Gui/DlgPropertyLink.cpp @@ -122,14 +122,14 @@ QList DlgPropertyLink::getLinksFromProperty(const App::Property std::vector subs; prop->getLinks(objs,true,&subs,false); if(subs.empty()) { - for(auto obj : objs) + for(auto obj : objs) res.push_back(App::SubObjectT(obj,0)); } else if (objs.size()==1) { - for(auto &sub : subs) + for(auto &sub : subs) res.push_back(App::SubObjectT(objs.front(),sub.c_str())); } else { int i=0; - for(auto obj : objs) + for(auto obj : objs) res.push_back(App::SubObjectT(obj,subs[i++].c_str())); } return res; @@ -279,10 +279,10 @@ void DlgPropertyLink::init(const App::DocumentObjectT &prop, bool tryFilter) { { isLinkList = true; allowSubObject = false; - } + } if(singleSelect) { - singleParent = true; + singleParent = true; ui->treeWidget->setSelectionMode(QAbstractItemView::SingleSelection); } else { ui->treeWidget->setSelectionMode(QAbstractItemView::MultiSelection); @@ -302,7 +302,7 @@ void DlgPropertyLink::init(const App::DocumentObjectT &prop, bool tryFilter) { ui->treeWidget->header()->setResizeMode(0, QHeaderView::ResizeToContents); #endif } - + std::set expandDocs; if(oldLinks.empty()) { @@ -529,7 +529,7 @@ void DlgPropertyLink::onItemSelectionChanged() sobj.getSubName().c_str()); blockConnection(blocked); - // Enforce single parent + // Enforce single parent if(singleParent && currentObj && currentObj!=obj) { ui->treeWidget->blockSignals(true); for(auto item : ui->treeWidget->selectedItems()) { @@ -717,7 +717,7 @@ DlgPropertyLink::getLinkFromItem(QTreeWidgetItem *item, bool needSubName) const void DlgPropertyLink::onTimer() { auto item = ui->treeWidget->itemAt( ui->treeWidget->viewport()->mapFromGlobal(QCursor::pos())); - if(!item) + if(!item) return; auto sobjs = getLinkFromItem(item); if(sobjs.isEmpty()) @@ -733,7 +733,7 @@ QList DlgPropertyLink::currentLinks() const { auto items = ui->treeWidget->selectedItems(); QList res; - for(auto item : items) + for(auto item : items) res.append(getLinkFromItem(item)); return res; } @@ -790,7 +790,7 @@ void DlgPropertyLink::filterItem(QTreeWidgetItem *item) { } bool DlgPropertyLink::eventFilter(QObject *obj, QEvent *e) { - if(obj == ui->searchBox + if(obj == ui->searchBox && e->type() == QEvent::KeyPress && static_cast(e)->key() == Qt::Key_Escape) { @@ -843,7 +843,7 @@ void DlgPropertyLink::itemSearch(const QString &text, bool select) { return; App::DocumentObject *obj = path.getDocumentObject(); - if(!obj) + if(!obj) return; bool found; @@ -881,7 +881,7 @@ QTreeWidgetItem *DlgPropertyLink::createItem( auto vp = Base::freecad_dynamic_cast( Application::Instance->getViewProvider(obj)); - if(!vp) + if(!vp) return 0; QTreeWidgetItem* item; @@ -912,7 +912,7 @@ QTreeWidgetItem *DlgPropertyLink::createItem( Py::Object proxy = prop->getValue(); if(!proxy.isNone() && !proxy.isString()) { const char *name = 0; - if (proxy.hasAttr("__class__")) + if (proxy.hasAttr("__class__")) proxyType = QByteArray(proxy.getAttr("__class__").as_string().c_str()); else { name = proxy.ptr()->ob_type->tp_name; @@ -1008,7 +1008,7 @@ bool DlgPropertyLink::filterType(QTreeWidgetItem *item) { } void DlgPropertyLink::onItemExpanded(QTreeWidgetItem * item) { - if(item->childCount()) + if(item->childCount()) return; const char *docName = item->data(0, Qt::UserRole+1).toByteArray().constData(); diff --git a/src/Gui/DlgReportViewImp.cpp b/src/Gui/DlgReportViewImp.cpp index 8d15bdd7ce..68c6d21807 100644 --- a/src/Gui/DlgReportViewImp.cpp +++ b/src/Gui/DlgReportViewImp.cpp @@ -36,8 +36,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgReportViewImp */ /** - * Constructs a DlgReportViewImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgReportViewImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -49,7 +49,7 @@ DlgReportViewImp::DlgReportViewImp( QWidget* parent ) ui->setupUi(this); } -/** +/** * Destroys the object and frees any allocated resources */ DlgReportViewImp::~DlgReportViewImp() diff --git a/src/Gui/DlgReportViewImp.h b/src/Gui/DlgReportViewImp.h index 6b4d992966..b4565b97f2 100644 --- a/src/Gui/DlgReportViewImp.h +++ b/src/Gui/DlgReportViewImp.h @@ -31,7 +31,7 @@ namespace Gui { namespace Dialog { class Ui_DlgReportView; -/** The DlgReportViewImp class implements the available settings for the +/** The DlgReportViewImp class implements the available settings for the * report output window to change. * \author Werner Mayer */ diff --git a/src/Gui/DlgRunExternal.cpp b/src/Gui/DlgRunExternal.cpp index 91ea200fd3..61851f5c92 100644 --- a/src/Gui/DlgRunExternal.cpp +++ b/src/Gui/DlgRunExternal.cpp @@ -40,8 +40,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgRunExternal */ /** - * Constructs a DlgRunExternal which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgRunExternal which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. @@ -62,7 +62,7 @@ DlgRunExternal::DlgRunExternal( QWidget* parent, Qt::WindowFlags fl ) ui->extensionWidget->hide(); } -/** +/** * Destroys the object and frees any allocated resources */ DlgRunExternal::~DlgRunExternal() @@ -114,8 +114,8 @@ void DlgRunExternal::advanced (void) void DlgRunExternal::finished (int exitCode, QProcess::ExitStatus exitStatus) { - Q_UNUSED(exitCode); - Q_UNUSED(exitStatus); + Q_UNUSED(exitCode); + Q_UNUSED(exitStatus); ui->buttonAccept->setEnabled(true); ui->buttonDiscard->setEnabled(true); ui->buttonAbort->setEnabled(false); diff --git a/src/Gui/DlgRunExternal.h b/src/Gui/DlgRunExternal.h index 65693858a2..108de5241a 100644 --- a/src/Gui/DlgRunExternal.h +++ b/src/Gui/DlgRunExternal.h @@ -37,7 +37,7 @@ class Ui_DlgRunExternal; * \author Jürgen Riegel */ class GuiExport DlgRunExternal : public QDialog -{ +{ Q_OBJECT public: diff --git a/src/Gui/DlgSettings3DViewImp.cpp b/src/Gui/DlgSettings3DViewImp.cpp index 3f6dbb0acc..134aae1336 100644 --- a/src/Gui/DlgSettings3DViewImp.cpp +++ b/src/Gui/DlgSettings3DViewImp.cpp @@ -52,8 +52,8 @@ using namespace Gui::Dialog; bool DlgSettings3DViewImp::showMsg = true; /** - * Constructs a DlgSettings3DViewImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgSettings3DViewImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ DlgSettings3DViewImp::DlgSettings3DViewImp(QWidget* parent) : PreferencePage( parent ) @@ -62,7 +62,7 @@ DlgSettings3DViewImp::DlgSettings3DViewImp(QWidget* parent) ui->setupUi(this); } -/** +/** * Destroys the object and frees any allocated resources */ DlgSettings3DViewImp::~DlgSettings3DViewImp() diff --git a/src/Gui/DlgSettingsDocumentImp.cpp b/src/Gui/DlgSettingsDocumentImp.cpp index 2a5fe4a4fc..e973043a82 100644 --- a/src/Gui/DlgSettingsDocumentImp.cpp +++ b/src/Gui/DlgSettingsDocumentImp.cpp @@ -35,8 +35,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgSettingsDocumentImp */ /** - * Constructs a DlgSettingsDocumentImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgSettingsDocumentImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ DlgSettingsDocumentImp::DlgSettingsDocumentImp( QWidget* parent ) : PreferencePage( parent ) @@ -58,7 +58,7 @@ DlgSettingsDocumentImp::DlgSettingsDocumentImp( QWidget* parent ) connect( ui->prefLicenseType, SIGNAL(currentIndexChanged(int)), this, SLOT(onLicenseTypeChanged(int)) ); } -/** +/** * Destroys the object and frees any allocated resources */ DlgSettingsDocumentImp::~DlgSettingsDocumentImp() @@ -143,8 +143,8 @@ void DlgSettingsDocumentImp::changeEvent(QEvent *e) } } -/** - * Set the correct URL depending on the license type +/** + * Set the correct URL depending on the license type */ void DlgSettingsDocumentImp::onLicenseTypeChanged(int index) { diff --git a/src/Gui/DlgSettingsImageImp.h b/src/Gui/DlgSettingsImageImp.h index f5a7ab2727..1e079b3750 100644 --- a/src/Gui/DlgSettingsImageImp.h +++ b/src/Gui/DlgSettingsImageImp.h @@ -24,8 +24,8 @@ #ifndef GUI_DIALOG_DLGSETTINGSIMAGE_IMP_H #define GUI_DIALOG_DLGSETTINGSIMAGE_IMP_H -#include -#include +#include +#include #include #include diff --git a/src/Gui/DlgSettingsMacroImp.cpp b/src/Gui/DlgSettingsMacroImp.cpp index 5f2548cf8e..cfd8534aa1 100644 --- a/src/Gui/DlgSettingsMacroImp.cpp +++ b/src/Gui/DlgSettingsMacroImp.cpp @@ -33,8 +33,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgSettingsMacroImp */ /** - * Constructs a DlgSettingsMacroImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgSettingsMacroImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ DlgSettingsMacroImp::DlgSettingsMacroImp( QWidget* parent ) : PreferencePage( parent ) @@ -52,7 +52,7 @@ DlgSettingsMacroImp::DlgSettingsMacroImp( QWidget* parent ) } } -/** +/** * Destroys the object and frees any allocated resources */ DlgSettingsMacroImp::~DlgSettingsMacroImp() diff --git a/src/Gui/DlgSettingsNavigation.cpp b/src/Gui/DlgSettingsNavigation.cpp index 575de5dc2f..e85fc23a23 100644 --- a/src/Gui/DlgSettingsNavigation.cpp +++ b/src/Gui/DlgSettingsNavigation.cpp @@ -51,7 +51,7 @@ using namespace Gui::Dialog; /** * Constructs a DlgSettingsNavigation which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * name 'name' and widget flags set to 'f' */ DlgSettingsNavigation::DlgSettingsNavigation(QWidget* parent) : PreferencePage( parent ) @@ -62,7 +62,7 @@ DlgSettingsNavigation::DlgSettingsNavigation(QWidget* parent) retranslate(); } -/** +/** * Destroys the object and frees any allocated resources */ DlgSettingsNavigation::~DlgSettingsNavigation() @@ -127,7 +127,7 @@ void DlgSettingsNavigation::loadSettings() index = hGrp->GetInt("OrbitStyle", int(NavigationStyle::Trackball)); index = Base::clamp(index, 0, ui->comboOrbitStyle->count()-1); ui->comboOrbitStyle->setCurrentIndex(index); - + index = hGrp->GetInt("CornerNaviCube", 1); ui->naviCubeCorner->setCurrentIndex(index); diff --git a/src/Gui/DlgSettingsUnitsImp.cpp b/src/Gui/DlgSettingsUnitsImp.cpp index 51a14120b4..cb4c3e701f 100644 --- a/src/Gui/DlgSettingsUnitsImp.cpp +++ b/src/Gui/DlgSettingsUnitsImp.cpp @@ -57,8 +57,8 @@ using namespace Base; #endif /** - * Constructs a DlgSettingsUnitsImp which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgSettingsUnitsImp which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ DlgSettingsUnitsImp::DlgSettingsUnitsImp(QWidget* parent) : PreferencePage( parent ), ui(new Ui_DlgSettingsUnits) @@ -86,7 +86,7 @@ DlgSettingsUnitsImp::DlgSettingsUnitsImp(QWidget* parent) } } -/** +/** * Destroys the object and frees any allocated resources */ DlgSettingsUnitsImp::~DlgSettingsUnitsImp() @@ -125,7 +125,7 @@ void DlgSettingsUnitsImp::saveSettings() // Set actual value Base::UnitsApi::setDecimals(ui->spinBoxDecimals->value()); - + // Convert the combobox index to the its integer denominator. Currently // with 1/2, 1/4, through 1/128, this little equation directly computes the // denominator given the combobox integer. diff --git a/src/Gui/DlgSettingsViewColor.cpp b/src/Gui/DlgSettingsViewColor.cpp index ad5cf7520c..972bf40de9 100644 --- a/src/Gui/DlgSettingsViewColor.cpp +++ b/src/Gui/DlgSettingsViewColor.cpp @@ -35,8 +35,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::DlgSettingsViewColor */ /** - * Constructs a DlgSettingsViewColor which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a DlgSettingsViewColor which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent) : PreferencePage(parent) @@ -47,7 +47,7 @@ DlgSettingsViewColor::DlgSettingsViewColor(QWidget* parent) ui->SelectionColor->setEnabled(ui->checkBoxSelection->isChecked()); } -/** +/** * Destroys the object and frees any allocated resources */ DlgSettingsViewColor::~DlgSettingsViewColor() diff --git a/src/Gui/DlgSettingsViewColor.h b/src/Gui/DlgSettingsViewColor.h index 2b02cb00c1..12ff65125c 100644 --- a/src/Gui/DlgSettingsViewColor.h +++ b/src/Gui/DlgSettingsViewColor.h @@ -37,7 +37,7 @@ class Ui_DlgSettingsViewColor; * @author Werner Mayer */ class DlgSettingsViewColor : public PreferencePage -{ +{ Q_OBJECT public: diff --git a/src/Gui/DlgToolbarsImp.cpp b/src/Gui/DlgToolbarsImp.cpp index 2907d254e5..aa69ed6b71 100644 --- a/src/Gui/DlgToolbarsImp.cpp +++ b/src/Gui/DlgToolbarsImp.cpp @@ -130,7 +130,7 @@ DlgCustomToolbars::DlgCustomToolbars(DlgCustomToolbars::Type t, QWidget* parent) } } - QStringList labels; + QStringList labels; labels << tr("Icon") << tr("Command"); ui->commandTreeWidget->setHeaderLabels(labels); ui->commandTreeWidget->header()->hide(); diff --git a/src/Gui/DlgToolbarsImp.h b/src/Gui/DlgToolbarsImp.h index 109b24b509..12a7b7ea80 100644 --- a/src/Gui/DlgToolbarsImp.h +++ b/src/Gui/DlgToolbarsImp.h @@ -33,19 +33,19 @@ class Ui_DlgCustomToolbars; /** This class implements the creation of user defined toolbars. * In the left panel are shown all command groups with their command objects. - * If any changeable toolbar was created in the left panel are shown all commands + * If any changeable toolbar was created in the left panel are shown all commands * of the currently edited toolbar, otherwise it is empty. * All changes to a toolbar is done immediately. - * + * * \author Werner Mayer */ class DlgCustomToolbars : public CustomizeActionPage -{ +{ Q_OBJECT protected: enum Type { Toolbar, Toolboxbar }; - + DlgCustomToolbars(Type, QWidget* parent = 0); virtual ~DlgCustomToolbars(); @@ -90,7 +90,7 @@ private: * \author Werner Mayer */ class DlgCustomToolbarsImp : public DlgCustomToolbars -{ +{ Q_OBJECT public: @@ -113,7 +113,7 @@ private: }; /** This class implements the creation of user defined toolbox bars. - * A toolbox bar is the same as a toolbar - a collection of several + * A toolbox bar is the same as a toolbar - a collection of several * action objects - unless a toolbox bar is placed in a toolbox, * while a toolbar is placed in the dock areas of the main window. * So toolbox bars are predestinated to save place on your desktop. @@ -122,7 +122,7 @@ private: * \author Werner Mayer */ class DlgCustomToolBoxbarsImp : public DlgCustomToolbars -{ +{ Q_OBJECT public: diff --git a/src/Gui/DlgUndoRedo.cpp b/src/Gui/DlgUndoRedo.cpp index 298d6e9c5a..2d183dcb60 100644 --- a/src/Gui/DlgUndoRedo.cpp +++ b/src/Gui/DlgUndoRedo.cpp @@ -38,8 +38,8 @@ using namespace Gui::Dialog; /* TRANSLATOR Gui::Dialog::UndoRedoDialog */ /** - * Constructs a UndoRedoDialog which is a child of 'parent', with the - * name 'name'.' + * Constructs a UndoRedoDialog which is a child of 'parent', with the + * name 'name'.' */ UndoDialog::UndoDialog( QWidget* parent ) : QMenu( parent ) @@ -47,7 +47,7 @@ UndoDialog::UndoDialog( QWidget* parent ) connect(this, SIGNAL(aboutToShow()), this, SLOT(onFetchInfo())); } -/** +/** * Destroys the object and frees any allocated resources. */ UndoDialog::~UndoDialog() @@ -55,11 +55,11 @@ UndoDialog::~UndoDialog() // no need to delete child widgets, Qt does it all for us } -/** - * This method fetches the undo / redo information from the +/** + * This method fetches the undo / redo information from the * active document and shows it in the undo / redo dialog. */ -void UndoDialog::onFetchInfo() +void UndoDialog::onFetchInfo() { clear(); // Remove first all items @@ -103,8 +103,8 @@ void UndoDialog::onSelected() /* TRANSLATOR Gui::Dialog::RedoDialog */ /** - * Constructs a UndoRedoDialog which is a child of 'parent', with the - * name 'name'.' + * Constructs a UndoRedoDialog which is a child of 'parent', with the + * name 'name'.' */ RedoDialog::RedoDialog( QWidget* parent ) : QMenu( parent ) @@ -112,7 +112,7 @@ RedoDialog::RedoDialog( QWidget* parent ) connect(this, SIGNAL(aboutToShow()), this, SLOT(onFetchInfo())); } -/** +/** * Destroys the object and frees any allocated resources. */ RedoDialog::~RedoDialog() @@ -120,11 +120,11 @@ RedoDialog::~RedoDialog() // no need to delete child widgets, Qt does it all for us } -/** - * This method fetches the undo / redo information from the +/** + * This method fetches the undo / redo information from the * active document and shows it in the undo / redo dialog. */ -void RedoDialog::onFetchInfo() +void RedoDialog::onFetchInfo() { clear(); // Remove first all items diff --git a/src/Gui/DlgUndoRedo.h b/src/Gui/DlgUndoRedo.h index 62b2ca9c6f..300b936406 100644 --- a/src/Gui/DlgUndoRedo.h +++ b/src/Gui/DlgUndoRedo.h @@ -33,7 +33,7 @@ namespace Dialog { * \author Werner Mayer */ class UndoDialog : public QMenu -{ +{ Q_OBJECT public: @@ -49,7 +49,7 @@ protected Q_SLOTS: * \author Werner Mayer */ class RedoDialog : public QMenu -{ +{ Q_OBJECT public: diff --git a/src/Gui/DlgUnitsCalculatorImp.h b/src/Gui/DlgUnitsCalculatorImp.h index 0e1ddd5607..93174200c6 100644 --- a/src/Gui/DlgUnitsCalculatorImp.h +++ b/src/Gui/DlgUnitsCalculatorImp.h @@ -35,7 +35,7 @@ class Ui_DlgUnitCalculator; /** * The DlgUnitsCalculator provides a unit conversion dialog - * \author Juergen Riegel + * \author Juergen Riegel */ class DlgUnitsCalculator : public QDialog { diff --git a/src/Gui/DlgWorkbenchesImp.cpp b/src/Gui/DlgWorkbenchesImp.cpp index 850de62cf3..3e4b15f21c 100644 --- a/src/Gui/DlgWorkbenchesImp.cpp +++ b/src/Gui/DlgWorkbenchesImp.cpp @@ -1,7 +1,6 @@ /*************************************************************************** * Copyright (c) 2015 FreeCAD Developers * * Author: Przemo Firszt * - * Based on DlgToolbars.cpp file * * * * This file is part of the FreeCAD CAx development system. * * * @@ -22,6 +21,8 @@ * * ***************************************************************************/ +// Based on DlgToolbars.cpp + #include "PreCompiled.h" #ifndef _PreComp_ diff --git a/src/Gui/DlgWorkbenchesImp.h b/src/Gui/DlgWorkbenchesImp.h index 0321e2e606..64097849d2 100644 --- a/src/Gui/DlgWorkbenchesImp.h +++ b/src/Gui/DlgWorkbenchesImp.h @@ -1,7 +1,6 @@ /*************************************************************************** * Copyright (c) 2015 FreeCAD Developers * * Author: Przemo Firszt * - * Based on DlgToolbars.h file * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Library General Public * @@ -20,6 +19,8 @@ * * ***************************************************************************/ +// Based on DlgToolbars.h file + #ifndef GUI_DIALOG_DLGWORKBENCHES_IMP_H #define GUI_DIALOG_DLGWORKBENCHES_IMP_H diff --git a/src/Gui/DockWindow.h b/src/Gui/DockWindow.h index 910aae70c6..9e53f6e44b 100644 --- a/src/Gui/DockWindow.h +++ b/src/Gui/DockWindow.h @@ -34,10 +34,10 @@ class MDIView; class Application; /** Base class of all dockable windows belonging to a document - * there are two ways of belonging to a document. The + * there are two ways of belonging to a document. The * first way is to a fixed one. The second way is to always * belong to the active document, that means switching every time - * the active document is changing. It also means that the view + * the active document is changing. It also means that the view * belongs sometimes to no document at all! * @see TreeView * @see Gui::Document @@ -60,7 +60,7 @@ public: */ virtual ~DockWindow(); - /** @name methods to override + /** @name methods to override */ //@{ /// get called when the document is updated @@ -82,4 +82,4 @@ Q_SIGNALS: } // namespace Gui -#endif // GUI_DOCKWINDOW_H +#endif // GUI_DOCKWINDOW_H diff --git a/src/Gui/DockWindowManager.cpp b/src/Gui/DockWindowManager.cpp index a3b5db25ab..4bafc8c099 100644 --- a/src/Gui/DockWindowManager.cpp +++ b/src/Gui/DockWindowManager.cpp @@ -261,10 +261,10 @@ void DockWindowManager::retranslate() * \li Std_SelectionView * * To avoid name clashes the caller should use names of the form \a module_widgettype, i. e. if a analyse dialog for - * the mesh module is added the name must then be Mesh_AnalyzeDialog. + * the mesh module is added the name must then be Mesh_AnalyzeDialog. * - * To make use of dock windows when a workbench gets loaded the method setupDockWindows() must reimplemented in a - * subclass of Gui::Workbench. + * To make use of dock windows when a workbench gets loaded the method setupDockWindows() must reimplemented in a + * subclass of Gui::Workbench. */ bool DockWindowManager::registerDockWindow(const char* name, QWidget* widget) { diff --git a/src/Gui/DockWindowManager.h b/src/Gui/DockWindowManager.h index 2a29ce4ac0..a38d89a2b1 100644 --- a/src/Gui/DockWindowManager.h +++ b/src/Gui/DockWindowManager.h @@ -71,7 +71,7 @@ public: void setup(DockWindowItems*); /// Adds a QDockWidget to the main window and sets \a widget as its widget - QDockWidget* addDockWindow(const char* name, QWidget* widget, + QDockWidget* addDockWindow(const char* name, QWidget* widget, Qt::DockWidgetArea pos = Qt::AllDockWidgetAreas); /// Removes and destroys the QDockWidget and returns the widget /// with name \a name added with @ref addDockWindow. @@ -102,7 +102,7 @@ private Q_SLOTS: private: QDockWidget* findDockWidget(const QList&, const QString&) const; - + DockWindowManager(); ~DockWindowManager(); static DockWindowManager* _instance; @@ -111,4 +111,4 @@ private: } // namespace Gui -#endif // GUI_DOCKWINDOWMANAGER_H +#endif // GUI_DOCKWINDOWMANAGER_H diff --git a/src/Gui/Document.cpp b/src/Gui/Document.cpp index b8ae366c16..e6463eec6a 100644 --- a/src/Gui/Document.cpp +++ b/src/Gui/Document.cpp @@ -199,7 +199,7 @@ Document::Document(App::Document* pcDocument,Application * app) (boost::bind(&Gui::Document::importObjects, this, bp::_1, bp::_2, bp::_3)); d->connectFinishImportObjects = pcDocument->signalFinishImportObjects.connect (boost::bind(&Gui::Document::slotFinishImportObjects, this, bp::_1)); - + d->connectUndoDocument = pcDocument->signalUndo.connect (boost::bind(&Gui::Document::slotUndoDocument, this, bp::_1)); d->connectRedoDocument = pcDocument->signalRedo.connect @@ -348,7 +348,7 @@ bool Document::setEdit(Gui::ViewProvider* p, int ModNum, const char *subname) // ViewProvider::setEditViewer(), which transfer all child node of the view // provider into an editing node inside the viewer of this document. And // that's may actually be the case, as the subname referenced sub object - // is allowed to be in other documents. + // is allowed to be in other documents. // // We just disabling editing external parent object here, for bug // tracking purpose. Because, bringing an unrelated external object to @@ -380,7 +380,7 @@ bool Document::setEdit(Gui::ViewProvider* p, int ModNum, const char *subname) // } auto sobj = obj->getSubObject(subname,0,&d->_editingTransform); if(!sobj || !sobj->getNameInDocument()) { - FC_ERR("Invalid sub object '" << obj->getFullName() + FC_ERR("Invalid sub object '" << obj->getFullName() << '.' << (subname?subname:"") << "'"); return false; } @@ -396,7 +396,7 @@ bool Document::setEdit(Gui::ViewProvider* p, int ModNum, const char *subname) View3DInventor *view3d = dynamic_cast(getActiveView()); // if the currently active view is not the 3d view search for it and activate it - if (view3d) + if (view3d) getMainWindow()->setActiveWindow(view3d); else view3d = dynamic_cast(setActiveView(vp)); @@ -453,7 +453,7 @@ void Document::setEditingTransform(const Base::Matrix4D &mat) { d->_editObjs.clear(); d->_editingTransform = mat; View3DInventor *activeView = dynamic_cast(getActiveView()); - if (activeView) + if (activeView) activeView->getViewer()->setEditingTransform(mat); } @@ -477,7 +477,7 @@ void Document::_resetEdit(void) // the editing object gets deleted inside the above call to // 'finishEditing()', which will trigger our slotDeletedObject(), which // nullifies _editViewProvider. - if (d->_editViewProvider && d->_editViewProvider->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) + if (d->_editViewProvider && d->_editViewProvider->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) signalResetEdit(*(static_cast(d->_editViewProvider))); d->_editViewProvider = 0; @@ -506,7 +506,7 @@ void Document::_resetEdit(void) Application::Instance->setEditDocument(0); } -ViewProvider *Document::getInEdit(ViewProviderDocumentObject **parentVp, +ViewProvider *Document::getInEdit(ViewProviderDocumentObject **parentVp, std::string *subname, int *mode, std::string *subelement) const { if(parentVp) *parentVp = d->_editViewProviderParent; @@ -540,7 +540,7 @@ void Document::setAnnotationViewProvider(const char* name, ViewProvider *pcProvi if (it != d->_ViewProviderMapAnnotation.end()) removeAnnotationViewProvider(name); - // add + // add d->_ViewProviderMapAnnotation[name] = pcProvider; // cycling to all views of the document @@ -570,7 +570,7 @@ void Document::removeAnnotationViewProvider(const char* name) } delete it->second; - d->_ViewProviderMapAnnotation.erase(it); + d->_ViewProviderMapAnnotation.erase(it); } @@ -584,7 +584,7 @@ ViewProvider* Document::getViewProvider(const App::DocumentObject* Feat) const std::vector Document::getViewProvidersOfType(const Base::Type& typeId) const { std::vector Objects; - for (std::map::const_iterator it = + for (std::map::const_iterator it = d->_ViewProviderMap.begin(); it != d->_ViewProviderMap.end(); ++it ) { if (it->second->getTypeId().isDerivedFrom(typeId)) Objects.push_back(it->second); @@ -739,7 +739,7 @@ void Document::slotDeletedObject(const App::DocumentObject& Obj) std::list::iterator vIt; setModified(true); //Base::Console().Log("Document::slotDeleteObject() called\n"); - + // cycling to all views of the document ViewProvider* viewProvider = getViewProvider(&Obj); if(!viewProvider) return; @@ -779,7 +779,7 @@ void Document::beforeDelete() { if(editDoc) { auto vp = dynamic_cast(editDoc->d->_editViewProvider); auto vpp = dynamic_cast(editDoc->d->_editViewProviderParent); - if(editDoc == this || + if(editDoc == this || (vp && vp->getDocument()==this) || (vpp && vpp->getDocument()==this)) { @@ -797,13 +797,13 @@ void Document::slotChangedObject(const App::DocumentObject& Obj, const App::Prop if (viewProvider) { try { viewProvider->update(&Prop); - if(d->_editingViewer + if(d->_editingViewer && d->_editingObject - && d->_editViewProviderParent + && d->_editViewProviderParent && (Prop.isDerivedFrom(App::PropertyPlacement::getClassTypeId()) // Issue ID 0004230 : getName() can return null in which case strstr() crashes || (Prop.getName() && strstr(Prop.getName(),"Scale"))) - && d->_editObjs.count(&Obj)) + && d->_editObjs.count(&Obj)) { Base::Matrix4D mat; auto sobj = d->_editViewProviderParent->getObject()->getSubObject( @@ -891,8 +891,8 @@ void Document::slotUndoDocument(const App::Document& doc) { if (d->_pcDocument != &doc) return; - - signalUndoDocument(*this); + + signalUndoDocument(*this); getMainWindow()->updateActions(); } @@ -900,8 +900,8 @@ void Document::slotRedoDocument(const App::Document& doc) { if (d->_pcDocument != &doc) return; - - signalRedoDocument(*this); + + signalRedoDocument(*this); getMainWindow()->updateActions(); } @@ -922,8 +922,8 @@ void Document::slotSkipRecompute(const App::Document& doc, const std::vector_pcDocument != &doc) return; - if(objs.size()>1 || - App::GetApplication().getActiveDocument()!=&doc || + if(objs.size()>1 || + App::GetApplication().getActiveDocument()!=&doc || !doc.testStatus(App::Document::AllowPartialRecompute)) return; App::DocumentObject *obj = 0; @@ -967,7 +967,7 @@ void Document::setModified(bool b) if(d->_isModified == b) return; d->_isModified = b; - + std::list mdis = getMDIViews(); for (std::list::iterator it = mdis.begin(); it != mdis.end(); ++it) { (*it)->setWindowModified(b); @@ -1173,8 +1173,8 @@ bool Document::saveAs(void) getMainWindow()->showMessage(QObject::tr("Save document under new filename...")); QString exe = qApp->applicationName(); - QString fn = FileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe), - QString::fromUtf8(getDocument()->FileName.getValue()), + QString fn = FileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe), + QString::fromUtf8(getDocument()->FileName.getValue()), QString::fromLatin1("%1 %2 (*.FCStd)").arg(exe).arg(QObject::tr("Document"))); if (!fn.isEmpty()) { QFileInfo fi; @@ -1252,9 +1252,9 @@ void Document::saveAll() gdoc->setModified(false); } catch (const Base::Exception& e) { - QMessageBox::critical(getMainWindow(), - QObject::tr("Failed to save document") + - QString::fromLatin1(": %1").arg(QString::fromUtf8(doc->getName())), + QMessageBox::critical(getMainWindow(), + QObject::tr("Failed to save document") + + QString::fromLatin1(": %1").arg(QString::fromUtf8(doc->getName())), QString::fromLatin1(e.what())); break; } @@ -1267,8 +1267,8 @@ bool Document::saveCopy(void) getMainWindow()->showMessage(QObject::tr("Save a copy of the document under new filename...")); QString exe = qApp->applicationName(); - QString fn = FileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe), - QString::fromUtf8(getDocument()->FileName.getValue()), + QString fn = FileDialog::getSaveFileName(getMainWindow(), QObject::tr("Save %1 Document").arg(exe), + QString::fromUtf8(getDocument()->FileName.getValue()), QObject::tr("%1 document (*.FCStd)").arg(exe)); if (!fn.isEmpty()) { const char * DocName = App::GetApplication().getDocumentName(getDocument()); @@ -1298,7 +1298,7 @@ unsigned int Document::getMemSize (void) const return size; } -/** +/** * Adds a separate XML file to the projects file that contains information about the view providers. */ void Document::Save (Base::Writer &writer) const @@ -1326,7 +1326,7 @@ void Document::Save (Base::Writer &writer) const } } -/** +/** * Loads a separate XML file from the projects file with information about the view providers. */ void Document::Restore(Base::XMLReader &reader) @@ -1475,7 +1475,7 @@ void Document::SaveDocFile (Base::Writer &writer) const writer.Stream() << "::const_iterator it; // writing the view provider names itself - writer.Stream() << writer.ind() << "_ViewProviderMap.size() <<"\">" << std::endl; bool xml = writer.isForceXML(); @@ -1507,7 +1507,7 @@ void Document::SaveDocFile (Base::Writer &writer) const << "expanded=\"" << (doc->testStatus(App::Expand) ? 1:0) << "\""; if (obj->hasExtensions()) writer.Stream() << " Extensions=\"True\""; - + writer.Stream() << ">" << std::endl; obj->Save(writer); writer.Stream() << writer.ind() << "" << std::endl; @@ -1530,7 +1530,7 @@ void Document::SaveDocFile (Base::Writer &writer) const } writer.incInd(); // indentation for camera settings - writer.Stream() << writer.ind() << "\n"; writer.decInd(); // indentation for camera settings writer.Stream() << "" << std::endl; @@ -1552,7 +1552,7 @@ void Document::exportObjects(const std::vector& obj, Base: // writing the view provider names itself writer.incInd(); // indentation for 'ViewProviderData Count' - writer.Stream() << writer.ind() << "" << std::endl; bool xml = writer.isForceXML(); @@ -1622,7 +1622,7 @@ void Document::importObjects(const std::vector& obj, Base: auto vpd = Base::freecad_dynamic_cast(pObj); if(vpd) vpd->startRestoring(); pObj->Restore(*localreader); - if (expanded && vpd) + if (expanded && vpd) this->signalExpandObject(*vpd, TreeItemMode::ExpandItem,0,0); } localreader->readEndElement("ViewProvider"); @@ -1906,7 +1906,7 @@ bool Document::isLastView(void) return false; } -/** +/** * This method checks if the document can be closed. It checks on * the save state of the document and is able to abort the closing. */ @@ -2035,7 +2035,7 @@ bool Document::sendMsgToFirstView(const Base::Type& typeId, const char* pMsg, co /// Getter for the active view MDIView* Document::getActiveView(void) const { - // get the main window's active view + // get the main window's active view MDIView* active = getMainWindow()->activeWindow(); // get all MDI views of the document @@ -2050,7 +2050,7 @@ MDIView* Document::getActiveView(void) const } } - if (ok) + if (ok) return active; // the active view is not part of this document, just use the last view @@ -2181,13 +2181,13 @@ Gui::MDIView* Document::getEditingViewOfViewProvider(Gui::ViewProvider* vp) cons } //-------------------------------------------------------------------------- -// UNDO REDO transaction handling +// UNDO REDO transaction handling //-------------------------------------------------------------------------- /** Open a new Undo transaction on the active document * This method opens a new UNDO transaction on the active document. This transaction - * will later appear in the UNDO/REDO dialog with the name of the command. If the user - * recall the transaction everything changed on the document between OpenCommand() and - * CommitCommand will be undone (or redone). You can use an alternative name for the + * will later appear in the UNDO/REDO dialog with the name of the command. If the user + * recall the transaction everything changed on the document between OpenCommand() and + * CommitCommand will be undone (or redone). You can use an alternative name for the * operation default is the command name. * @see CommitCommand(),AbortCommand() */ @@ -2258,7 +2258,7 @@ bool Document::checkTransactionID(bool undo, int iSteps) { } str << " " << doc->getName() << "\n"; } - int ret = QMessageBox::warning(getMainWindow(), + int ret = QMessageBox::warning(getMainWindow(), undo?QObject::tr("Undo"):QObject::tr("Redo"), QString::fromLatin1("%1,\n%2%3") .arg(QObject::tr( @@ -2384,7 +2384,7 @@ void Document::handleChildren3D(ViewProvider* viewProvider, bool deleting) } } } - } + } } void Document::toggleInSceneGraph(ViewProvider *vp) diff --git a/src/Gui/Document.h b/src/Gui/Document.h index 171ae9ed3f..b24887aaf8 100644 --- a/src/Gui/Document.h +++ b/src/Gui/Document.h @@ -115,15 +115,15 @@ public: /// signal on leaving edit mode mutable boost::signals2::signal signalResetEdit; /// signal on changed Object, the 2nd argument is the highlite mode to use - mutable boost::signals2::signal signalHighlightObject; + App::DocumentObject *parent, + const char *subname)> signalHighlightObject; /// signal on changed Object, the 2nd argument is the highlite mode to use mutable boost::signals2::signal signalExpandObject; /// signal on changed ShowInTree property in view provider mutable boost::signals2::signal signalShowItem; @@ -246,7 +246,7 @@ public: /// reset edit of this document void _resetEdit(void); /// get the in edit ViewProvider or NULL - ViewProvider *getInEdit(ViewProviderDocumentObject **parentVp=0, + ViewProvider *getInEdit(ViewProviderDocumentObject **parentVp=0, std::string *subname=0, int *mode=0, std::string *subElement=0) const; /// set the in edit ViewProvider subname reference void setInEdit(ViewProviderDocumentObject *parentVp, const char *subname); diff --git a/src/Gui/DocumentModel.cpp b/src/Gui/DocumentModel.cpp index a43e9a07bf..228e5a0df7 100644 --- a/src/Gui/DocumentModel.cpp +++ b/src/Gui/DocumentModel.cpp @@ -84,12 +84,12 @@ namespace Gui { { return childItems.count(); } virtual QVariant data(int role) const { - Q_UNUSED(role); + Q_UNUSED(role); return QVariant(); } virtual bool setData (const QVariant & value, int role) { - Q_UNUSED(value); + Q_UNUSED(value); if (role == Qt::EditRole) { return true; } @@ -299,7 +299,7 @@ namespace Gui { ViewProviderIndex* c = static_cast(*it)->clone(); copy->appendChild(c); } - return copy; + return copy; } void ViewProviderIndex::findViewProviders(const ViewProviderDocumentObject& vp, @@ -412,7 +412,7 @@ void DocumentModel::slotDeleteDocument(const Gui::Document& Doc) void DocumentModel::slotRenameDocument(const Gui::Document& Doc) { - Q_UNUSED(Doc); + Q_UNUSED(Doc); // do nothing here } @@ -437,12 +437,12 @@ void DocumentModel::slotActiveDocument(const Gui::Document& /*Doc*/) void DocumentModel::slotInEdit(const Gui::ViewProviderDocumentObject& v) { - Q_UNUSED(v); + Q_UNUSED(v); } void DocumentModel::slotResetEdit(const Gui::ViewProviderDocumentObject& v) { - Q_UNUSED(v); + Q_UNUSED(v); } void DocumentModel::slotNewObject(const Gui::ViewProviderDocumentObject& obj) @@ -551,13 +551,13 @@ void DocumentModel::slotChangeObject(const Gui::ViewProviderDocumentObject& obj, void DocumentModel::slotRenameObject(const Gui::ViewProviderDocumentObject& obj) { - Q_UNUSED(obj); + Q_UNUSED(obj); // renaming of objects not supported at the moment } void DocumentModel::slotActiveObject(const Gui::ViewProviderDocumentObject& obj) { - Q_UNUSED(obj); + Q_UNUSED(obj); // do nothing here because this is automatically done by calling // ViewProviderIndex::data() } @@ -665,7 +665,7 @@ int DocumentModel::rowCount (const QModelIndex & parent) const QVariant DocumentModel::headerData (int section, Qt::Orientation orientation, int role) const { - Q_UNUSED(section); + Q_UNUSED(section); if (orientation == Qt::Horizontal) { if (role != Qt::DisplayRole) return QVariant(); diff --git a/src/Gui/DocumentObserverPython.h b/src/Gui/DocumentObserverPython.h index be1427630b..96d9196008 100644 --- a/src/Gui/DocumentObserverPython.h +++ b/src/Gui/DocumentObserverPython.h @@ -35,7 +35,7 @@ namespace Gui /** * The DocumentObserverPython class is used to notify registered Python instances * whenever something happens to a document, like creation, destruction, adding or - * removing viewproviders or when viewprovider property changes. This is the equivalent to the app + * removing viewproviders or when viewprovider property changes. This is the equivalent to the app * python document observer */ class GuiExport DocumentObserverPython @@ -49,7 +49,7 @@ public: static void addObserver(const Py::Object& obj); static void removeObserver(const Py::Object& obj); -private: +private: /** Checks if a new document was created */ void slotCreatedDocument(const Gui::Document& Doc); /** Checks if the given document is about to be closed */ diff --git a/src/Gui/DocumentPyImp.cpp b/src/Gui/DocumentPyImp.cpp index 4d638a2df5..0ffbfd7095 100644 --- a/src/Gui/DocumentPyImp.cpp +++ b/src/Gui/DocumentPyImp.cpp @@ -62,11 +62,11 @@ std::string DocumentPy::representation(void) const PyObject* DocumentPy::show(PyObject *args) { char *psFeatStr; - if (!PyArg_ParseTuple(args, "s;Name of the Feature to show have to be given!",&psFeatStr)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "s;Name of the Feature to show have to be given!",&psFeatStr)) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { - getDocumentPtr()->setShow(psFeatStr); + getDocumentPtr()->setShow(psFeatStr); Py_Return; } PY_CATCH; } @@ -74,11 +74,11 @@ PyObject* DocumentPy::show(PyObject *args) PyObject* DocumentPy::hide(PyObject *args) { char *psFeatStr; - if (!PyArg_ParseTuple(args, "s;Name of the Feature to hide have to be given!",&psFeatStr)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "s;Name of the Feature to hide have to be given!",&psFeatStr)) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { - getDocumentPtr()->setHide(psFeatStr); + getDocumentPtr()->setHide(psFeatStr); Py_Return; } PY_CATCH; } @@ -90,13 +90,13 @@ PyObject* DocumentPy::setPos(PyObject *args) PyObject *pcMatObj; if (!PyArg_ParseTuple(args, "sO!;Name of the Feature and the transformation matrix have to be given!", &psFeatStr, - &(Base::MatrixPy::Type), &pcMatObj)) // convert args: Python->C - return NULL; // NULL triggers exception + &(Base::MatrixPy::Type), &pcMatObj)) // convert args: Python->C + return NULL; // NULL triggers exception mat = static_cast(pcMatObj)->value(); PY_TRY { - getDocumentPtr()->setPos(psFeatStr,mat); + getDocumentPtr()->setPos(psFeatStr,mat); Py_Return; } PY_CATCH; } @@ -159,8 +159,8 @@ PyObject* DocumentPy::getInEdit(PyObject *args) PyObject* DocumentPy::resetEdit(PyObject *args) { - if (!PyArg_ParseTuple(args, ";No arguments allowed")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, ";No arguments allowed")) // convert args: Python->C + return NULL; // NULL triggers exception getDocumentPtr()->resetEdit(); Py_Return; @@ -169,8 +169,8 @@ PyObject* DocumentPy::resetEdit(PyObject *args) PyObject* DocumentPy::addAnnotation(PyObject *args) { char *psAnnoName,*psFileName,*psModName=0; - if (!PyArg_ParseTuple(args, "ss|s;Name of the Annotation and a file name have to be given!",&psAnnoName,&psFileName,&psModName)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "ss|s;Name of the Annotation and a file name have to be given!",&psAnnoName,&psFileName,&psModName)) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { ViewProviderExtern *pcExt = new ViewProviderExtern(); @@ -187,8 +187,8 @@ PyObject* DocumentPy::addAnnotation(PyObject *args) PyObject* DocumentPy::update(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { getDocumentPtr()->onUpdate(); @@ -199,8 +199,8 @@ PyObject* DocumentPy::update(PyObject *args) PyObject* DocumentPy::getObject(PyObject *args) { char *sName; - if (!PyArg_ParseTuple(args, "s",&sName)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "s",&sName)) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { ViewProvider *pcView = getDocumentPtr()->getViewProviderByName(sName); @@ -214,8 +214,8 @@ PyObject* DocumentPy::getObject(PyObject *args) PyObject* DocumentPy::activeObject(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { App::DocumentObject *pcFtr = getDocumentPtr()->getDocument()->getActiveObject(); @@ -230,8 +230,8 @@ PyObject* DocumentPy::activeObject(PyObject *args) PyObject* DocumentPy::activeView(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { Gui::MDIView *pcView = getDocumentPtr()->getActiveView(); @@ -247,8 +247,8 @@ PyObject* DocumentPy::activeView(PyObject *args) PyObject* DocumentPy::mdiViewsOfType(PyObject *args) { char* sType; - if (!PyArg_ParseTuple(args, "s", &sType)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "s", &sType)) // convert args: Python->C + return NULL; // NULL triggers exception Base::Type type = Base::Type::fromName(sType); if (type == Base::Type::badType()) { @@ -268,8 +268,8 @@ PyObject* DocumentPy::mdiViewsOfType(PyObject *args) PyObject* DocumentPy::sendMsgToViews(PyObject *args) { char* msg; - if (!PyArg_ParseTuple(args, "s", &msg)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "s", &msg)) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { getDocumentPtr()->sendMsgToViews(msg); @@ -280,8 +280,8 @@ PyObject* DocumentPy::sendMsgToViews(PyObject *args) PyObject* DocumentPy::mergeProject(PyObject *args) { char* filename; - if (!PyArg_ParseTuple(args, "s", &filename)) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "s", &filename)) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { Base::FileInfo fi(filename); @@ -301,18 +301,18 @@ PyObject* DocumentPy::toggleTreeItem(PyObject *args) if (PyArg_ParseTuple(args,"O!|is",&(App::DocumentObjectPy::Type), &object,&mod,&subname)) { App::DocumentObject* Object = static_cast(object)->getDocumentObjectPtr(); // Should be set! - assert(Object); + assert(Object); App::DocumentObject *parent = 0; if (subname) { auto sobj = Object->getSubObject(subname); - if (!sobj) + if (!sobj) throw Py::RuntimeError("Sub-object not found"); parent = Object; Object = sobj; } - - // get the gui document of the Assembly Item + + // get the gui document of the Assembly Item //ActiveAppDoc = Item->getDocument(); //ActiveGuiDoc = Gui::Application::Instance->getDocument(getDocumentPtr()); Gui::ViewProviderDocumentObject* ActiveVp = dynamic_cast (getDocumentPtr()->getViewProvider(Object)); @@ -410,8 +410,8 @@ Py::Object DocumentPy::getInEditInfo(void) const { ViewProviderDocumentObject *vp = 0; std::string subname,subelement; int mode = 0; - getDocumentPtr()->getInEdit(&vp,&subname,&mode,&subelement); - if (!vp || !vp->getObject() || !vp->getObject()->getNameInDocument()) + getDocumentPtr()->getInEdit(&vp,&subname,&mode,&subelement); + if (!vp || !vp->getObject() || !vp->getObject()->getNameInDocument()) return Py::None(); return Py::TupleN(Py::Object(vp->getObject()->getPyObject(),true), Py::String(subname),Py::String(subelement),Py::Int(mode)); @@ -420,7 +420,7 @@ Py::Object DocumentPy::getInEditInfo(void) const { void DocumentPy::setInEditInfo(Py::Object arg) { PyObject *pyobj = 0; const char *subname = 0; - if (!PyArg_ParseTuple(arg.ptr(), "O!s", + if (!PyArg_ParseTuple(arg.ptr(), "O!s", &Gui::ViewProviderDocumentObjectPy::Type, &pyobj,&subname)) throw Py::Exception(); getDocumentPtr()->setInEdit(static_cast( @@ -476,11 +476,11 @@ int DocumentPy::setCustomAttributes(const char* attr, PyObject *) ViewProvider* obj = getDocumentPtr()->getViewProviderByName(attr); if (obj) { std::stringstream str; - str << "'Document' object attribute '" << attr + str << "'Document' object attribute '" << attr << "' must not be set this way" << std::ends; throw Py::AttributeError(str.str()); } - + return 0; } diff --git a/src/Gui/EditorView.cpp b/src/Gui/EditorView.cpp index eb13f0a7b3..75f010da77 100644 --- a/src/Gui/EditorView.cpp +++ b/src/Gui/EditorView.cpp @@ -166,7 +166,7 @@ void EditorView::closeEvent(QCloseEvent* event) void EditorView::OnChange(Base::Subject &rCaller,const char* rcReason) { - Q_UNUSED(rCaller); + Q_UNUSED(rCaller); ParameterGrp::handle hPrefGrp = getWindowParameter(); if (strcmp(rcReason, "EnableLineNumber") == 0) { //bool show = hPrefGrp->GetBool( "EnableLineNumber", true ); @@ -178,7 +178,7 @@ void EditorView::checkTimestamp() QFileInfo fi(d->fileName); uint timeStamp = fi.lastModified().toTime_t(); if (timeStamp != d->timeStamp) { - switch( QMessageBox::question( this, tr("Modified file"), + switch( QMessageBox::question( this, tr("Modified file"), tr("%1.\n\nThis has been modified outside of the source editor. Do you want to reload it?").arg(d->fileName), QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) ) { @@ -300,10 +300,10 @@ bool EditorView::canClose(void) if ( !d->textEdit->document()->isModified() ) return true; this->setFocus(); // raises the view to front - switch( QMessageBox::question(this, tr("Unsaved document"), + switch( QMessageBox::question(this, tr("Unsaved document"), tr("The document has been modified.\n" "Do you want to save your changes?"), - QMessageBox::Yes|QMessageBox::Default, QMessageBox::No, + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel|QMessageBox::Escape)) { case QMessageBox::Yes: @@ -380,7 +380,7 @@ void EditorView::copy(void) } /** - * Pastes the text from the clipboard into the text edit at the current cursor position. + * Pastes the text from the clipboard into the text edit at the current cursor position. * If there is no text in the clipboard nothing happens. */ void EditorView::paste(void) @@ -531,7 +531,7 @@ void EditorView::redoAvailable(bool redo) void EditorView::contentsChange(int position, int charsRemoved, int charsAdded) { - Q_UNUSED(position); + Q_UNUSED(position); if (d->lock) return; if (charsRemoved > 0 && charsAdded > 0) diff --git a/src/Gui/ExpressionBinding.cpp b/src/Gui/ExpressionBinding.cpp index 21ded0c06a..0be9f992c6 100644 --- a/src/Gui/ExpressionBinding.cpp +++ b/src/Gui/ExpressionBinding.cpp @@ -84,7 +84,7 @@ void Gui::ExpressionBinding::setExpression(boost::shared_ptr expr) if(m_autoApply) apply(); - + if(transaction) App::GetApplication().closeActiveTransaction(); @@ -97,7 +97,7 @@ void ExpressionBinding::bind(const App::ObjectIdentifier &_path) Q_ASSERT(prop != 0); path = prop->canonicalPath(_path); - + //connect to be informed about changes DocumentObject * docObj = path.getDocumentObject(); connection = docObj->ExpressionEngine.expressionChanged.connect(boost::bind(&ExpressionBinding::expressionChange, this, bp::_1)); @@ -170,7 +170,7 @@ QPixmap ExpressionBinding::getIcon(const char* name, const QSize& size) const bool ExpressionBinding::apply(const std::string & propName) { - Q_UNUSED(propName); + Q_UNUSED(propName); if (hasExpression()) { DocumentObject * docObj = path.getDocumentObject(); diff --git a/src/Gui/ExpressionBinding.h b/src/Gui/ExpressionBinding.h index 031006ca5d..40c1604fb2 100644 --- a/src/Gui/ExpressionBinding.h +++ b/src/Gui/ExpressionBinding.h @@ -49,19 +49,19 @@ public: bool hasExpression() const; QPixmap getIcon(const char *name, const QSize &size) const; - - //auto apply means that the python code is issued not only on apply() but + + //auto apply means that the python code is issued not only on apply() but //also on setExpression bool autoApply() const {return m_autoApply;}; void setAutoApply(bool value) {m_autoApply = value;}; - + protected: const App::ObjectIdentifier & getPath() const { return path; } boost::shared_ptr getExpression() const; std::string getExpressionString(bool no_throw=true) const; std::string getEscapedExpressionString() const; virtual void setExpression(boost::shared_ptr expr); - + //gets called when the bound expression is changed, either by this binding or any external action virtual void onChange() {}; diff --git a/src/Gui/ExpressionCompleter.cpp b/src/Gui/ExpressionCompleter.cpp index 812ba04168..0338cfc757 100644 --- a/src/Gui/ExpressionCompleter.cpp +++ b/src/Gui/ExpressionCompleter.cpp @@ -1,3 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2015 Eivind Kvedalen * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + #include "PreCompiled.h" #ifndef _PreComp_ @@ -59,12 +81,12 @@ public: } // This ExpressionCompleter model works without any pysical items. - // Everything item related is stored inside QModelIndex.InternalPointer/InternalId(), + // Everything item related is stored inside QModelIndex.InternalPointer/InternalId(), // using the following Info structure. // // The Info contains two indices, one for document and the other for object. // For 32-bit system, the index is 16bit which limits the size to 64K. For - // 64-bit system, the index is 32bit. + // 64-bit system, the index is 32bit. // // The "virtual" items are organized as a tree. The root items are special, // which consists of three types in the following order, @@ -142,7 +164,7 @@ public: App::Document *doc = 0; App::DocumentObject *obj = 0; App::Property *prop = 0; - if(idx>=0 && idx=0 && idx=0 && v) { QString res; @@ -189,7 +211,7 @@ public: if(sep && !noProperty) res += QLatin1Char('.'); } else { - if(idx & 1) + if(idx & 1) res = QString::fromUtf8(quote(doc->Label.getStrValue()).c_str()); else res = QString::fromLatin1(doc->getName()); @@ -237,7 +259,7 @@ public: if(count) *count = propSize; } - if(v) + if(v) *v = QString::fromLatin1(prop->getName()); return; } @@ -287,7 +309,7 @@ public: row = -1; }else{ info = getInfo(parent); - if(info.d.doc<0) + if(info.d.doc<0) info.d.doc = parent.row(); else if(info.d.obj<0) info.d.obj = parent.row(); @@ -318,7 +340,7 @@ private: * @param parent Parent object owning the completer. */ -ExpressionCompleter::ExpressionCompleter(const App::DocumentObject * currentDocObj, +ExpressionCompleter::ExpressionCompleter(const App::DocumentObject * currentDocObj, QObject *parent, bool noProperty) : QCompleter(parent), currentObj(currentDocObj), noProperty(noProperty) { @@ -393,7 +415,7 @@ QStringList ExpressionCompleter::splitPath ( const QString & input ) const l << Base::Tools::fromStdString(*sli); ++sli; } - FC_TRACE("split path " << path + FC_TRACE("split path " << path << " -> " << l.join(QLatin1String("/")).toUtf8().constData()); return l; } @@ -477,7 +499,7 @@ void ExpressionCompleter::slotUpdate(const QString & prefix, int pos) stringing = false; break; } - if(token==ExpressionParser::LT + if(token==ExpressionParser::LT && i && get<0>(tokens[i-1])==ExpressionParser::LT) { --i; @@ -497,7 +519,7 @@ void ExpressionCompleter::slotUpdate(const QString & prefix, int pos) i = static_cast(tokens.size()) - 1; for(;i>=0;--i) { int token = get<0>(tokens[i]); - if (token != '.' && token != '#' && + if (token != '.' && token != '#' && token != ExpressionParser::IDENTIFIER && token != ExpressionParser::STRING && token != ExpressionParser::UNIT) diff --git a/src/Gui/ExpressionCompleter.h b/src/Gui/ExpressionCompleter.h index 2d291e4c60..8829c77836 100644 --- a/src/Gui/ExpressionCompleter.h +++ b/src/Gui/ExpressionCompleter.h @@ -1,3 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2015 Eivind Kvedalen * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + #ifndef EXPRESSIONCOMPLETER_H #define EXPRESSIONCOMPLETER_H @@ -28,10 +50,10 @@ class GuiExport ExpressionCompleter : public QCompleter { Q_OBJECT public: - ExpressionCompleter(const App::DocumentObject * currentDocObj, + ExpressionCompleter(const App::DocumentObject * currentDocObj, QObject *parent = 0, bool noProperty = false); - void getPrefixRange(int &start, int &end) const { + void getPrefixRange(int &start, int &end) const { start = prefixStart; end = prefixEnd; } diff --git a/src/Gui/FileDialog.cpp b/src/Gui/FileDialog.cpp index 45afbddf68..139b1bdf78 100644 --- a/src/Gui/FileDialog.cpp +++ b/src/Gui/FileDialog.cpp @@ -131,7 +131,7 @@ void FileDialog::accept() /** * This is a convenience static function that will return a file name selected by the user. The file does not have to exist. */ -QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption, const QString & dir, +QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption, const QString & dir, const QString & filter, QString * selectedFilter, Options options) { QString dirName = dir; @@ -144,7 +144,7 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption, dirName += QLatin1String("/"); dirName += fi.fileName(); } - + // get the suffix for the filter QRegExp rx; rx.setPattern(QLatin1String("\\s(\\(\\*\\.\\w{1,})\\W")); @@ -166,7 +166,7 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption, #endif // NOTE: We must not change the specified file name afterwards as we may return the name of an already - // existing file. Hence we must extract the first matching suffix from the filter list and append it + // existing file. Hence we must extract the first matching suffix from the filter list and append it // before showing the file dialog. QString file; if (dontUseNativeDialog()) { @@ -245,11 +245,11 @@ QString FileDialog::getExistingDirectory( QWidget * parent, const QString & capt return path; } -/** - * This is a convenience static function that returns an existing file selected by the user. +/** + * This is a convenience static function that returns an existing file selected by the user. * If the user pressed Cancel, it returns a null string. */ -QString FileDialog::getOpenFileName(QWidget * parent, const QString & caption, const QString & dir, +QString FileDialog::getOpenFileName(QWidget * parent, const QString & caption, const QString & dir, const QString & filter, QString * selectedFilter, Options options) { QString dirName = dir; @@ -597,7 +597,7 @@ void FileOptionsDialog::setOptionsWidget(FileOptionsDialog::ExtensionPosition po // Instead of resizing the dialog we can fix the layout size. // This however, doesn't work nicely when the extension widget - // is higher/wider than the dialog. + // is higher/wider than the dialog. //grid->setSizeConstraint(QLayout::SetFixedSize); oldSize = size(); @@ -727,7 +727,7 @@ void FileChooser::editingFinished() fileNameSelected(le_converted); } -/** +/** * Sets the file name \a s. */ void FileChooser::setFileName( const QString& s ) @@ -795,7 +795,7 @@ void FileChooser::setMode( FileChooser::Mode m ) /** * \property FileChooser::filter * - * This property holds the set filter to choose a file. This property is used only if + * This property holds the set filter to choose a file. This property is used only if * FileChooser::Mode is set to File. * * \sa chooseFile(), filter(), setFilter(). @@ -806,7 +806,7 @@ QString FileChooser::filter() const } /** - * Sets the filter for choosing a file. + * Sets the filter for choosing a file. */ void FileChooser::setFilter ( const QString& filter ) { @@ -966,7 +966,7 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con QFileInfo fi(*it); QString ext = fi.completeSuffix().toLower(); std::map filters = App::GetApplication().getExportFilters(ext.toLatin1()); - + if (filters.empty()) { ext = fi.suffix().toLower(); filters = App::GetApplication().getExportFilters(ext.toLatin1()); @@ -980,7 +980,7 @@ SelectModule::Dict SelectModule::exportHandler(const QStringList& fileNames, con dict[*it] = QString::fromLatin1(filters.begin()->second.c_str()); } - for (QMap::const_iterator it = filetypeHandler.begin(); + for (QMap::const_iterator it = filetypeHandler.begin(); it != filetypeHandler.end(); ++it) { if (it.value().size() > 1) { SelectModule dlg(it.key(),it.value(), getMainWindow()); @@ -1028,7 +1028,7 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con QFileInfo fi(*it); QString ext = fi.completeSuffix().toLower(); std::map filters = App::GetApplication().getImportFilters(ext.toLatin1()); - + if (filters.empty()) { ext = fi.suffix().toLower(); filters = App::GetApplication().getImportFilters(ext.toLatin1()); @@ -1042,7 +1042,7 @@ SelectModule::Dict SelectModule::importHandler(const QStringList& fileNames, con dict[*it] = QString::fromLatin1(filters.begin()->second.c_str()); } - for (QMap::const_iterator it = filetypeHandler.begin(); + for (QMap::const_iterator it = filetypeHandler.begin(); it != filetypeHandler.end(); ++it) { if (it.value().size() > 1) { SelectModule dlg(it.key(),it.value(), getMainWindow()); diff --git a/src/Gui/FileDialog.h b/src/Gui/FileDialog.h index c5f1fcef20..7c9ffe6582 100644 --- a/src/Gui/FileDialog.h +++ b/src/Gui/FileDialog.h @@ -48,11 +48,11 @@ class GuiExport FileDialog : public QFileDialog Q_OBJECT public: - static QString getOpenFileName( QWidget * parent = 0, const QString & caption = QString(), const QString & dir = QString(), + static QString getOpenFileName( QWidget * parent = 0, const QString & caption = QString(), const QString & dir = QString(), const QString & filter = QString(), QString * selectedFilter = 0, Options options = Options() ); - static QString getSaveFileName( QWidget * parent = 0, const QString & caption = QString(), const QString & dir = QString(), + static QString getSaveFileName( QWidget * parent = 0, const QString & caption = QString(), const QString & dir = QString(), const QString & filter = QString(), QString * selectedFilter = 0, Options options = Options() ); - static QString getExistingDirectory( QWidget * parent = 0, const QString & caption = QString(), const QString & dir = QString(), + static QString getExistingDirectory( QWidget * parent = 0, const QString & caption = QString(), const QString & dir = QString(), Options options = ShowDirsOnly ); static QStringList getOpenFileNames( QWidget * parent = 0, const QString & caption = QString(), const QString & dir = QString(), const QString & filter = QString(), QString * selectedFilter = 0, Options options = Options() ); @@ -80,7 +80,7 @@ private: // ---------------------------------------------------------------------- /** - * The FileOptionsDialog class provides an extensible file dialog with an additional widget either at the right + * The FileOptionsDialog class provides an extensible file dialog with an additional widget either at the right * or at the bottom, that can be shown or hidden with the 'Extended' button. * @author Werner Mayer */ @@ -155,12 +155,12 @@ public: FileChooser ( QWidget * parent = 0 ); virtual ~FileChooser(); - /** + /** * Returns the set filter. */ QString filter() const; - /** + /** * Returns the filename. */ QString fileName() const; @@ -234,7 +234,7 @@ public: virtual ~SelectModule(); QString getModule() const; - /** @name Import/Export handler + /** @name Import/Export handler * These methods accepts a file name or a list of file names and return * a map of file names with the associated Python module that should open * the file. diff --git a/src/Gui/Flag.cpp b/src/Gui/Flag.cpp index 51e5c10cd1..907a3a32a9 100644 --- a/src/Gui/Flag.cpp +++ b/src/Gui/Flag.cpp @@ -274,13 +274,13 @@ void FlagLayout::setGeometry(const QRect &rect) if (position == TopLeft) { topHeight += spacing(); - item->setGeometry(QRect(rect.x() + spacing(), topHeight, + item->setGeometry(QRect(rect.x() + spacing(), topHeight, item->sizeHint().width(), item->sizeHint().height())); topHeight += item->geometry().height(); } else if (position == BottomLeft) { bottomHeight += item->geometry().height() + spacing(); - item->setGeometry(QRect(rect.x() + spacing(), rect.height() - bottomHeight, + item->setGeometry(QRect(rect.x() + spacing(), rect.height() - bottomHeight, item->sizeHint().width(), item->sizeHint().height())); } } @@ -296,13 +296,13 @@ void FlagLayout::setGeometry(const QRect &rect) int rightpos = item->sizeHint().width() + spacing(); if (position == TopRight) { topHeight += spacing(); - item->setGeometry(QRect(rect.x() + rect.width() - rightpos, topHeight, + item->setGeometry(QRect(rect.x() + rect.width() - rightpos, topHeight, item->sizeHint().width(), item->sizeHint().height())); topHeight += item->geometry().height(); } else if (position == BottomRight) { bottomHeight += item->geometry().height() + spacing(); - item->setGeometry(QRect(rect.x() + rect.width() - rightpos, rect.height() - bottomHeight, + item->setGeometry(QRect(rect.x() + rect.width() - rightpos, rect.height() - bottomHeight, item->sizeHint().width(), item->sizeHint().height())); } } diff --git a/src/Gui/FreeCADGuiInit.py b/src/Gui/FreeCADGuiInit.py index 5f0f619cf8..66ada4808d 100644 --- a/src/Gui/FreeCADGuiInit.py +++ b/src/Gui/FreeCADGuiInit.py @@ -1,12 +1,5 @@ -# FreeCAD gui init module -# (c) 2003 Jürgen Riegel -# -# Gathering all the information to start FreeCAD -# This is the second one of three init scripts, the third one -# runs when the gui is up - #*************************************************************************** -#* Copyright (c) 2002 Jürgen Riegel * +#* Copyright (c) 2002,2003 Jürgen Riegel * #* * #* This file is part of the FreeCAD CAx development system. * #* * @@ -28,6 +21,11 @@ #* * #***************************************************************************/ +# FreeCAD gui init module +# +# Gathering all the information to start FreeCAD +# This is the second one of three init scripts, the third one +# runs when the gui is up # imports the one and only import FreeCAD, FreeCADGui diff --git a/src/Gui/GLPainter.cpp b/src/Gui/GLPainter.cpp index 20fda13bcd..ad65e96b3b 100644 --- a/src/Gui/GLPainter.cpp +++ b/src/Gui/GLPainter.cpp @@ -390,7 +390,7 @@ void Polyline::setCloseStippled(bool c) void Polyline::setLineWidth(float l) { - line = l; + line = l; } void Polyline::addNode(const QPoint& p) diff --git a/src/Gui/GraphvizView.cpp b/src/Gui/GraphvizView.cpp index c28ff37216..58632d31cc 100644 --- a/src/Gui/GraphvizView.cpp +++ b/src/Gui/GraphvizView.cpp @@ -103,7 +103,7 @@ public: void run() { QByteArray preprocessed = str; - + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/DependencyGraph"); if(hGrp->GetBool("Unflatten", true)) { // Write data to unflatten process @@ -116,7 +116,7 @@ public: unflattenProc.closeWriteChannel(); unflattenProc.waitForFinished(); } - + dotProc.write(preprocessed); dotProc.closeWriteChannel(); if (!dotProc.waitForFinished()) { @@ -131,7 +131,7 @@ public: QProcess * dotProcess() { return &dotProc; } - + QProcess * unflattenProcess() { return &unflattenProc; } @@ -343,13 +343,13 @@ QByteArray GraphvizView::exportGraph(const QString& format) QString exe = QString::fromLatin1("%1/dot").arg(path); QString unflatten = QString::fromLatin1("%1/unflatten").arg(path); #endif - + dotProc.setEnvironment(QProcess::systemEnvironment()); dotProc.start(exe, args); if (!dotProc.waitForStarted()) { return QByteArray(); } - + ParameterGrp::handle depGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/DependencyGraph"); if(depGrp->GetBool("Unflatten", true)) { flatProc.setEnvironment(QProcess::systemEnvironment()); @@ -361,12 +361,12 @@ QByteArray GraphvizView::exportGraph(const QString& format) flatProc.closeWriteChannel(); if (!flatProc.waitForFinished()) return QByteArray(); - + dotProc.write(flatProc.readAll()); } - else - dotProc.write(graphCode.c_str(), graphCode.size()); - + else + dotProc.write(graphCode.c_str(), graphCode.size()); + dotProc.closeWriteChannel(); if (!dotProc.waitForFinished()) return QByteArray(); @@ -434,11 +434,11 @@ bool GraphvizView::onHasMsg(const char* pMsg) const else if (strcmp("SaveAs",pMsg) == 0) return true; else if (strcmp("Print",pMsg) == 0) - return true; + return true; else if (strcmp("PrintPreview",pMsg) == 0) - return true; + return true; else if (strcmp("PrintPdf",pMsg) == 0) - return true; + return true; return false; } diff --git a/src/Gui/GraphvizView.h b/src/Gui/GraphvizView.h index 5a9dc204b3..0fc516dbb4 100644 --- a/src/Gui/GraphvizView.h +++ b/src/Gui/GraphvizView.h @@ -35,7 +35,7 @@ class QSvgRenderer; class QGraphicsSvgItem; class GraphicsViewZoom; -namespace Gui +namespace Gui { class GraphvizWorker; diff --git a/src/Gui/GuiApplication.cpp b/src/Gui/GuiApplication.cpp index 9b435015e3..abdbf870c9 100644 --- a/src/Gui/GuiApplication.cpp +++ b/src/Gui/GuiApplication.cpp @@ -85,7 +85,7 @@ bool GUIApplication::notify (QObject * receiver, QEvent * event) return false; } try { - if (event->type() == Spaceball::ButtonEvent::ButtonEventType || + if (event->type() == Spaceball::ButtonEvent::ButtonEventType || event->type() == Spaceball::MotionEvent::MotionEventType) return processSpaceballEvent(receiver, event); else diff --git a/src/Gui/GuiApplicationNativeEventAware.cpp b/src/Gui/GuiApplicationNativeEventAware.cpp index 3506ec9e68..e3f77bde13 100644 --- a/src/Gui/GuiApplicationNativeEventAware.cpp +++ b/src/Gui/GuiApplicationNativeEventAware.cpp @@ -117,7 +117,7 @@ void Gui::GUIApplicationNativeEventAware::postMotionEvent(std::vector motio Spaceball::MotionEvent *motionEvent = new Spaceball::MotionEvent(); motionEvent->setTranslations(motionDataArray[0], motionDataArray[1], motionDataArray[2]); - motionEvent->setRotations(motionDataArray[3], motionDataArray[4], motionDataArray[5]); + motionEvent->setRotations(motionDataArray[3], motionDataArray[4], motionDataArray[5]); this->postEvent(currentWidget, motionEvent); } diff --git a/src/Gui/GuiApplicationNativeEventAware.h b/src/Gui/GuiApplicationNativeEventAware.h index 156a0f7504..2265d03217 100644 --- a/src/Gui/GuiApplicationNativeEventAware.h +++ b/src/Gui/GuiApplicationNativeEventAware.h @@ -43,7 +43,7 @@ namespace Gui ~GUIApplicationNativeEventAware(); void initSpaceball(QMainWindow *window); bool isSpaceballPresent() const {return spaceballPresent;} - void setSpaceballPresent(bool present) {spaceballPresent = present;} + void setSpaceballPresent(bool present) {spaceballPresent = present;} bool processSpaceballEvent(QObject *object, QEvent *event); void postMotionEvent(std::vector motionDataArray); void postButtonEvent(int buttonNumber, int buttonPress); diff --git a/src/Gui/GuiConsole.cpp b/src/Gui/GuiConsole.cpp index 8833da243c..a2bfc7dd30 100644 --- a/src/Gui/GuiConsole.cpp +++ b/src/Gui/GuiConsole.cpp @@ -45,7 +45,7 @@ const unsigned int GUIConsole::s_nMaxLines = 1000; unsigned int GUIConsole::s_nRefCount = 0; /** Constructor - * Open a Top level Window and redirect the + * Open a Top level Window and redirect the * stdin, stdout and stderr stream to it. * Not needed in Linux! */ @@ -76,7 +76,7 @@ GUIConsole::GUIConsole (void) } /** Destructor - * Close the window and redirect the streams back + * Close the window and redirect the streams back */ GUIConsole::~GUIConsole (void) { diff --git a/src/Gui/GuiConsole.h b/src/Gui/GuiConsole.h index a06c7bc250..bca7a14a22 100644 --- a/src/Gui/GuiConsole.h +++ b/src/Gui/GuiConsole.h @@ -30,12 +30,12 @@ namespace Gui { /** The console window class - * This class opens a console window when instantiated - * and redirects the stdio streams to it as long it exists. + * This class opens a console window when instantiated + * and redirects the stdio streams to it as long it exists. * This is for Windows only! * After instantiation it automatically registers itself at * the FCConsole class and gets all the FCConsoleObserver - * messages. The class must not used directly! Only the + * messages. The class must not used directly! Only the * FCConsole class is allowed! * @see FCConsole * \author Jürgen Riegel diff --git a/src/Gui/InputField.cpp b/src/Gui/InputField.cpp index ecc5f72961..9192b8237b 100644 --- a/src/Gui/InputField.cpp +++ b/src/Gui/InputField.cpp @@ -314,7 +314,7 @@ void InputField::pushToHistory(const QString &valueq) for(std::vector::const_iterator it = hist.begin();it!=hist.end();++it) if( *it == val) return; - + std::string value(val.toUtf8()); if(_handle.isValid()){ char hist1[21]; @@ -489,7 +489,7 @@ double InputField::singleStep(void)const return StepSize; } -/// set the value of the singleStep property +/// set the value of the singleStep property void InputField::setSingleStep(double s) { StepSize = s; @@ -501,7 +501,7 @@ double InputField::maximum(void)const return Maximum; } -/// set the value of the maximum property +/// set the value of the maximum property void InputField::setMaximum(double m) { Maximum = m; @@ -517,7 +517,7 @@ double InputField::minimum(void)const return Minimum; } -/// set the value of the minimum property +/// set the value of the minimum property void InputField::setMinimum(double m) { Minimum = m; @@ -581,7 +581,7 @@ int InputField::historySize(void)const return HistorySize; } -// set the value of the minimum property +// set the value of the minimum property void InputField::setHistorySize(int i) { assert(i>=0); diff --git a/src/Gui/InputField.h b/src/Gui/InputField.h index 0f956970e5..d242446f90 100644 --- a/src/Gui/InputField.h +++ b/src/Gui/InputField.h @@ -107,11 +107,11 @@ public: /// (shown by the red pixmap in the gui) bool hasValidInput() { return validInput;} - /** sets the Unit this field is working with. + /** sets the Unit this field is working with. * After setting the Unit the field will only accept - * user input with this unit type. Or if the user input + * user input with this unit type. Or if the user input * a value without unit, this one will be added to the resulting - * Quantity. + * Quantity. */ void setUnit(const Base::Unit&); const Base::Unit& getUnit() const; @@ -120,33 +120,33 @@ public: void setToLastUsedValue(void); /// get the value of the singleStep property double singleStep(void)const; - /// set the value of the singleStep property + /// set the value of the singleStep property void setSingleStep(double); /// get the value of the maximum property double maximum(void)const; - /// set the value of the maximum property + /// set the value of the maximum property void setMaximum(double); /// get the value of the minimum property double minimum(void)const; - /// set the value of the minimum property + /// set the value of the minimum property void setMinimum(double); /// get the value of the minimum property int historySize(void)const; - /// set the value of the minimum property + /// set the value of the minimum property void setHistorySize(int); - /// set the unit by a string (can be used in the *.ui file) + /// set the unit by a string (can be used in the *.ui file) void setUnitText(const QString&); - /// get the unit as a string (can be used in the *.ui file) - QString getUnitText(void); + /// get the unit as a string (can be used in the *.ui file) + QString getUnitText(void); /// get the value of the precision property - int getPrecision(void) const; - /// set the value of the precision property (can be used in the *.ui file) + int getPrecision(void) const; + /// set the value of the precision property (can be used in the *.ui file) void setPrecision(const int); /// get the value of the format property: "f" (fixed), "e" (scientific), "g" (general) - QString getFormat(void) const; - /// set the value of the format property (can be used in the *.ui file) + QString getFormat(void) const; + /// set the value of the format property (can be used in the *.ui file) void setFormat(const QString&); - /// set the number portion selected (use after setValue()) + /// set the number portion selected (use after setValue()) void selectNumber(void); /// input validation void fixup(QString& input) const; @@ -159,11 +159,11 @@ public: QByteArray paramGrpPath () const; /// set the param group path where the widget writes and reads the default values void setParamGrpPath ( const QByteArray& name ); - /// push a new value to the history, if no string given the actual text of the input field is used. + /// push a new value to the history, if no string given the actual text of the input field is used. void pushToHistory(const QString &valueq = QString()); /// get the history of the field, newest first std::vector getHistory(void); - /// push a new value to the history, if no string given the actual text of the input field is used. + /// push a new value to the history, if no string given the actual text of the input field is used. void pushToSavedValues(const QString &valueq = QString()); /// get the history of the field, newest first std::vector getSavedValues(void); @@ -176,15 +176,15 @@ public: Q_SIGNALS: /** gets emitted if the user has entered a VALID input * Valid means the user inputted string obeys all restrictions - * like: minimum, maximum and/or the right Unit (if specified). - * If you want the unfiltered/non-validated input use textChanged(const QString&) + * like: minimum, maximum and/or the right Unit (if specified). + * If you want the unfiltered/non-validated input use textChanged(const QString&) * instead: */ void valueChanged(const Base::Quantity&); /** gets emitted if the user has entered a VALID input * Valid means the user inputted string obeys all restrictions - * like: minimum, maximum and/or the right Unit (if specified). - * If you want the unfiltered/non-validated input use textChanged(const QString&) + * like: minimum, maximum and/or the right Unit (if specified). + * If you want the unfiltered/non-validated input use textChanged(const QString&) * instead: */ void valueChanged(double); diff --git a/src/Gui/InputVector.cpp b/src/Gui/InputVector.cpp index c6a52cf7a8..9b73b7aafc 100644 --- a/src/Gui/InputVector.cpp +++ b/src/Gui/InputVector.cpp @@ -100,7 +100,7 @@ void LocationWidget::retranslateUi() yLabel->setText(QApplication::translate("Gui::LocationWidget", "Y:")); zLabel->setText(QApplication::translate("Gui::LocationWidget", "Z:")); dLabel->setText(QApplication::translate("Gui::LocationWidget", "Direction:")); - + if (dValue->count() == 0) { dValue->insertItems(0, QStringList() << QApplication::translate("Gui::LocationDialog", "X") @@ -120,7 +120,7 @@ void LocationWidget::retranslateUi() dValue->setItemText(0, QApplication::translate("Gui::LocationDialog", "X")); dValue->setItemText(1, QApplication::translate("Gui::LocationDialog", "Y")); dValue->setItemText(2, QApplication::translate("Gui::LocationDialog", "Z")); - dValue->setItemText(dValue->count()-1, + dValue->setItemText(dValue->count()-1, QApplication::translate("Gui::LocationDialog", "User defined...")); } } diff --git a/src/Gui/InventorAll.h b/src/Gui/InventorAll.h index b559d4a5e5..afcab3da18 100644 --- a/src/Gui/InventorAll.h +++ b/src/Gui/InventorAll.h @@ -36,9 +36,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -49,9 +49,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -82,7 +82,7 @@ #include #include #include -#include +#include #include #include #include @@ -99,7 +99,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/Gui/InventorNavigationStyle.cpp b/src/Gui/InventorNavigationStyle.cpp index eca15da5af..74062c51b8 100644 --- a/src/Gui/InventorNavigationStyle.cpp +++ b/src/Gui/InventorNavigationStyle.cpp @@ -250,8 +250,8 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev) this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise - // the canvas doesn't get any release events - if (this->currentmode != NavigationStyle::ZOOMING && + // the canvas doesn't get any release events + if (this->currentmode != NavigationStyle::ZOOMING && this->currentmode != NavigationStyle::PANNING) { if (this->isPopupMenuEnabled()) { if (!press) { // release right mouse button diff --git a/src/Gui/LinkViewPyImp.cpp b/src/Gui/LinkViewPyImp.cpp index 53cb2777c2..c5d01abe8d 100644 --- a/src/Gui/LinkViewPyImp.cpp +++ b/src/Gui/LinkViewPyImp.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2017 Zheng, Lei (realthunder) * + * Copyright (c) 2017 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -119,7 +119,7 @@ PyObject* LinkViewPy::setMaterial(PyObject *args) { lv->setMaterial(i,materials[i]); Py_Return; } - + PyErr_SetString(PyExc_TypeError, "exepcting a type of Material, [Material,...] or {Int:Material,}"); return 0; } PY_CATCH; @@ -168,7 +168,7 @@ PyObject* LinkViewPy::setTransform(PyObject *args) { lv->setTransform(i,*mat[i]); Py_Return; } - + PyErr_SetString(PyExc_TypeError, "exepcting a type of Matrix, [Matrix,...] or {Int:Matrix,...}"); return 0; } PY_CATCH; @@ -221,7 +221,7 @@ PyObject* LinkViewPy::setLink(PyObject *args) else if(PyObject_TypeCheck(pyObj,&ViewProviderDocumentObjectPy::Type)) vpd = static_cast(pyObj)->getViewProviderDocumentObjectPtr(); else { - PyErr_SetString(PyExc_TypeError, + PyErr_SetString(PyExc_TypeError, "exepcting a type of DocumentObject or ViewProviderDocumentObject"); return 0; } @@ -233,9 +233,9 @@ PyObject* LinkViewPy::setLink(PyObject *args) prop.setPyObject(pySubName); if(obj) - getLinkViewPtr()->setLink(obj,prop.getValue()); + getLinkViewPtr()->setLink(obj,prop.getValue()); else - getLinkViewPtr()->setLinkViewObject(vpd,prop.getValue()); + getLinkViewPtr()->setLinkViewObject(vpd,prop.getValue()); Py_Return; } PY_CATCH; } @@ -283,7 +283,7 @@ PyObject* LinkViewPy::getElementPicked(PyObject* args) void *ptr = 0; Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoPickedPoint *", obj, &ptr, 0); SoPickedPoint *pp = reinterpret_cast(ptr); - if(!pp) + if(!pp) throw Py::TypeError("type must be of coin.SoPickedPoint"); PY_TRY{ std::string name; @@ -302,7 +302,7 @@ PyObject* LinkViewPy::getDetailPath(PyObject* args) void *ptr = 0; Base::Interpreter().convertSWIGPointerObj("pivy.coin", "SoPath *", path, &ptr, 0); SoPath *pPath = reinterpret_cast(ptr); - if(!pPath) + if(!pPath) throw Py::TypeError("type must be of coin.SoPath"); PY_TRY{ SoDetail *det = 0; diff --git a/src/Gui/MDIView.cpp b/src/Gui/MDIView.cpp index 99a8ecb78b..0e64d1a7e5 100644 --- a/src/Gui/MDIView.cpp +++ b/src/Gui/MDIView.cpp @@ -58,7 +58,7 @@ MDIView::MDIView(Gui::Document* pcDocument,QWidget* parent, Qt::WindowFlags wfla , ActiveObjects(pcDocument) { setAttribute(Qt::WA_DeleteOnClose); - + if (pcDocument) { connectDelObject = pcDocument->signalDeletedObject.connect @@ -211,7 +211,7 @@ void MDIView::closeEvent(QCloseEvent *e) // and thus the notification in QMdiSubWindow::closeEvent of // other mdi windows to get maximized if this window // is maximized will fail. - // This odd behaviour is caused by the invocation of + // This odd behaviour is caused by the invocation of // d->mdiArea->removeSubWindow(parent) which we must let there // because otherwise other parts don't work as they should. QMainWindow::closeEvent(e); @@ -308,7 +308,7 @@ void MDIView::setCurrentViewMode(ViewMode mode) if (qobject_cast(this->parentWidget())) getMainWindow()->removeWindow(this,false); setWindowFlags(windowFlags() | Qt::Window); - setParent(0, Qt::Window | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | + setParent(0, Qt::Window | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint); if (this->wstate & Qt::WindowMaximized) showMaximized(); @@ -327,7 +327,7 @@ void MDIView::setCurrentViewMode(ViewMode mode) else showNormal(); } - + this->currentMode = TopLevel; update(); } break; @@ -345,7 +345,7 @@ void MDIView::setCurrentViewMode(ViewMode mode) this->wstate = windowState(); showFullScreen(); } - + this->currentMode = FullScreen; update(); } break; diff --git a/src/Gui/MDIView.h b/src/Gui/MDIView.h index c33f9a336b..0aadbb4ead 100644 --- a/src/Gui/MDIView.h +++ b/src/Gui/MDIView.h @@ -32,7 +32,7 @@ QT_BEGIN_NAMESPACE class QPrinter; QT_END_NAMESPACE -namespace Gui +namespace Gui { class Document; class ViewProvider; @@ -99,8 +99,8 @@ public: /// MDI view mode enum enum ViewMode { - Child, /**< Child viewing, view is docked inside the MDI application window */ - TopLevel, /**< The view becomes a top level window and can be moved outsinde the application window */ + Child, /**< Child viewing, view is docked inside the MDI application window */ + TopLevel, /**< The view becomes a top level window and can be moved outsinde the application window */ FullScreen /**< The view goes to full screen viewing */ }; /** @@ -175,4 +175,4 @@ private: } // namespace Gui -#endif // GUI_MDIVIEW_H +#endif // GUI_MDIVIEW_H diff --git a/src/Gui/Macro.cpp b/src/Gui/Macro.cpp index faae471de8..41ce6da705 100644 --- a/src/Gui/Macro.cpp +++ b/src/Gui/Macro.cpp @@ -103,7 +103,7 @@ void MacroManager::open(MacroType eType, const char *sName) void MacroManager::commit(void) { QFile file(this->macroName); - if (file.open(QFile::WriteOnly)) + if (file.open(QFile::WriteOnly)) { // sort import lines and avoid duplicates QTextStream str(&file); @@ -172,7 +172,7 @@ void MacroManager::addLine(LineType Type, const char* sLine, bool pending) if(pending) { if(!sLine) pendingLine.clear(); - else + else pendingLine.emplace_back(Type,sLine); return; } @@ -263,7 +263,7 @@ namespace Gui { void MacroManager::run(MacroType eType, const char *sName) { - Q_UNUSED(eType); + Q_UNUSED(eType); try { ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter() diff --git a/src/Gui/Macro.h b/src/Gui/Macro.h index 4ef6c4d24c..b2771cf2b5 100644 --- a/src/Gui/Macro.h +++ b/src/Gui/Macro.h @@ -41,7 +41,7 @@ class PythonDebugger; * a macro file (so far). * \author Jürgen Riegel */ -class GuiExport MacroManager : public Base::Observer +class GuiExport MacroManager : public Base::Observer { protected: MacroManager(); @@ -50,22 +50,22 @@ protected: public: /** Macro type enumeration */ - enum MacroType { - File, /**< The macro will be saved in a file */ - User, /**< The macro belongs to the Application and will be saved in the UserParameter */ - Doc /**< The macro belongs to the Document and will be saved and restored with the Document */ - }; + enum MacroType { + File, /**< The macro will be saved in a file */ + User, /**< The macro belongs to the Application and will be saved in the UserParameter */ + Doc /**< The macro belongs to the Document and will be saved and restored with the Document */ + }; /** Line type enumeration */ - enum LineType { + enum LineType { App, /**< The line effects only the document and Application (FreeCAD) */ Gui, /**< The line effects the Gui (FreeCADGui) */ Cmt, /**< The line is handled as a comment */ - }; + }; /** Opens a new Macro recording session * Starts a session with the type and the name of the macro. - * All user interactions will be recorded as long as the commit() or cancel() isn't called. + * All user interactions will be recorded as long as the commit() or cancel() isn't called. * There is only one recording session possible. Trying to open a second one causes an exception: * @param eType Type of the macro * @param sName Name or path of the macro @@ -81,7 +81,7 @@ public: bool isOpen(void) const {return openMacro;} /// insert a new line in the macro void addLine(LineType Type,const char* sLine,bool pending=false); - /** Set the active module + /** Set the active module * This is normally done by the workbench switch. It sets * the actually active application module so when the macro * gets started the right import can be issued. diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index ba3e169fed..6c829f7c80 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -86,7 +86,7 @@ #include "WorkbenchManager.h" #include "Workbench.h" -#include "Window.h" +#include "Window.h" #include "View.h" #include "Macro.h" #include "ProgressBar.h" @@ -140,8 +140,8 @@ MainWindow* MainWindow::instance = 0L; namespace Gui { /** - * The CustomMessageEvent class is used to send messages as events in the methods - * Error(), Warning() and Message() of the StatusBarObserver class to the main window + * The CustomMessageEvent class is used to send messages as events in the methods + * Error(), Warning() and Message() of the StatusBarObserver class to the main window * to display them on the status bar instead of printing them directly to the status bar. * * This makes the usage of StatusBarObserver thread-safe. @@ -288,7 +288,7 @@ MainWindow::MainWindow(QWidget * parent, Qt::WindowFlags f) d->whatsthis = false; d->assistant = new Assistant(); - // global access + // global access instance = this; // support for grouped dragging of dockwidgets @@ -629,7 +629,7 @@ int MainWindow::confirmSave(const char *docName, QWidget *parent, bool addCheckb GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General"); checkBox.setChecked(hGrp->GetBool("ConfirmAll",false)); checkBox.blockSignals(true); - box.addButton(&checkBox, QMessageBox::ResetRole); + box.addButton(&checkBox, QMessageBox::ResetRole); } // add shortcuts @@ -678,7 +678,7 @@ bool MainWindow::closeAllDocuments (bool close) continue; if(!gdoc->canClose(false)) return false; - if(!gdoc->isModified() + if(!gdoc->isModified() || doc->testStatus(App::Document::PartialDoc) || doc->testStatus(App::Document::TempDoc)) continue; @@ -829,8 +829,8 @@ bool MainWindow::eventFilter(QObject* o, QEvent* e) { if (o != this) { if (e->type() == QEvent::WindowStateChange) { - // notify all mdi views when the active view receives a show normal, show minimized - // or show maximized event + // notify all mdi views when the active view receives a show normal, show minimized + // or show maximized event MDIView * view = qobject_cast(o); if (view) { // emit this signal Qt::WindowStates oldstate = static_cast(e)->oldState(); @@ -993,7 +993,7 @@ void MainWindow::removeWindow(Gui::MDIView* view, bool close) // d->mdiArea->removeSubWindow(parent); } - if(close) + if(close) parent->deleteLater(); updateActions(); } @@ -1052,7 +1052,7 @@ void MainWindow::onWindowActivated(QMdiSubWindow* w) w->setProperty("ownWB", QString::fromStdString(WorkbenchManager::instance()->active()->name())); } } - + // Even if windowActivated() signal is emitted mdi doesn't need to be a top-level window. // This happens e.g. if two windows are top-level and one of them gets docked again. // QWorkspace emits the signal then even though the other window is in front. @@ -1063,7 +1063,7 @@ void MainWindow::onWindowActivated(QMdiSubWindow* w) // at least under Linux. It seems to be a problem with the window manager. // Under Windows it seems to work though it's not really sure that it works reliably. // Result: So, we accept the first problem to be sure to avoid the second one. - if ( !view /*|| !mdi->isActiveWindow()*/ ) + if ( !view /*|| !mdi->isActiveWindow()*/ ) return; // either no MDIView or no valid object or no top-level window // set active the appropriate window (it needs not to be part of mdiIds, e.g. directly after creation) @@ -1483,7 +1483,7 @@ void MainWindow::startSplasher(void) { // startup splasher // when running in verbose mode no splasher - if (!(App::Application::Config()["Verbose"] == "Strict") && + if (!(App::Application::Config()["Verbose"] == "Strict") && (App::Application::Config()["RunMode"] == "Gui")) { ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("General"); @@ -1724,7 +1724,7 @@ bool MainWindow::canInsertFromMimeData (const QMimeData * source) const { if (!source) return false; - return source->hasUrls() || + return source->hasUrls() || source->hasFormat(_MimeDocObj) || source->hasFormat(_MimeDocObjX) || source->hasFormat(_MimeDocObjFile) || source->hasFormat(_MimeDocObjXFile); } @@ -1881,7 +1881,7 @@ void MainWindow::changeEvent(QEvent *e) { if (e->type() == QEvent::LanguageChange) { d->sizeLabel->setText(tr("Dimension")); - + CommandManager& rclMan = Application::Instance->commandManager(); std::vector cmd = rclMan.getAllCommands(); for (std::vector::iterator it = cmd.begin(); it != cmd.end(); ++it) @@ -1941,7 +1941,7 @@ void MainWindow::showMessage(const QString& message, int timeout) { void MainWindow::showStatus(int type, const QString& message) { if(QApplication::instance()->thread() != QThread::currentThread()) { - QApplication::postEvent(this, + QApplication::postEvent(this, new CustomMessageEvent(type,message)); return; } diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h index d704956547..b4c94df325 100644 --- a/src/Gui/MainWindow.h +++ b/src/Gui/MainWindow.h @@ -67,7 +67,7 @@ public: } }; -/** +/** * The MainWindow class provides a main window with menu bar, toolbars, dockable windows, * a status bar and mainly a workspace for the MDI windows. * @author Werner Mayer @@ -75,7 +75,7 @@ public: class GuiExport MainWindow : public QMainWindow { Q_OBJECT - + public: /** * Constructs an empty main window. For default \a parent is 0, as there usually is @@ -141,7 +141,7 @@ public: void showDocumentation(const QString& help); //@} - /** @name Layout Methods + /** @name Layout Methods */ //@{ /// Loads the main window settings. @@ -214,7 +214,7 @@ public Q_SLOTS: */ void closeActiveWindow (); /** - * Closes all document window. + * Closes all document window. */ bool closeAllDocuments (bool close=true); /** Pop up a message box asking for saving document @@ -293,7 +293,7 @@ private Q_SLOTS: * Fills up the menu with the current dock windows. */ void onDockWindowMenuAboutToShow(); - /** + /** * This method gets frequently activated and test the commands if they are still active. */ void _updateActions(); diff --git a/src/Gui/ManualAlignment.cpp b/src/Gui/ManualAlignment.cpp index 34dfd5111f..14fe025e3f 100644 --- a/src/Gui/ManualAlignment.cpp +++ b/src/Gui/ManualAlignment.cpp @@ -509,7 +509,7 @@ public: SbRotation rot_cam1, rot_cam2; SbVec3f pos_cam1, pos_cam2; - Private() + Private() : sensorCam1(0), sensorCam2(0) { // left view @@ -551,7 +551,7 @@ public: SoCamera* cam2, SbRotation& rot_cam2, SbVec3f& pos_cam2) { Q_UNUSED(pos_cam2); - + // recompute the diff we have applied to the camera's orientation SbRotation rot = cam1->orientation.getValue(); SbRotation dif = rot * rot_cam1.inverse(); @@ -713,7 +713,7 @@ void ManualAlignment::destruct() } /** - * Checks whether the one instance exists. + * Checks whether the one instance exists. */ bool ManualAlignment::hasInstance() { @@ -851,10 +851,10 @@ void ManualAlignment::startAlignment(Base::Type mousemodel) } myViewer->getViewer(0)->setEditing(true); - myViewer->getViewer(0)->addEventCallback(SoMouseButtonEvent::getClassTypeId(), + myViewer->getViewer(0)->addEventCallback(SoMouseButtonEvent::getClassTypeId(), ManualAlignment::probePickedCallback); myViewer->getViewer(1)->setEditing(true); - myViewer->getViewer(1)->addEventCallback(SoMouseButtonEvent::getClassTypeId(), + myViewer->getViewer(1)->addEventCallback(SoMouseButtonEvent::getClassTypeId(), ManualAlignment::probePickedCallback); // apply the mouse model myViewer->getViewer(0)->setNavigationType(mousemodel); @@ -966,19 +966,19 @@ void ManualAlignment::cancel() void ManualAlignment::align() { - // Now we can start the actual alignment + // Now we can start the actual alignment if (myAlignModel.activeGroup().countPoints() < myPickPoints) { - QMessageBox::warning(myViewer, tr("Manual alignment"), + QMessageBox::warning(myViewer, tr("Manual alignment"), tr("Too few points picked in the left view." " At least %1 points are needed.").arg(myPickPoints)); } else if (myFixedGroup.countPoints() < myPickPoints) { - QMessageBox::warning(myViewer, tr("Manual alignment"), + QMessageBox::warning(myViewer, tr("Manual alignment"), tr("Too few points picked in the right view." " At least %1 points are needed.").arg(myPickPoints)); } else if (myAlignModel.activeGroup().countPoints() != myFixedGroup.countPoints()) { - QMessageBox::warning(myViewer, tr("Manual alignment"), + QMessageBox::warning(myViewer, tr("Manual alignment"), tr("Different number of points picked in left and right view.\n" "On the left view %1 points are picked,\n" "on the right view %2 points are picked.") @@ -1010,7 +1010,7 @@ void ManualAlignment::align() } else { // Inform user that alignment failed - int ret = QMessageBox::critical(myViewer, tr("Manual alignment"), + int ret = QMessageBox::critical(myViewer, tr("Manual alignment"), tr("The alignment failed.\nHow do you want to proceed?"), tr("Retry"), tr("Ignore"), tr("Abort")); if ( ret == 1 ) { @@ -1028,7 +1028,7 @@ void ManualAlignment::align() void ManualAlignment::showInstructions() { - // Now we can start the actual alignment + // Now we can start the actual alignment if (myAlignModel.activeGroup().countPoints() < myPickPoints) { Gui::getMainWindow()->showMessage( tr("Too few points picked in the left view." @@ -1224,7 +1224,7 @@ void ManualAlignment::onCancel() void ManualAlignment::probePickedCallback(void * ud, SoEventCallback * n) { - Q_UNUSED(ud); + Q_UNUSED(ud); Gui::View3DInventorViewer* view = reinterpret_cast(n->getUserData()); const SoEvent* ev = n->getEvent(); @@ -1237,7 +1237,7 @@ void ManualAlignment::probePickedCallback(void * ud, SoEventCallback * n) if (mbe->getButton() == SoMouseButtonEvent::BUTTON1 && mbe->getState() == SoButtonEvent::DOWN) { // if we are in 'align' mode then handle the click event ManualAlignment* self = ManualAlignment::instance(); - // Get the closest point to the camera of the whole scene. + // Get the closest point to the camera of the whole scene. // This point doesn't need to be part of this view provider. Gui::WaitCursor wc; const SoPickedPoint * point = view->getPickedPoint(n); diff --git a/src/Gui/ManualAlignment.h b/src/Gui/ManualAlignment.h index 522f593029..121c3b7ee3 100644 --- a/src/Gui/ManualAlignment.h +++ b/src/Gui/ManualAlignment.h @@ -67,7 +67,7 @@ public: void addView(App::DocumentObject*); std::vector getViews() const; /** - * Checks for the view provider of one of the added views. + * Checks for the view provider of one of the added views. */ bool hasView(Gui::ViewProviderDocumentObject*) const; /** diff --git a/src/Gui/MenuManager.h b/src/Gui/MenuManager.h index 0715219957..52bacbbb0c 100644 --- a/src/Gui/MenuManager.h +++ b/src/Gui/MenuManager.h @@ -68,7 +68,7 @@ private: * The MenuManager class is responsible for the creation of menus and context menus and appending them * to the main window. * @see ToolBoxManager - * @see ToolBarManager + * @see ToolBarManager * @author Werner Mayer */ class GuiExport MenuManager @@ -103,4 +103,4 @@ private: } // namespace Gui -#endif // GUI_MENUMANAGER_H +#endif // GUI_MENUMANAGER_H diff --git a/src/Gui/MergeDocuments.cpp b/src/Gui/MergeDocuments.cpp index 818b6b88c6..9e22096ecc 100644 --- a/src/Gui/MergeDocuments.cpp +++ b/src/Gui/MergeDocuments.cpp @@ -65,7 +65,7 @@ public: } protected: // See App::MergeDocument::XMLMergeReader for comments, with one additional - // benefits, we can save repetitive coding here. + // benefits, we can save repetitive coding here. #if 0 void startElement(const XMLCh* const uri, const XMLCh* const localname, const XMLCh* const qname, diff --git a/src/Gui/MouseSelection.h b/src/Gui/MouseSelection.h index 132326bbb0..667a8be901 100644 --- a/src/Gui/MouseSelection.h +++ b/src/Gui/MouseSelection.h @@ -258,4 +258,4 @@ public: } // namespace Gui -#endif // MOUSESELECTION_H +#endif // MOUSESELECTION_H diff --git a/src/Gui/NaviCube.cpp b/src/Gui/NaviCube.cpp index 2690031d42..72f57992ab 100644 --- a/src/Gui/NaviCube.cpp +++ b/src/Gui/NaviCube.cpp @@ -1086,7 +1086,7 @@ void NaviCubeImplementation::drawNaviCube(bool pickMode) { glVertex3f(0.0f, 0.0f, 0.0f); glEnd(); } - + QColor& c = m_ButtonColor; glColor4f(c.redF(), c.greenF(), c.blueF(), c.alphaF()); glBindTexture(GL_TEXTURE_2D, m_Textures[TEX_VIEW_MENU_ICON]); diff --git a/src/Gui/NavigationStyle.cpp b/src/Gui/NavigationStyle.cpp index d5f43bd9d2..e3f524d6b5 100644 --- a/src/Gui/NavigationStyle.cpp +++ b/src/Gui/NavigationStyle.cpp @@ -165,7 +165,7 @@ NavigationStyleEvent::~NavigationStyleEvent() } const Base::Type& NavigationStyleEvent::style() const -{ +{ return t; } @@ -459,7 +459,7 @@ void NavigationStyle::setCameraOrientation(const SbRotation& rot, SbBool moveToC void NavigationStyleP::viewAnimationCB(void * data, SoSensor * sensor) { - Q_UNUSED(sensor); + Q_UNUSED(sensor); NavigationStyle* that = reinterpret_cast(data); if (PRIVATE(that)->animationsteps > 0) { // here the camera rotates from the current rotation to a given @@ -494,7 +494,7 @@ void NavigationStyleP::viewAnimationCB(void * data, SoSensor * sensor) void NavigationStyle::boxZoom(const SbBox2s& box) { SoCamera* cam = viewer->getSoRenderManager()->getCamera(); - if (!cam) return; // no camera + if (!cam) return; // no camera const SbViewportRegion & vp = viewer->getSoRenderManager()->getViewportRegion(); SbViewVolume vv = cam->getViewVolume(vp.getViewportAspectRatio()); @@ -504,7 +504,7 @@ void NavigationStyle::boxZoom(const SbBox2s& box) // The bbox must not be empty i.e. width and length is zero, but it is possible that // either width or length is zero - if (sizeX == 0 && sizeY == 0) + if (sizeX == 0 && sizeY == 0) return; // Get the new center in normalized pixel coordinates @@ -543,8 +543,8 @@ void NavigationStyle::viewAll() // check whether the box is very wide or tall, if not do nothing float box_width, box_height, box_depth; box.getSize( box_width, box_height, box_depth ); - if (box_width < 5.0f*box_height && box_width < 5.0f*box_depth && - box_height < 5.0f*box_width && box_height < 5.0f*box_depth && + if (box_width < 5.0f*box_height && box_width < 5.0f*box_depth && + box_height < 5.0f*box_width && box_height < 5.0f*box_depth && box_depth < 5.0f*box_width && box_depth < 5.0f*box_height ) return; #endif @@ -1039,7 +1039,7 @@ void NavigationStyle::saveCursorPosition(const SoEvent * const ev) float ratio = vp.getViewportAspectRatio(); SoCamera* cam = viewer->getSoRenderManager()->getCamera(); - if (!cam) return; // no camera + if (!cam) return; // no camera SbViewVolume vv = cam->getViewVolume(ratio); SbLine line; @@ -1173,7 +1173,7 @@ void NavigationStyle::stopAnimating(void) if (this->currentmode != NavigationStyle::SPINNING) { return; } - this->setViewingMode(this->isViewing() ? + this->setViewingMode(this->isViewing() ? NavigationStyle::IDLE : NavigationStyle::INTERACT); } @@ -1262,7 +1262,7 @@ void NavigationStyle::startSelection(NavigationStyle::SelectionMode mode) return; if (isSelecting()) stopSelection(); - + switch (mode) { case Lasso: @@ -1418,14 +1418,14 @@ SbBool NavigationStyle::processEvent(const SoEvent * const ev) else if (hd==AbstractMouseSelection::Finish) { pcPolygon = mouseSelection->getPositions(); selectedRole = mouseSelection->selectedRole(); - delete mouseSelection; + delete mouseSelection; mouseSelection = 0; syncWithEvent(ev); return NavigationStyle::processSoEvent(ev); } else if (hd==AbstractMouseSelection::Cancel) { pcPolygon.clear(); - delete mouseSelection; + delete mouseSelection; mouseSelection = 0; syncWithEvent(ev); return NavigationStyle::processSoEvent(ev); @@ -1585,7 +1585,7 @@ SbBool NavigationStyle::isPopupMenuEnabled(void) const void NavigationStyle::openPopupMenu(const SbVec2s& position) { - Q_UNUSED(position); + Q_UNUSED(position); // ask workbenches and view provider, ... MenuItem* view = new MenuItem; Gui::Application::Instance->setupContextMenu("View", view); diff --git a/src/Gui/NavigationStyle.h b/src/Gui/NavigationStyle.h index 732ac7ecb9..0e5b1179d0 100644 --- a/src/Gui/NavigationStyle.h +++ b/src/Gui/NavigationStyle.h @@ -264,7 +264,7 @@ private: * in the above dialog. * This mechanism is useful to implement special navigation styles which are * only needed for certain purposes. Thus, it should not be possible to be - * choosable by the user + * choosable by the user * @author Werner Mayer */ class GuiExport UserNavigationStyle : public NavigationStyle { @@ -410,4 +410,4 @@ private: } // namespace Gui -#endif // GUI_NAVIGATIONSTYLE_H +#endif // GUI_NAVIGATIONSTYLE_H diff --git a/src/Gui/NetworkRetriever.cpp b/src/Gui/NetworkRetriever.cpp index b6cbe153bc..b4b4606aee 100644 --- a/src/Gui/NetworkRetriever.cpp +++ b/src/Gui/NetworkRetriever.cpp @@ -91,7 +91,7 @@ NetworkRetriever::NetworkRetriever( QObject * parent ) wget = new QProcess(this); // if wgets exits emit signal - connect(wget, SIGNAL(finished(int, QProcess::ExitStatus)), + connect(wget, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(wgetFinished(int, QProcess::ExitStatus))); // if application quits kill wget immediately to avoid dangling processes @@ -107,11 +107,11 @@ NetworkRetriever::~NetworkRetriever() /** * This method is connected to QTimer::singleShot() and executed after 5 seconds. If wget then is still running * we can assume that everything is fine. - * \note This test is necessary since \a wget writes all its output on stderr and we cannot determine surely + * \note This test is necessary since \a wget writes all its output on stderr and we cannot determine surely * if an error occurred or not. * - * There is still a problem that is not solved so far. If wget requires the proxy settings and if these - * are not set, wget could take more than 5 seconds without downloading anything. + * There is still a problem that is not solved so far. If wget requires the proxy settings and if these + * are not set, wget could take more than 5 seconds without downloading anything. */ void NetworkRetriever::testFailure() { @@ -164,7 +164,7 @@ void NetworkRetriever::setProxy( const QString& proxy, const QString& user, cons /** * If \a recursive is true all referenced files are downloaded recursively. - * As default recursion is disabled. \a level specifies the maximum recursion + * As default recursion is disabled. \a level specifies the maximum recursion * depth. If \a level is 0 the recursion depth is infinite. As default the level * property is 1. * \note: Use this with care! @@ -185,7 +185,7 @@ void NetworkRetriever::setFollowRelative( bool folRel ) } /** - * If \a convert is true all non-relative links are converted to + * If \a convert is true all non-relative links are converted to * relative links. As default the convert property is true. */ void NetworkRetriever::setEnableConvert( bool convert ) @@ -357,8 +357,8 @@ void NetworkRetriever::abort() void NetworkRetriever::wgetFinished(int exitCode, QProcess::ExitStatus status) { - Q_UNUSED(exitCode); - Q_UNUSED(status); + Q_UNUSED(exitCode); + Q_UNUSED(status); wget->setReadChannel(QProcess::StandardError); if (wget->canReadLine()) { QByteArray data = wget->readAll(); @@ -455,7 +455,7 @@ void StdCmdDownloadOnlineHelp::languageChange() void StdCmdDownloadOnlineHelp::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); if (!wget->isDownloading()) { ParameterGrp::handle hGrp = App::GetApplication().GetUserParameter().GetGroup("BaseApp"); hGrp = hGrp->GetGroup("Preferences")->GetGroup("OnlineHelp"); @@ -496,16 +496,16 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg) loop--; QFileInfo fi( path); if (!fi.exists()) { - if (QMessageBox::critical(getMainWindow(), tr("Non-existing directory"), + if (QMessageBox::critical(getMainWindow(), tr("Non-existing directory"), tr("The directory '%1' does not exist.\n\n" - "Do you want to specify an existing directory?").arg(fi.filePath()), - QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) != + "Do you want to specify an existing directory?").arg(fi.filePath()), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) != QMessageBox::Yes) { // exit the command return; } - else + else { path = FileDialog::getExistingDirectory(); if ( path.isEmpty() ) @@ -514,10 +514,10 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg) } if (!fi.permission( QFile::WriteUser)) { - if (QMessageBox::critical(getMainWindow(), tr("Missing permission"), + if (QMessageBox::critical(getMainWindow(), tr("Missing permission"), tr("You don't have write permission to '%1'\n\n" - "Do you want to specify another directory?").arg(fi.filePath()), - QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) != + "Do you want to specify another directory?").arg(fi.filePath()), + QMessageBox::Yes|QMessageBox::Default, QMessageBox::No|QMessageBox::Escape) != QMessageBox::Yes) { // exit the command diff --git a/src/Gui/NetworkRetriever.h b/src/Gui/NetworkRetriever.h index 1a90dde4b3..4fa065cde7 100644 --- a/src/Gui/NetworkRetriever.h +++ b/src/Gui/NetworkRetriever.h @@ -37,7 +37,7 @@ namespace Gui { * file structure from a server. * \author Werner Mayer */ -class NetworkRetriever : public QObject +class NetworkRetriever : public QObject { Q_OBJECT diff --git a/src/Gui/OnlineDocumentation.cpp b/src/Gui/OnlineDocumentation.cpp index 4c1921c3ee..119fc6f77b 100644 --- a/src/Gui/OnlineDocumentation.cpp +++ b/src/Gui/OnlineDocumentation.cpp @@ -195,7 +195,7 @@ QByteArray PythonOnlineHelp::loadResource(const QString& filename) const PyObject* main = PyImport_AddModule("__main__"); PyObject* dict = PyModule_GetDict(main); dict = PyDict_Copy(dict); - QByteArray cmd = + QByteArray cmd = "import pydoc\n" "object, name = pydoc.resolve(\""; cmd += name.toUtf8(); @@ -393,19 +393,19 @@ StdCmdPythonHelp::~StdCmdPythonHelp() void StdCmdPythonHelp::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); // try to open a connection over this port qint16 port = 7465; if (!this->server) this->server = new HttpServer(); // if server is not yet running try to open one - if (this->server->isListening() || + if (this->server->isListening() || this->server->listen(QHostAddress(QHostAddress::LocalHost), port)) { // okay the server is running, now we try to open the system internet browser bool failed = true; - // The webbrowser Python module allows to start the system browser in an + // The webbrowser Python module allows to start the system browser in an // OS-independent way Base::PyGILStateLocker lock; PyObject* module = PyImport_ImportModule("webbrowser"); @@ -424,7 +424,7 @@ void StdCmdPythonHelp::activated(int iMsg) #endif if (result) failed = false; - + // decrement the args and module reference Py_XDECREF(result); Py_DECREF(args); @@ -434,13 +434,13 @@ void StdCmdPythonHelp::activated(int iMsg) // print error message on failure if (failed) { - QMessageBox::critical(Gui::getMainWindow(), QObject::tr("No Browser"), + QMessageBox::critical(Gui::getMainWindow(), QObject::tr("No Browser"), QObject::tr("Unable to open your browser.\n\n" "Please open a browser window and type in: http://localhost:%1.").arg(port)); } } else { - QMessageBox::critical(Gui::getMainWindow(), QObject::tr("No Server"), + QMessageBox::critical(Gui::getMainWindow(), QObject::tr("No Server"), QObject::tr("Unable to start the server to port %1: %2.").arg(port).arg(server->errorString())); } } @@ -464,21 +464,21 @@ bool Gui::OpenURLInBrowser(const char * URL) #endif if (result) failed = false; - + // decrement the args and module reference Py_XDECREF(result); Py_DECREF(args); Py_DECREF(module); } - } + } // print error message on failure if (failed) { - QMessageBox::critical(Gui::getMainWindow(), QObject::tr("No Browser"), + QMessageBox::critical(Gui::getMainWindow(), QObject::tr("No Browser"), QObject::tr("Unable to open your system browser.")); return false; } - + return true; } diff --git a/src/Gui/OnlineDocumentation.h b/src/Gui/OnlineDocumentation.h index 3ff180d5a2..8e54c9d07a 100644 --- a/src/Gui/OnlineDocumentation.h +++ b/src/Gui/OnlineDocumentation.h @@ -35,7 +35,7 @@ namespace Gui { bool GuiExport OpenURLInBrowser(const char * URL); /** - * Returns the content of an HTML page which gets sent to + * Returns the content of an HTML page which gets sent to * the client to be displayed. * @author Werner Mayer */ @@ -52,7 +52,7 @@ public: QByteArray loadFailed(const QString& error) const; }; -/** +/** * The HttpServer class implements a simple HTTP server. */ class HttpServer : public QTcpServer diff --git a/src/Gui/Placement.cpp b/src/Gui/Placement.cpp index acf9f72715..cc9f336e27 100644 --- a/src/Gui/Placement.cpp +++ b/src/Gui/Placement.cpp @@ -875,7 +875,7 @@ void TaskPlacement::setPropertyName(const QString& name) } QDialogButtonBox::StandardButtons TaskPlacement::getStandardButtons() const -{ +{ return QDialogButtonBox::Ok| QDialogButtonBox::Cancel| QDialogButtonBox::Apply; diff --git a/src/Gui/PreCompiled.cpp b/src/Gui/PreCompiled.cpp index 3e85848b9a..7b200a1bf2 100644 --- a/src/Gui/PreCompiled.cpp +++ b/src/Gui/PreCompiled.cpp @@ -21,4 +21,4 @@ ***************************************************************************/ -#include "PreCompiled.h" +#include "PreCompiled.h" diff --git a/src/Gui/PreCompiled.h b/src/Gui/PreCompiled.h index 63b0fcc25e..7163d51450 100644 --- a/src/Gui/PreCompiled.h +++ b/src/Gui/PreCompiled.h @@ -23,7 +23,7 @@ #ifndef GUI_PRECOMPILED_H #define GUI_PRECOMPILED_H - + #include #ifdef FC_OS_WIN32 diff --git a/src/Gui/PrefWidgets.cpp b/src/Gui/PrefWidgets.cpp index 6274c8f281..94342eb0a7 100644 --- a/src/Gui/PrefWidgets.cpp +++ b/src/Gui/PrefWidgets.cpp @@ -38,7 +38,7 @@ using Base::Console; using namespace Gui; -/** Constructs a preference widget. +/** Constructs a preference widget. */ PrefWidget::PrefWidget() : WindowParameter("") @@ -94,9 +94,9 @@ QByteArray PrefWidget::paramGrpPath() const return m_sPrefGrp; } -/** - * This method is called if one or more values in the parameter settings are changed - * where getParamGrp() points to. +/** + * This method is called if one or more values in the parameter settings are changed + * where getParamGrp() points to. * Note: This method is called for each parameter inside the parameter group. So * you have to filter out the appropriate parameter with the name \a sReason. * \a rCaller calls this method. @@ -711,7 +711,7 @@ void PrefFontBox::restorePreferences() QFont currFont = currentFont(); //QFont from selector widget QString currName = currFont.family(); - + std::string prefName = getWindowParameter()->GetASCII(entryName(), currName.toUtf8()); //font name from cfg file currFont.setFamily(QString::fromStdString(prefName)); diff --git a/src/Gui/PrefWidgets.h b/src/Gui/PrefWidgets.h index cbad7282e6..00425e0b5f 100644 --- a/src/Gui/PrefWidgets.h +++ b/src/Gui/PrefWidgets.h @@ -42,14 +42,14 @@ class WidgetFactoryInst; /** The preference widget class. * If you want to extend a QWidget class to save/restore its data - * you just have to derive from this class and implement the methods + * you just have to derive from this class and implement the methods * restorePreferences() and savePreferences(). * * To restore and save the settings of any widgets in own dialogs you have * call onRestore() e.g. in the dialog's constructor and call onSave() e.g. - * in accept() for each widget you want to enable this mechanism. - * - * For more information of how to use these widgets in normal container widgets + * in accept() for each widget you want to enable this mechanism. + * + * For more information of how to use these widgets in normal container widgets * which are again in a dialog refer to the description of Gui::Dialog::DlgPreferencesImp. * * \author Werner Mayer @@ -324,7 +324,7 @@ public: void setToLastUsedValue(); /// get the value of the history size property int historySize() const; - /// set the value of the history size property + /// set the value of the history size property void setHistorySize(int); /// Convenience method as offered by PrefWidget. Does the same as pushToHistory(). void onSave(); diff --git a/src/Gui/ProgressBar.h b/src/Gui/ProgressBar.h index 4f02e06af4..e70f369ba1 100644 --- a/src/Gui/ProgressBar.h +++ b/src/Gui/ProgressBar.h @@ -52,7 +52,7 @@ class ProgressBar; * seq.next(); * // do one step of your algorithm * } - * + * * \endcode * * The example below shows how to use two nested progresses. @@ -70,7 +70,7 @@ class ProgressBar; * } * * } - * + * * void function2() * { * unsigned long steps = ... @@ -95,9 +95,9 @@ class GuiExport SequencerBar : public Base::SequencerBase public: /** Returns the sequencer object. */ static SequencerBar* instance(); - /** This restores the last overridden cursor and release the keyboard while the progress bar + /** This restores the last overridden cursor and release the keyboard while the progress bar * is running. This is useful e.g. if a modal dialog appears while a long operation is performed - * to indicate that the user can click on the dialog. Every pause() must eventually be followed + * to indicate that the user can click on the dialog. Every pause() must eventually be followed * by a corresponding @ref resume(). */ void pause() override; diff --git a/src/Gui/ProgressDialog.cpp b/src/Gui/ProgressDialog.cpp index cf803daf6b..519ad2e72e 100644 --- a/src/Gui/ProgressDialog.cpp +++ b/src/Gui/ProgressDialog.cpp @@ -240,7 +240,7 @@ void SequencerDialog::resetData() } else { d->dlg->resetEx(); - // Note: Under Qt 4.1.4 this forces to run QWindowsStyle::eventFilter() twice + // Note: Under Qt 4.1.4 this forces to run QWindowsStyle::eventFilter() twice // handling the same event thus a warning is printed. Possibly, this is a bug // in Qt. The message is QEventDispatcherUNIX::unregisterTimer: invalid argument. d->dlg->hide(); @@ -312,7 +312,7 @@ void ProgressDialog::onCancel() bool ProgressDialog::canAbort() const { int ret = QMessageBox::question(getMainWindow(),tr("Aborting"), - tr("Do you really want to abort the operation?"), QMessageBox::Yes, + tr("Do you really want to abort the operation?"), QMessageBox::Yes, QMessageBox::No|QMessageBox::Default); return (ret == QMessageBox::Yes) ? true : false; diff --git a/src/Gui/ProjectView.h b/src/Gui/ProjectView.h index 3e361cb4e7..add88c6748 100644 --- a/src/Gui/ProjectView.h +++ b/src/Gui/ProjectView.h @@ -50,7 +50,7 @@ public: private: QFileSystemModel *fileModel; - + }; diff --git a/src/Gui/PropertyPage.cpp b/src/Gui/PropertyPage.cpp index bdf83d6d74..806d3aee6d 100644 --- a/src/Gui/PropertyPage.cpp +++ b/src/Gui/PropertyPage.cpp @@ -31,13 +31,13 @@ using namespace Gui::Dialog; /** Construction */ -PropertyPage::PropertyPage(QWidget* parent) : QWidget(parent) +PropertyPage::PropertyPage(QWidget* parent) : QWidget(parent) { bChanged = false; } /** Destruction */ -PropertyPage::~PropertyPage() +PropertyPage::~PropertyPage() { } @@ -96,12 +96,12 @@ void PropertyPage::onReset() // ---------------------------------------------------------------- /** Construction */ -PreferencePage::PreferencePage(QWidget* parent) : QWidget(parent) +PreferencePage::PreferencePage(QWidget* parent) : QWidget(parent) { } /** Destruction */ -PreferencePage::~PreferencePage() +PreferencePage::~PreferencePage() { } @@ -202,12 +202,12 @@ void PreferenceUiForm::saveSettings() // ---------------------------------------------------------------- /** Construction */ -CustomizeActionPage::CustomizeActionPage(QWidget* parent) : QWidget(parent) +CustomizeActionPage::CustomizeActionPage(QWidget* parent) : QWidget(parent) { } /** Destruction */ -CustomizeActionPage::~CustomizeActionPage() +CustomizeActionPage::~CustomizeActionPage() { } diff --git a/src/Gui/PropertyView.cpp b/src/Gui/PropertyView.cpp index f7434ff9a5..99a44066b5 100644 --- a/src/Gui/PropertyView.cpp +++ b/src/Gui/PropertyView.cpp @@ -76,9 +76,9 @@ static ParameterGrp::handle _GetParam() { * in two tabs. */ PropertyView::PropertyView(QWidget *parent) - : QWidget(parent),SelectionObserver(false,0) + : QWidget(parent),SelectionObserver(false,0) { - QGridLayout* pLayout = new QGridLayout( this ); + QGridLayout* pLayout = new QGridLayout( this ); pLayout->setSpacing(0); pLayout->setMargin (0); @@ -134,13 +134,13 @@ PropertyView::PropertyView(QWidget *parent) this->connectActiveDoc = Application::Instance->signalActiveDocument.connect(boost::bind (&PropertyView::slotActiveDocument, this, bp::_1)); - this->connectDelDocument = + this->connectDelDocument = Application::Instance->signalDeleteDocument.connect( boost::bind(&PropertyView::slotDeleteDocument, this, bp::_1)); - this->connectDelViewObject = + this->connectDelViewObject = Application::Instance->signalDeletedObject.connect( boost::bind(&PropertyView::slotDeletedViewObject, this, bp::_1)); - this->connectDelObject = + this->connectDelObject = App::GetApplication().signalDeletedObject.connect( boost::bind(&PropertyView::slotDeletedObject, this, bp::_1)); } @@ -227,7 +227,7 @@ bool PropertyView::isPropertyHidden(const App::Property *prop) { void PropertyView::slotAppendDynamicProperty(const App::Property& prop) { - if (isPropertyHidden(&prop)) + if (isPropertyHidden(&prop)) return; if (propertyEditorData->appendProperty(prop) @@ -365,7 +365,7 @@ void PropertyView::onTimer() { auto doc = gdoc->getDocument(); std::map props; doc->getPropertyMap(props); - for(auto &v : props) + for(auto &v : props) docProps.emplace_back(v.first, std::vector(1,v.second)); propertyEditorData->buildUp(std::move(docProps)); diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index 9eb42fb69c..aac3961edf 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -186,7 +186,7 @@ void InteractiveInterpreter::setPrompt() /** * Compile a command and determine whether it is incomplete. - * + * * The source string may contain line feeds and/or carriage returns. \n * Return value / exceptions raised: * - Return a code object if the command is complete and valid @@ -222,7 +222,7 @@ PyObject* InteractiveInterpreter::compile(const char* source) const /** * Compile a command and determine whether it is incomplete. - * + * * The source string may contain line feeds and/or carriage returns. \n * Return value: * - Return 1 if the command is incomplete @@ -264,17 +264,17 @@ int InteractiveInterpreter::compileCommand(const char* source) const * * One several things can happen: * - * - The input is incorrect; compile() raised an exception (SyntaxError or OverflowError). + * - The input is incorrect; compile() raised an exception (SyntaxError or OverflowError). * A syntax traceback will be printed by calling Python's PyErr_Print() method to the redirected stderr. * - * - The input is incomplete, and more input is required; compile() returned 'None'. + * - The input is incomplete, and more input is required; compile() returned 'None'. * Nothing happens. * - * - The input is complete; compile() returned a code object. The code is executed by calling + * - The input is complete; compile() returned a code object. The code is executed by calling * runCode() (which also handles run-time exceptions, except for SystemExit). * . * The return value is True if the input is incomplete, False in the other cases (unless - * an exception is raised). The return value can be used to decide whether to use sys.ps1 + * an exception is raised). The return value can be used to decide whether to use sys.ps1 * or sys.ps2 to prompt the next line. */ bool InteractiveInterpreter::runSource(const char* source) const @@ -316,10 +316,10 @@ void InteractiveInterpreter::runCode(PyCodeObject* code) const Base::PyGILStateLocker lock; PyObject *module, *dict, *presult; /* "exec code in d, d" */ module = PyImport_AddModule("__main__"); /* get module, init python */ - if (module == NULL) + if (module == NULL) throw Base::PyException(); /* not incref'd */ dict = PyModule_GetDict(module); /* get dict namespace */ - if (dict == NULL) + if (dict == NULL) throw Base::PyException(); /* not incref'd */ // It seems that the return value is always 'None' or Null @@ -425,7 +425,7 @@ void InteractiveInterpreter::clearBuffer() /* TRANSLATOR Gui::PythonConsole */ /** - * Constructs a PythonConsole which is a child of 'parent'. + * Constructs a PythonConsole which is a child of 'parent'. */ PythonConsole::PythonConsole(QWidget *parent) : TextEdit(parent), WindowParameter( "Editor" ), _sourceDrain(NULL) @@ -434,7 +434,7 @@ PythonConsole::PythonConsole(QWidget *parent) d->interactive = false; // create an instance of InteractiveInterpreter - try { + try { d->interpreter = new InteractiveInterpreter(); } catch (const Base::Exception& e) { setPlainText(QString::fromLatin1(e.what())); @@ -456,7 +456,7 @@ PythonConsole::PythonConsole(QWidget *parent) QFont serifFont(QLatin1String("Courier"), 10, QFont::Normal); setFont(serifFont); - + // set colors and font from settings ParameterGrp::handle hPrefGrp = getWindowParameter(); hPrefGrp->Attach( this ); @@ -503,10 +503,10 @@ PythonConsole::~PythonConsole() delete d; } -/** Set new font and colors according to the parameters. */ +/** Set new font and colors according to the parameters. */ void PythonConsole::OnChange( Base::Subject &rCaller,const char* sReason ) { - Q_UNUSED(rCaller); + Q_UNUSED(rCaller); ParameterGrp::handle hPrefGrp = getWindowParameter(); bool pythonWordWrap = App::GetApplication().GetUserParameter(). @@ -521,7 +521,7 @@ void PythonConsole::OnChange( Base::Subject &rCaller,const char* sR if (strcmp(sReason, "FontSize") == 0 || strcmp(sReason, "Font") == 0) { int fontSize = hPrefGrp->GetInt("FontSize", 10); QString fontFamily = QString::fromLatin1(hPrefGrp->GetASCII("Font", "Courier").c_str()); - + QFont font(fontFamily, fontSize); setFont(font); QFontMetrics metric(font); @@ -580,8 +580,8 @@ void PythonConsole::keyPressEvent(QKeyEvent * e) e->matches(QKeySequence::SelectAll)) { TextEdit::keyPressEvent(e); } - else if (!e->text().isEmpty() && - (e->modifiers() == Qt::NoModifier || + else if (!e->text().isEmpty() && + (e->modifiers() == Qt::NoModifier || e->modifiers() == Qt::ShiftModifier)) { this->moveCursor(QTextCursor::End); TextEdit::keyPressEvent(e); @@ -688,7 +688,7 @@ void PythonConsole::keyPressEvent(QKeyEvent * e) { TextEdit::keyPressEvent(e); } } break; - default: + default: { TextEdit::keyPressEvent(e); } break; @@ -730,8 +730,8 @@ void PythonConsole::onFlush() } /** Prints the ps1 prompt (>>> ) for complete and ps2 prompt (... ) for - * incomplete commands to the console window. - */ + * incomplete commands to the console window. + */ void PythonConsole::printPrompt(PythonConsole::Prompt mode) { // write normal messages @@ -791,7 +791,7 @@ void PythonConsole::appendOutput(const QString& output, int state) QTextCursor cursor = textCursor(); cursor.movePosition(QTextCursor::End); int pos = cursor.position() + 1; - + // delay rehighlighting cursor.beginEditBlock(); appendPlainText(output); @@ -827,7 +827,7 @@ void PythonConsole::runSource(const QString& line) PySys_SetObject("stdout", d->_stdoutPy); PySys_SetObject("stderr", d->_stderrPy); d->interactive = true; - + try { d->history.markScratch(); //< mark current history position ... // launch the command now @@ -916,7 +916,7 @@ void PythonConsole::printStatement( const QString& cmd ) QTextCursor cursor = textCursor(); QStringList statements = cmd.split(QLatin1String("\n")); for (QStringList::Iterator it = statements.begin(); it != statements.end(); ++it) { - // go to the end before inserting new text + // go to the end before inserting new text cursor.movePosition(QTextCursor::End); cursor.insertText( *it ); d->history.append( *it ); @@ -1000,7 +1000,7 @@ void PythonConsole::dropEvent (QDropEvent * e) QPlainTextEdit::dropEvent(e); } -/** Dragging of action objects is allowed. */ +/** Dragging of action objects is allowed. */ void PythonConsole::dragMoveEvent( QDragMoveEvent *e ) { const QMimeData* mimeData = e->mimeData(); @@ -1010,7 +1010,7 @@ void PythonConsole::dragMoveEvent( QDragMoveEvent *e ) QPlainTextEdit::dragMoveEvent(e); } -/** Dragging of action objects is allowed. */ +/** Dragging of action objects is allowed. */ void PythonConsole::dragEnterEvent (QDragEnterEvent * e) { const QMimeData* mimeData = e->mimeData(); @@ -1096,7 +1096,7 @@ QTextCursor PythonConsole::inputBegin(void) const QMimeData * PythonConsole::createMimeDataFromSelection () const { QMimeData* mime = new QMimeData(); - + switch (d->type) { case PythonConsoleP::Normal: { @@ -1138,9 +1138,9 @@ void PythonConsole::runSourceFromMimeData(const QString& source) // When inserting a big text block we must break it down into several command // blocks instead of processing the text block as a whole or each single line. // If we processed the complete block as a whole only the first valid Python - // command would be executed and the rest would be ignored. However, if we - // processed each line separately the interpreter might be confused that a block - // is complete but it might be not. This is for instance, if a class or method + // command would be executed and the rest would be ignored. However, if we + // processed each line separately the interpreter might be confused that a block + // is complete but it might be not. This is for instance, if a class or method // definition contains several empty lines which leads to error messages (almost // indentation errors) later on. QString text = source; @@ -1202,7 +1202,7 @@ void PythonConsole::runSourceFromMimeData(const QString& source) nextline = lines[k]; k++; } - + int ret = d->interpreter->compileCommand(nextline.toUtf8()); // If the line is valid, i.e. complete or incomplete the previous block @@ -1486,8 +1486,8 @@ void PythonConsoleHighlighter::highlightBlock(const QString& text) void PythonConsoleHighlighter::colorChanged(const QString& type, const QColor& col) { - Q_UNUSED(type); - Q_UNUSED(col); + Q_UNUSED(type); + Q_UNUSED(col); } // --------------------------------------------------------------------- @@ -1517,7 +1517,7 @@ bool ConsoleHistory::more() * While searching the next item, the routine respects the search prefix set by prev(). * @return true if the pointer was switched to a later item, false otherwise. */ -bool ConsoleHistory::next() +bool ConsoleHistory::next() { bool wentNext = false; @@ -1550,7 +1550,7 @@ bool ConsoleHistory::prev( const QString &prefix ) // store prefix if it's the first history access if (_it == _history.end()) { _prefix = prefix; } - + // while we didn't go back or reach history's begin ... while (!wentPrev && _it != _history.begin()) { diff --git a/src/Gui/PythonConsole.h b/src/Gui/PythonConsole.h index 17763e5097..d5e07eb0de 100644 --- a/src/Gui/PythonConsole.h +++ b/src/Gui/PythonConsole.h @@ -79,13 +79,13 @@ public: void append(const QString &inputLine); const QStringList& values() const; void restart(); - void markScratch( void ); - void doScratch( void ); + void markScratch( void ); + void doScratch( void ); private: QStringList _history; QStringList::ConstIterator _it; - int _scratchBegin; + int _scratchBegin; QString _prefix; }; @@ -102,8 +102,8 @@ public: enum Prompt { Complete = 0, Incomplete = 1, - Flush = 2, - Special = 3 + Flush = 2, + Special = 3 }; PythonConsole(QWidget *parent = 0); @@ -111,7 +111,7 @@ public: void OnChange( Base::Subject &rCaller,const char* rcReason ); void printStatement( const QString& cmd ); - QString readline( void ); + QString readline( void ); public Q_SLOTS: void onSaveHistoryAs(); @@ -131,7 +131,7 @@ protected: void dragEnterEvent ( QDragEnterEvent * e ); void dragMoveEvent ( QDragMoveEvent * e ); void changeEvent ( QEvent * e ); - void mouseReleaseEvent( QMouseEvent * e ); + void mouseReleaseEvent( QMouseEvent * e ); void overrideCursor(const QString& txt); @@ -140,7 +140,7 @@ protected: bool canInsertFromMimeData ( const QMimeData * source ) const; QMimeData * createMimeDataFromSelection () const; void insertFromMimeData ( const QMimeData * source ); - QTextCursor inputBegin( void ) const; + QTextCursor inputBegin( void ) const; private: void runSource(const QString&); @@ -153,9 +153,9 @@ private: void loadHistory() const; void saveHistory() const; -Q_SIGNALS: - void pendingSource( void ); - +Q_SIGNALS: + void pendingSource( void ); + private: struct PythonConsoleP* d; @@ -165,7 +165,7 @@ private: private: PythonConsoleHighlighter* pythonSyntax; QString *_sourceDrain; - QString _historyFile; + QString _historyFile; }; /** diff --git a/src/Gui/PythonConsolePy.cpp b/src/Gui/PythonConsolePy.cpp index 16151a8ac8..c92b65a750 100644 --- a/src/Gui/PythonConsolePy.cpp +++ b/src/Gui/PythonConsolePy.cpp @@ -102,7 +102,7 @@ Py::Object PythonStdout::write(const Py::Tuple& args) } } catch (Py::Exception& e) { - // Do not provoke error messages + // Do not provoke error messages e.clear(); } diff --git a/src/Gui/PythonConsolePy.h b/src/Gui/PythonConsolePy.h index 8060b51c07..052e6b8f2b 100644 --- a/src/Gui/PythonConsolePy.h +++ b/src/Gui/PythonConsolePy.h @@ -33,13 +33,13 @@ class PythonConsole; /** * Python class for redirection of stdout to FreeCAD's Python - * console window. This allows to show all Python messages in + * console window. This allows to show all Python messages in * the same window where the commands are performed. * @see PythonStderr * @see PythonConsole * @author Werner Mayer */ -class PythonStdout : public Py::PythonExtension +class PythonStdout : public Py::PythonExtension { private: PythonConsole* pyConsole; @@ -59,13 +59,13 @@ public: /** * Python class for redirection of stderr to FreeCAD's Python - * console window. This allows to show all Python messages in + * console window. This allows to show all Python messages in * the same window where the commands are performed. * @see PythonStdout * @see PythonConsole * @author Werner Mayer */ -class PythonStderr : public Py::PythonExtension +class PythonStderr : public Py::PythonExtension { private: PythonConsole* pyConsole; @@ -108,13 +108,13 @@ public: /** * Python class for redirection of stderr to FreeCAD's output - * console window. This allows to report all Python errors to + * console window. This allows to report all Python errors to * the output window which simplifies error tracking. * @see PythonStdout * @see PythonStderr * @author Werner Mayer */ -class OutputStderr : public Py::PythonExtension +class OutputStderr : public Py::PythonExtension { public: static void init_type(void); // announce properties and methods @@ -133,7 +133,7 @@ public: * Python class for redirection of stdin to an input dialog of Qt. * @author Werner Mayer */ -class PythonStdin : public Py::PythonExtension +class PythonStdin : public Py::PythonExtension { private: PythonConsole* pyConsole; diff --git a/src/Gui/PythonDebugger.cpp b/src/Gui/PythonDebugger.cpp index 796251741f..10f51e8119 100644 --- a/src/Gui/PythonDebugger.cpp +++ b/src/Gui/PythonDebugger.cpp @@ -301,7 +301,7 @@ Py::Object PythonDebugExcept::excepthook(const Py::Tuple& args) //get the pointer to the frame held by the bottom traceback object - this //should be where the exception occurred. tracebackobject* pTb = (tracebackobject*)tb; - while (pTb->tb_next != NULL) + while (pTb->tb_next != NULL) { pTb = pTb->tb_next; } @@ -316,7 +316,7 @@ Py::Object PythonDebugExcept::excepthook(const Py::Tuple& args) // ----------------------------------------------------- namespace Gui { -class PythonDebuggerPy : public Py::PythonExtension +class PythonDebuggerPy : public Py::PythonExtension { public: PythonDebuggerPy(PythonDebugger* d) : dbg(d), depth(0) { } diff --git a/src/Gui/PythonDebugger.h b/src/Gui/PythonDebugger.h index e3af16ebe7..8979c22c7a 100644 --- a/src/Gui/PythonDebugger.h +++ b/src/Gui/PythonDebugger.h @@ -111,7 +111,7 @@ private: /** * @author Werner Mayer */ -class GuiExport PythonDebugStdout : public Py::PythonExtension +class GuiExport PythonDebugStdout : public Py::PythonExtension { public: static void init_type(void); // announce properties and methods @@ -127,7 +127,7 @@ public: /** * @author Werner Mayer */ -class GuiExport PythonDebugStderr : public Py::PythonExtension +class GuiExport PythonDebugStderr : public Py::PythonExtension { public: static void init_type(void); // announce properties and methods @@ -142,7 +142,7 @@ public: /** * @author Werner Mayer */ -class GuiExport PythonDebugExcept : public Py::PythonExtension +class GuiExport PythonDebugExcept : public Py::PythonExtension { public: static void init_type(void); // announce properties and methods diff --git a/src/Gui/PythonEditor.cpp b/src/Gui/PythonEditor.cpp index 22f2e4c5d9..c4c5c0ac14 100644 --- a/src/Gui/PythonEditor.cpp +++ b/src/Gui/PythonEditor.cpp @@ -67,7 +67,7 @@ struct PythonEditorP /** * Constructs a PythonEditor which is a child of 'parent' and does the - * syntax highlighting for the Python language. + * syntax highlighting for the Python language. */ PythonEditor::PythonEditor(QWidget* parent) : TextEditor(parent) @@ -82,9 +82,9 @@ PythonEditor::PythonEditor(QWidget* parent) QShortcut* uncomment = new QShortcut(this); uncomment->setKey(Qt::ALT + Qt::Key_U); - connect(comment, SIGNAL(activated()), + connect(comment, SIGNAL(activated()), this, SLOT(onComment())); - connect(uncomment, SIGNAL(activated()), + connect(uncomment, SIGNAL(activated()), this, SLOT(onUncomment())); } @@ -277,7 +277,7 @@ void PythonSyntaxHighlighter::highlightBlock (const QString & text) const int DefineName = 8; // Text after the keyword def int endStateOfLastPara = previousBlockState(); - if (endStateOfLastPara < 0 || endStateOfLastPara > maximumUserState()) + if (endStateOfLastPara < 0 || endStateOfLastPara > maximumUserState()) endStateOfLastPara = Standard; while ( i < text.length() ) @@ -314,7 +314,7 @@ void PythonSyntaxHighlighter::highlightBlock (const QString & text) case '\'': { // Begin either string literal or block comment - if ((i>=2) && text.at(i-1) == QLatin1Char('\'') && + if ((i>=2) && text.at(i-1) == QLatin1Char('\'') && text.at(i-2) == QLatin1Char('\'')) { setFormat( i-2, 3, this->colorByType(SyntaxHighlighter::BlockComment)); @@ -331,9 +331,9 @@ void PythonSyntaxHighlighter::highlightBlock (const QString & text) { // ignore whitespaces } break; - case '(': case ')': case '[': case ']': - case '+': case '-': case '*': case '/': - case ':': case '%': case '^': case '~': + case '(': case ')': case '[': case ']': + case '+': case '-': case '*': case '/': + case ':': case '%': case '^': case '~': case '!': case '=': case '<': case '>': // possibly two characters { setFormat(i, 1, this->colorByType(SyntaxHighlighter::Operator)); @@ -465,10 +465,10 @@ void PythonSyntaxHighlighter::highlightBlock (const QString & text) } // only block comments can have several lines - if ( endStateOfLastPara != Blockcomment1 && endStateOfLastPara != Blockcomment2 ) + if ( endStateOfLastPara != Blockcomment1 && endStateOfLastPara != Blockcomment2 ) { endStateOfLastPara = Standard ; - } + } setCurrentBlockState(endStateOfLastPara); } diff --git a/src/Gui/PythonEditor.h b/src/Gui/PythonEditor.h index 0db11c9e01..fbb05ea42a 100644 --- a/src/Gui/PythonEditor.h +++ b/src/Gui/PythonEditor.h @@ -50,7 +50,7 @@ public: void hideDebugMarker(); public Q_SLOTS: - /** Inserts a '#' at the beginning of each selected line or the current line if + /** Inserts a '#' at the beginning of each selected line or the current line if * nothing is selected */ void onComment(); diff --git a/src/Gui/QListWidgetCustom.cpp b/src/Gui/QListWidgetCustom.cpp index 704e3e2a99..a2a41033af 100644 --- a/src/Gui/QListWidgetCustom.cpp +++ b/src/Gui/QListWidgetCustom.cpp @@ -28,7 +28,7 @@ # include #endif -#include "QListWidgetCustom.h" +#include "QListWidgetCustom.h" QListWidgetCustom::QListWidgetCustom(QWidget * parent) : QListWidget(parent) diff --git a/src/Gui/QuantitySpinBox.cpp b/src/Gui/QuantitySpinBox.cpp index cd635681b0..4b64ecc7b2 100644 --- a/src/Gui/QuantitySpinBox.cpp +++ b/src/Gui/QuantitySpinBox.cpp @@ -422,7 +422,7 @@ QString Gui::QuantitySpinBox::expressionText() const void Gui::QuantitySpinBox::onChange() { Q_ASSERT(isBound()); - + if (getExpression()) { std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); @@ -463,7 +463,7 @@ bool QuantitySpinBox::apply(const std::string & propName) if (isBound()) { const App::ObjectIdentifier & path = getPath(); const Property * prop = path.getProperty(); - + /* Skip update if property is bound and we know it is read-only */ if (prop && prop->isReadOnly()) return true; diff --git a/src/Gui/QuantitySpinBox.h b/src/Gui/QuantitySpinBox.h index 61b9719c89..678fcb944d 100644 --- a/src/Gui/QuantitySpinBox.h +++ b/src/Gui/QuantitySpinBox.h @@ -66,7 +66,7 @@ public: /** Sets the Unit this widget is working with. * After setting the Unit the widget will only accept - * user input with this unit type. Or if the user input + * user input with this unit type. Or if the user input * a value without unit, this one will be added to the resulting * Quantity. */ @@ -79,17 +79,17 @@ public: /// Get the value of the singleStep property double singleStep() const; - /// Set the value of the singleStep property + /// Set the value of the singleStep property void setSingleStep(double val); /// Gets the value of the minimum property double minimum() const; - /// Sets the value of the minimum property + /// Sets the value of the minimum property void setMinimum(double min); /// Gets the value of the maximum property double maximum() const; - /// Sets the value of the maximum property + /// Sets the value of the maximum property void setMaximum(double max); /// Gets the number of decimals diff --git a/src/Gui/ReportView.cpp b/src/Gui/ReportView.cpp index 889d297fad..f68eae7658 100644 --- a/src/Gui/ReportView.cpp +++ b/src/Gui/ReportView.cpp @@ -50,8 +50,8 @@ using namespace Gui::DockWnd; /* TRANSLATOR Gui::DockWnd::ReportView */ /** - * Constructs a ReportView which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a ReportView which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ ReportView::ReportView( QWidget* parent ) : QWidget(parent) @@ -206,7 +206,7 @@ void ReportHighlighter::setErrorColor( const QColor& col ) // ---------------------------------------------------------- /** - * The CustomReportEvent class is used to send report events in the methods Log(), + * The CustomReportEvent class is used to send report events in the methods Log(), * Error(), Warning() and Message() of the ReportOutput class to itself instead of * printing the messages directly in its text view. * @@ -217,7 +217,7 @@ class CustomReportEvent : public QEvent { public: CustomReportEvent(ReportHighlighter::Paragraph p, const QString& s) - : QEvent(QEvent::Type(QEvent::User)) + : QEvent(QEvent::Type(QEvent::User)) { par = p; msg = s;} ~CustomReportEvent() { } @@ -348,8 +348,8 @@ PyObject* ReportOutput::Data::replace_stderr = 0; /* TRANSLATOR Gui::DockWnd::ReportOutput */ /** - * Constructs a ReportOutput which is a child of 'parent', with the - * name 'name' and widget flags set to 'f' + * Constructs a ReportOutput which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' */ ReportOutput::ReportOutput(QWidget* parent) : QTextEdit(parent) @@ -714,7 +714,7 @@ void ReportOutput::OnChange(Base::Subject &rCaller, const char * sR else if (strcmp(sReason, "FontSize") == 0 || strcmp(sReason, "Font") == 0) { int fontSize = rclGrp.GetInt("FontSize", 10); QString fontFamily = QString::fromLatin1(rclGrp.GetASCII("Font", "Courier").c_str()); - + QFont font(fontFamily, fontSize); setFont(font); QFontMetrics metric(font); diff --git a/src/Gui/ReportView.h b/src/Gui/ReportView.h index 534561fb0d..d3b204e5b7 100644 --- a/src/Gui/ReportView.h +++ b/src/Gui/ReportView.h @@ -69,8 +69,8 @@ private: */ class GuiExport ReportHighlighter : public QSyntaxHighlighter { -public: - enum Paragraph { +public: + enum Paragraph { Message = 0, /**< normal text */ Warning = 1, /**< Warning */ Error = 2, /**< Error text */ @@ -83,7 +83,7 @@ public: /** Parses the given text and highlight it in the right colors. */ void highlightBlock ( const QString & text ); - /** + /** * Sets the current paragraph type used in ReportOutput * @see ReportOutput::Message * @see ReportOutput::Warning @@ -143,11 +143,11 @@ public: /** Restore the default font settings. */ void restoreFont (); - /** Returns true whether errors are reported. */ + /** Returns true whether errors are reported. */ bool isError() const; - /** Returns true whether warnings are reported. */ + /** Returns true whether warnings are reported. */ bool isWarning() const; - /** Returns true whether log messages are reported. */ + /** Returns true whether log messages are reported. */ bool isLogMessage() const; /** Returns true whether normal messages are reported. */ bool isNormalMessage() const; @@ -193,7 +193,7 @@ private: bool blockStart; ReportHighlighter* reportHl; /**< Syntax highlighter */ int messageSize; - ParameterGrp::handle _prefs; + ParameterGrp::handle _prefs; }; /** diff --git a/src/Gui/RevitNavigationStyle.cpp b/src/Gui/RevitNavigationStyle.cpp index d48953b6d0..977d0c01a2 100644 --- a/src/Gui/RevitNavigationStyle.cpp +++ b/src/Gui/RevitNavigationStyle.cpp @@ -221,8 +221,8 @@ SbBool RevitNavigationStyle::processSoEvent(const SoEvent * const ev) this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise - // the canvas doesn't get any release events - if (this->currentmode != NavigationStyle::ZOOMING && + // the canvas doesn't get any release events + if (this->currentmode != NavigationStyle::ZOOMING && this->currentmode != NavigationStyle::PANNING && this->currentmode != NavigationStyle::DRAGGING) { if (this->isPopupMenuEnabled()) { diff --git a/src/Gui/SceneInspector.cpp b/src/Gui/SceneInspector.cpp index 9d87cf62cc..c407118e32 100644 --- a/src/Gui/SceneInspector.cpp +++ b/src/Gui/SceneInspector.cpp @@ -52,7 +52,7 @@ SceneModel::~SceneModel() int SceneModel::columnCount (const QModelIndex & parent) const { - Q_UNUSED(parent); + Q_UNUSED(parent); return 2; } @@ -143,7 +143,7 @@ DlgInspector::DlgInspector(QWidget* parent, Qt::WindowFlags fl) ui->treeView->setRootIsDecorated(true); } -/* +/* * Destroys the object and frees any allocated resources */ DlgInspector::~DlgInspector() @@ -168,7 +168,7 @@ void DlgInspector::setNode(SoNode* node) { SceneModel* model = static_cast(ui->treeView->model()); model->setNode(node); - + QHeaderView* header = ui->treeView->header(); #if QT_VERSION >= 0x050000 header->setSectionResizeMode(0, QHeaderView::Stretch); diff --git a/src/Gui/Selection.cpp b/src/Gui/Selection.cpp index b21de2e0f3..84fa8d1b2a 100644 --- a/src/Gui/Selection.cpp +++ b/src/Gui/Selection.cpp @@ -1,5 +1,6 @@ /*************************************************************************** - * Copyright (c) Jürgen Riegel * + * Copyright (c) 2011 Jürgen Riegel * + * Copyright (c) 2011 Werner Mayer * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/Selection.h b/src/Gui/Selection.h index 22a2191bed..90f4df024b 100644 --- a/src/Gui/Selection.h +++ b/src/Gui/Selection.h @@ -1,5 +1,6 @@ /*************************************************************************** - * Copyright (c) Jürgen Riegel * + * Copyright (c) 2011 Jürgen Riegel * + * Copyright (c) 2011 Werner Mayer * * * * This file is part of the FreeCAD CAx development system. * * * @@ -79,7 +80,7 @@ public: MovePreselect, // to signal observer the mouse movement when preselect }; - SelectionChanges(MsgType type = ClrSelection, + SelectionChanges(MsgType type = ClrSelection, const char *docName=0, const char *objName=0, const char *subName=0, const char *typeName=0, float x=0, float y=0, float z=0, int subtype=0) @@ -95,8 +96,8 @@ public: } SelectionChanges(MsgType type, - const std::string &docName, - const std::string &objName, + const std::string &docName, + const std::string &objName, const std::string &subName, const std::string &typeName = std::string(), float x=0,float y=0,float z=0, int subtype=0) @@ -208,7 +209,7 @@ class GuiExport SelectionObserver public: /** Constructor - * + * * @param attach: whether to attach this observer on construction * @param resolve: sub-object resolving mode. * 0 no resolve, @@ -217,11 +218,11 @@ public: */ SelectionObserver(bool attach = true, int resolve = 1); /** Constructor - * + * * @param vp: filtering view object. * @param attach: whether to attach this observer on construction * @param resolve: sub-object resolving mode. - * 0 no resolve, + * 0 no resolve, * 1 resolve sub-object with old style element name * 2 resolve sub-object with new style element name * @@ -363,10 +364,10 @@ public: float x,y,z; }; - /// Add to selection - bool addSelection(const char* pDocName, const char* pObjectName=0, const char* pSubName=0, + /// Add to selection + bool addSelection(const char* pDocName, const char* pObjectName=0, const char* pSubName=0, float x=0, float y=0, float z=0, const std::vector *pickedList = 0, bool clearPreSelect=true); - bool addSelection2(const char* pDocName, const char* pObjectName=0, const char* pSubName=0, + bool addSelection2(const char* pDocName, const char* pObjectName=0, const char* pSubName=0, float x=0, float y=0, float z=0, const std::vector *pickedList = 0) { return addSelection(pDocName,pObjectName,pSubName,x,y,z,pickedList,false); @@ -376,10 +377,10 @@ public: bool addSelection(const SelectionObject&, bool clearPreSelect=true); /// Add to selection with several sub-elements bool addSelections(const char* pDocName, const char* pObjectName, const std::vector& pSubNames); - /// Update a selection + /// Update a selection bool updateSelection(bool show, const char* pDocName, const char* pObjectName=0, const char* pSubName=0); /// Remove from selection (for internal use) - void rmvSelection(const char* pDocName, const char* pObjectName=0, const char* pSubName=0, + void rmvSelection(const char* pDocName, const char* pObjectName=0, const char* pSubName=0, const std::vector *pickedList = 0); /// Set the selection for a document void setSelection(const char* pDocName, const std::vector&); @@ -388,7 +389,7 @@ public: /// Clear the selection of all documents void clearCompleteSelection(bool clearPreSelect=true); /// Check if selected - bool isSelected(const char* pDocName, const char* pObjectName=0, + bool isSelected(const char* pDocName, const char* pObjectName=0, const char* pSubName=0, int resolve=1) const; /// Check if selected bool isSelected(App::DocumentObject*, const char* pSubName=0, int resolve=1) const; @@ -396,7 +397,7 @@ public: const char *getSelectedElement(App::DocumentObject*, const char* pSubName) const; /// set the preselected object (mostly by the 3D view) - int setPreselect(const char* pDocName, const char* pObjectName, + int setPreselect(const char* pDocName, const char* pObjectName, const char* pSubName, float x=0, float y=0, float z=0, int signal=0); /// remove the present preselection void rmvPreselect(bool signal=false); @@ -428,7 +429,7 @@ public: * Does basically the same as the method above unless that it accepts a string literal as first argument. * \a typeName must be a registered type, otherwise 0 is returned. */ - unsigned int countObjectsOfType(const char* typeName, + unsigned int countObjectsOfType(const char* typeName, const char* pDocName=0, int resolve=1) const; /** Returns a vector of objects of type \a TypeName selected for the given document name \a pDocName. @@ -436,14 +437,14 @@ public: * If no objects of this document are selected an empty vector is returned. * @note The vector reflects the sequence of selection. */ - std::vector getObjectsOfType(const Base::Type& typeId, + std::vector getObjectsOfType(const Base::Type& typeId, const char* pDocName=0, int resolve=1) const; /** * Does basically the same as the method above unless that it accepts a string literal as first argument. * \a typeName must be a registered type otherwise an empty array is returned. */ - std::vector getObjectsOfType(const char* typeName, + std::vector getObjectsOfType(const char* typeName, const char* pDocName=0, int resolve=1) const; /** * A convenience template-based method that returns an array with the correct types already. @@ -480,9 +481,9 @@ 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 - * considered. + * considered. * @param resolve: sub-object resolving mode - * 0 no resolve, + * 0 no resolve, * 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 @@ -496,10 +497,10 @@ 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 - * considered. + * considered. * @param typeId: specify the type of object to be returned. * @param resolve: sub-object resolving mode. - * 0 no resolve, + * 0 no resolve, * 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 @@ -569,11 +570,11 @@ public: int selStackForwardSize() const {return _SelStackForward.size();} /** Obtain selected objects from stack - * + * * @param pDocName: optional filtering document, NULL for current active * document * @param resolve: sub-object resolving mode. - * 0 no resolve, + * 0 no resolve, * 1 resolve sub-object with old style element name * 2 resolve sub-object with new style element name * @param index: optional position in the stack @@ -589,7 +590,7 @@ public: */ void selStackGoBack(int count=1); - /** Go forward selection history + /** Go forward selection history * * @param count: optional number of steps to go back * @@ -709,12 +710,12 @@ protected: std::deque _SelStackBack; std::deque _SelStackForward; - int checkSelection(const char *pDocName, const char *pObjectName, + int checkSelection(const char *pDocName, const char *pObjectName, const char *pSubName,int resolve, _SelObj &sel, const std::list<_SelObj> *selList=0) const; std::vector getObjectList(const char* pDocName,Base::Type typeId, std::list<_SelObj> &objs, int resolve, bool single=false) const; - static App::DocumentObject *getObjectOfType(_SelObj &sel, Base::Type type, + static App::DocumentObject *getObjectOfType(_SelObj &sel, Base::Type type, int resolve, const char **subelement=0); static SelectionSingleton* _pcSingleton; diff --git a/src/Gui/SelectionFilter.h b/src/Gui/SelectionFilter.h index ead3b36811..c0fd212c54 100644 --- a/src/Gui/SelectionFilter.h +++ b/src/Gui/SelectionFilter.h @@ -34,19 +34,19 @@ namespace App { namespace Gui { struct Node_Block; - -/** Selection filter definition + +/** Selection filter definition * This class builds up a type/count tree out of a string - * to test very fast a selection or object/subelement type - * against it. + * to test very fast a selection or object/subelement type + * against it. * * Example strings are: - * "SELECT Part::Feature SUBELEMENT Edge", - * "SELECT Robot::RobotObject", + * "SELECT Part::Feature SUBELEMENT Edge", + * "SELECT Robot::RobotObject", * "SELECT Robot::RobotObject COUNT 1..5" */ -class GuiExport SelectionFilter +class GuiExport SelectionFilter { public: @@ -55,26 +55,26 @@ public: SelectionFilter(const std::string& filter); virtual ~SelectionFilter(); - /// Set a new filter string + /// Set a new filter string void setFilter(const char* filter); const std::string& getFilter() const { return Filter; } /** Test to current selection * This method tests the current selection set - * against the filter and returns true if the + * against the filter and returns true if the * described object(s) are selected. */ bool match(void); /** Test objects - * This method tests if a given object is described in the + * This method tests if a given object is described in the * filter. If SubName is not NULL the Subelement gets also * tested. */ bool test(App::DocumentObject*pObj, const char*sSubName); void addError(const char* e); - + friend class SelectionSingleton; std::vector > Result; @@ -92,9 +92,9 @@ protected: }; /** Filter object for the SelectionSengleton - * This object is a link between the selection - * filter class and the selection singleton. Created with a - * filter string and registered in the selection it will only + * This object is a link between the selection + * filter class and the selection singleton. Created with a + * filter string and registered in the selection it will only * allow the described object types to be selected. * @see SelectionFilter * @see SelectionSingleton @@ -141,7 +141,7 @@ private: * @see SelectionFilter * @author Werner Mayer */ -class SelectionFilterPy : public Py::PythonExtension +class SelectionFilterPy : public Py::PythonExtension { public: SelectionFilter filter; @@ -193,7 +193,7 @@ private: // === Abstract syntax tree (AST) =========================================== -struct Node_Slice +struct Node_Slice { Node_Slice(int min=1,int max=INT_MAX):Min(min),Max(max){} int Min,Max; @@ -201,7 +201,7 @@ struct Node_Slice }; -struct Node_Object +struct Node_Object { Node_Object(std::string *type,std::string *subname,Node_Slice* slc ) :Slice(slc) @@ -221,7 +221,7 @@ struct Node_Object std::string SubName; }; -struct Node_Block +struct Node_Block { Node_Block(Node_Object* obj){Objects.push_back(obj);} std::vector< Node_Object *> Objects; diff --git a/src/Gui/SelectionFilter.l b/src/Gui/SelectionFilter.l index f13dcacc1c..eda00025a7 100644 --- a/src/Gui/SelectionFilter.l +++ b/src/Gui/SelectionFilter.l @@ -1,6 +1,25 @@ %{ +/*************************************************************************** + * Copyright (c) 2010 Jürgen Riegel * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + /* Lexer for the FreeCAD selection filter language */ -/* Copyright (c) 2010 Jürgen Riegel LGPL */ /* flex -o lex.SelectionFilter.c SelectionFilter.l */ @@ -24,12 +43,12 @@ %option batch /* no support for include files is planned */ -%option noyywrap nounput +%option noyywrap nounput %% /*** Filter language Part ***/ - + [ \t] ; [\n]+ ; "SUBELEMENT" return TSUB; @@ -50,4 +69,4 @@ - + diff --git a/src/Gui/SelectionFilter.y b/src/Gui/SelectionFilter.y index 29b8baea9f..6f135a93f5 100644 --- a/src/Gui/SelectionFilter.y +++ b/src/Gui/SelectionFilter.y @@ -1,5 +1,24 @@ +/*************************************************************************** + * Copyright (c) 2010 Jürgen Riegel * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + /* Parser for the FreeCAD selection filter language */ -/* Copyright (c) 2010 Jürgen Riegel LGPL */ /* bison -o SelectionFilter.tab.c SelectionFilter.y */ @@ -18,7 +37,7 @@ match our tokens.l lex file. We also define the node type they represent. */ -%token TIDENTIFIER +%token TIDENTIFIER %token TSUB TSELECT TCOUNT TSLICE TNAMESPACE %token TNUMBER @@ -34,24 +53,24 @@ %% - - + + type : TSELECT TIDENTIFIER { $$ = $2 } | TSELECT TIDENTIFIER TNAMESPACE TIDENTIFIER { $$ = new std::string(*$2 + "::" + *$4) } subname : { $$ = 0 } | TSUB TIDENTIFIER { $$ = $2 } - + count : { $$ = 0 } | TCOUNT TNUMBER TSLICE TNUMBER { $$ = new Node_Slice($2,$4) } | TCOUNT TNUMBER TSLICE { $$ = new Node_Slice($2) } | TCOUNT TNUMBER { $$ = new Node_Slice($2,$2) } - + matchline : type subname count { $$ = new Node_Object($1,$2,$3) } matchlines : matchline { $$ = new Node_Block($1); } | matchlines matchline { $$ = $1 ; $$->Objects.push_back($2); } - + block : matchlines { $$ = $1 } filter: block { TopBlock = $1 } diff --git a/src/Gui/SelectionObject.cpp b/src/Gui/SelectionObject.cpp index 28e7e82de3..939045fe88 100644 --- a/src/Gui/SelectionObject.cpp +++ b/src/Gui/SelectionObject.cpp @@ -77,7 +77,7 @@ const App::DocumentObject * SelectionObject::getObject(void) const return 0; } -App::DocumentObject * SelectionObject::getObject(void) +App::DocumentObject * SelectionObject::getObject(void) { if (!DocName.empty()) { App::Document *doc = App::GetApplication().getDocument(DocName.c_str()); diff --git a/src/Gui/SelectionObject.h b/src/Gui/SelectionObject.h index c4c1fd8123..bf5701886d 100644 --- a/src/Gui/SelectionObject.h +++ b/src/Gui/SelectionObject.h @@ -98,4 +98,4 @@ private: } // namespace Gui -#endif // GUI_SelectionObject_H +#endif // GUI_SelectionObject_H diff --git a/src/Gui/SelectionObjectPyImp.cpp b/src/Gui/SelectionObjectPyImp.cpp index b179a53e80..3c25efeab0 100644 --- a/src/Gui/SelectionObjectPyImp.cpp +++ b/src/Gui/SelectionObjectPyImp.cpp @@ -151,5 +151,5 @@ PyObject *SelectionObjectPy::getCustomAttributes(const char* /*attr*/) const int SelectionObjectPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Gui/SelectionView.h b/src/Gui/SelectionView.h index a6d6b962e5..ecb9a1dad5 100644 --- a/src/Gui/SelectionView.h +++ b/src/Gui/SelectionView.h @@ -43,7 +43,7 @@ namespace DockWnd { /** A test class. A more elaborate class description. */ -class SelectionView : public Gui::DockWindow, +class SelectionView : public Gui::DockWindow, public Gui::SelectionObserver { Q_OBJECT diff --git a/src/Gui/SoAxisCrossKit.cpp b/src/Gui/SoAxisCrossKit.cpp index 37eec7da33..7663505ed1 100644 --- a/src/Gui/SoAxisCrossKit.cpp +++ b/src/Gui/SoAxisCrossKit.cpp @@ -129,17 +129,17 @@ SoAxisCrossKit::SoAxisCrossKit() SO_KIT_CONSTRUCTOR(SoAxisCrossKit); // Add the parts to the catalog... - SO_KIT_ADD_CATALOG_ENTRY(xAxis, SoShapeKit, + SO_KIT_ADD_CATALOG_ENTRY(xAxis, SoShapeKit, true, this,"", true); - SO_KIT_ADD_CATALOG_ENTRY(xHead, SoShapeKit, + SO_KIT_ADD_CATALOG_ENTRY(xHead, SoShapeKit, true, this,"", true); - SO_KIT_ADD_CATALOG_ENTRY(yAxis, SoShapeKit, + SO_KIT_ADD_CATALOG_ENTRY(yAxis, SoShapeKit, true, this,"", true); - SO_KIT_ADD_CATALOG_ENTRY(yHead, SoShapeKit, + SO_KIT_ADD_CATALOG_ENTRY(yHead, SoShapeKit, true, this,"", true); - SO_KIT_ADD_CATALOG_ENTRY(zAxis, SoShapeKit, + SO_KIT_ADD_CATALOG_ENTRY(zAxis, SoShapeKit, true, this,"", true); - SO_KIT_ADD_CATALOG_ENTRY(zHead, SoShapeKit, + SO_KIT_ADD_CATALOG_ENTRY(zHead, SoShapeKit, true, this,"", true); SO_KIT_INIT_INSTANCE(); @@ -300,7 +300,7 @@ void SoRegPoint::GLRender(SoGLRenderAction *action) SbVec3f p1 = base.getValue(); SbVec3f p2 = p1 + normal.getValue() * length.getValue(); - + glLineWidth(1.0f); glColor3fv(color.getValue().getValue()); glBegin(GL_LINE_STRIP); diff --git a/src/Gui/SoFCBoundingBox.cpp b/src/Gui/SoFCBoundingBox.cpp index 95a67c9c0e..2a5e8c5309 100644 --- a/src/Gui/SoFCBoundingBox.cpp +++ b/src/Gui/SoFCBoundingBox.cpp @@ -93,7 +93,7 @@ SoFCBoundingBox::SoFCBoundingBox () bboxLines->coordIndex.setNum(36); bboxLines->coordIndex.setValues(0, 36, bBoxEdges); bboxSep->addChild(bboxLines); - + // create the text nodes, including a transform for each vertice offset textSep = new SoSeparator(); diff --git a/src/Gui/SoFCBoundingBox.h b/src/Gui/SoFCBoundingBox.h index 34ba8f1e88..3043ccf82f 100644 --- a/src/Gui/SoFCBoundingBox.h +++ b/src/Gui/SoFCBoundingBox.h @@ -25,7 +25,7 @@ #define COIN_SOFCBOUNDINGBOX_H #include -#include +#include #include #include #include @@ -43,7 +43,7 @@ namespace Gui { * A subclass of SoShape used to create an axis aligned wire frame box based * on the minBounds and maxBounds fields. The class also has a field which * can be toggled on or off for displaying text coordinate labels at the - * vertices of the box. + * vertices of the box. * @note Original source are taken from http://www.wheatchex.com/projects/openinventor/bbox/BoundingBox.h and * http://www.wheatchex.com/projects/openinventor/bbox/BoundingBox.cpp * @date November 12th, 2001 @@ -95,7 +95,7 @@ public: enum Modes { INCLUDE_BBOX, EXCLUDE_BBOX }; - + SoSFEnum mode; virtual void getBoundingBox(SoGetBoundingBoxAction *action); diff --git a/src/Gui/SoFCCSysDragger.h b/src/Gui/SoFCCSysDragger.h index 72929617a1..3a37df095d 100644 --- a/src/Gui/SoFCCSysDragger.h +++ b/src/Gui/SoFCCSysDragger.h @@ -138,7 +138,7 @@ private: * with *Increment for full double precision output. * * Dragger can be displayed in 2 modes: static scale and auto scale. - * For static you can set the field scale and you are done. + * For static you can set the field scale and you are done. * For autoscale you set the field scale & call setupAutoScale with * the viewer camera. @see setUpAutoScale @see scale. */ @@ -195,7 +195,7 @@ public: SoSFInt32 rotationIncrementCountZ; //!< used from outside for rotation z steps. void clearIncrementCounts(); //!< used to reset after drag update. - + /*! @brief Overall scale of dragger node. * * When using autoscale mode, this represents normalized device coordinates (0.0 to 1.0). A value @@ -207,7 +207,7 @@ public: SoIdleSensor idleSensor; //!< might be overkill, but want to make sure of performance. void setUpAutoScale(SoCamera *cameraIn); //!< used to setup the auto scaling of dragger. - + //! @name Visibility Functions //@{ void showTranslationX(); //!< show the x translation dragger. @@ -216,21 +216,21 @@ public: void hideTranslationX(); //!< hide the x translation dragger. void hideTranslationY(); //!< hide the y translation dragger. void hideTranslationZ(); //!< hide the z translation dragger. - + void showRotationX(); //!< show the x rotation dragger. void showRotationY(); //!< show the y rotation dragger. void showRotationZ(); //!< show the z rotation dragger. void hideRotationX(); //!< hide the x rotation dragger. void hideRotationY(); //!< hide the y rotation dragger. void hideRotationZ(); //!< hide the z rotation dragger. - + bool isShownTranslationX(); //!< is x translation dragger shown. bool isShownTranslationY(); //!< is y translation dragger shown. bool isShownTranslationZ(); //!< is z translation dragger shown. bool isShownRotationX(); //!< is x rotation dragger shown. bool isShownRotationY(); //!< is x rotation dragger shown. bool isShownRotationZ(); //!< is x rotation dragger shown. - + bool isHiddenTranslationX(); //!< is x translation dragger hidden. bool isHiddenTranslationY(); //!< is y translation dragger hidden. bool isHiddenTranslationZ(); //!< is z translation dragger hidden. diff --git a/src/Gui/SoFCColorBar.cpp b/src/Gui/SoFCColorBar.cpp index eabe799bf9..6a3f3e21ea 100644 --- a/src/Gui/SoFCColorBar.cpp +++ b/src/Gui/SoFCColorBar.cpp @@ -219,7 +219,7 @@ void SoFCColorBar::eventCallback(void * /*userdata*/, SoEventCallback * node) } } -void SoFCColorBar::handleEvent (SoHandleEventAction *action) +void SoFCColorBar::handleEvent (SoHandleEventAction *action) { const SoEvent * event = action->getEvent(); @@ -229,7 +229,7 @@ void SoFCColorBar::handleEvent (SoHandleEventAction *action) // calculate the mouse position relative to the colorbar // - const SbViewportRegion& vp = action->getViewportRegion(); + const SbViewportRegion& vp = action->getViewportRegion(); float fRatio = vp.getViewportAspectRatio(); SbVec2f pos = event->getNormalizedPosition(vp); float pX,pY; pos.getValue(pX,pY); diff --git a/src/Gui/SoFCDB.cpp b/src/Gui/SoFCDB.cpp index f4317678d4..3d3214962e 100644 --- a/src/Gui/SoFCDB.cpp +++ b/src/Gui/SoFCDB.cpp @@ -204,7 +204,7 @@ void Gui::SoFCDB::init() void Gui::SoFCDB::finish() { // Coin doesn't provide a mechanism to free static members of own data types. - // Hence, we need to define a static method e.g. 'finish()' for all new types + // Hence, we need to define a static method e.g. 'finish()' for all new types // to invoke the private member function 'atexit_cleanup()'. SoFCColorBarBase ::finish(); SoFCColorBar ::finish(); @@ -225,7 +225,7 @@ void Gui::SoFCDB::finish() SoFCSeparator ::finish(); SoFCSelectionRoot ::finish(); SoFCPathAnnotation ::finish(); - + storage->unref(); storage = nullptr; } diff --git a/src/Gui/SoFCDB.h b/src/Gui/SoFCDB.h index afaf6fe72a..ff92642063 100644 --- a/src/Gui/SoFCDB.h +++ b/src/Gui/SoFCDB.h @@ -56,7 +56,7 @@ public: static bool writeToFile(SoNode* node, const char* filename, bool binary); /*! container for app lifetime storage. See SoFCCSysDragger for details * on why this is needed. - */ + */ static SoGroup* getStorage(); private: diff --git a/src/Gui/SoFCOffscreenRenderer.cpp b/src/Gui/SoFCOffscreenRenderer.cpp index c09b16c019..4f86f8752b 100644 --- a/src/Gui/SoFCOffscreenRenderer.cpp +++ b/src/Gui/SoFCOffscreenRenderer.cpp @@ -162,10 +162,10 @@ void SoFCOffscreenRenderer::writeToImageFile(const char* filename, const char* c img.setText(QLatin1String("Description"), QLatin1String("Screenshot created by FreeCAD")); else if (strcmp(comment,"$MIBA")==0) img.setText(QLatin1String("Description"), QLatin1String(createMIBA(mat).c_str())); - else + else img.setText(QLatin1String("Description"), QString::fromUtf8(comment)); img.setText(QLatin1String("Creation Time"), QDateTime::currentDateTime().toString()); - img.setText(QLatin1String("Software"), + img.setText(QLatin1String("Software"), QString::fromUtf8(App::GetApplication().getExecutableName())); } @@ -238,7 +238,7 @@ QStringList SoFCOffscreenRenderer::getWriteImageFiletypeInfo() SbList extlist; # else // Coin3D >= 2.3.x SbPList extlist; -# endif +# endif #else // Coin3D >= 3.x SbPList extlist; #endif @@ -285,17 +285,17 @@ std::string SoFCOffscreenRenderer::createMIBA(const SbMatrix& mat) const com << setw(7) << setfill(' ') << fixed; com << " \n" ; com << " \n" ; - com << " \n"; - com << " \n"; + com << " \n" ; - com << " \n" ; - com << " \n" ; - com << " Unknown\n" ; - com << " " << QDateTime::currentDateTime().toString().toLatin1().constData() << "\n" ; + com << " />\n" ; + com << " \n" ; + com << " \n" ; + com << " Unknown\n" ; + com << " " << QDateTime::currentDateTime().toString().toLatin1().constData() << "\n" ; com << " " << App::GetApplication().getExecutableName() << " " << major << "." << minor << "\n" ; com << " Unknown\n"; com << " 1.0\n"; @@ -779,7 +779,7 @@ SoQtOffscreenRenderer::render(SoPath * scene) return PRIVATE(this)->renderFromBase(scene); } -/*! +/*! Writes the rendered image buffer directly into a QImage object. */ void @@ -822,7 +822,7 @@ SoQtOffscreenRenderer::writeToImage (QImage& img) const } /*! - This method returns all image file formats supported by Coin3D (see getWriteFiletypeInfo()) with all QImage file formats that are + This method returns all image file formats supported by Coin3D (see getWriteFiletypeInfo()) with all QImage file formats that are not directly supported by Coin3D, if so. */ QStringList SoQtOffscreenRenderer::getWriteImageFiletypeInfo() const diff --git a/src/Gui/SoFCOffscreenRenderer.h b/src/Gui/SoFCOffscreenRenderer.h index ce4b0ffa65..01500bdd30 100644 --- a/src/Gui/SoFCOffscreenRenderer.h +++ b/src/Gui/SoFCOffscreenRenderer.h @@ -34,7 +34,7 @@ namespace Gui { /** - * The SoFCOffscreenRenderer class is used for rendering scenes in offscreen buffers. + * The SoFCOffscreenRenderer class is used for rendering scenes in offscreen buffers. * @author Werner Mayer */ class GuiExport SoFCOffscreenRenderer : public SoOffscreenRenderer @@ -54,32 +54,32 @@ private: protected: /** - * Constructor. Argument is the \a viewportregion we should use when rendering. An internal - * SoGLRenderAction will be constructed. + * Constructor. Argument is the \a viewportregion we should use when rendering. An internal + * SoGLRenderAction will be constructed. */ SoFCOffscreenRenderer (const SbViewportRegion &viewportregion); /** - * Constructor. Argument is the \a action we should apply to the scene graph when rendering the - * scene. Information about the viewport is extracted from the \a action. + * Constructor. Argument is the \a action we should apply to the scene graph when rendering the + * scene. Information about the viewport is extracted from the \a action. */ SoFCOffscreenRenderer (SoGLRenderAction *action); /** - * Destructor. + * Destructor. */ ~SoFCOffscreenRenderer(); public: - /** + /** * Writes the rendered image buffer directly into a QImage object * instead of an image file. */ void writeToImage (QImage&) const; - /** + /** * Saves the buffer to \a filename, in the filetype specified by \a filetypeextensions. * - * Note that you must still specify the full filename for the first argument, i.e. the second argument will + * Note that you must still specify the full filename for the first argument, i.e. the second argument will * not automatically be attached to the filename -- it is only used to decide the filetype. - * + * * If \a comment is set to '$MIBA' information regarding the MIBA standard is * embedded to the picture, otherwise the \a comment is embedded as is. * The appropriate file format must support embedding meta information which @@ -90,7 +90,7 @@ public: */ void writeToImageFile(const char* filename, const char* comment, const SbMatrix& mat, const QImage& img); /** - * This method returns all image file formats supported by Coin3D (see getWriteFiletypeInfo()) with all QImage file formats that are + * This method returns all image file formats supported by Coin3D (see getWriteFiletypeInfo()) with all QImage file formats that are * not directly supported by Coin3D, if so. */ QStringList getWriteImageFiletypeInfo(); @@ -160,4 +160,4 @@ private: } // namespace Gui -#endif // GUI_SOFCOFFSCREENRENDERER_H +#endif // GUI_SOFCOFFSCREENRENDERER_H diff --git a/src/Gui/SoFCSelection.cpp b/src/Gui/SoFCSelection.cpp index 67ed645963..4523c96709 100644 --- a/src/Gui/SoFCSelection.cpp +++ b/src/Gui/SoFCSelection.cpp @@ -66,7 +66,7 @@ // // Disable front buffer in all cases, in order to spare the repeating logic of // handling selection contextn. SoFCSelection is not really used that much -// anyway. +// anyway. // // #if defined(_OCC64) // is set by configure or cmake # define NO_FRONTBUFFER @@ -261,11 +261,11 @@ void SoFCSelection::doAction(SoAction *action) if (selectionMode.getValue() == SEL_ON && action->getTypeId() == SoFCSelectionAction::getClassTypeId()) { SoFCSelectionAction *selaction = static_cast(action); - if (selaction->SelChange.Type == SelectionChanges::AddSelection || + if (selaction->SelChange.Type == SelectionChanges::AddSelection || selaction->SelChange.Type == SelectionChanges::RmvSelection) { if (documentName.getValue() == selaction->SelChange.pDocName && objectName.getValue() == selaction->SelChange.pObjectName && - (subElementName.getValue() == selaction->SelChange.pSubName || + (subElementName.getValue() == selaction->SelChange.pSubName || *(selaction->SelChange.pSubName) == '\0') ) { if (selaction->SelChange.Type == SelectionChanges::AddSelection) { if(selected.getValue() == NOTSELECTED){ @@ -286,7 +286,7 @@ void SoFCSelection::doAction(SoAction *action) if(selected.getValue() == SELECTED){ selected = NOTSELECTED; } - + } } else if (selaction->SelChange.Type == SelectionChanges::SetSelection) { @@ -324,7 +324,7 @@ int SoFCSelection::getPriority(const SoPickedPoint* p) const SoPickedPoint* SoFCSelection::getPickedPoint(SoHandleEventAction* action) const { - // To identify the picking of lines in a concave area we have to + // To identify the picking of lines in a concave area we have to // get all intersection points. If we have two or more intersection // points where the first is of a face and the second of a line with // almost similar coordinates we use the second point, instead. @@ -346,13 +346,13 @@ SoFCSelection::getPickedPoint(SoHandleEventAction* action) const //} //return pp0; - + const SoPickedPoint* picked = points[0]; int picked_prio = getPriority(picked); const SbVec3f& picked_pt = picked->getPoint(); - + for(int i=1; iredrawHighlighted(action, true); } } - + const auto &pt = pp->getPoint(); - + auto pts = schemaTranslatePoint(pt[0], pt[1], pt[2], 1e-7); snprintf(buf,512,"Preselected: %s.%s.%s (%f %s, %f %s, %f %s)" ,documentName.getValue().getString() @@ -414,7 +414,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) ,pts[0].first, pts[0].second.c_str() ,pts[1].first, pts[1].second.c_str() ,pts[2].first, pts[2].second.c_str()); - + getMainWindow()->showMessage(QString::fromUtf8(buf)); } else { // picked point @@ -506,7 +506,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) } } - action->setHandled(); + action->setHandled(); } // picked point } // mouse release } @@ -523,7 +523,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) // return; //} - + // // If this is a mouseMotion event, then check for locate highlighting // @@ -601,7 +601,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) bCtrl = false; } // mouse press events for (de)selection (only if selection is enabled on this node) - else if (event->isOfType(SoMouseButtonEvent::getClassTypeId()) && + else if (event->isOfType(SoMouseButtonEvent::getClassTypeId()) && selectionMode.getValue() == SoFCSelection::SEL_ON) { SoMouseButtonEvent * const e = (SoMouseButtonEvent *) event; if (SoMouseButtonEvent::isButtonReleaseEvent(e,SoMouseButtonEvent::BUTTON1)) { @@ -652,7 +652,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) ,objectName.getValue().getString() ,0 ,pt[0] ,pt[1] ,pt[2]); } - + if (mymode == OFF) { snprintf(buf,512,"Selected: %s.%s.%s (%g, %g, %g)",documentName.getValue().getString() ,objectName.getValue().getString() @@ -665,7 +665,7 @@ SoFCSelection::handleEvent(SoHandleEventAction * action) } } - action->setHandled(); + action->setHandled(); } // picked point } // mouse release } @@ -699,7 +699,7 @@ SoFCSelection::GLRenderBelowPath(SoGLRenderAction * action) if(this->setOverride(action,ctx)) { inherited::GLRenderBelowPath(action); state->pop(); - } else + } else inherited::GLRenderBelowPath(action); #else // Set up state for locate highlighting (if necessary) @@ -861,8 +861,8 @@ SoFCSelection::preRender(SoGLRenderAction *action, GLint &oldDepthFunc) void SoFCSelection::redrawHighlighted(SoAction * action , SbBool doHighlight ) { - Q_UNUSED(action); - Q_UNUSED(doHighlight); + Q_UNUSED(action); + Q_UNUSED(doHighlight); //Base::Console().Log("SoFCSelection::redrawHighlighted() (%p) doHigh=%d \n",this,doHighlight?1:0); #ifdef NO_FRONTBUFFER @@ -951,7 +951,7 @@ SoFCSelection::redrawHighlighted(SoAction * action , SbBool doHighlight ) #endif } -SbBool +SbBool SoFCSelection::readInstance ( SoInput * in, unsigned short flags ) { // Note: The read in document name can be false, so the caller must ensure pointing to the correct document @@ -991,15 +991,15 @@ SoFCSelection::setOverride(SoGLRenderAction * action, SelContextPtr ctx) SoMaterialBindingElement::set(state,SoMaterialBindingElement::OVERALL); SoOverrideElement::setMaterialBindingOverride(state,this,true); - + if(!preselected) SoLazyElement::setEmissive(state, &ctx->selectionColor); - else + else SoLazyElement::setEmissive(state, &ctx->highlightColor); SoOverrideElement::setEmissiveColorOverride(state, this, true); if(SoLazyElement::getLightModel(state)==SoLazyElement::BASE_COLOR - || mystyle == SoFCSelection::EMISSIVE_DIFFUSE) + || mystyle == SoFCSelection::EMISSIVE_DIFFUSE) { if(!preselected) SoLazyElement::setDiffuse(state, this,1, &ctx->selectionColor,&colorpacker); diff --git a/src/Gui/SoFCSelection.h b/src/Gui/SoFCSelection.h index 216b371a0a..c37a5f1455 100644 --- a/src/Gui/SoFCSelection.h +++ b/src/Gui/SoFCSelection.h @@ -117,7 +117,7 @@ protected: virtual void redrawHighlighted(SoAction * act, SbBool flag); - virtual SbBool readInstance(SoInput * in, unsigned short flags); + virtual SbBool readInstance(SoInput * in, unsigned short flags); private: static int getPriority(const SoPickedPoint*); diff --git a/src/Gui/SoFCSelectionAction.cpp b/src/Gui/SoFCSelectionAction.cpp index 68dc73fdf1..cd07fc627b 100644 --- a/src/Gui/SoFCSelectionAction.cpp +++ b/src/Gui/SoFCSelectionAction.cpp @@ -1,5 +1,4 @@ /*************************************************************************** - * * Copyright (c) 2005 Jürgen Riegel * * * * This file is part of the FreeCAD CAx development system. * @@ -184,11 +183,11 @@ void SoFCHighlightAction::callDoAction(SoAction *action,SoNode *node) SO_ACTION_SOURCE(SoFCSelectionAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoFCSelectionAction::initClass() @@ -254,7 +253,7 @@ SoFCSelectionAction::~SoFCSelectionAction() { } - + void SoFCSelectionAction::beginTraversal(SoNode *node) { traverse(node); @@ -270,11 +269,11 @@ void SoFCSelectionAction::callDoAction(SoAction *action,SoNode *node) SO_ACTION_SOURCE(SoFCEnableSelectionAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoFCEnableSelectionAction::initClass() @@ -336,7 +335,7 @@ SoFCEnableSelectionAction::~SoFCEnableSelectionAction() { } - + void SoFCEnableSelectionAction::beginTraversal(SoNode *node) { traverse(node); @@ -352,11 +351,11 @@ void SoFCEnableSelectionAction::callDoAction(SoAction *action,SoNode *node) SO_ACTION_SOURCE(SoFCEnableHighlightAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoFCEnableHighlightAction::initClass() @@ -418,7 +417,7 @@ SoFCEnableHighlightAction::~SoFCEnableHighlightAction() { } - + void SoFCEnableHighlightAction::beginTraversal(SoNode *node) { traverse(node); @@ -434,11 +433,11 @@ void SoFCEnableHighlightAction::callDoAction(SoAction *action,SoNode *node) SO_ACTION_SOURCE(SoFCSelectionColorAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoFCSelectionColorAction::initClass() @@ -500,7 +499,7 @@ SoFCSelectionColorAction::~SoFCSelectionColorAction() { } - + void SoFCSelectionColorAction::beginTraversal(SoNode *node) { traverse(node); @@ -516,11 +515,11 @@ void SoFCSelectionColorAction::callDoAction(SoAction *action,SoNode *node) SO_ACTION_SOURCE(SoFCHighlightColorAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoFCHighlightColorAction::initClass() @@ -582,7 +581,7 @@ SoFCHighlightColorAction::~SoFCHighlightColorAction() { } - + void SoFCHighlightColorAction::beginTraversal(SoNode *node) { traverse(node); @@ -598,11 +597,11 @@ void SoFCHighlightColorAction::callDoAction(SoAction *action,SoNode *node) SO_ACTION_SOURCE(SoFCDocumentAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoFCDocumentAction::initClass() @@ -664,7 +663,7 @@ SoFCDocumentAction::~SoFCDocumentAction() { } - + void SoFCDocumentAction::beginTraversal(SoNode *node) { traverse(node); @@ -681,11 +680,11 @@ void SoFCDocumentAction::callDoAction(SoAction *action,SoNode *node) SO_ACTION_SOURCE(SoFCDocumentObjectAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoFCDocumentObjectAction::initClass() @@ -766,11 +765,11 @@ SbBool SoFCDocumentObjectAction::isHandled() const SO_ACTION_SOURCE(SoGLSelectAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoGLSelectAction::initClass() @@ -842,11 +841,11 @@ SbBool SoGLSelectAction::isHandled() const SO_ACTION_SOURCE(SoVisibleFaceAction) /** - * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base - * classes and afterwards subclasses of them must be listed, otherwise the registered methods - * of subclasses will be overridden. For more details see the thread in the Coin3d forum + * The order of the defined SO_ACTION_ADD_METHOD statements is very important. First the base + * classes and afterwards subclasses of them must be listed, otherwise the registered methods + * of subclasses will be overridden. For more details see the thread in the Coin3d forum * https://www.coin3d.org/pipermail/coin-discuss/2004-May/004346.html. - * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after + * This means that \c SoSwitch must be listed after \c SoGroup and \c SoFCSelection after * \c SoSeparator because both classes inherits the others. */ void SoVisibleFaceAction::initClass() @@ -976,7 +975,7 @@ void SoUpdateVBOAction::callDoAction(SoAction *action,SoNode *node) namespace Gui { class SoBoxSelectionRenderActionP { public: - SoBoxSelectionRenderActionP(SoBoxSelectionRenderAction * master) + SoBoxSelectionRenderActionP(SoBoxSelectionRenderAction * master) : master(master) , searchaction(0) , selectsearch(0) @@ -1020,7 +1019,7 @@ public: // used to initialize the internal storage class with variables void -SoBoxSelectionRenderActionP::initBoxGraph() +SoBoxSelectionRenderActionP::initBoxGraph() { this->localRoot = new SoSeparator; this->localRoot->ref(); @@ -1052,8 +1051,8 @@ SoBoxSelectionRenderActionP::initBoxGraph() } -// used to render shape and non-shape nodes (usually SoGroup or SoSeparator). -void +// used to render shape and non-shape nodes (usually SoGroup or SoSeparator). +void SoBoxSelectionRenderActionP::updateBbox(const SoPath * path) { if (this->camerasearch == NULL) { @@ -1065,22 +1064,22 @@ SoBoxSelectionRenderActionP::updateBbox(const SoPath * path) this->camerasearch->setInterest(SoSearchAction::LAST); this->camerasearch->setType(SoCamera::getClassTypeId()); this->camerasearch->apply((SoPath*) path); - + if (!this->camerasearch->getPath()) { // if there is no camera there is no point rendering the bbox return; } this->localRoot->insertChild(this->camerasearch->getPath()->getTail(), 0); this->camerasearch->reset(); - + if (this->bboxaction == NULL) { this->bboxaction = new SoGetBoundingBoxAction(SbViewportRegion(100, 100)); } this->bboxaction->setViewportRegion(PUBLIC(this)->getViewportRegion()); this->bboxaction->apply((SoPath*) path); - + SbXfBox3f & box = this->bboxaction->getXfBoundingBox(); - + if (!box.isEmpty()) { // set cube size float x, y, z; @@ -1088,20 +1087,20 @@ SoBoxSelectionRenderActionP::updateBbox(const SoPath * path) this->cube->width = x; this->cube->height = y; this->cube->depth = z; - + SbMatrix transform = box.getTransform(); - + // get center (in the local bbox coordinate system) SbVec3f center = box.SbBox3f::getCenter(); - + // if center != (0,0,0), move the cube if (center != SbVec3f(0.0f, 0.0f, 0.0f)) { SbMatrix t; t.setTranslate(center); transform.multLeft(t); } - this->xform->matrix = transform; - + this->xform->matrix = transform; + PUBLIC(this)->SoGLRenderAction::apply(this->localRoot); } // remove camera @@ -1335,7 +1334,7 @@ SoBoxSelectionRenderAction::drawBoxes(SoPath * pathtothis, const SoPathList * pa int thispos = ((SoFullPath *)pathtothis)->getLength()-1; assert(thispos >= 0); PRIVATE(this)->postprocpath->truncate(0); // reset - + for (i = 0; i < thispos; i++) PRIVATE(this)->postprocpath->append(pathtothis->getNode(i)); diff --git a/src/Gui/SoFCSelectionAction.h b/src/Gui/SoFCSelectionAction.h index 92d650672b..4f1c36b51d 100644 --- a/src/Gui/SoFCSelectionAction.h +++ b/src/Gui/SoFCSelectionAction.h @@ -24,7 +24,7 @@ #ifndef _SoFCSelectionAction_h #define _SoFCSelectionAction_h -//#include +//#include #include #include #include @@ -65,7 +65,7 @@ private: /** * The SoFCSelectionAction class is used to inform an SoFCSelection node - * whether an object gets selected. + * whether an object gets selected. * @author Jürgen Riegel */ class GuiExport SoFCSelectionAction : public SoAction @@ -90,7 +90,7 @@ private: /** * The SoFCEnableSelectionAction class is used to inform an SoFCSelection node - * whether selection is enabled or disabled. + * whether selection is enabled or disabled. * @author Werner Mayer */ class GuiExport SoFCEnableSelectionAction : public SoAction @@ -115,7 +115,7 @@ private: /** * The SoFCEnableHighlightAction class is used to inform an SoFCSelection node - * whether preselection is enabled or disabled. + * whether preselection is enabled or disabled. * @author Werner Mayer */ class GuiExport SoFCEnableHighlightAction : public SoAction @@ -140,7 +140,7 @@ private: /** * The SoFCSelectionColorAction class is used to inform an SoFCSelection node - * which selection color is used. + * which selection color is used. * @author Werner Mayer */ class GuiExport SoFCSelectionColorAction : public SoAction @@ -165,7 +165,7 @@ private: /** * The SoFCHighlightColorAction class is used to inform an SoFCSelection node - * which preselection color is used. + * which preselection color is used. * @author Werner Mayer */ class GuiExport SoFCHighlightColorAction : public SoAction @@ -190,7 +190,7 @@ private: /** * The SoFCDocumentAction class is used to inform an SoFCSelection node - * when a document has been renamed. + * when a document has been renamed. * @author Werner Mayer */ class GuiExport SoFCDocumentAction : public SoAction @@ -370,4 +370,4 @@ private: } // namespace Gui -#endif // _SoFCSelectionAction_h +#endif // _SoFCSelectionAction_h diff --git a/src/Gui/SoFCSelectionContext.cpp b/src/Gui/SoFCSelectionContext.cpp index bd350cf5fe..e940a22c49 100644 --- a/src/Gui/SoFCSelectionContext.cpp +++ b/src/Gui/SoFCSelectionContext.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -40,7 +40,7 @@ bool SoFCSelectionContext::checkGlobal(SoFCSelectionContextPtr ctx) { bool sel = false; bool hl = false; SoFCSelectionRoot::checkSelection(sel,selectionColor,hl,highlightColor); - if(sel) + if(sel) selectionIndex.insert(-1); else if(ctx && hl) { selectionColor = ctx->selectionColor; @@ -66,7 +66,7 @@ bool SoFCSelectionContext::removeIndex(int index) { return false; } -int SoFCSelectionContext::merge(int status, SoFCSelectionContextBasePtr &output, +int SoFCSelectionContext::merge(int status, SoFCSelectionContextBasePtr &output, SoFCSelectionContextBasePtr input, SoFCSelectionRoot *) { auto ctx = std::dynamic_pointer_cast(input); @@ -172,7 +172,7 @@ bool SoFCSelectionContextEx::isSingleColor(uint32_t &color, bool &hasTransparenc return false; } -int SoFCSelectionContextEx::merge(int status, SoFCSelectionContextBasePtr &output, +int SoFCSelectionContextEx::merge(int status, SoFCSelectionContextBasePtr &output, SoFCSelectionContextBasePtr input, SoFCSelectionRoot *node) { auto ctx = std::dynamic_pointer_cast(input); @@ -243,7 +243,7 @@ SoFCSelectionCounter::~SoFCSelectionCounter() bool SoFCSelectionCounter::checkRenderCache(SoState *state) { - if(*counter || + if(*counter || (hasSelection && Selection().hasSelection()) || (hasPreselection && Selection().hasPreselection())) { diff --git a/src/Gui/SoFCSelectionContext.h b/src/Gui/SoFCSelectionContext.h index b87d013ffd..e4a8387a86 100644 --- a/src/Gui/SoFCSelectionContext.h +++ b/src/Gui/SoFCSelectionContext.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -38,7 +38,7 @@ typedef std::shared_ptr SoFCSelectionContextBasePtr; struct GuiExport SoFCSelectionContextBase { virtual ~SoFCSelectionContextBase() {} - typedef int MergeFunc(int status, SoFCSelectionContextBasePtr &output, + typedef int MergeFunc(int status, SoFCSelectionContextBasePtr &output, SoFCSelectionContextBasePtr input, SoFCSelectionRoot *node); }; diff --git a/src/Gui/SoFCUnifiedSelection.cpp b/src/Gui/SoFCUnifiedSelection.cpp index dce9ac1fac..5300e5869d 100644 --- a/src/Gui/SoFCUnifiedSelection.cpp +++ b/src/Gui/SoFCUnifiedSelection.cpp @@ -234,7 +234,7 @@ int SoFCUnifiedSelection::getPriority(const SoPickedPoint* p) return 0; } -std::vector +std::vector SoFCUnifiedSelection::getPickedList(SoHandleEventAction* action, bool singlePick) const { ViewProvider *last_vp = 0; @@ -269,14 +269,14 @@ SoFCUnifiedSelection::getPickedList(SoHandleEventAction* action, bool singlePick if(!info.vpd->getElementPicked(info.pp,info.element)) continue; - if(singlePick) + if(singlePick) last_vp = vp; ret.push_back(info); } if(ret.size()<=1) return ret; - // To identify the picking of lines in a concave area we have to + // To identify the picking of lines in a concave area we have to // get all intersection points. If we have two or more intersection // points where the first is of a face and the second of a line with // almost similar coordinates we use the second point, instead. @@ -287,7 +287,7 @@ SoFCUnifiedSelection::getPickedList(SoHandleEventAction* action, bool singlePick auto itPicked = ret.begin(); for(auto it=ret.begin()+1;it!=ret.end();++it) { auto &info = *it; - if(last_vpd != info.vpd) + if(last_vpd != info.vpd) break; int cur_prio = getPriority(info.pp); @@ -385,8 +385,8 @@ void SoFCUnifiedSelection::doAction(SoAction *action) if (action->getTypeId() == SoFCSelectionAction::getClassTypeId()) { SoFCSelectionAction *selaction = static_cast(action); - if(selectionMode.getValue() == ON - && (selaction->SelChange.Type == SelectionChanges::AddSelection + if(selectionMode.getValue() == ON + && (selaction->SelChange.Type == SelectionChanges::AddSelection || selaction->SelChange.Type == SelectionChanges::RmvSelection)) { // selection changes inside the 3d view are handled in handleEvent() @@ -456,13 +456,13 @@ void SoFCUnifiedSelection::doAction(SoAction *action) App::DocumentObject* obj = doc->getObject(selaction->SelChange.pObjectName); ViewProvider*vp = Application::Instance->getViewProvider(obj); if (vp && vp->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId()) && - (useNewSelection.getValue()||vp->useNewSelectionModel()) && vp->isSelectable()) + (useNewSelection.getValue()||vp->useNewSelectionModel()) && vp->isSelectable()) { detailPath->truncate(0); SoDetail *det = 0; if(vp->getDetailPath(selaction->SelChange.pSubName,detailPath,true,det)) { setHighlight(detailPath,det,static_cast(vp), - selaction->SelChange.pSubName, + selaction->SelChange.pSubName, selaction->SelChange.x, selaction->SelChange.y, selaction->SelChange.z); @@ -482,22 +482,22 @@ bool SoFCUnifiedSelection::setHighlight(const PickedInfo &info) { if(!info.pp) return setHighlight(0,0,0,0,0.0,0.0,0.0); const auto &pt = info.pp->getPoint(); - return setHighlight(static_cast(info.pp->getPath()), + return setHighlight(static_cast(info.pp->getPath()), info.pp->getDetail(), info.vpd, info.element.c_str(), pt[0],pt[1],pt[2]); } -bool SoFCUnifiedSelection::setHighlight(SoFullPath *path, const SoDetail *det, - ViewProviderDocumentObject *vpd, const char *element, float x, float y, float z) +bool SoFCUnifiedSelection::setHighlight(SoFullPath *path, const SoDetail *det, + ViewProviderDocumentObject *vpd, const char *element, float x, float y, float z) { Base::FlagToggler flag(setPreSelection); bool highlighted = false; - if(path && path->getLength() && - vpd && vpd->getObject() && vpd->getObject()->getNameInDocument()) + if(path && path->getLength() && + vpd && vpd->getObject() && vpd->getObject()->getNameInDocument()) { const char *docname = vpd->getObject()->getDocument()->getName(); const char *objname = vpd->getObject()->getNameInDocument(); - + this->preSelection = 1; static char buf[513]; @@ -605,7 +605,7 @@ bool SoFCUnifiedSelection::setSelection(const std::vector &infos, bo // Hierarchy ascending // // If the clicked subelement is already selected, check if there is an - // upper hierarchy, and select that hierarchy instead. + // upper hierarchy, and select that hierarchy instead. // // For example, let's suppose PickedInfo above reports // 'link.link2.box.Face1', and below Selection().getSelectedElement returns @@ -620,7 +620,7 @@ bool SoFCUnifiedSelection::setSelection(const std::vector &infos, bo const char *subSelected = Gui::Selection().getSelectedElement( vpd->getObject(),subName.c_str()); - FC_TRACE("select " << (subSelected?subSelected:"'null'") << ", " << + FC_TRACE("select " << (subSelected?subSelected:"'null'") << ", " << objectName << ", " << subName); std::string newElement; if(subSelected) { @@ -648,8 +648,8 @@ bool SoFCUnifiedSelection::setSelection(const std::vector &infos, bo hasNext = true; subName = nextsub; detailPath->truncate(0); - if(vpd->getDetailPath(subName.c_str(),detailPath,true,detNext) && - detailPath->getLength()) + if(vpd->getDetailPath(subName.c_str(),detailPath,true,detNext) && + detailPath->getLength()) { pPath = detailPath; det = detNext; @@ -660,7 +660,7 @@ bool SoFCUnifiedSelection::setSelection(const std::vector &infos, bo #if 0 // ViewProviderDocumentObject now has default implementation of getElementPicked - // If no next hierarchy is found, do another try on view provider hierarchies, + // If no next hierarchy is found, do another try on view provider hierarchies, // which is used by geo feature group. if(!hasNext) { bool found = false; @@ -687,7 +687,7 @@ bool SoFCUnifiedSelection::setSelection(const std::vector &infos, bo FC_TRACE("clearing selection"); Gui::Selection().clearSelection(); FC_TRACE("add selection"); - bool ok = Gui::Selection().addSelection(docname, objectName.c_str() ,subName.c_str(), + bool ok = Gui::Selection().addSelection(docname, objectName.c_str() ,subName.c_str(), pt[0] ,pt[1] ,pt[2], &sels); if (ok) type = hasNext?SoSelectionElementAction::All:SoSelectionElementAction::Append; @@ -749,7 +749,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) if (mymode == AUTO || mymode == ON) { // check to see if the mouse is over our geometry... auto infos = this->getPickedList(action,true); - if(infos.size()) + if(infos.size()) setHighlight(infos[0]); else { setHighlight(PickedInfo()); @@ -763,7 +763,7 @@ SoFCUnifiedSelection::handleEvent(SoHandleEventAction * action) } } // mouse press events for (de)selection - else if (event->isOfType(SoMouseButtonEvent::getClassTypeId()) && + else if (event->isOfType(SoMouseButtonEvent::getClassTypeId()) && selectionMode.getValue() == SoFCUnifiedSelection::ON) { const SoMouseButtonEvent* e = static_cast(event); if (SoMouseButtonEvent::isButtonReleaseEvent(e,SoMouseButtonEvent::BUTTON1)) { @@ -1006,16 +1006,16 @@ void SoVRMLAction::callDoAction(SoAction *action, SoNode *node) // --------------------------------------------------------------------------------- bool SoFCSelectionRoot::StackComp::operator()(const Stack &a, const Stack &b) const { - if(a.size()-a.offset < b.size()-b.offset) + if(a.size()-a.offset < b.size()-b.offset) return true; - if(a.size()-a.offset > b.size()-b.offset) + if(a.size()-a.offset > b.size()-b.offset) return false; - auto it1=a.rbegin(), end1=a.rend()-a.offset; + auto it1=a.rbegin(), end1=a.rend()-a.offset; auto it2=b.rbegin(); for(;it1!=end1;++it1,++it2) { - if(*it1 < *it2) + if(*it1 < *it2) return true; - if(*it1 > *it2) + if(*it1 > *it2) return false; } return false; @@ -1129,7 +1129,7 @@ void SoFCSelectionRoot::finish() } SoNode *SoFCSelectionRoot::getCurrentRoot(bool front, SoNode *def) { - if(SelStack.size()) + if(SelStack.size()) return front?SelStack.front():SelStack.back(); return def; } @@ -1149,13 +1149,13 @@ SoFCSelectionContextBasePtr SoFCSelectionRoot::getNodeContext( auto it = front->contextMap.find(stack); stack.front() = front; - if(it!=front->contextMap.end()) + if(it!=front->contextMap.end()) return it->second; return SoFCSelectionContextBasePtr(); } -SoFCSelectionContextBasePtr -SoFCSelectionRoot::getNodeContext2(Stack &stack, SoNode *node, SoFCSelectionContextBase::MergeFunc *merge) +SoFCSelectionContextBasePtr +SoFCSelectionRoot::getNodeContext2(Stack &stack, SoNode *node, SoFCSelectionContextBase::MergeFunc *merge) { SoFCSelectionContextBasePtr ret; if(stack.empty() || stack.back()->contextMap2.empty()) @@ -1191,7 +1191,7 @@ std::pair SoFCSelectionRoot::findActionContex return res; auto &stack = it->second; - + auto node = static_cast(_node); if(res.first) { @@ -1211,7 +1211,7 @@ std::pair SoFCSelectionRoot::findActionContex }else{ auto front = stack.front(); stack.front() = node; - if(create) + if(create) res.second = &front->contextMap[stack]; else { auto it = front->contextMap.find(stack); @@ -1226,7 +1226,7 @@ std::pair SoFCSelectionRoot::findActionContex return res; } -bool SoFCSelectionRoot::renderBBox(SoGLRenderAction *action, SoNode *node, SbColor color) +bool SoFCSelectionRoot::renderBBox(SoGLRenderAction *action, SoNode *node, SbColor color) { auto data = (SoFCBBoxRenderInfo*) so_bbox_storage->get(); if (data->bboxaction == NULL) { @@ -1279,7 +1279,7 @@ static std::time_t _CyclicLastReported; void SoFCSelectionRoot::renderPrivate(SoGLRenderAction * action, bool inPath) { if(ViewParams::instance()->getCoinCycleCheck() - && !SelStack.nodeSet.insert(this).second) + && !SelStack.nodeSet.insert(this).second) { std::time_t t = std::time(0); if(_CyclicLastReported < t) { @@ -1308,7 +1308,7 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) { SelContextPtr ctx = getRenderContext(this); int style = selectionStyle.getValue(); if((style==SoFCSelectionRoot::Box || ViewParams::instance()->getShowSelectionBoundingBox()) - && ctx && !ctx->hideAll && (ctx->selAll || ctx->hlAll)) + && ctx && !ctx->hideAll && (ctx->selAll || ctx->hlAll)) { if (style==SoFCSelectionRoot::PassThrough) { style = SoFCSelectionRoot::Box; @@ -1328,7 +1328,7 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) { // honour the secondary color override. bool colorPushed = false; - if(!ShapeColorNode && overrideColor && + if(!ShapeColorNode && overrideColor && !SoOverrideElement::getDiffuseColorOverride(state) && (style==SoFCSelectionRoot::Box || !ctx || (!ctx->selAll && !ctx->hideAll))) { @@ -1376,7 +1376,7 @@ bool SoFCSelectionRoot::_renderPrivate(SoGLRenderAction * action, bool inPath) { } } - if((hlPushed = ctx->hlAll)) + if((hlPushed = ctx->hlAll)) HlColorStack.push_back(ctx->hlColor); if(inPath) @@ -1558,8 +1558,8 @@ bool SoFCSelectionRoot::doActionPrivate(Stack &stack, SoAction *action) { if(action->getCurPathCode()==SoAction::IN_PATH) { auto path = action->getPathAppliedTo(); if(path) { - isTail = path->getTail()==this || - (path->getLength()>1 + isTail = path->getTail()==this || + (path->getLength()>1 && path->getNodeFromTail(1)==this && path->getTail()->isOfType(SoSwitch::getClassTypeId())); } @@ -1579,7 +1579,7 @@ bool SoFCSelectionRoot::doActionPrivate(Stack &stack, SoAction *action) { auto selAction = static_cast(action); if(selAction->isSecondary()) { if(selAction->getType() == SoSelectionElementAction::Show || - (selAction->getType() == SoSelectionElementAction::Color && + (selAction->getType() == SoSelectionElementAction::Color && selAction->getColors().empty() && action->getWhatAppliedTo()==SoAction::NODE)) { @@ -1606,8 +1606,8 @@ bool SoFCSelectionRoot::doActionPrivate(Stack &stack, SoAction *action) { } } return true; - } - + } + if(selAction->getType() == SoSelectionElementAction::None) { if(action->getWhatAppliedTo() == SoAction::NODE) { // Here the 'select none' action is applied to a node, and we @@ -1675,7 +1675,7 @@ bool SoFCSelectionRoot::doActionPrivate(Stack &stack, SoAction *action) { return true; } -int SoFCSelectionRoot::SelContext::merge(int status, SoFCSelectionContextBasePtr &output, +int SoFCSelectionRoot::SelContext::merge(int status, SoFCSelectionContextBasePtr &output, SoFCSelectionContextBasePtr input, SoFCSelectionRoot *) { auto ctx = std::dynamic_pointer_cast(input); @@ -1705,7 +1705,7 @@ SoFCPathAnnotation::~SoFCPathAnnotation() delete det; } -void SoFCPathAnnotation::finish() +void SoFCPathAnnotation::finish() { atexit_cleanup(); } diff --git a/src/Gui/SoFCUnifiedSelection.h b/src/Gui/SoFCUnifiedSelection.h index 45f1757f76..0745d01359 100644 --- a/src/Gui/SoFCUnifiedSelection.h +++ b/src/Gui/SoFCUnifiedSelection.h @@ -47,10 +47,10 @@ class Document; class ViewProviderDocumentObject; /** Unified Selection node - * This is the new selection node for the 3D Viewer which will + * This is the new selection node for the 3D Viewer which will * gradually remove all the low level selection nodes in the view * provider. The handling of the highlighting and the selection will - * be unified here. + * be unified here. * \author Jürgen Riegel */ class GuiExport SoFCUnifiedSelection : public SoSeparator { @@ -93,7 +93,7 @@ public: protected: virtual ~SoFCUnifiedSelection(); //virtual void redrawHighlighted(SoAction * act, SbBool flag); - //virtual SbBool readInstance(SoInput * in, unsigned short flags); + //virtual SbBool readInstance(SoInput * in, unsigned short flags); private: //static void turnoffcurrent(SoAction * action); @@ -111,7 +111,7 @@ private: }; bool setHighlight(const PickedInfo &); - bool setHighlight(SoFullPath *path, const SoDetail *det, + bool setHighlight(SoFullPath *path, const SoDetail *det, ViewProviderDocumentObject *vpd, const char *element, float x, float y, float z); bool setSelection(const std::vector &, bool ctrlDown=false); @@ -186,7 +186,7 @@ class GuiExport SoFCSelectionRoot : public SoFCSeparator { typedef SoFCSeparator inherited; SO_NODE_HEADER(Gui::SoFCSelectionRoot); - + public: static void initClass(void); static void finish(void); @@ -210,7 +210,7 @@ public: return std::dynamic_pointer_cast(getNodeContext(SelStack,node,def)); } - /** Returns selection context for rendering. + /** Returns selection context for rendering. * * @param node: the querying node * @param def: default context if none is found @@ -219,12 +219,12 @@ public: * @return Returned the primary context for selection, and the context is * always stored in the first encountered SoFCSelectionRoot in the path. It * is keyed using the entire sequence of SoFCSelectionRoot along the path - * to \c node, replacing the first SoFCSelectionRoot with the given node. + * to \c node, replacing the first SoFCSelectionRoot with the given node. * * @return Secondary context returned in \c ctx2 is for customized * highlighting, and is not affected by mouse event. The highlight is * applied manually using SoSelectionElementAction. It is stored in the - * last encountered SoFCSelectionRoot, and is keyed using the querying + * last encountered SoFCSelectionRoot, and is keyed using the querying * \c node and (if there are more than one SoFCSelectionRoot along the * path) the first SoFCSelectionRoot. The reason is so that any link to a * node (new links means additional SoFCSelectionRoot added in front) with @@ -238,13 +238,13 @@ public: * when the storage SoFCSSelectionRoot node is freed. */ template - static std::shared_ptr getRenderContext(SoNode *node, std::shared_ptr def, std::shared_ptr &ctx2) + static std::shared_ptr getRenderContext(SoNode *node, std::shared_ptr def, std::shared_ptr &ctx2) { ctx2 = std::dynamic_pointer_cast(getNodeContext2(SelStack,node,T::merge)); return std::dynamic_pointer_cast(getNodeContext(SelStack,node,def)); } - /** Get the selection context for an action. + /** Get the selection context for an action. * * @param action: the action. SoSelectionElementAction has any option to * query for secondary context. \sa getRenderContext for detail about @@ -260,7 +260,7 @@ public: */ template static std::shared_ptr getActionContext( - SoAction *action, SoNode *node, std::shared_ptr def=std::shared_ptr(), bool create=true) + SoAction *action, SoNode *node, std::shared_ptr def=std::shared_ptr(), bool create=true) { auto res = findActionContext(action,node,create,false); if(!res.second) { @@ -276,7 +276,7 @@ public: if(!ret) ctx.reset(); } - if(!ctx && create) + if(!ctx && create) ctx = std::make_shared(); return std::static_pointer_cast(ctx); } diff --git a/src/Gui/SoFCVectorizeSVGAction.cpp b/src/Gui/SoFCVectorizeSVGAction.cpp index 490ccebf40..eb75c76740 100644 --- a/src/Gui/SoFCVectorizeSVGAction.cpp +++ b/src/Gui/SoFCVectorizeSVGAction.cpp @@ -202,7 +202,7 @@ void SoFCVectorizeSVGActionP::printText(const SoVectorizeText * item) const std::ostream& str = publ->getSVGOutput()->getFileStream(); str << "fontsize * mul[1] << "px\">" + "font-size=\"" << item->fontsize * mul[1] << "px\">" << item->string.getString() << "" << std::endl; } @@ -246,7 +246,7 @@ Separator { Material { diffuseColor [ 1 1 0, 0 0 1, 1 0 0 ] } - + MaterialBinding { value PER_VERTEX } @@ -314,17 +314,17 @@ void SoFCVectorizeSVGActionP::printTriangle(const SbVec3f * v, const SbColor * c void SoFCVectorizeSVGActionP::printCircle(const SbVec3f & v, const SbColor & c, const float radius) const { // todo - Q_UNUSED(v); - Q_UNUSED(c); - Q_UNUSED(radius); + Q_UNUSED(v); + Q_UNUSED(c); + Q_UNUSED(radius); } void SoFCVectorizeSVGActionP::printSquare(const SbVec3f & v, const SbColor & c, const float size) const { // todo - Q_UNUSED(v); - Q_UNUSED(c); - Q_UNUSED(size); + Q_UNUSED(v); + Q_UNUSED(c); + Q_UNUSED(size); } void SoFCVectorizeSVGActionP::printLine(const SoVectorizeLine * item) const @@ -359,13 +359,13 @@ void SoFCVectorizeSVGActionP::printLine(const SoVectorizeLine * item) const void SoFCVectorizeSVGActionP::printPoint(const SoVectorizePoint * item) const { // todo - Q_UNUSED(item); + Q_UNUSED(item); } void SoFCVectorizeSVGActionP::printImage(const SoVectorizeImage * item) const { // todo - Q_UNUSED(item); + Q_UNUSED(item); } // ------------------------------------------------------- diff --git a/src/Gui/SoFCVectorizeSVGAction.h b/src/Gui/SoFCVectorizeSVGAction.h index 9728d13423..734d2f9e8b 100644 --- a/src/Gui/SoFCVectorizeSVGAction.h +++ b/src/Gui/SoFCVectorizeSVGAction.h @@ -63,11 +63,11 @@ public: SoSVGVectorOutput * getSVGOutput(void) const; virtual void setBackgroundState(bool b) { m_backgroundState = b; } - virtual bool getBackgroundState(void) const { return m_backgroundState; } + virtual bool getBackgroundState(void) const { return m_backgroundState; } virtual void setLineWidth(double w) { m_lineWidth = w; } - virtual double getLineWidth(void) const { return m_lineWidth; } + virtual double getLineWidth(void) const { return m_lineWidth; } virtual void setUseMM(bool b) { m_usemm = b; } - virtual bool getUseMM(void) const { return m_usemm; } + virtual bool getUseMM(void) const { return m_usemm; } protected: virtual void printHeader(void) const; diff --git a/src/Gui/SoFCVectorizeU3DAction.cpp b/src/Gui/SoFCVectorizeU3DAction.cpp index 7dd04c5b18..b2c3a52efe 100644 --- a/src/Gui/SoFCVectorizeU3DAction.cpp +++ b/src/Gui/SoFCVectorizeU3DAction.cpp @@ -202,7 +202,7 @@ void SoFCVectorizeU3DActionP::printText(const SoVectorizeText * item) const //std::ostream& str = publ->getU3DOutput()->getFileStream(); // todo - Q_UNUSED(item); + Q_UNUSED(item); } void SoFCVectorizeU3DActionP::printTriangle(const SoVectorizeTriangle * item) const @@ -232,23 +232,23 @@ void SoFCVectorizeU3DActionP::printTriangle(const SbVec3f * v, const SbColor * c //std::ostream& str = publ->getU3DOutput()->getFileStream(); // todo - Q_UNUSED(c); + Q_UNUSED(c); } void SoFCVectorizeU3DActionP::printCircle(const SbVec3f & v, const SbColor & c, const float radius) const { // todo - Q_UNUSED(v); - Q_UNUSED(c); - Q_UNUSED(radius); + Q_UNUSED(v); + Q_UNUSED(c); + Q_UNUSED(radius); } void SoFCVectorizeU3DActionP::printSquare(const SbVec3f & v, const SbColor & c, const float size) const { // todo - Q_UNUSED(v); - Q_UNUSED(c); - Q_UNUSED(size); + Q_UNUSED(v); + Q_UNUSED(c); + Q_UNUSED(size); } void SoFCVectorizeU3DActionP::printLine(const SoVectorizeLine * item) const @@ -272,19 +272,19 @@ void SoFCVectorizeU3DActionP::printLine(const SoVectorizeLine * item) const //std::ostream& str = publ->getU3DOutput()->getFileStream(); // todo - Q_UNUSED(item); + Q_UNUSED(item); } void SoFCVectorizeU3DActionP::printPoint(const SoVectorizePoint * item) const { // todo - Q_UNUSED(item); + Q_UNUSED(item); } void SoFCVectorizeU3DActionP::printImage(const SoVectorizeImage * item) const { // todo - Q_UNUSED(item); + Q_UNUSED(item); } // ------------------------------------------------------- @@ -318,8 +318,8 @@ SoFCVectorizeU3DAction::getU3DOutput(void) const void SoFCVectorizeU3DAction::actionMethod(SoAction * a, SoNode * n) { - Q_UNUSED(a); - Q_UNUSED(n); + Q_UNUSED(a); + Q_UNUSED(n); } void SoFCVectorizeU3DAction::beginTraversal(SoNode * node) diff --git a/src/Gui/SoMouseWheelEvent.cpp b/src/Gui/SoMouseWheelEvent.cpp index 10d694b508..1eb55eefa5 100644 --- a/src/Gui/SoMouseWheelEvent.cpp +++ b/src/Gui/SoMouseWheelEvent.cpp @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (c) Victor Titov (DeepSOIC) * - * (vv.titov@gmail.com) 2020 * + * Copyright (c) 2020 Victor Titov (DeepSOIC) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/SoMouseWheelEvent.h b/src/Gui/SoMouseWheelEvent.h index 043c6070bd..a08b49a7b8 100644 --- a/src/Gui/SoMouseWheelEvent.h +++ b/src/Gui/SoMouseWheelEvent.h @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (c) Victor Titov (DeepSOIC) * - * (vv.titov@gmail.com) 2020 * + * Copyright (c) 2020 Victor Titov (DeepSOIC) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/SoNavigationDragger.cpp b/src/Gui/SoNavigationDragger.cpp index 9f4693ad5d..3f7ee2a8cc 100644 --- a/src/Gui/SoNavigationDragger.cpp +++ b/src/Gui/SoNavigationDragger.cpp @@ -40,7 +40,7 @@ // Include file the binaray of SoNavigationDraggerLayout.iv, the layout of the dragger. #include "SoNavigationDraggerLayout.h" -// This file contains RotTransDragger::geomBuffer, which +// This file contains RotTransDragger::geomBuffer, which // describes the default geometry resources for this class. //#include "RotTransDraggerGeom.h" @@ -52,14 +52,14 @@ SO_KIT_SOURCE(RotTransDragger) void RotTransDragger::initClass() { - SO_KIT_INIT_CLASS(RotTransDragger, SoDragger, "Dragger"); + SO_KIT_INIT_CLASS(RotTransDragger, SoDragger, "Dragger"); } RotTransDragger::RotTransDragger() { SO_KIT_CONSTRUCTOR(RotTransDragger); - // Don't create "surroundScale" by default. It's only put + // Don't create "surroundScale" by default. It's only put // to use if this dragger is used within a manipulator. SO_KIT_ADD_CATALOG_ENTRY(surroundScale, SoSurroundScale, true, topSeparator, geomSeparator, true); @@ -92,7 +92,7 @@ RotTransDragger::RotTransDragger() // scene graphs in the file: // $(SO_DRAGGER_DIR)/rotTransDragger.iv" if (SO_KIT_IS_FIRST_INSTANCE()) - readDefaultParts("SoNavigationDraggerLayout.iv", + readDefaultParts("SoNavigationDraggerLayout.iv", NavigationDraggerLayout, strlen(NavigationDraggerLayout)); @@ -109,37 +109,37 @@ RotTransDragger::RotTransDragger() myAntiSquish->sizing = SoAntiSquish::BIGGEST_DIMENSION; // Create the simple draggers that comprise this dragger. - // This dragger has four simple pieces: + // This dragger has four simple pieces: // 1 TranslateRadialDragger // 3 RotateCylindricalDraggers // In the constructor, we just call SO_GET_ANY_PART to // build each dragger. // Within the setUpConnections() method, we will - // take care of giving these draggers new geometry and + // take care of giving these draggers new geometry and // establishing their callbacks. - // Create the translator dragger. - SoDragger *tDragger = SO_GET_ANY_PART(this, "translator", + // Create the translator dragger. + SoDragger *tDragger = SO_GET_ANY_PART(this, "translator", SoTranslate1Dragger); (void)tDragger; - // Create the XRotator dragger. - SoDragger *XDragger = SO_GET_ANY_PART(this, "XRotator", + // Create the XRotator dragger. + SoDragger *XDragger = SO_GET_ANY_PART(this, "XRotator", SoRotateCylindricalDragger); (void)XDragger; - // Create the YRotator dragger. - SoDragger *YDragger = SO_GET_ANY_PART(this, "YRotator", + // Create the YRotator dragger. + SoDragger *YDragger = SO_GET_ANY_PART(this, "YRotator", SoRotateCylindricalDragger); (void)YDragger; - // Create the ZRotator dragger. - SoDragger *ZDragger = SO_GET_ANY_PART(this, "ZRotator", + // Create the ZRotator dragger. + SoDragger *ZDragger = SO_GET_ANY_PART(this, "ZRotator", SoRotateCylindricalDragger); (void)ZDragger; // Set rotations in "XRotatorRot" and "ZRotatorRot" parts. - // These parts will orient the draggers from their default + // These parts will orient the draggers from their default // (rotating about Y) to the desired configurations. // By calling 'setAnyPartAsDefault' instead of 'setAnyPart' // we ensure that they will not be written out, unless @@ -154,7 +154,7 @@ RotTransDragger::RotTransDragger() SbRotation(SbVec3f(0,1,0), SbVec3f(0,0,1))); setAnyPartAsDefault("ZRotatorRot", ZRot); - // Updates the fields when motionMatrix changes + // Updates the fields when motionMatrix changes addValueChangedCallback(&RotTransDragger::valueChangedCB); // Updates motionMatrix when either field changes. @@ -187,18 +187,18 @@ RotTransDragger::setUpConnections(SbBool onOff, SbBool doItAlways) SoDragger::setUpConnections(onOff, doItAlways); // For each of the simple draggers that compries this: - // [a]Call setPart after looking up our replacement parts + // [a]Call setPart after looking up our replacement parts // in the global dictionary. // [b]Add the invalidateSurroundScaleCB as a start and end - // callback. When using a surroundScale node, these - // trigger it to recalculate a bounding box at the + // callback. When using a surroundScale node, these + // trigger it to recalculate a bounding box at the // beginning and end of dragging. - // [c]Register the dragger as a 'childDragger' of this - // one. This has the following effects: - // [1] This dragger's callbacks will be invoked - // following the child manip's callbacks. - // [2] When the child is dragged, the child's motion - // will be transferred into motion of the entire + // [c]Register the dragger as a 'childDragger' of this + // one. This has the following effects: + // [1] This dragger's callbacks will be invoked + // following the child manip's callbacks. + // [2] When the child is dragged, the child's motion + // will be transferred into motion of the entire // dragger. SoDragger *tD = (SoDragger *) getAnyPart("translator", false); @@ -369,9 +369,9 @@ RotTransDragger::fieldSensorCB(void *inDragger, SoSensor *) } // When any child dragger starts or ends a drag, tell the -// "surroundScale" part (if it exists) to invalidate its +// "surroundScale" part (if it exists) to invalidate its // current bounding box value. -void +void RotTransDragger::invalidateSurroundScaleCB(void *parent, SoDragger *) { RotTransDragger *myParentDragger = (RotTransDragger *) parent; @@ -386,7 +386,7 @@ RotTransDragger::invalidateSurroundScaleCB(void *parent, SoDragger *) void RotTransDragger::setDefaultOnNonWritingFields() { - // The nodes pointed to by these part-fields may + // The nodes pointed to by these part-fields may // change after construction, but we // don't want to write them out. surroundScale.setDefault(true); diff --git a/src/Gui/SoNavigationDragger.h b/src/Gui/SoNavigationDragger.h index 5698cbf1b5..f5c8391ec7 100644 --- a/src/Gui/SoNavigationDragger.h +++ b/src/Gui/SoNavigationDragger.h @@ -19,10 +19,10 @@ * Suite 330, Boston, MA 02111-1307, USA * * * ***************************************************************************/ - - -#ifndef SONAVIGATIONDRAGGER_H -#define SONAVIGATIONDRAGGER_H + + +#ifndef SONAVIGATIONDRAGGER_H +#define SONAVIGATIONDRAGGER_H // Geometry resources and part names for this dragger: @@ -59,8 +59,8 @@ class RotTransDragger : public SoDragger // The translating dragger... SO_KIT_CATALOG_ENTRY_HEADER(translator); - // The X and Z rotators need to be turned so as to orient - // correctly. So create a separator part and put an + // The X and Z rotators need to be turned so as to orient + // correctly. So create a separator part and put an // SoRotation node and the dragger underneath. SO_KIT_CATALOG_ENTRY_HEADER(XRotatorSep); SO_KIT_CATALOG_ENTRY_HEADER(XRotatorRot); @@ -73,7 +73,7 @@ class RotTransDragger : public SoDragger SO_KIT_CATALOG_ENTRY_HEADER(ZRotator); public: - + // Constructor RotTransDragger(); @@ -86,13 +86,13 @@ class RotTransDragger : public SoDragger protected: - // These sensors ensure that the motionMatrix is updated + // These sensors ensure that the motionMatrix is updated // when the fields are changed from outside. SoFieldSensor *rotFieldSensor; SoFieldSensor *translFieldSensor; static void fieldSensorCB(void *, SoSensor *); - // This function is invoked by the child draggers when they + // This function is invoked by the child draggers when they // change their value. static void valueChangedCB(void *, SoDragger *); @@ -105,7 +105,7 @@ class RotTransDragger : public SoDragger // and at the start/end of SoBaseKit::readInstance() // and on the new copy at the start/end of SoBaseKit::copy() // Returns the state of the node when this was called. - virtual SbBool setUpConnections( SbBool onOff, + virtual SbBool setUpConnections( SbBool onOff, SbBool doItAlways = false); // This allows us to specify that certain parts do not @@ -119,7 +119,7 @@ class RotTransDragger : public SoDragger // Destructor. ~RotTransDragger(); -}; - -#endif //SONAVIGATIONDRAGGER_H - +}; + +#endif //SONAVIGATIONDRAGGER_H + diff --git a/src/Gui/SoNavigationDraggerLayout.h b/src/Gui/SoNavigationDraggerLayout.h index c9eb67ccc0..629ba9027c 100644 --- a/src/Gui/SoNavigationDraggerLayout.h +++ b/src/Gui/SoNavigationDraggerLayout.h @@ -1,3 +1,25 @@ +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This file is part of the FreeCAD CAx development system. * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + const char RotTransDragger::NavigationDraggerLayout[] = "\n" "\n" diff --git a/src/Gui/SoTextLabel.cpp b/src/Gui/SoTextLabel.cpp index 8d254342d3..e15d484f1f 100644 --- a/src/Gui/SoTextLabel.cpp +++ b/src/Gui/SoTextLabel.cpp @@ -205,7 +205,7 @@ void SoTextLabel::GLRender(SoGLRenderAction *action) } #else // Unfortunately, the required size (in pixels) is stored in a non-accessible way - // in the subclass SoText2. Thus, we try to get a satisfactory solution with Qt + // in the subclass SoText2. Thus, we try to get a satisfactory solution with Qt // methods. // The font name is of the form "family:style". If 'style' is given it can be // 'Bold', 'Italic' or 'Bold Italic'. @@ -282,7 +282,7 @@ void SoTextLabel::GLRender(SoGLRenderAction *action) glPopClientAttrib(); glPopAttrib(); state->pop(); - + glPixelStorei(GL_UNPACK_ALIGNMENT,4); // Pop old GL matrix state. glMatrixMode(GL_PROJECTION); diff --git a/src/Gui/SoTouchEvents.cpp b/src/Gui/SoTouchEvents.cpp index 0e1bf608fe..4a34583d35 100644 --- a/src/Gui/SoTouchEvents.cpp +++ b/src/Gui/SoTouchEvents.cpp @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (c) Victor Titov (DeepSOIC) * - * (vv.titov@gmail.com) 2015 * + * Copyright (c) 2015 Victor Titov (DeepSOIC) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -42,7 +41,7 @@ SO_EVENT_SOURCE(SoGesturePanEvent); SoGesturePanEvent::SoGesturePanEvent(QPanGesture* qpan, QWidget *widget) { - Q_UNUSED(widget); + Q_UNUSED(widget); totalOffset = SbVec2f(qpan->offset().x(), -qpan->offset().y()); deltaOffset = SbVec2f(qpan->delta().x(), -qpan->delta().y()); state = SbGestureState(qpan->state()); @@ -120,7 +119,7 @@ SO_EVENT_SOURCE(SoGestureSwipeEvent); SoGestureSwipeEvent::SoGestureSwipeEvent(QSwipeGesture *qwsipe, QWidget *widget) { - Q_UNUSED(widget); + Q_UNUSED(widget); angle = qwsipe->swipeAngle(); switch (qwsipe->verticalDirection()){ case QSwipeGesture::Up : diff --git a/src/Gui/SoTouchEvents.h b/src/Gui/SoTouchEvents.h index 980931709e..ccba4add80 100644 --- a/src/Gui/SoTouchEvents.h +++ b/src/Gui/SoTouchEvents.h @@ -1,6 +1,5 @@ /*************************************************************************** - * Copyright (c) Victor Titov (DeepSOIC) * - * (vv.titov@gmail.com) 2015 * + * Copyright (c) 2015 Victor Titov (DeepSOIC) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/SpinBox.cpp b/src/Gui/SpinBox.cpp index e751c149f7..428e65440c 100644 --- a/src/Gui/SpinBox.cpp +++ b/src/Gui/SpinBox.cpp @@ -249,7 +249,7 @@ int UIntSpinBox::valueFromText (const QString & text) const return d->mapToInt(newVal); } -void UIntSpinBox::updateValidator() +void UIntSpinBox::updateValidator() { d->mValidator->setRange(this->minimum(), this->maximum()); } @@ -281,7 +281,7 @@ void UIntSpinBox::setExpression(boost::shared_ptr expr) } void UIntSpinBox::onChange() { - + if (getExpression()) { std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); @@ -454,7 +454,7 @@ IntSpinBox::~IntSpinBox() { bool IntSpinBox::apply(const std::string& propName) { - + if (!ExpressionBinding::apply(propName)) { Gui::Command::doCommand(Gui::Command::Doc, "%s = %d", propName.c_str(), value()); return true; @@ -464,7 +464,7 @@ bool IntSpinBox::apply(const std::string& propName) { } void IntSpinBox::bind(const ObjectIdentifier& _path) { - + ExpressionBinding::bind(_path); int frameWidth = style()->pixelMetric(QStyle::PM_SpinBoxFrameWidth); @@ -490,7 +490,7 @@ void IntSpinBox::setExpression(boost::shared_ptr expr) } void IntSpinBox::onChange() { - + if (getExpression()) { std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); @@ -647,7 +647,7 @@ DoubleSpinBox::~DoubleSpinBox() { bool DoubleSpinBox::apply(const std::string& propName) { - + if (!ExpressionBinding::apply(propName)) { Gui::Command::doCommand(Gui::Command::Doc, "%s = %f", propName.c_str(), value()); return true; @@ -657,7 +657,7 @@ bool DoubleSpinBox::apply(const std::string& propName) { } void DoubleSpinBox::bind(const ObjectIdentifier& _path) { - + ExpressionBinding::bind(_path); int frameWidth = style()->pixelMetric(QStyle::PM_SpinBoxFrameWidth); @@ -683,7 +683,7 @@ void DoubleSpinBox::setExpression(boost::shared_ptr expr) } void DoubleSpinBox::onChange() { - + if (getExpression()) { std::unique_ptr result(getExpression()->eval()); NumberExpression * value = freecad_dynamic_cast(result.get()); diff --git a/src/Gui/SpinBox.h b/src/Gui/SpinBox.h index 7369fe08f4..90a16c5f28 100644 --- a/src/Gui/SpinBox.h +++ b/src/Gui/SpinBox.h @@ -107,7 +107,7 @@ private Q_SLOTS: protected: virtual QString textFromValue ( int v ) const; virtual int valueFromText ( const QString & text ) const; - virtual void onChange(); + virtual void onChange(); private: void updateValidator(); @@ -142,7 +142,7 @@ private Q_SLOTS: }; /** - * The DoubleSpinBox class does exactly the same as Qt's QDoubleSpinBox but has expression + * The DoubleSpinBox class does exactly the same as Qt's QDoubleSpinBox but has expression * support * @author Stefan Tröger */ diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index c9cb160005..de1b9ca4ec 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -755,11 +755,11 @@ void AboutDialog::on_copyButton_clicked() QString major = QString::fromLatin1(config["BuildVersionMajor"].c_str()); QString minor = QString::fromLatin1(config["BuildVersionMinor"].c_str()); QString build = QString::fromLatin1(config["BuildRevision"].c_str()); - + QString deskEnv = QProcessEnvironment::systemEnvironment().value(QString::fromLatin1("XDG_CURRENT_DESKTOP"),QString::fromLatin1("")); QString deskSess = QProcessEnvironment::systemEnvironment().value(QString::fromLatin1("DESKTOP_SESSION"),QString::fromLatin1("")); QString deskInfo = QString::fromLatin1(""); - + if (!(deskEnv == QString::fromLatin1("") && deskSess == QString::fromLatin1(""))) { if (deskEnv == QString::fromLatin1("") || deskSess == QString::fromLatin1("")) @@ -772,9 +772,9 @@ void AboutDialog::on_copyButton_clicked() deskInfo = QString::fromLatin1(" (") + deskEnv + QString::fromLatin1("/") + deskSess + QString::fromLatin1(")"); } } - + str << "OS: " << SystemInfo::getOperatingSystem() << deskInfo << '\n'; - + int wordSize = SystemInfo::getWordSizeOfOS(); if (wordSize > 0) { str << "Word size of OS: " << wordSize << "-bit\n"; diff --git a/src/Gui/Splashscreen.h b/src/Gui/Splashscreen.h index 0baa568c1e..9b3fc1a130 100644 --- a/src/Gui/Splashscreen.h +++ b/src/Gui/Splashscreen.h @@ -87,8 +87,8 @@ private: QTextBrowser* browser; }; -/** This widget provides the "About dialog" of an application. - * This shows the current version, the build number and date. +/** This widget provides the "About dialog" of an application. + * This shows the current version, the build number and date. * \author Werner Mayer */ class GuiExport AboutDialog : public QDialog diff --git a/src/Gui/SplitView3DInventor.cpp b/src/Gui/SplitView3DInventor.cpp index 41633ff0b4..7db754c7dd 100644 --- a/src/Gui/SplitView3DInventor.cpp +++ b/src/Gui/SplitView3DInventor.cpp @@ -48,7 +48,7 @@ AbstractSplitView::AbstractSplitView(Gui::Document* pcDocument, QWidget* parent, : MDIView(pcDocument,parent, wflags) { _viewerPy = 0; - // important for highlighting + // important for highlighting setMouseTracking(true); } @@ -296,7 +296,7 @@ void AbstractSplitView::OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp void AbstractSplitView::onUpdate(void) { - update(); + update(); } const char *AbstractSplitView::getName(void) const @@ -409,7 +409,7 @@ bool AbstractSplitView::onHasMsg(const char* pMsg) const void AbstractSplitView::setOverrideCursor(const QCursor& aCursor) { - Q_UNUSED(aCursor); + Q_UNUSED(aCursor); //_viewer->getWidget()->setCursor(aCursor); } diff --git a/src/Gui/SyntaxHighlighter.cpp b/src/Gui/SyntaxHighlighter.cpp index 9d12741bed..1c3e829968 100644 --- a/src/Gui/SyntaxHighlighter.cpp +++ b/src/Gui/SyntaxHighlighter.cpp @@ -38,7 +38,7 @@ public: cBlockcomment.setRgb(160, 160, 164); cLiteral.setRgb(255, 0, 0); cNumber.setRgb(0, 0, 255); cOperator.setRgb(160, 160, 164); cKeyword.setRgb(0, 0, 255); cClassName.setRgb(255, 170, 0); - cDefineName.setRgb(255, 170, 0); cOutput.setRgb(170, 170, 127); + cDefineName.setRgb(255, 170, 0); cOutput.setRgb(170, 170, 127); cError.setRgb(255, 0, 0); } @@ -62,7 +62,7 @@ SyntaxHighlighter::~SyntaxHighlighter() delete d; } -/** Sets the color \a col to the paragraph type \a type. +/** Sets the color \a col to the paragraph type \a type. * This method is provided for convenience to specify the paragraph type * by its name. */ @@ -73,7 +73,7 @@ void SyntaxHighlighter::setColor(const QString& type, const QColor& col) if (!old.isValid()) return; // no such type if (old == col) - return; + return; if (type == QLatin1String("Text")) d->cNormalText = col; else if (type == QLatin1String("Comment")) @@ -157,8 +157,8 @@ QColor SyntaxHighlighter::colorByType(SyntaxHighlighter::TColor type) void SyntaxHighlighter::colorChanged(const QString& type, const QColor& col) { - Q_UNUSED(type); - Q_UNUSED(col); + Q_UNUSED(type); + Q_UNUSED(col); // rehighlight #if QT_VERSION >= 0x040200 rehighlight(); diff --git a/src/Gui/TaskCSysDragger.h b/src/Gui/TaskCSysDragger.h index b2dcad3b5e..5b50850501 100644 --- a/src/Gui/TaskCSysDragger.h +++ b/src/Gui/TaskCSysDragger.h @@ -31,7 +31,7 @@ namespace Gui class QuantitySpinBox; class SoFCCSysDragger; class ViewProviderDragger; - + class TaskCSysDragger : public Gui::TaskView::TaskDialog { Q_OBJECT diff --git a/src/Gui/TaskDlgRelocation.cpp b/src/Gui/TaskDlgRelocation.cpp index ce04380a5b..3ae609b505 100644 --- a/src/Gui/TaskDlgRelocation.cpp +++ b/src/Gui/TaskDlgRelocation.cpp @@ -36,7 +36,7 @@ using namespace Gui; //************************************************************************** //************************************************************************** -// TaskBoxPosition +// TaskBoxPosition //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /* TRANSLATOR Gui::TaskBoxPosition */ @@ -100,11 +100,11 @@ TaskDlgRelocation::TaskDlgRelocation() { /* rob = new TaskRobot6Axis(pcRobotObject); ctr = new TaskRobotControl(pcRobotObject); - + trac = new TaskTrajectory(pcRobotObject,pcTrajectoryObject); msg = new TaskRobotMessages(pcRobotObject); - - + + QObject::connect(trac ,SIGNAL(axisChanged(float,float,float,float,float,float,const Base::Placement &)), rob ,SLOT (setAxis(float,float,float,float,float,float,const Base::Placement &))); @@ -130,7 +130,7 @@ void TaskDlgRelocation::open() void TaskDlgRelocation::clicked(int) { - + } bool TaskDlgRelocation::accept() diff --git a/src/Gui/TaskDlgRelocation.h b/src/Gui/TaskDlgRelocation.h index f58db4becc..33fccdcea0 100644 --- a/src/Gui/TaskDlgRelocation.h +++ b/src/Gui/TaskDlgRelocation.h @@ -70,7 +70,7 @@ private: }; -/// +/// class GuiExport TaskDlgRelocation : public Gui::TaskView::TaskDialog { Q_OBJECT @@ -88,10 +88,10 @@ public: virtual bool accept(); /// is called by the framework if the dialog is rejected (Cancel) virtual bool reject(); - /// is called by the framework if the user press the help button + /// is called by the framework if the user press the help button virtual void helpRequested(); - /// returns for Close and Help button + /// returns for Close and Help button virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const { return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; } diff --git a/src/Gui/TaskElementColors.cpp b/src/Gui/TaskElementColors.cpp index 39b70b2bf4..d92dbf9a73 100644 --- a/src/Gui/TaskElementColors.cpp +++ b/src/Gui/TaskElementColors.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -77,7 +77,7 @@ public: std::string editSub; std::string editElement; - Private(ViewProviderDocumentObject* vp, const char *element="") + Private(ViewProviderDocumentObject* vp, const char *element="") : ui(new Ui_TaskElementColors()), vp(vp),editElement(element) { vpDoc = vp->getDocument(); @@ -167,7 +167,7 @@ public: c.setRgbF(color.r,color.g,color.b,1.0-color.a); px.fill(c); QListWidgetItem* item = new QListWidgetItem(QIcon(px), - QString::fromLatin1(Data::ComplexGeoData::oldElementName(v.first.c_str()).c_str()), + QString::fromLatin1(Data::ComplexGeoData::oldElementName(v.first.c_str()).c_str()), ui->elementList); item->setData(Qt::UserRole,c); item->setData(Qt::UserRole+1,QString::fromLatin1(v.first.c_str())); @@ -245,7 +245,7 @@ public: item->setIcon(QIcon(px)); apply(); } - + void onSelectionChanged(const SelectionChanges &msg) { // no object selected in the combobox or no sub-element was selected if (busy) @@ -278,7 +278,7 @@ public: busy = true; std::map sels; for(auto &sel : Selection().getSelectionEx( - editDoc.c_str(),App::DocumentObject::getClassTypeId(),0)) + editDoc.c_str(),App::DocumentObject::getClassTypeId(),0)) { if(sel.getFeatName()!=editObj) continue; for(auto &sub : sel.getSubNames()) { @@ -323,7 +323,7 @@ ElementColors::ElementColors(ViewProviderDocumentObject* vp, bool noHide) ("User parameter:BaseApp/Preferences/View"); d->ui->recompute->setChecked(hPart->GetBool("ColorRecompute",true)); d->ui->onTop->setChecked(hPart->GetBool("ColorOnTop",true)); - if(d->ui->onTop->isChecked()) + if(d->ui->onTop->isChecked()) d->vpParent->OnTopWhenSelected.setValue(3); Selection().addSelectionGate(d,0); diff --git a/src/Gui/TaskElementColors.h b/src/Gui/TaskElementColors.h index f672dcd90c..b3355fc9d5 100644 --- a/src/Gui/TaskElementColors.h +++ b/src/Gui/TaskElementColors.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/TextEdit.cpp b/src/Gui/TextEdit.cpp index 8be98a1472..d9cbda44bd 100644 --- a/src/Gui/TextEdit.cpp +++ b/src/Gui/TextEdit.cpp @@ -68,7 +68,7 @@ void TextEdit::keyPressEvent(QKeyEvent* e) QTextCursor cursor = textCursor(); cursor.movePosition(QTextCursor::StartOfWord); // the cursor has moved to outside the word prefix - if (cursor.position() < cursorPosition-wordPrefix.length() || + if (cursor.position() < cursorPosition-wordPrefix.length() || cursor.position() > cursorPosition) { listBox->hide(); return; @@ -95,7 +95,7 @@ void TextEdit::complete() wordPrefix = para.mid(wordStart, cursorPos - wordStart); if (wordPrefix.isEmpty()) return; - + QStringList list = toPlainText().split(QRegExp(QLatin1String("\\W+"))); QMap map; QStringList::Iterator it = list.begin(); @@ -104,7 +104,7 @@ void TextEdit::complete() map[(*it).toLower()] = *it; ++it; } - + if (map.count() == 1) { insertPlainText((*map.begin()).mid(wordPrefix.length())); } else if (map.count() > 1) { @@ -149,7 +149,7 @@ void TextEdit::complete() w += style()->pixelMetric(QStyle::PM_ScrollBarExtent); listBox->setGeometry(posX, posY+fontMetrics().height(), w, h); } - + listBox->setCurrentRow(0); listBox->show(); } @@ -200,7 +200,7 @@ struct TextEditorP /** * Constructs a TextEditor which is a child of 'parent' and does the - * syntax highlighting for the Python language. + * syntax highlighting for the Python language. */ TextEditor::TextEditor(QWidget* parent) : TextEdit(parent), WindowParameter("Editor"), highlighter(0) @@ -292,10 +292,10 @@ void TextEditor::highlightCurrentLine() void TextEditor::drawMarker(int line, int x, int y, QPainter* p) { - Q_UNUSED(line); - Q_UNUSED(x); - Q_UNUSED(y); - Q_UNUSED(p); + Q_UNUSED(line); + Q_UNUSED(x); + Q_UNUSED(y); + Q_UNUSED(p); } void TextEditor::lineNumberAreaPaintEvent(QPaintEvent *event) @@ -418,10 +418,10 @@ void TextEditor::keyPressEvent (QKeyEvent * e) TextEdit::keyPressEvent( e ); } -/** Sets the font, font size and tab size of the editor. */ +/** Sets the font, font size and tab size of the editor. */ void TextEditor::OnChange(Base::Subject &rCaller,const char* sReason) { - Q_UNUSED(rCaller); + Q_UNUSED(rCaller); ParameterGrp::handle hPrefGrp = getWindowParameter(); if (strcmp(sReason, "FontSize") == 0 || strcmp(sReason, "Font") == 0) { #ifdef FC_OS_LINUX @@ -430,7 +430,7 @@ void TextEditor::OnChange(Base::Subject &rCaller,const char* sReaso int fontSize = hPrefGrp->GetInt("FontSize", 10); #endif QString fontFamily = QString::fromLatin1(hPrefGrp->GetASCII( "Font", "Courier" ).c_str()); - + QFont font(fontFamily, fontSize); setFont(font); } else { @@ -505,7 +505,7 @@ CompletionList::CompletionList(QPlainTextEdit* parent) pal.setColor(QPalette::Inactive, QPalette::HighlightedText, pal.color(QPalette::Active, QPalette::HighlightedText)); parent->setPalette( pal ); - connect(this, SIGNAL(itemActivated(QListWidgetItem *)), + connect(this, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(completionItem(QListWidgetItem *))); } @@ -514,7 +514,7 @@ CompletionList::~CompletionList() } void CompletionList::findCurrentWord(const QString& wordPrefix) -{ +{ for (int i=0; itext(); if (text.startsWith(wordPrefix)) { @@ -527,7 +527,7 @@ void CompletionList::findCurrentWord(const QString& wordPrefix) currentItem()->setSelected(false); } -/** +/** * Get all incoming events of the text edit and redirect some of them, like key up and * down, mouse press events, ... to the widget itself. */ @@ -579,4 +579,4 @@ void CompletionList::completionItem(QListWidgetItem *item) textEdit->ensureCursorVisible(); } -#include "moc_TextEdit.cpp" +#include "moc_TextEdit.cpp" diff --git a/src/Gui/TextEdit.h b/src/Gui/TextEdit.h index 2ad2a7fa88..ee85626323 100644 --- a/src/Gui/TextEdit.h +++ b/src/Gui/TextEdit.h @@ -20,6 +20,8 @@ * * ***************************************************************************/ +/* Text completion mechanism */ + #ifndef GUI_TEXTEDIT_H #define GUI_TEXTEDIT_H @@ -34,19 +36,19 @@ class CompletionBox; class SyntaxHighlighter; /** - * Completion is a means by which an editor automatically completes words that the user is typing. - * For example, in a code editor, a programmer might type "sur", then Tab, and the editor will complete - * the word the programmer was typing so that "sur" is replaced by "surnameLineEdit". This is very - * useful for text that contains long words or variable names. The completion mechanism usually works - * by looking at the existing text to see if any words begin with what the user has typed, and in most + * Completion is a means by which an editor automatically completes words that the user is typing. + * For example, in a code editor, a programmer might type "sur", then Tab, and the editor will complete + * the word the programmer was typing so that "sur" is replaced by "surnameLineEdit". This is very + * useful for text that contains long words or variable names. The completion mechanism usually works + * by looking at the existing text to see if any words begin with what the user has typed, and in most * editors completion is invoked by a special key sequence. * - * TextEdit can detect a special key sequence to invoke the completion mechanism, and can handle three + * TextEdit can detect a special key sequence to invoke the completion mechanism, and can handle three * different situations: * \li There are no possible completions. * \li There is a single possible completion. * \li There are two or more possible completions. - * + * * \remark The original sources are taken from Qt Quarterly (Customizing for Completion). * @author Werner Mayer */ diff --git a/src/Gui/TextureMapping.cpp b/src/Gui/TextureMapping.cpp index 2fbd3293ab..2b39b4c5f9 100644 --- a/src/Gui/TextureMapping.cpp +++ b/src/Gui/TextureMapping.cpp @@ -65,7 +65,7 @@ TextureMapping::TextureMapping(QWidget* parent, Qt::WindowFlags fl) for (QList::Iterator it = qtformats.begin(); it != qtformats.end(); ++it) { formats << QString::fromLatin1("*.%1").arg(QLatin1String(*it)); } - + ui->fileChooser->setFilter(tr("Image files (%1)").arg(formats.join(QLatin1String(" ")))); this->tex = new SoTexture2(); diff --git a/src/Gui/Thumbnail.cpp b/src/Gui/Thumbnail.cpp index a4a7bf7da0..c8eafeaccf 100644 --- a/src/Gui/Thumbnail.cpp +++ b/src/Gui/Thumbnail.cpp @@ -79,7 +79,7 @@ void Thumbnail::Save (Base::Writer &writer) const void Thumbnail::Restore(Base::XMLReader &reader) { - Q_UNUSED(reader); + Q_UNUSED(reader); //reader.addFile("Thumbnail.png",this); } @@ -132,5 +132,5 @@ void Thumbnail::SaveDocFile (Base::Writer &writer) const void Thumbnail::RestoreDocFile(Base::Reader &reader) { - Q_UNUSED(reader); + Q_UNUSED(reader); } diff --git a/src/Gui/ToolBarManager.h b/src/Gui/ToolBarManager.h index 7bceccdff2..82230044f6 100644 --- a/src/Gui/ToolBarManager.h +++ b/src/Gui/ToolBarManager.h @@ -65,7 +65,7 @@ private: * The ToolBarManager class is responsible for the creation of toolbars and appending them * to the main window. * @see ToolBoxManager - * @see MenuManager + * @see MenuManager * @author Werner Mayer */ class GuiExport ToolBarManager @@ -97,4 +97,4 @@ private: } // namespace Gui -#endif // GUI_TOOLBARMANAGER_H +#endif // GUI_TOOLBARMANAGER_H diff --git a/src/Gui/ToolBox.cpp b/src/Gui/ToolBox.cpp index e27677f8b9..61213bb963 100644 --- a/src/Gui/ToolBox.cpp +++ b/src/Gui/ToolBox.cpp @@ -52,7 +52,7 @@ ToolBox::~ToolBox() } /** - * Adds the widget w in a new tab at bottom of the toolbox. The new tab's label is set to \a label. + * Adds the widget w in a new tab at bottom of the toolbox. The new tab's label is set to \a label. * Returns the new tab's index. */ int ToolBox::addItem ( QWidget * w, const QString & label ) @@ -61,7 +61,7 @@ int ToolBox::addItem ( QWidget * w, const QString & label ) } /** - * Adds the widget \a item in a new tab at bottom of the toolbox. The new tab's label is set to \a label, and + * Adds the widget \a item in a new tab at bottom of the toolbox. The new tab's label is set to \a label, and * the \a iconSet is displayed to the left of the \a label. Returns the new tab's index. */ int ToolBox::addItem ( QWidget * item, const QIcon & iconSet, const QString & label ) @@ -70,9 +70,9 @@ int ToolBox::addItem ( QWidget * item, const QIcon & iconSet, const QString & la } /** - * This is an overloaded member function, provided for convenience. It behaves essentially like the above function. + * This is an overloaded member function, provided for convenience. It behaves essentially like the above function. * - * Inserts the widget \a item at position \a index, or at the bottom of the toolbox if \a index is out of range. + * Inserts the widget \a item at position \a index, or at the bottom of the toolbox if \a index is out of range. * The new item's label is set to \a label. Returns the new item's index. */ int ToolBox::insertItem ( int index, QWidget * item, const QString & label ) @@ -81,8 +81,8 @@ int ToolBox::insertItem ( int index, QWidget * item, const QString & label ) } /** - * Inserts the widget \a item at position \a index, or at the bottom of the toolbox if \a index is out of range. - * The new item's label is set to \a label, and the \a iconSet is displayed to the left of the \a label. + * Inserts the widget \a item at position \a index, or at the bottom of the toolbox if \a index is out of range. + * The new item's label is set to \a label, and the \a iconSet is displayed to the left of the \a label. * Returns the new item's index. */ int ToolBox::insertItem ( int index, QWidget * item, const QIcon & iconSet, const QString & label ) diff --git a/src/Gui/ToolBox.h b/src/Gui/ToolBox.h index 936f39efdb..04c3f5f109 100644 --- a/src/Gui/ToolBox.h +++ b/src/Gui/ToolBox.h @@ -31,22 +31,22 @@ class QToolBox; namespace Gui { -namespace DockWnd +namespace DockWnd { /** The ToolBox class provides a column of tabbed widget items. - * A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed - * below the current tab. Every tab has an index position within the column of tabs. A tab's item is a QWidget. + * A toolbox is a widget that displays a column of tabs one above the other, with the current item displayed + * below the current tab. Every tab has an index position within the column of tabs. A tab's item is a QWidget. * * Each item has an itemLabel(), an optional icon, itemIconSet(), an optional itemToolTip(), and a widget. - * The item's attributes can be changed with setItemLabel(), setItemIconSet() and setItemToolTip(). + * The item's attributes can be changed with setItemLabel(), setItemIconSet() and setItemToolTip(). * - * Items are added using addItem(), or inserted at particular positions using insertItem(). The total number of - * items is given by count(). Items can be deleted with delete, or removed from the toolbox with removeItem(). - * Combining removeItem() and insertItem() allows to move items to different positions. + * Items are added using addItem(), or inserted at particular positions using insertItem(). The total number of + * items is given by count(). Items can be deleted with delete, or removed from the toolbox with removeItem(). + * Combining removeItem() and insertItem() allows to move items to different positions. * - * The current item widget is returned by currentItem() and set with setCurrentItem(). If you prefer you can - * work in terms of indexes using currentIndex(), setCurrentIndex(), indexOf() and item(). + * The current item widget is returned by currentItem() and set with setCurrentItem(). If you prefer you can + * work in terms of indexes using currentIndex(), setCurrentIndex(), indexOf() and item(). * * The currentChanged() signal is emitted when the current item is changed. * @@ -74,13 +74,13 @@ public: void setItemText ( int index, const QString & label ); QString itemText ( int index ) const; - + void setItemIcon ( int index, const QIcon & iconSet ); QIcon itemIcon ( int index ) const; - + void setItemToolTip ( int index, const QString & toolTip ); QString itemToolTip ( int index ) const; - + QWidget * currentWidget () const; int currentIndex () const; @@ -96,7 +96,7 @@ protected: void changeEvent(QEvent *e); Q_SIGNALS: - /** This signal is emitted when the current item changed. + /** This signal is emitted when the current item changed. * The new current item's index is passed in index, or -1 if there is no current item. */ void currentChanged ( int index ); diff --git a/src/Gui/ToolBoxManager.h b/src/Gui/ToolBoxManager.h index b03ba7a220..4bb8025bd8 100644 --- a/src/Gui/ToolBoxManager.h +++ b/src/Gui/ToolBoxManager.h @@ -29,14 +29,14 @@ namespace Gui { class ToolBarItem; -namespace DockWnd +namespace DockWnd { class ToolBox;} /** * The ToolBoxManager class is responsible for the creation of command bars and appending them * to the toolbox window. * @see ToolBarManager - * @see MenuManager + * @see MenuManager * @author Werner Mayer */ class GuiExport ToolBoxManager @@ -62,4 +62,4 @@ private: } // namespace Gui -#endif // GUI_TOOLBOXMANAGER_H +#endif // GUI_TOOLBOXMANAGER_H diff --git a/src/Gui/TouchpadNavigationStyle.cpp b/src/Gui/TouchpadNavigationStyle.cpp index a6f2e68fb7..7b279eefc4 100644 --- a/src/Gui/TouchpadNavigationStyle.cpp +++ b/src/Gui/TouchpadNavigationStyle.cpp @@ -225,8 +225,8 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) this->lockrecenter = true; if (!viewer->isEditing()) { // If we are in zoom or pan mode ignore RMB events otherwise - // the canvas doesn't get any release events - if (this->currentmode != NavigationStyle::ZOOMING && + // the canvas doesn't get any release events + if (this->currentmode != NavigationStyle::ZOOMING && this->currentmode != NavigationStyle::PANNING && this->currentmode != NavigationStyle::DRAGGING) { if (this->isPopupMenuEnabled()) { diff --git a/src/Gui/TransactionObject.cpp b/src/Gui/TransactionObject.cpp index 4f8a6073be..a9d04a8b74 100644 --- a/src/Gui/TransactionObject.cpp +++ b/src/Gui/TransactionObject.cpp @@ -58,6 +58,6 @@ void TransactionViewProvider::applyNew(App::Document& Doc, App::TransactionalObj void TransactionViewProvider::applyDel(App::Document& Doc, App::TransactionalObject* pcObj) { // nothing to do here - Q_UNUSED(Doc); - Q_UNUSED(pcObj); + Q_UNUSED(Doc); + Q_UNUSED(pcObj); } diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index 457ee84d10..e76c7b8a8e 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -164,7 +164,7 @@ struct Stats { int _name##_count; DEFINE_STATS - + void init() { #undef DEFINE_STAT #define DEFINE_STAT(_name) \ @@ -293,19 +293,19 @@ public: continue; if(child && child->getNameInDocument()) { if(!newSet.insert(child).second) { - TREE_WARN("duplicate child item " << obj->getFullName() + TREE_WARN("duplicate child item " << obj->getFullName() << '.' << child->getNameInDocument()); }else if(!childSet.erase(child)) { // this means new child detected updated = true; - if(child->getDocument()==obj->getDocument() && + if(child->getDocument()==obj->getDocument() && child->getDocument()==docItem->document()->getDocument()) { auto &parents = docItem->_ParentMap[child]; if(parents.insert(obj).second && child->Visibility.getValue()) { bool showable = false; - for(auto parent : parents) { - if(!parent->hasChildElement() + for(auto parent : parents) { + if(!parent->hasChildElement() && parent->getLinkedObject(false)==parent) { showable = true; @@ -373,7 +373,7 @@ public: // --------------------------------------------------------------------------- -class DocumentItem::ExpandInfo: +class DocumentItem::ExpandInfo: public std::unordered_map { public: @@ -400,7 +400,7 @@ TreeWidgetEditDelegate::TreeWidgetEditDelegate(QObject* parent) } QWidget* TreeWidgetEditDelegate::createEditor( - QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const + QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const { auto ti = static_cast(index.internalPointer()); if(ti->type()!=TreeWidget::ObjectType || index.column()>1) @@ -660,7 +660,7 @@ void TreeWidget::startItemSearch(QLineEdit *edit) { searchDoc = item->object()->getDocument(); searchContextDoc = item->getOwnerDocument()->document(); } - }else + }else searchDoc = Application::Instance->activeDocument(); App::DocumentObject *obj = 0; @@ -791,7 +791,7 @@ void TreeWidget::updateStatus(bool delay) { void TreeWidget::_updateStatus(bool delay) { if(!delay) { - if(ChangedObjects.size() || NewObjects.size()) + if(ChangedObjects.size() || NewObjects.size()) onUpdateStatus(); return; } @@ -993,7 +993,7 @@ void TreeWidget::onStartEditing() int edit = action->data().toInt(); App::DocumentObject* obj = objitem->object()->getObject(); - if (!obj || !obj->getNameInDocument()) + if (!obj || !obj->getNameInDocument()) return; auto doc = const_cast(objitem->getOwnerDocument()->document()); MDIView *view = doc->getActiveView(); @@ -1100,7 +1100,7 @@ DocumentItem *TreeWidget::getDocumentItem(const Gui::Document *doc) const { } void TreeWidget::selectAllInstances(const ViewProviderDocumentObject &vpd) { - if(!isConnectionAttached()) + if(!isConnectionAttached()) return; if(selectTimer->isActive()) @@ -1108,7 +1108,7 @@ void TreeWidget::selectAllInstances(const ViewProviderDocumentObject &vpd) { else _updateStatus(false); - for(const auto &v : DocumentMap) + for(const auto &v : DocumentMap) v.second->selectAllInstances(vpd); } @@ -1182,7 +1182,7 @@ std::vector TreeWidget::getSelection(App::Document *doc) } void TreeWidget::selectAllLinks(App::DocumentObject *obj) { - if(!isConnectionAttached()) + if(!isConnectionAttached()) return; if(!obj || !obj->getNameInDocument()) { @@ -1195,7 +1195,7 @@ void TreeWidget::selectAllLinks(App::DocumentObject *obj) { else _updateStatus(false); - for(auto link: App::GetApplication().getLinksTo(obj,App::GetLinkRecursive)) + for(auto link: App::GetApplication().getLinksTo(obj,App::GetLinkRecursive)) { if(!link || !link->getNameInDocument()) { TREE_ERR("invalid linked object"); @@ -1253,8 +1253,8 @@ bool TreeWidget::eventFilter(QObject *, QEvent *ev) { if (ke->key() != Qt::Key_Escape) { // Qt 5 only recheck key modifier on mouse move, so generate a fake // event to trigger drag cursor change - QMouseEvent *mouseEvent = new QMouseEvent(QEvent::MouseMove, - mapFromGlobal(QCursor::pos()), QCursor::pos(), Qt::NoButton, + QMouseEvent *mouseEvent = new QMouseEvent(QEvent::MouseMove, + mapFromGlobal(QCursor::pos()), QCursor::pos(), Qt::NoButton, QApplication::mouseButtons(), QApplication::queryKeyboardModifiers()); QApplication::postEvent(this,mouseEvent); } @@ -1480,8 +1480,8 @@ void TreeWidget::dragMoveEvent(QDragMoveEvent *event) if(!dropOnly && !vp->canDragAndDropObject(obj)) { // check if items can be dragged auto parentItem = item->getParentItem(); - if(parentItem - && (!parentItem->object()->canDragObjects() + if(parentItem + && (!parentItem->object()->canDragObjects() || !parentItem->object()->canDragObject(item->object()->getObject()))) { if(!(event->possibleActions() & Qt::CopyAction)) { @@ -1586,7 +1586,7 @@ void TreeWidget::dropEvent(QDropEvent *event) if (ti->type() != TreeWidget::ObjectType) continue; // ignore child elements if the parent is selected - if(sels.contains(ti->parent())) + if(sels.contains(ti->parent())) continue; if (ti == targetItem) continue; @@ -1604,7 +1604,7 @@ void TreeWidget::dropEvent(QDropEvent *event) if(QApplication::keyboardModifiers()== Qt::ControlModifier) event->setDropAction(Qt::CopyAction); - else if(QApplication::keyboardModifiers()== Qt::AltModifier + else if(QApplication::keyboardModifiers()== Qt::AltModifier && (items.size()==1||targetItem->type()==TreeWidget::DocumentType)) event->setDropAction(Qt::LinkAction); else @@ -1679,15 +1679,15 @@ void TreeWidget::dropEvent(QDropEvent *event) info.subs.swap(v.second); // check if items can be dragged - if(!dropOnly && - item->myOwner == targetItemObj->myOwner && + if(!dropOnly && + item->myOwner == targetItemObj->myOwner && vp->canDragAndDropObject(item->object()->getObject())) { // check if items can be dragged auto parentItem = item->getParentItem(); if(!parentItem) info.dragging = true; - else if(parentItem->object()->canDragObjects() + else if(parentItem->object()->canDragObjects() && parentItem->object()->canDragObject(item->object()->getObject())) { info.dragging = true; @@ -1697,8 +1697,8 @@ void TreeWidget::dropEvent(QDropEvent *event) } } - if (da!=Qt::LinkAction - && !vp->canDropObjectEx(obj,owner,info.subname.c_str(),item->mySubs)) + if (da!=Qt::LinkAction + && !vp->canDropObjectEx(obj,owner,info.subname.c_str(),item->mySubs)) { if(event->possibleActions() & Qt::LinkAction) { if(items.size()>1) { @@ -1769,7 +1769,7 @@ void TreeWidget::dropEvent(QDropEvent *event) App::DocumentObject *owner = 0; if(info.ownerDoc.size()) { auto ownerDoc = App::GetApplication().getDocument(info.ownerDoc.c_str()); - if(ownerDoc) + if(ownerDoc) owner = ownerDoc->getObject(info.owner.c_str()); if(!owner) { FC_WARN("Cannot find dragging object's top parent " << info.owner); @@ -1859,9 +1859,9 @@ void TreeWidget::dropEvent(QDropEvent *event) dropParent = 0; parentItem->getSubName(ss,dropParent); - if(dropParent) + if(dropParent) ss << parentItem->object()->getObject()->getNameInDocument() << '.'; - else + else dropParent = parentItem->object()->getObject(); ss << obj->getNameInDocument() << '.'; dropName = ss.str(); @@ -1871,7 +1871,7 @@ void TreeWidget::dropEvent(QDropEvent *event) } Gui::Command::runCommand(Gui::Command::App, ss.str().c_str()); - + }else{ ss << Command::getObjectCmd(vp->getObject()) << ".ViewObject.dropObject(" << Command::getObjectCmd(obj); @@ -1904,7 +1904,7 @@ void TreeWidget::dropEvent(QDropEvent *event) Base::Matrix4D newMat; auto sobj = dropParent->getSubObject(dropName.c_str(),0,&newMat); if(!sobj) { - FC_LOG("failed to find dropped object " + FC_LOG("failed to find dropped object " << dropParent->getFullName() << '.' << dropName); setSelection = false; continue; @@ -1912,8 +1912,8 @@ void TreeWidget::dropEvent(QDropEvent *event) if(da!=Qt::CopyAction && propPlacement) { // try to adjust placement - if((info.dragging && sobj==obj) || - (!info.dragging && sobj->getLinkedObject(false)==obj)) + if((info.dragging && sobj==obj) || + (!info.dragging && sobj->getLinkedObject(false)==obj)) { if(!info.dragging) propPlacement = Base::freecad_dynamic_cast( @@ -1975,10 +1975,10 @@ void TreeWidget::dropEvent(QDropEvent *event) // key is held, or 2) the dragging item is not inside the // dropping document tree. parentItem = 0; - }else if(!parentItem->object()->canDragObjects() - || !parentItem->object()->canDragObject(obj)) + }else if(!parentItem->object()->canDragObjects() + || !parentItem->object()->canDragObject(obj)) { - TREE_ERR("'" << obj->getFullName() << "' cannot be dragged out of '" << + TREE_ERR("'" << obj->getFullName() << "' cannot be dragged out of '" << parentItem->object()->getObject()->getFullName() << "'"); return; } @@ -2058,7 +2058,7 @@ void TreeWidget::dropEvent(QDropEvent *event) continue; FCMD_OBJ_CMD(link,"Label='" << obj->getLinkedObject(true)->Label.getValue() << "'"); propPlacement = dynamic_cast(link->getPropertyByName("Placement")); - if(propPlacement) + if(propPlacement) propPlacement->setValueIfChanged(Base::Placement(mat)); droppedObjs.push_back(link); }else if(info.parent.size()) { @@ -2096,7 +2096,7 @@ void TreeWidget::dropEvent(QDropEvent *event) if(!obj || !obj->getNameInDocument()) continue; droppedObjs.push_back(obj); - if(propPlacement) + if(propPlacement) propPlacement->setValueIfChanged(Base::Placement(mat)); } else { std::ostringstream ss; @@ -2113,7 +2113,7 @@ void TreeWidget::dropEvent(QDropEvent *event) if(res) { propPlacement = dynamic_cast( res->getPropertyByName("Placement")); - if(propPlacement) + if(propPlacement) propPlacement->setValueIfChanged(Base::Placement(mat)); droppedObjs.push_back(res); } @@ -2237,7 +2237,7 @@ void TreeWidget::slotRenameDocument(const Gui::Document& Doc) void TreeWidget::slotChangedViewObject(const Gui::ViewProvider& vp, const App::Property &prop) { if(!App::GetApplication().isRestoring() - && vp.isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) + && vp.isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) { const auto &vpd = static_cast(vp); if(&prop == &vpd.ShowInTree) { @@ -2353,13 +2353,13 @@ void TreeWidget::onUpdateStatus(void) // Checking for new objects for(auto &v : NewObjects) { auto doc = App::GetApplication().getDocument(v.first.c_str()); - if(!doc) + if(!doc) continue; auto gdoc = Application::Instance->getDocument(doc); - if(!gdoc) + if(!gdoc) continue; auto docItem = getDocumentItem(gdoc); - if(!docItem) + if(!docItem) continue; for(auto id : v.second) { auto obj = doc->getObjectByID(id); @@ -2393,7 +2393,7 @@ void TreeWidget::onUpdateStatus(void) if(data->itemHidden != itemHidden) { for(auto &data : iter->second) { data->itemHidden = itemHidden; - if(data->docItem->showHidden()) + if(data->docItem->showHidden()) continue; for(auto item : data->items) item->setHidden(itemHidden); @@ -2538,7 +2538,7 @@ void TreeWidget::onPreSelectTimer() { if(!TreeParams::Instance()->PreSelection()) return; auto item = itemAt(viewport()->mapFromGlobal(QCursor::pos())); - if(!item || item->type()!=TreeWidget::ObjectType) + if(!item || item->type()!=TreeWidget::ObjectType) return; preselectTime.restart(); @@ -2578,7 +2578,7 @@ void TreeWidget::scrollItemToTop() { auto doc = Application::Instance->activeDocument(); for(auto tree : Instances) { - if(!tree->isConnectionAttached() || tree->isConnectionBlocked()) + if(!tree->isConnectionAttached() || tree->isConnectionBlocked()) continue; tree->_updateStatus(false); @@ -2613,7 +2613,7 @@ void TreeWidget::scrollItemToTop() void TreeWidget::expandSelectedItems(TreeItemMode mode) { - if(!isConnectionAttached()) + if(!isConnectionAttached()) return; for(auto item : selectedItems()) { @@ -2666,7 +2666,7 @@ void TreeWidget::setupText() this->closeDocAction->setText(tr("Close document")); this->closeDocAction->setStatusTip(tr("Close the document")); - + this->reloadDocAction->setText(tr("Reload document")); this->reloadDocAction->setStatusTip(tr("Reload a partially loaded document")); @@ -2724,7 +2724,7 @@ void TreeWidget::changeEvent(QEvent *e) void TreeWidget::onItemSelectionChanged () { - if (!this->isConnectionAttached() + if (!this->isConnectionAttached() || this->isConnectionBlocked() || updateBlocked) return; @@ -2953,8 +2953,8 @@ TreeDockWidget::~TreeDockWidget() { } -void TreeWidget::selectLinkedObject(App::DocumentObject *linked) { - if(!isConnectionAttached() || isConnectionBlocked()) +void TreeWidget::selectLinkedObject(App::DocumentObject *linked) { + if(!isConnectionAttached() || isConnectionBlocked()) return; auto linkedVp = Base::freecad_dynamic_cast( @@ -2980,7 +2980,7 @@ void TreeWidget::selectLinkedObject(App::DocumentObject *linked) { return; } auto linkedItem = it->second->rootItem; - if(!linkedItem) + if(!linkedItem) linkedItem = *it->second->items.begin(); if(linkedDoc->showItem(linkedItem,true)) @@ -3121,7 +3121,7 @@ bool DocumentItem::createNewItem(const Gui::ViewProviderDocumentObject& obj, QTreeWidgetItem *parent, int index, DocumentObjectDataPtr data) { const char *name; - if (!obj.getObject() || + if (!obj.getObject() || !(name=obj.getObject()->getNameInDocument()) || obj.getObject()->testStatus(App::PartialObject)) return false; @@ -3187,9 +3187,9 @@ ViewProviderDocumentObject *DocumentItem::getViewProvider(App::DocumentObject *o if(!obj || !obj->getNameInDocument()) return 0; ViewProvider *vp; - if(obj->getDocument() == pDocument->getDocument()) + if(obj->getDocument() == pDocument->getDocument()) vp = pDocument->getViewProvider(obj); - else + else vp = Application::Instance->getViewProvider(obj); if(!vp || !vp->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())) return 0; @@ -3358,8 +3358,8 @@ void DocumentItem::populateItem(DocumentObjectItem *item, bool refresh, bool del bool updated = false; int i=-1; - // iterate through the claimed children, and try to synchronize them with the - // children tree item with the same order of appearance. + // iterate through the claimed children, and try to synchronize them with the + // children tree item with the same order of appearance. int childCount = item->childCount(); for(auto child : item->myData->children) { @@ -3386,7 +3386,7 @@ void DocumentItem::populateItem(DocumentObjectItem *item, bool refresh, bool del } // Check if the item just changed its policy of whether to remove - // children item from the root. + // children item from the root. if(item->myData->removeChildrenFromRoot) { if(childItem->myData->rootItem) { assert(childItem != childItem->myData->rootItem); @@ -3426,7 +3426,7 @@ void DocumentItem::populateItem(DocumentObjectItem *item, bool refresh, bool del }else { DocumentObjectItem *childItem = it->second->rootItem; if(item==childItem || item->isChildOfItem(childItem)) { - TREE_ERR("Cyclic dependency in " + TREE_ERR("Cyclic dependency in " << item->object()->getObject()->getFullName() << '.' << childItem->object()->getObject()->getFullName()); --i; @@ -3465,7 +3465,7 @@ void DocumentItem::populateItem(DocumentObjectItem *item, bool refresh, bool del delete ci; getTree()->blockConnection(lock); } - if(updated) + if(updated) getTree()->_updateStatus(); } @@ -3509,7 +3509,7 @@ int DocumentItem::findRootIndex(App::DocumentObject *childObj) { count = last-first; int pos; while (count > 0) { - int step = count / 2; + int step = count / 2; pos = first + step; for(;pos<=last;++pos) { auto citem = this->child(pos); @@ -3578,7 +3578,7 @@ void TreeWidget::slotChangeObject( } auto &s = ChangedObjects[obj]; - if(prop.testStatus(App::Property::Output) + if(prop.testStatus(App::Property::Output) || prop.testStatus(App::Property::NoRecompute)) { s.set(CS_Output); @@ -3641,7 +3641,7 @@ void TreeWidget::updateChildren(App::DocumentObject *obj, if(!selectTimer->isActive()) onSelectionChanged(SelectionChanges()); - //if the item is in a GeoFeatureGroup we may need to update that too, as the claim children + //if the item is in a GeoFeatureGroup we may need to update that too, as the claim children //of the geofeaturegroup depends on what the childs claim auto grp = App::GeoFeatureGroupExtension::getGroupOfObject(obj); if(grp && !ChangedObjects.count(grp)) { @@ -3651,8 +3651,8 @@ void TreeWidget::updateChildren(App::DocumentObject *obj, } } } - -void DocumentItem::slotHighlightObject (const Gui::ViewProviderDocumentObject& obj, + +void DocumentItem::slotHighlightObject (const Gui::ViewProviderDocumentObject& obj, const Gui::HighlightMode& high, bool set, const App::DocumentObject *parent, const char *subname) { getTree()->_updateStatus(false); @@ -3720,7 +3720,7 @@ static void saveExpandedItem(Base::Writer &writer, const QTreeWidgetItem *item) continue; auto obj = static_cast(citem)->object()->getObject(); if(obj->getNameInDocument()) { - writer.Stream() << writer.ind() << "getNameInDocument() << "\""; saveExpandedItem(writer,static_cast(citem)); } @@ -3805,9 +3805,9 @@ void DocumentItem::slotExpandObject (const Gui::ViewProviderDocumentObject& obj, break; } // fall through - case TreeItemMode::ExpandItem: + case TreeItemMode::ExpandItem: if(!parent) { - if(item->parent()->isExpanded()) + if(item->parent()->isExpanded()) item->setExpanded(true); }else{ App::DocumentObject *topParent = 0; @@ -3847,7 +3847,7 @@ void DocumentItem::slotScrollToObject(const Gui::ViewProviderDocumentObject& obj if(!obj.getObject() || !obj.getObject()->getNameInDocument()) return; auto it = ObjectMap.find(obj.getObject()); - if(it == ObjectMap.end() || it->second->items.empty()) + if(it == ObjectMap.end() || it->second->items.empty()) return; auto item = it->second->rootItem; if(!item) @@ -3865,7 +3865,7 @@ void DocumentItem::slotRecomputedObject(const App::DocumentObject &obj) { void DocumentItem::slotRecomputed(const App::Document &, const std::vector &objs) { auto tree = getTree(); for(auto obj : objs) { - if(!obj->isValid()) + if(!obj->isValid()) tree->ChangedObjects[obj].set(TreeWidget::CS_Error); } if(tree->ChangedObjects.size()) @@ -3933,7 +3933,7 @@ void DocumentItem::updateSelection(QTreeWidgetItem *ti, bool unselect) { auto child = ti->child(i); if(child && child->type()==TreeWidget::ObjectType) { auto childItem = static_cast(child); - if(unselect) + if(unselect) childItem->setSelected(false); updateItemSelection(childItem); if(unselect && childItem->isGroup()) { @@ -3944,7 +3944,7 @@ void DocumentItem::updateSelection(QTreeWidgetItem *ti, bool unselect) { } } } - + if(unselect) return; for(int i=0,count=ti->childCount();ichild(i)); @@ -3952,7 +3952,7 @@ void DocumentItem::updateSelection(QTreeWidgetItem *ti, bool unselect) { void DocumentItem::updateItemSelection(DocumentObjectItem *item) { bool selected = item->isSelected(); - if((selected && item->selected>0) || (!selected && !item->selected)) + if((selected && item->selected>0) || (!selected && !item->selected)) return; if(item->selected != -1) item->mySubs.clear(); @@ -4002,7 +4002,7 @@ void DocumentItem::updateItemSelection(DocumentObjectItem *item) { if(selected && item->isGroup()) { // Same reasoning as above. When a group item is newly selected, We // choose to force unselect all its children to void messing up the - // selection highlight + // selection highlight // // UPDATE: same as above, child and parent selection is now re-enabled. // @@ -4070,14 +4070,14 @@ App::DocumentObject *DocumentItem::getTopParent(App::DocumentObject *obj, std::s return obj; } ss << obj->getNameInDocument() << '.' << subname; - FC_LOG("Subname correction " << obj->getFullName() << '.' << subname + FC_LOG("Subname correction " << obj->getFullName() << '.' << subname << " -> " << topParent->getFullName() << '.' << ss.str()); subname = ss.str(); return topParent; } DocumentObjectItem *DocumentItem::findItemByObject( - bool sync, App::DocumentObject *obj, const char *subname, bool select) + bool sync, App::DocumentObject *obj, const char *subname, bool select) { if(!subname) subname = ""; @@ -4087,14 +4087,14 @@ DocumentObjectItem *DocumentItem::findItemByObject( return 0; // prefer top level item of this object - if(it->second->rootItem) + if(it->second->rootItem) return findItem(sync,it->second->rootItem,subname,select); for(auto item : it->second->items) { // non group object do not provide a coordinate system, hence its // claimed child is still in the global coordinate space, so the // child can still be considered a top level object - if(!item->isParentGroup()) + if(!item->isParentGroup()) return findItem(sync,item,subname,select); } @@ -4115,9 +4115,9 @@ DocumentObjectItem *DocumentItem::findItemByObject( } DocumentObjectItem *DocumentItem::findItem( - bool sync, DocumentObjectItem *item, const char *subname, bool select) + bool sync, DocumentObjectItem *item, const char *subname, bool select) { - if(item->isHidden()) + if(item->isHidden()) item->setHidden(false); if(!subname || *subname==0) { @@ -4133,7 +4133,7 @@ DocumentObjectItem *DocumentItem::findItem( // try to find the next level object name const char *nextsub = 0; const char *dot = 0; - if((dot=strchr(subname,'.'))) + if((dot=strchr(subname,'.'))) nextsub = dot+1; else { if(select) { @@ -4172,7 +4172,7 @@ DocumentObjectItem *DocumentItem::findItem( if(!ti || ti->type()!=TreeWidget::ObjectType) continue; auto child = static_cast(ti); - if(child->object()->getObject() == subObj) + if(child->object()->getObject() == subObj) return findItem(sync,child,nextsub,select); } @@ -4250,7 +4250,7 @@ void DocumentItem::selectItems(SelectionReason reason) { newSelect = oldSelect; else getTree()->syncView(newSelect->object()); - if(newSelect) + if(newSelect) getTree()->scrollToItem(newSelect); } } @@ -4284,7 +4284,7 @@ void DocumentItem::selectAllInstances(const ViewProviderDocumentObject &vpd) { // We are trying to select all items corresponding to a given view // provider, i.e. all appearance of the object inside all its parent items // - // Build a map of object to all its parent + // Build a map of object to all its parent for(auto &v : ObjectMap) { if(v.second->viewObject == &vpd) continue; for(auto child : v.second->viewObject->claimChildren()) { @@ -4326,8 +4326,8 @@ bool DocumentItem::showItem(DocumentObjectItem *item, bool select, bool force) { return false; item->setHidden(false); } - - if(parent->type()==TreeWidget::ObjectType) { + + if(parent->type()==TreeWidget::ObjectType) { if(!showItem(static_cast(parent),false)) return false; auto pitem = static_cast(parent); @@ -4348,7 +4348,7 @@ void DocumentItem::updateItemsVisibility(QTreeWidgetItem *item, bool show) { auto objitem = static_cast(item); objitem->setHidden(!show && !objitem->object()->showInTree()); } - for(int i=0;ichildCount();++i) + for(int i=0;ichildCount();++i) updateItemsVisibility(item->child(i),show); } @@ -4484,7 +4484,7 @@ void DocumentObjectItem::testStatus(bool resetStatus, QIcon &icon1, QIcon &icon2 Timing(testStatus1); auto parent = parentItem->object()->getObject(); auto ext = parent->getExtensionByType(true,false); - if(!ext) + if(!ext) visible = parent->isElementVisible(pObject->getNameInDocument()); else { // We are dealing with a plain group. It has special handling when @@ -4733,7 +4733,7 @@ bool DocumentObjectItem::isChildOfItem(DocumentObjectItem* item) } bool DocumentObjectItem::requiredAtRoot(bool excludeSelf) const{ - if(myData->rootItem || object()->getDocument()!=getOwnerDocument()->document()) + if(myData->rootItem || object()->getDocument()!=getOwnerDocument()->document()) return false; bool checkMap = true; for(auto item : myData->items) { @@ -4751,7 +4751,7 @@ bool DocumentObjectItem::requiredAtRoot(bool excludeSelf) const{ // still being referred to by some parent item that is not expanded // yet. So, we force populate at least one item of the parent // object to make sure that there is at least one corresponding - // item for each object. + // item for each object. // // PS: practically speaking, it won't hurt much to delete all the // items, because the item will be auto created once the user @@ -4817,10 +4817,10 @@ bool DocumentItem::isObjectShowable(App::DocumentObject *obj) { if(itParents == _ParentMap.end() || itParents->second.empty()) return true; bool showable = true; - for(auto parent : itParents->second) { + for(auto parent : itParents->second) { if(parent->getDocument() != obj->getDocument()) continue; - if(!parent->hasChildElement() + if(!parent->hasChildElement() && parent->getLinkedObject(false)==parent) return true; showable = false; @@ -4886,7 +4886,7 @@ int DocumentObjectItem::getSubName(std::ostringstream &str, App::DocumentObject } App::DocumentObject *DocumentObjectItem::getFullSubName( - std::ostringstream &str, DocumentObjectItem *parent) const + std::ostringstream &str, DocumentObjectItem *parent) const { auto pi = getParentItem(); if(this==parent || !pi || (!parent && !pi->isGroup())) diff --git a/src/Gui/Tree.h b/src/Gui/Tree.h index a33809d02e..a47473e4ae 100644 --- a/src/Gui/Tree.h +++ b/src/Gui/Tree.h @@ -81,8 +81,8 @@ public: static void scrollItemToTop(); void selectAllInstances(const ViewProviderDocumentObject &vpd); - void selectLinkedObject(App::DocumentObject *linked); - void selectAllLinks(App::DocumentObject *obj); + void selectLinkedObject(App::DocumentObject *linked); + void selectAllLinks(App::DocumentObject *obj); void expandSelectedItems(TreeItemMode mode); bool eventFilter(QObject *, QEvent *ev) override; @@ -202,7 +202,7 @@ private: void changeEvent(QEvent *e) override; void setupText(); - void updateChildren(App::DocumentObject *obj, + void updateChildren(App::DocumentObject *obj, const std::set &data, bool output, bool force); private: @@ -329,13 +329,13 @@ protected: bool updateObject(const Gui::ViewProviderDocumentObject&, const App::Property &prop); - bool createNewItem(const Gui::ViewProviderDocumentObject&, - QTreeWidgetItem *parent=0, int index=-1, + bool createNewItem(const Gui::ViewProviderDocumentObject&, + QTreeWidgetItem *parent=0, int index=-1, DocumentObjectDataPtr ptrs = DocumentObjectDataPtr()); int findRootIndex(App::DocumentObject *childObj); - DocumentObjectItem *findItemByObject(bool sync, + DocumentObjectItem *findItemByObject(bool sync, App::DocumentObject *obj, const char *subname, bool select=false); DocumentObjectItem *findItem(bool sync, DocumentObjectItem *item, const char *subname, bool select=true); @@ -402,7 +402,7 @@ public: // check if a new item is required at root bool requiredAtRoot(bool excludeSelf=true) const; - + // return the owner, and full quanlified subname App::DocumentObject *getFullSubName(std::ostringstream &str, DocumentObjectItem *parent = 0) const; @@ -411,7 +411,7 @@ public: // 'cousin'. App::DocumentObject *getRelativeParent( std::ostringstream &str, - DocumentObjectItem *cousin, + DocumentObjectItem *cousin, App::DocumentObject **topParent=0, std::string *topSubname=0) const; @@ -491,7 +491,7 @@ class TreeWidgetEditDelegate: public QStyledItemDelegate { Q_OBJECT public: TreeWidgetEditDelegate(QObject* parent=0); - virtual QWidget* createEditor(QWidget *parent, + virtual QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const; }; diff --git a/src/Gui/TreeView.h b/src/Gui/TreeView.h index dae426dc1d..091d8bfc33 100644 --- a/src/Gui/TreeView.h +++ b/src/Gui/TreeView.h @@ -37,7 +37,7 @@ namespace Gui { class GuiExport TreeView : public QTreeView { Q_OBJECT - + public: TreeView(QWidget* parent=0); virtual ~TreeView(); diff --git a/src/Gui/Utilities.cpp b/src/Gui/Utilities.cpp index 40e4db7d1c..a3626b1624 100644 --- a/src/Gui/Utilities.cpp +++ b/src/Gui/Utilities.cpp @@ -95,8 +95,8 @@ Base::Matrix4D ViewVolumeProjection::getProjectionMatrix () const void Tessellator::tessCB(void * v0, void * v1, void * v2, void * cbdata) { - int * vtx0 = (int *)v0; - int * vtx1 = (int *)v1; + int * vtx0 = (int *)v0; + int * vtx1 = (int *)v1; int * vtx2 = (int *)v2; std::vector* array = (std::vector *)cbdata; diff --git a/src/Gui/View.cpp b/src/Gui/View.cpp index 5bd72d4cb2..0da5508f30 100644 --- a/src/Gui/View.cpp +++ b/src/Gui/View.cpp @@ -86,7 +86,7 @@ void BaseView::setDocument(Gui::Document* pcDocument) if (_pcDocument) _pcDocument->detachView(this, true); if (pcDocument) - pcDocument->attachView(this,true); + pcDocument->attachView(this,true); // set the new document as the active one _pcDocument = pcDocument; diff --git a/src/Gui/View.h b/src/Gui/View.h index c3fd2c49f7..300eaae611 100644 --- a/src/Gui/View.h +++ b/src/Gui/View.h @@ -32,16 +32,16 @@ namespace App class Document; } -namespace Gui +namespace Gui { class Document; class ViewProvider; /** Base class of all windows belonging to a document - * there are two ways of belonging to a document. The + * there are two ways of belonging to a document. The * first way is to a fixed one. The second way is to always * belonging to the Active document. that means switching every time - * the active document is changing. It also means that the view + * the active document is changing. It also means that the view * belongs sometimes to no document at all! * @see TreeView * @see Gui::Document @@ -65,7 +65,7 @@ public: virtual ~BaseView(); - /** @name methods used by the Application and the GuiDocument + /** @name methods used by the Application and the GuiDocument */ //@{ /// sets the view to another document (called by Application) @@ -81,7 +81,7 @@ public: /// indicates if the view is in passive mode bool isPassive(void) const {return bIsPassive;} - /** @name methods to override + /** @name methods to override */ //@{ /// get called when the document is updated @@ -111,4 +111,4 @@ protected: } // namespace Gui -#endif // GUI_VIEW_H +#endif // GUI_VIEW_H diff --git a/src/Gui/View3DInventor.cpp b/src/Gui/View3DInventor.cpp index 8425cc4570..f41415a4b1 100644 --- a/src/Gui/View3DInventor.cpp +++ b/src/Gui/View3DInventor.cpp @@ -200,7 +200,7 @@ View3DInventor::~View3DInventor() { if(_pcDocument) { SoCamera * Cam = _viewer->getSoRenderManager()->getCamera(); - if (Cam) + if (Cam) _pcDocument->saveCameraSettings(SoFCDB::writeNodesToString(Cam).c_str()); } hGrp->Detach(this); diff --git a/src/Gui/View3DInventor.h b/src/Gui/View3DInventor.h index 106b38190e..15dab6c554 100644 --- a/src/Gui/View3DInventor.h +++ b/src/Gui/View3DInventor.h @@ -58,7 +58,7 @@ protected: }; /** The 3D view window - * It consists out of the 3D view + * It consists out of the 3D view * \author Juergen Riegel */ class GuiExport View3DInventor : public MDIView, public ParameterGrp::ObserverType @@ -93,7 +93,7 @@ public: /** * If \a b is set to \a FullScreen the MDI view is displayed in full screen mode, if \a b * is set to \a TopLevel then it is displayed as an own top-level window, otherwise (\a Normal) - * as tabbed window. + * as tabbed window. * This method is reimplemented from MDIView to set the this widget as the proxy of the embedded * GL widget to get all key events in \a TopLevel or \a Fullscreen mode. */ diff --git a/src/Gui/View3DInventorExamples.cpp b/src/Gui/View3DInventorExamples.cpp index cb03296280..2fc97a7bf3 100644 --- a/src/Gui/View3DInventorExamples.cpp +++ b/src/Gui/View3DInventorExamples.cpp @@ -82,7 +82,7 @@ unsigned char * generateTexture(int w, int h, int d) } } - + return bitmap; } @@ -117,11 +117,11 @@ void doClipping(SbVec3f trans, SbRotation rot) // Clip box against plane SbClip clip; - SoMFVec3f * globalVerts = + SoMFVec3f * globalVerts = (SoMFVec3f *)SoDB::getGlobalField(SbName("globalVerts")); - SoMFVec3f * globalTVerts = + SoMFVec3f * globalTVerts = (SoMFVec3f *)SoDB::getGlobalField(SbName("globalTVerts")); - SoMFInt32 * globalnv = + SoMFInt32 * globalnv = (SoMFInt32 *)SoDB::getGlobalField(SbName("globalnv")); globalVerts->startEditing(); globalVerts->setNum(0); @@ -154,7 +154,7 @@ void doClipping(SbVec3f trans, SbRotation rot) globalnv->finishEditing(); // Close hole in clipped box by clipping against all 6 planes - + const SbVec3f planecoords[] = { SbVec3f(-10,0,-10), SbVec3f(10,0,-10), @@ -162,7 +162,7 @@ void doClipping(SbVec3f trans, SbRotation rot) SbVec3f(-10,0,10) }; - + clip.reset(); for (i = 0;i<4;i++) { SbVec3f v; @@ -176,9 +176,9 @@ void doClipping(SbVec3f trans, SbRotation rot) clip.clip(p); } int numVerts = clip.getNumVertices(); - SoMFVec3f * planeVerts = + SoMFVec3f * planeVerts = (SoMFVec3f *)SoDB::getGlobalField(SbName("planeVerts")); - SoMFVec3f * planeTVerts = + SoMFVec3f * planeTVerts = (SoMFVec3f *)SoDB::getGlobalField(SbName("planeTVerts")); planeVerts->startEditing(); planeVerts->setNum(0); @@ -235,7 +235,7 @@ void Texture3D(SoSeparator * root) SoMaterial * mat = new SoMaterial; mat->emissiveColor.setValue(1,1,1); root->addChild(mat); - + SoTransformerDragger * dragger = new SoTransformerDragger; dragger->scaleFactor.setValue(5,5,5); dragger->addValueChangedCallback(draggerCB, NULL); @@ -310,7 +310,7 @@ void LightManip(SoSeparator * root) } -} +} @@ -339,9 +339,9 @@ unsigned char bitmap[texturewidth*textureheight]; // int height - height of the bitmap // int mult - number to multiply each color by. // unsigned char * bmp - pointer to the bitmap -// int n - number of iterations +// int n - number of iterations void -julia(double crr, double cii, float zoom, int width, int height, int mult, +julia(double crr, double cii, float zoom, int width, int height, int mult, unsigned char * bmp, int n) { double zr, zr_old, zi; @@ -375,7 +375,7 @@ texture() return texture; } -// This function is called 20 times each second. +// This function is called 20 times each second. static void timersensorcallback(void * data, SoSensor *) { @@ -413,7 +413,7 @@ void AnimationTexture(SoSeparator * root) // Generate a julia set to use as a texturemap julia(global_cr, global_ci, 2.5, texturewidth, textureheight, 4, bitmap, 64); - + SoTexture2 * texnode = texture(); // Enable backface culling diff --git a/src/Gui/View3DInventorRiftViewer.cpp b/src/Gui/View3DInventorRiftViewer.cpp index 4e72573c0d..b0f50d79e2 100644 --- a/src/Gui/View3DInventorRiftViewer.cpp +++ b/src/Gui/View3DInventorRiftViewer.cpp @@ -36,7 +36,7 @@ View3DInventorRiftViewer::View3DInventorRiftViewer() : CoinRiftWidget() { workplace = new SoGroup(); - //translation = new SoTranslation ; + //translation = new SoTranslation ; //translation->translation.setValue(0,-1,0); //workplace->addChild(translation); @@ -56,26 +56,26 @@ View3DInventorRiftViewer::View3DInventorRiftViewer() : CoinRiftWidget() workplace->addChild(scale); ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Oculus"); - + this->setGeometry( hGrp->GetInt("RenderWindowPosX",100) , hGrp->GetInt("RenderWindowPosY",100) , hGrp->GetInt("RenderWindowSizeW",1920) , - hGrp->GetInt("RenderWindowSizeH",1080) + hGrp->GetInt("RenderWindowSizeH",1080) ); - + setBackgroundColor(SbColor(51,51,101)); basePosition = SbVec3f(0.0f, 0.5f, 0.8f); } //void saveWinPosition(void) //{ -// -// +// +// // //} -View3DInventorRiftViewer::~View3DInventorRiftViewer() +View3DInventorRiftViewer::~View3DInventorRiftViewer() { ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Oculus"); diff --git a/src/Gui/View3DInventorRiftViewer.h b/src/Gui/View3DInventorRiftViewer.h index 9991af9841..ed5ff528af 100644 --- a/src/Gui/View3DInventorRiftViewer.h +++ b/src/Gui/View3DInventorRiftViewer.h @@ -49,7 +49,7 @@ protected: }; -} //namespace Gui +} //namespace Gui #endif //BUILD_VR diff --git a/src/Gui/View3DInventorViewer.cpp b/src/Gui/View3DInventorViewer.cpp index 9ff80e2197..35cee0fdcd 100644 --- a/src/Gui/View3DInventorViewer.cpp +++ b/src/Gui/View3DInventorViewer.cpp @@ -745,7 +745,7 @@ void View3DInventorViewer::checkGroupOnTop(const SelectionChanges &Reason) { return; } if(Reason.Type == SelectionChanges::RmvPreselect || - Reason.Type == SelectionChanges::RmvPreselectSignal) + Reason.Type == SelectionChanges::RmvPreselectSignal) { SoSelectionElementAction action(SoSelectionElementAction::None,true); action.apply(pcGroupOnTopPreSel); @@ -863,12 +863,12 @@ void View3DInventorViewer::checkGroupOnTop(const SelectionChanges &Reason) { if(idx<0 || idx>=modeSwitch->getNumChildren() || modeSwitch->getChild(idx)!=childRoot) { - FC_LOG("skip " << obj->getFullName() << '.' << (subname?subname:"") + FC_LOG("skip " << obj->getFullName() << '.' << (subname?subname:"") << ", hidden inside geo group"); return; } if(childRoot->findChild(childVp->getRoot())<0) { - FC_LOG("cannot find '" << childVp->getObject()->getFullName() + FC_LOG("cannot find '" << childVp->getObject()->getFullName() << "' in geo group '" << grp->getNameInDocument() << "'"); break; } @@ -918,7 +918,7 @@ void View3DInventorViewer::onSelectionChanged(const SelectionChanges &_Reason) SelectionChanges Reason(_Reason); - if(Reason.pDocName && *Reason.pDocName && + if(Reason.pDocName && *Reason.pDocName && strcmp(getDocument()->getDocument()->getName(),Reason.pDocName)!=0) return; @@ -937,7 +937,7 @@ void View3DInventorViewer::onSelectionChanged(const SelectionChanges &_Reason) case SelectionChanges::RmvPreselect: case SelectionChanges::RmvPreselectSignal: case SelectionChanges::SetSelection: - case SelectionChanges::AddSelection: + case SelectionChanges::AddSelection: case SelectionChanges::RmvSelection: case SelectionChanges::ClrSelection: checkGroupOnTop(Reason); @@ -948,8 +948,8 @@ void View3DInventorViewer::onSelectionChanged(const SelectionChanges &_Reason) return; } - if(Reason.Type == SelectionChanges::RmvPreselect || - Reason.Type == SelectionChanges::RmvPreselectSignal) + if(Reason.Type == SelectionChanges::RmvPreselect || + Reason.Type == SelectionChanges::RmvPreselectSignal) { SoFCHighlightAction cAct(SelectionChanges::RmvPreselect); cAct.apply(pcViewProviderRoot); @@ -1045,7 +1045,7 @@ void View3DInventorViewer::setEditingTransform(const Base::Matrix4D &mat) { } void View3DInventorViewer::setupEditingRoot(SoNode *node, const Base::Matrix4D *mat) { - if(!editViewProvider) + if(!editViewProvider) return; resetEditingRoot(false); if(mat) @@ -1078,7 +1078,7 @@ void View3DInventorViewer::resetEditingRoot(bool updateLinks) } restoreEditingRoot = false; auto root = editViewProvider->getRoot(); - if(root->getNumChildren()) + if(root->getNumChildren()) FC_ERR("WARNING!!! Editing view provider root node is tampered"); root->addChild(editViewProvider->getTransformNode()); for(int i=1,count=pcEditingRoot->getNumChildren();isetMatrix(gm.getMatrix()); trans->ref(); - - // build a temporary scenegraph only keeping this viewproviders nodes and the accumulated + + // build a temporary scenegraph only keeping this viewproviders nodes and the accumulated // transformation SoSeparator* root = new SoSeparator; root->ref(); @@ -1168,7 +1168,7 @@ SoPickedPoint* View3DInventorViewer::getPointOnRay(const SbVec3f& pos,const SbVe { // Note: There seems to be a bug with setRay() which causes SoRayPickAction // to fail to get intersections between the ray and a line - + SoPath *path; if(vp == editViewProvider && pcEditingRoot->getNumChildren()>1) { path = new SoPath(1); @@ -1187,19 +1187,19 @@ SoPickedPoint* View3DInventorViewer::getPointOnRay(const SbVec3f& pos,const SbVe } SoGetMatrixAction gm(getSoRenderManager()->getViewportRegion()); gm.apply(path); - - // build a temporary scenegraph only keeping this viewproviders nodes and the accumulated + + // build a temporary scenegraph only keeping this viewproviders nodes and the accumulated // transformation SoTransform* trans = new SoTransform; trans->ref(); trans->setMatrix(gm.getMatrix()); - + SoSeparator* root = new SoSeparator; root->ref(); root->addChild(getSoRenderManager()->getCamera()); root->addChild(trans); root->addChild(path->getTail()); - + //get the picked point SoRayPickAction rp(getSoRenderManager()->getViewportRegion()); rp.setRay(pos,dir); @@ -2751,7 +2751,7 @@ void View3DInventorViewer::toggleClippingPlane(int toggle, bool beforeEditing, pcClipPlane->ref(); if(beforeEditing) pcViewProviderRoot->insertChild(pcClipPlane,0); - else + else pcViewProviderRoot->insertChild(pcClipPlane,pcViewProviderRoot->findChild(pcEditingRoot)+1); } diff --git a/src/Gui/View3DInventorViewer.h b/src/Gui/View3DInventorViewer.h index ff41435d36..c690b54346 100644 --- a/src/Gui/View3DInventorViewer.h +++ b/src/Gui/View3DInventorViewer.h @@ -78,7 +78,7 @@ class ViewerEventFilter; class GuiExport View3DInventorViewer : public Quarter::SoQTQuarterAdaptor, public SelectionObserver { typedef Quarter::SoQTQuarterAdaptor inherited; - + public: /// Pick modes for picking points in the scene enum SelectionMode { @@ -102,7 +102,7 @@ public: DisallowZooming=32,/**< switch off the zooming. */ }; //@} - + /** @name Anti-Aliasing modes of the rendered 3D scene * Specifies Anti-Aliasing (AA) method * - Smoothing enables OpenGL line and vertex smoothing (basically deprecated) @@ -131,7 +131,7 @@ public: View3DInventorViewer (QWidget *parent, const QtGLWidget* sharewidget = 0); View3DInventorViewer (const QtGLFormat& format, QWidget *parent, const QtGLWidget* sharewidget = 0); virtual ~View3DInventorViewer(); - + void init(); /// Observer message from the Selection @@ -229,7 +229,7 @@ public: void saveGraphic(int pagesize, const QColor&, SoVectorizeAction* va) const; //@} /** - * Writes the current scenegraph to an Inventor file, either in ascii or binary. + * Writes the current scenegraph to an Inventor file, either in ascii or binary. */ bool dumpToFile(SoNode* node, const char* filename, bool binary) const; @@ -244,7 +244,7 @@ public: void setSelectionEnabled(const SbBool enable); SbBool isSelectionEnabled(void) const; //@} - + /// Returns the screen coordinates of the origin of the path's tail object /*! Return value is in floating-point pixels, origin at bottom-left. */ SbVec2f screenCoordsOfPath(SoPath *path) const; @@ -272,8 +272,8 @@ public: //@} /** - * Set up a callback function \a cb which will be invoked for the given eventtype. - * \a userdata will be given as the first argument to the callback function. + * Set up a callback function \a cb which will be invoked for the given eventtype. + * \a userdata will be given as the first argument to the callback function. */ void addEventCallback(SoType eventtype, SoEventCallbackCB * cb, void* userdata = 0); /** @@ -292,7 +292,7 @@ public: /** Returns the up direction */ SbVec3f getUpDirection() const; /** Returns the orientation of the camera. */ - SbRotation getCameraOrientation() const; + SbRotation getCameraOrientation() const; /** Returns the 3d point on the focal plane to the given 2d point. */ SbVec3f getPointOnScreen(const SbVec2s&) const; /** Returns the near plane represented by its normal and base point. */ @@ -300,7 +300,7 @@ public: /** Returns the far plane represented by its normal and base point. */ void getFarPlane(SbVec3f& rcPt, SbVec3f& rcNormal) const; /** Adds or remove a manipulator to/from the scenegraph. */ - void toggleClippingPlane(int toggle=-1, bool beforeEditing=false, + void toggleClippingPlane(int toggle=-1, bool beforeEditing=false, bool noManip=false, const Base::Placement &pla = Base::Placement()); /** Checks whether a clipping plane is set or not. */ bool hasClippingPlane() const; @@ -309,7 +309,7 @@ public: /** Project the given normalized 2d point onto the far plane */ SbVec3f projectOnFarPlane(const SbVec2f&) const; //@} - + /** @name Dimension controls * the "turn*" functions are wired up to parameter groups through view3dinventor. * don't call them directly. instead set the parameter groups. @@ -335,8 +335,8 @@ public: void setCameraOrientation(const SbRotation& rot, SbBool moveTocenter=false); void setCameraType(SoType t); void moveCameraTo(const SbRotation& rot, const SbVec3f& pos, int steps, int ms); - /** - * Zooms the viewport to the size of the bounding box. + /** + * Zooms the viewport to the size of the bounding box. */ void boxZoom(const SbBox2s&); /** @@ -349,7 +349,7 @@ public: void viewVR(void); /** - * Reposition the current camera so we can see all selected objects + * Reposition the current camera so we can see all selected objects * of the scene. Therefore we search for all SOFCSelection nodes, if * none of them is selected nothing happens. */ @@ -366,7 +366,7 @@ public: void setAxisCross(bool b); bool hasAxisCross(void); - + void setEnabledFPSCounter(bool b); void setEnabledNaviCube(bool b); bool isEnabledNaviCube(void) const; @@ -467,7 +467,7 @@ private: // big one in the middle SoShapeScale* axisCross; SoGroup* axisGroup; - + //stuff needed to draw the fps counter bool fpsEnabled; bool vboEnabled; @@ -480,9 +480,9 @@ private: std::string overrideMode; Gui::Document* guiDocument = nullptr; - + ViewerEventFilter* viewerEventFilter; - + PyObject *_viewerPy; // friends diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp index 1c7f1d987d..18cf5985ec 100644 --- a/src/Gui/View3DPy.cpp +++ b/src/Gui/View3DPy.cpp @@ -295,7 +295,7 @@ Py::Object View3DInventorPy::message(const Py::Tuple& args) { const char **ppReturn = 0; char *psMsgStr; - if (!PyArg_ParseTuple(args.ptr(), "s;Message string needed (string)",&psMsgStr)) // convert args: Python->C + if (!PyArg_ParseTuple(args.ptr(), "s;Message string needed (string)",&psMsgStr)) // convert args: Python->C throw Py::Exception(); try { @@ -1100,8 +1100,8 @@ Py::Object View3DInventorPy::getViewDirection(const Py::Tuple& args) Py::Object View3DInventorPy::setViewDirection(const Py::Tuple& args) { PyObject* object; - if (!PyArg_ParseTuple(args.ptr(), "O", &object)) - throw Py::Exception(); + if (!PyArg_ParseTuple(args.ptr(), "O", &object)) + throw Py::Exception(); try { if (PyTuple_Check(object)) { @@ -1182,7 +1182,7 @@ Py::Object View3DInventorPy::getCameraType(const Py::Tuple& args) Py::Object View3DInventorPy::setCameraType(const Py::Tuple& args) { int cameratype=-1; - if (!PyArg_ParseTuple(args.ptr(), "i", &cameratype)) { // convert args: Python->C + if (!PyArg_ParseTuple(args.ptr(), "i", &cameratype)) { // convert args: Python->C char* modename; PyErr_Clear(); if (!PyArg_ParseTuple(args.ptr(), "s", &modename)) @@ -1259,7 +1259,7 @@ Py::Object View3DInventorPy::dump(const Py::Tuple& args) Py::Object View3DInventorPy::dumpNode(const Py::Tuple& args) { PyObject* object; - if (!PyArg_ParseTuple(args.ptr(), "O", &object)) // convert args: Python->C + if (!PyArg_ParseTuple(args.ptr(), "O", &object)) // convert args: Python->C throw Py::Exception(); void* ptr = 0; @@ -1387,7 +1387,7 @@ Py::Object View3DInventorPy::getObjectInfo(const Py::Tuple& args) try { //Note: For gcc (4.2) we need the 'const' keyword to avoid the compiler error: //conversion from 'Py::seqref' to non-scalar type 'Py::Int' requested - //We should report this problem to the PyCXX project as in the documentation an + //We should report this problem to the PyCXX project as in the documentation an //example without the 'const' keyword is used. //Or we can also write Py::Int x(tuple[0]); const Py::Tuple tuple(object); @@ -1494,7 +1494,7 @@ Py::Object View3DInventorPy::getObjectsInfo(const Py::Tuple& args) try { //Note: For gcc (4.2) we need the 'const' keyword to avoid the compiler error: //conversion from 'Py::seqref' to non-scalar type 'Py::Int' requested - //We should report this problem to the PyCXX project as in the documentation an + //We should report this problem to the PyCXX project as in the documentation an //example without the 'const' keyword is used. //Or we can also write Py::Int x(tuple[0]); const Py::Tuple tuple(object); @@ -2287,7 +2287,7 @@ Py::Object View3DInventorPy::addEventCallbackPivy(const Py::Tuple& args) throw Py::TypeError("object is not callable"); } - SoEventCallbackCB* callback = (ex == 1 ? + SoEventCallbackCB* callback = (ex == 1 ? View3DInventorPy::eventCallbackPivyEx : View3DInventorPy::eventCallbackPivy); _view->getViewer()->addEventCallback(*eventId, callback, method); @@ -2329,7 +2329,7 @@ Py::Object View3DInventorPy::removeEventCallbackPivy(const Py::Tuple& args) throw Py::TypeError("object is not callable"); } - SoEventCallbackCB* callback = (ex == 1 ? + SoEventCallbackCB* callback = (ex == 1 ? View3DInventorPy::eventCallbackPivyEx : View3DInventorPy::eventCallbackPivy); _view->getViewer()->removeEventCallback(*eventId, callback, method); @@ -2515,7 +2515,7 @@ Py::Object View3DInventorPy::getActiveObject(const Py::Tuple& args) PyObject *resolve = Py_True; if (!PyArg_ParseTuple(args.ptr(), "s|O", &name,&resolve)) throw Py::Exception(); - + App::DocumentObject *parent = 0; std::string subname; App::DocumentObject* obj = _view->getActiveObject(name,&parent,&subname); @@ -2526,8 +2526,8 @@ Py::Object View3DInventorPy::getActiveObject(const Py::Tuple& args) return Py::asObject(obj->getPyObject()); return Py::TupleN( - Py::asObject(obj->getPyObject()), - Py::asObject(parent->getPyObject()), + Py::asObject(obj->getPyObject()), + Py::asObject(parent->getPyObject()), Py::String(subname.c_str())); } diff --git a/src/Gui/View3DViewerPy.cpp b/src/Gui/View3DViewerPy.cpp index e1a86fb7c7..b134b15a08 100644 --- a/src/Gui/View3DViewerPy.cpp +++ b/src/Gui/View3DViewerPy.cpp @@ -260,7 +260,7 @@ Py::Object View3DInventorViewerPy::seekToPoint(const Py::Tuple& args) else { Py::Int x(tuple[0]); Py::Int y(tuple[1]); - + SbVec2s hitpoint ((long)x,(long)y); _viewer->seekToPoint(hitpoint); } @@ -276,7 +276,7 @@ Py::Object View3DInventorViewerPy::setFocalDistance(const Py::Tuple& args) { float distance; if (!PyArg_ParseTuple(args.ptr(), "f", &distance)) - throw Py::Exception(); + throw Py::Exception(); try { SoCamera* cam = _viewer->getSoRenderManager()->getCamera(); @@ -295,7 +295,7 @@ Py::Object View3DInventorViewerPy::setFocalDistance(const Py::Tuple& args) catch(...) { throw Py::RuntimeError("Unknown C++ exception"); } - + return Py::None(); } @@ -303,7 +303,7 @@ Py::Object View3DInventorViewerPy::getFocalDistance(const Py::Tuple& args) { if (!PyArg_ParseTuple(args.ptr(), "")) throw Py::Exception(); - + try { double d = _viewer->getSoRenderManager()->getCamera()->focalDistance.getValue(); return Py::Float(d); diff --git a/src/Gui/View3DViewerPy.h b/src/Gui/View3DViewerPy.h index 0832f568bf..0418d8bd8a 100644 --- a/src/Gui/View3DViewerPy.h +++ b/src/Gui/View3DViewerPy.h @@ -34,11 +34,11 @@ class View3DInventorViewer; /** * @brief Python interface for View3DInventorViewer - * + * * The interface does not offer all methods the c++ View3DInventorViewer counterpart has, respectively - * also not everything the QuarterWidget and the SoQtQuarterAdaptor offers. It only exposes + * also not everything the QuarterWidget and the SoQtQuarterAdaptor offers. It only exposes * methods with additioanl functionality in comparison to the View3DInventorPy class. Everything that - * can be done from there has no interface here. + * can be done from there has no interface here. */ class View3DInventorViewerPy : public Py::PythonExtension { diff --git a/src/Gui/ViewParams.cpp b/src/Gui/ViewParams.cpp index d0082c2571..248d02c5f7 100644 --- a/src/Gui/ViewParams.cpp +++ b/src/Gui/ViewParams.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/ViewParams.h b/src/Gui/ViewParams.h index 92ac24dd72..cee80eb4fa 100644 --- a/src/Gui/ViewParams.h +++ b/src/Gui/ViewParams.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2018 Zheng, Lei (realthunder) * + * Copyright (c) 2018 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -28,7 +28,7 @@ namespace Gui { -/** Convenient class to obtain view provider related parameters +/** Convenient class to obtain view provider related parameters * * The parameters are under group "User parameter:BaseApp/Preferences/View" */ diff --git a/src/Gui/ViewProvider.cpp b/src/Gui/ViewProvider.cpp index d8895df849..ba98ea4d16 100644 --- a/src/Gui/ViewProvider.cpp +++ b/src/Gui/ViewProvider.cpp @@ -757,7 +757,7 @@ void ViewProvider::dropObject(App::DocumentObject* obj) { throw Base::RuntimeError("ViewProvider::dropObject: no extension for dropping given object available."); } -bool ViewProvider::canDropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, +bool ViewProvider::canDropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, const char *subname, const std::vector &elements) const { auto vector = getExtensionsDerivedFromType(); @@ -768,8 +768,8 @@ bool ViewProvider::canDropObjectEx(App::DocumentObject* obj, App::DocumentObject return canDropObject(obj); } -std::string ViewProvider::dropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, - const char *subname, const std::vector &elements) +std::string ViewProvider::dropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, + const char *subname, const std::vector &elements) { auto vector = getExtensionsDerivedFromType(); for(Gui::ViewProviderExtension* ext : vector) { @@ -924,7 +924,7 @@ int ViewProvider::partialRender(const std::vector &elements, bool c action.setSecondary(true); for(auto element : elements) { bool hidden = hasHiddenMarker(element.c_str()); - if(hidden) + if(hidden) element.resize(element.size()-hiddenMarker().size()); path->truncate(0); SoDetail *det = 0; @@ -934,7 +934,7 @@ int ViewProvider::partialRender(const std::vector &elements, bool c continue; } FC_LOG("partial render (" << path->getLength() << "): " << element); - if(!hidden) + if(!hidden) action.setType(clear?SoSelectionElementAction::Remove:SoSelectionElementAction::Append); else action.setType(clear?SoSelectionElementAction::Show:SoSelectionElementAction::Hide); diff --git a/src/Gui/ViewProvider.h b/src/Gui/ViewProvider.h index 1b68137fd7..4ca3c483a8 100644 --- a/src/Gui/ViewProvider.h +++ b/src/Gui/ViewProvider.h @@ -83,7 +83,7 @@ enum ViewStatus { }; -/** Convenience smart pointer to wrap coin node. +/** Convenience smart pointer to wrap coin node. * * It is basically boost::intrusive plus implicit pointer conversion to save the * trouble of typing get() all the time. @@ -173,7 +173,7 @@ public: * @param subname: dot separated string reference to the sub element * @param pPath: output coin path leading to the returned element detail * @param append: If true, pPath will be first appended with the root node and - * the mode switch node of this view provider. + * the mode switch node of this view provider. * * @return the coint detail of the subelement * @@ -276,7 +276,7 @@ public: virtual bool canDragAndDropObject(App::DocumentObject*) const; /** Add an object to the view provider by drag and drop */ virtual void dropObject(App::DocumentObject*); - /** Query object dropping with full quanlified name + /** Query object dropping with full quanlified name * * Tree view now calls this function instead of canDropObject(), and may * query for objects from other document. The default implementation @@ -298,7 +298,7 @@ public: * * @return Return whether the dropping action is allowed. * */ - virtual bool canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, + virtual bool canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, const char *subname, const std::vector &elements) const; /// return a subname referencing the sub-object holding the dropped objects @@ -322,7 +322,7 @@ public: * object, which may or may not be the actual dropped object, e.g. it may be * a link. */ - virtual std::string dropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, + virtual std::string dropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, const char *subname, const std::vector &elements); /** Replace an object to the view provider by drag and drop * @@ -393,7 +393,7 @@ public: const std::string getOverrideMode(); //@} - /** @name Color management methods + /** @name Color management methods */ //@{ virtual std::map getElementColors(const char *element=0) const { @@ -507,7 +507,7 @@ public: void setDefaultMode(int); int getDefaultMode() const; //@} - + virtual void setRenderCacheMode(int); protected: diff --git a/src/Gui/ViewProviderAnnotation.cpp b/src/Gui/ViewProviderAnnotation.cpp index 7859dc7c37..17825d5364 100644 --- a/src/Gui/ViewProviderAnnotation.cpp +++ b/src/Gui/ViewProviderAnnotation.cpp @@ -68,7 +68,7 @@ const char* ViewProviderAnnotation::RotationAxisEnums[]= {"X","Y","Z",NULL}; PROPERTY_SOURCE(Gui::ViewProviderAnnotation, Gui::ViewProviderDocumentObject) -ViewProviderAnnotation::ViewProviderAnnotation() +ViewProviderAnnotation::ViewProviderAnnotation() { ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); unsigned long col = hGrp->GetUnsigned("AnnotationTextColor",4294967295UL); // light grey @@ -191,7 +191,7 @@ void ViewProviderAnnotation::attach(App::DocumentObject* f) SoAnnotation* anno3d = new SoAnnotation(); SoFCSelection* textsep = new SoFCSelection(); - + // set selection/highlight colors float transparency; ParameterGrp::handle hGrp = Gui::WindowParameter::getDefaultParameter()->GetGroup("View"); @@ -217,11 +217,11 @@ void ViewProviderAnnotation::attach(App::DocumentObject* f) textsep->addChild(pLabel); SoFCSelection* textsep3d = new SoFCSelection(); - + // set sel/highlight color here too textsep3d->colorHighlight.setValue(highlightColor); textsep3d->colorSelection.setValue(selectionColor); - + textsep3d->objectName = pcObject->getNameInDocument(); textsep3d->documentName = pcObject->getDocument()->getName(); textsep3d->subElementName = "Main"; @@ -240,7 +240,7 @@ void ViewProviderAnnotation::attach(App::DocumentObject* f) void ViewProviderAnnotation::updateData(const App::Property* prop) { - if (prop->getTypeId() == App::PropertyStringList::getClassTypeId() && + if (prop->getTypeId() == App::PropertyStringList::getClassTypeId() && strcmp(prop->getName(),"LabelText") == 0) { const std::vector lines = static_cast(prop)->getValues(); int index=0; @@ -278,7 +278,7 @@ const char* ViewProviderAnnotationLabel::JustificationEnums[]= {"Left","Right"," PROPERTY_SOURCE(Gui::ViewProviderAnnotationLabel, Gui::ViewProviderDocumentObject) -ViewProviderAnnotationLabel::ViewProviderAnnotationLabel() +ViewProviderAnnotationLabel::ViewProviderAnnotationLabel() { ADD_PROPERTY(TextColor,(1.0f,1.0f,1.0f)); ADD_PROPERTY(BackgroundColor,(0.0f,0.333f,1.0f)); @@ -381,7 +381,7 @@ void ViewProviderAnnotationLabel::attach(App::DocumentObject* f) void ViewProviderAnnotationLabel::updateData(const App::Property* prop) { - if (prop->getTypeId() == App::PropertyStringList::getClassTypeId() && + if (prop->getTypeId() == App::PropertyStringList::getClassTypeId() && strcmp(prop->getName(),"LabelText") == 0) { drawImage(static_cast(prop)->getValues()); } @@ -435,7 +435,7 @@ void ViewProviderAnnotationLabel::dragMotionCallback(void *data, SoDragger *drag bool ViewProviderAnnotationLabel::setEdit(int ModNum) { - Q_UNUSED(ModNum); + Q_UNUSED(ModNum); SoSearchAction sa; sa.setInterest(SoSearchAction::FIRST); sa.setSearchingAll(false); @@ -456,7 +456,7 @@ bool ViewProviderAnnotationLabel::setEdit(int ModNum) void ViewProviderAnnotationLabel::unsetEdit(int ModNum) { - Q_UNUSED(ModNum); + Q_UNUSED(ModNum); SoSearchAction sa; sa.setType(TranslateManip::getClassTypeId()); sa.setInterest(SoSearchAction::FIRST); diff --git a/src/Gui/ViewProviderBuilder.cpp b/src/Gui/ViewProviderBuilder.cpp index 99385a814a..58b8bd54d7 100644 --- a/src/Gui/ViewProviderBuilder.cpp +++ b/src/Gui/ViewProviderBuilder.cpp @@ -36,7 +36,7 @@ using namespace Gui; std::map ViewProviderBuilder::_prop_to_view; -ViewProviderBuilder::ViewProviderBuilder() +ViewProviderBuilder::ViewProviderBuilder() { } @@ -93,7 +93,7 @@ Gui::SoFCSelection* ViewProviderBuilder::createSelection() // -------------------------------------- -ViewProviderColorBuilder::ViewProviderColorBuilder() +ViewProviderColorBuilder::ViewProviderColorBuilder() { } diff --git a/src/Gui/ViewProviderDocumentObject.cpp b/src/Gui/ViewProviderDocumentObject.cpp index 5ae249139c..0230117675 100644 --- a/src/Gui/ViewProviderDocumentObject.cpp +++ b/src/Gui/ViewProviderDocumentObject.cpp @@ -74,11 +74,11 @@ ViewProviderDocumentObject::ViewProviderDocumentObject() { static const char *dogroup = "Display Options"; static const char *sgroup = "Selection"; - + ADD_PROPERTY_TYPE(DisplayMode, ((long)0), dogroup, App::Prop_None, "Set the display mode"); ADD_PROPERTY_TYPE(Visibility, (true), dogroup, App::Prop_None, "Show the object in the 3d view"); ADD_PROPERTY_TYPE(ShowInTree, (true), dogroup, App::Prop_None, "Show the object in the tree view"); - + ADD_PROPERTY_TYPE(SelectionStyle, ((long)0), sgroup, App::Prop_None, "Set the object selection style"); static const char *SelectionStyleEnum[] = {"Shape","BoundBox",0}; SelectionStyle.setEnums(SelectionStyleEnum); @@ -188,7 +188,7 @@ void ViewProviderDocumentObject::onChanged(const App::Property* prop) Visibility.setStatus(App::Property::User2, false); } if (!Visibility.testStatus(App::Property::User1) - && getObject() + && getObject() && getObject()->Visibility.getValue()!=Visibility.getValue()) { // Changing the visibility of a document object will automatically set @@ -483,7 +483,7 @@ PyObject* ViewProviderDocumentObject::getPyObject() return pyViewObject; } -bool ViewProviderDocumentObject::canDropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, +bool ViewProviderDocumentObject::canDropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, const char *subname, const std::vector &elements) const { auto vector = getExtensionsDerivedFromType(); @@ -504,7 +504,7 @@ int ViewProviderDocumentObject::replaceObject( { FC_THROWM(Base::RuntimeError,"Invalid object"); } - + auto obj = getObject(); if(!obj || !obj->getNameInDocument()) FC_THROWM(Base::RuntimeError,"View provider not attached"); @@ -570,7 +570,7 @@ bool ViewProviderDocumentObject::getElementPicked(const SoPickedPoint *pp, std:: auto childRoot = getChildRoot(); int idx; - if(!childRoot || + if(!childRoot || (idx=pcModeSwitch->whichChild.getValue())<0 || pcModeSwitch->getChild(idx)!=childRoot) { @@ -619,7 +619,7 @@ bool ViewProviderDocumentObject::getDetailPath(const char *subname, SoFullPath * if(!vp) return false; auto childRoot = getChildRoot(); - if(!childRoot) + if(!childRoot) path->truncate(len); else { auto idx = pcModeSwitch->whichChild.getValue(); @@ -638,7 +638,7 @@ bool ViewProviderDocumentObject::getDetailPath(const char *subname, SoFullPath * } void ViewProviderDocumentObject::onPropertyStatusChanged( - const App::Property &prop, unsigned long oldStatus) + const App::Property &prop, unsigned long oldStatus) { (void)oldStatus; if(!App::Document::isAnyRestoring() && pcObject && pcObject->getDocument()) diff --git a/src/Gui/ViewProviderDocumentObject.h b/src/Gui/ViewProviderDocumentObject.h index d809814138..3af4173d13 100644 --- a/src/Gui/ViewProviderDocumentObject.h +++ b/src/Gui/ViewProviderDocumentObject.h @@ -78,7 +78,7 @@ public: /// If null is returned then no transaction will be opened. virtual const char* getTransactionText() const override; - virtual bool canDropObjectEx(App::DocumentObject *, App::DocumentObject *, + virtual bool canDropObjectEx(App::DocumentObject *, App::DocumentObject *, const char *, const std::vector &) const override; virtual int replaceObject(App::DocumentObject*, App::DocumentObject*) override; @@ -131,7 +131,7 @@ public: /** Return the linked view object * * This function is mainly used for GUI navigation (e.g. - * StdCmdLinkSelectLinked). + * StdCmdLinkSelectLinked). * * @param subname: output as the subname referencing the linked object * @param recursive: whether to follow the link recursively @@ -185,7 +185,7 @@ protected: * is part of the same document as the object this view provider is * attached to for an front root of \a type. * Before calling this function this view provider has to be attached - * to an object. The method returns after the first front root node + * to an object. The method returns after the first front root node * matches. If no front root node matches, 0 is returned. */ SoNode* findFrontRootOfType(const SoType& type) const; diff --git a/src/Gui/ViewProviderDocumentObjectGroup.cpp b/src/Gui/ViewProviderDocumentObjectGroup.cpp index 6256a96381..711ec667a9 100644 --- a/src/Gui/ViewProviderDocumentObjectGroup.cpp +++ b/src/Gui/ViewProviderDocumentObjectGroup.cpp @@ -84,7 +84,7 @@ QIcon ViewProviderDocumentObjectGroup::getIcon(void) const } /** - * Extracts the associated view providers of the objects of the associated object group group. + * Extracts the associated view providers of the objects of the associated object group group. */ void ViewProviderDocumentObjectGroup::getViewProviders(std::vector& vp) const { diff --git a/src/Gui/ViewProviderDocumentObjectGroup.h b/src/Gui/ViewProviderDocumentObjectGroup.h index 2b853fab99..f78cd676a4 100644 --- a/src/Gui/ViewProviderDocumentObjectGroup.h +++ b/src/Gui/ViewProviderDocumentObjectGroup.h @@ -31,7 +31,7 @@ namespace Gui { -class GuiExport ViewProviderDocumentObjectGroup : public ViewProviderDocumentObject, +class GuiExport ViewProviderDocumentObjectGroup : public ViewProviderDocumentObject, public ViewProviderGroupExtension { PROPERTY_HEADER_WITH_EXTENSIONS(Gui::ViewProviderDocumentObjectGroup); diff --git a/src/Gui/ViewProviderDocumentObjectPyImp.cpp b/src/Gui/ViewProviderDocumentObjectPyImp.cpp index 8d3d299aef..0dba4eff87 100644 --- a/src/Gui/ViewProviderDocumentObjectPyImp.cpp +++ b/src/Gui/ViewProviderDocumentObjectPyImp.cpp @@ -48,8 +48,8 @@ std::string ViewProviderDocumentObjectPy::representation(void) const PyObject* ViewProviderDocumentObjectPy::update(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { getViewProviderDocumentObjectPtr()->updateView(); Py_Return; @@ -73,7 +73,7 @@ void ViewProviderDocumentObjectPy::setObject(Py::Object pyobj) static_cast(*pyobj)->getDocumentObjectPtr()); } -Py::Boolean ViewProviderDocumentObjectPy::getForceUpdate() const +Py::Boolean ViewProviderDocumentObjectPy::getForceUpdate() const { return Py::Boolean(getViewProviderDocumentObjectPtr()->isUpdateForced()); } @@ -96,5 +96,5 @@ PyObject *ViewProviderDocumentObjectPy::getCustomAttributes(const char* /*attr*/ int ViewProviderDocumentObjectPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Gui/ViewProviderDragger.cpp b/src/Gui/ViewProviderDragger.cpp index 4ac792ee86..dbaff82b63 100644 --- a/src/Gui/ViewProviderDragger.cpp +++ b/src/Gui/ViewProviderDragger.cpp @@ -39,9 +39,9 @@ # include # include # include -# include +# include # include -# include +# include #endif /// Here the FreeCAD includes sorted by Base,App,Gui...... @@ -126,7 +126,7 @@ bool ViewProviderDragger::checkLink() { ViewProviderDocumentObject *vpParent = 0; std::string subname; auto doc = Application::Instance->editDocument(); - if(!doc) + if(!doc) return false; doc->getInEdit(&vpParent,&subname); if(!vpParent) @@ -158,29 +158,29 @@ bool ViewProviderDragger::setEdit(int ModNum) SoTransform *tempTransform = new SoTransform(); tempTransform->ref(); updateTransform(placement, tempTransform); - + assert(!csysDragger); csysDragger = new SoFCCSysDragger(); csysDragger->draggerSize.setValue(0.05f); csysDragger->translation.setValue(tempTransform->translation.getValue()); csysDragger->rotation.setValue(tempTransform->rotation.getValue()); - + tempTransform->unref(); - + pcTransform->translation.connectFrom(&csysDragger->translation); pcTransform->rotation.connectFrom(&csysDragger->rotation); - + csysDragger->addStartCallback(dragStartCallback, this); csysDragger->addFinishCallback(dragFinishCallback, this); - + // dragger node is added to viewer's editing root in setEditViewer // pcRoot->insertChild(csysDragger, 0); csysDragger->ref(); - + TaskCSysDragger *task = new TaskCSysDragger(this, csysDragger); Gui::Control().showDialog(task); } - + return true; } @@ -192,7 +192,7 @@ void ViewProviderDragger::unsetEdit(int ModNum) { pcTransform->translation.disconnect(&csysDragger->translation); pcTransform->rotation.disconnect(&csysDragger->rotation); - + // dragger node is added to viewer's editing root in setEditViewer // pcRoot->removeChild(csysDragger); //should delete csysDragger csysDragger->unref(); @@ -245,11 +245,11 @@ void ViewProviderDragger::dragStartCallback(void *, SoDragger *) void ViewProviderDragger::dragFinishCallback(void *data, SoDragger *d) { // This is called when a manipulator has done manipulating - + ViewProviderDragger* sudoThis = reinterpret_cast(data); SoFCCSysDragger *dragger = static_cast(d); updatePlacementFromDragger(sudoThis, dragger); - + Gui::Application::Instance->activeDocument()->commitCommand(); } @@ -263,7 +263,7 @@ void ViewProviderDragger::updatePlacementFromDragger(ViewProviderDragger* sudoTh double pMatrix[16]; originalPlacement.toMatrix().getMatrix(pMatrix); Base::Placement freshPlacement = originalPlacement; - + //local cache for brevity. double translationIncrement = draggerIn->translationIncrement.getValue(); double rotationIncrement = draggerIn->rotationIncrement.getValue(); @@ -273,7 +273,7 @@ void ViewProviderDragger::updatePlacementFromDragger(ViewProviderDragger* sudoTh int rCountX = draggerIn->rotationIncrementCountX.getValue(); int rCountY = draggerIn->rotationIncrementCountY.getValue(); int rCountZ = draggerIn->rotationIncrementCountZ.getValue(); - + //just as a little sanity check make sure only 1 field has changed. int numberOfFieldChanged = 0; if (tCountX) numberOfFieldChanged++; @@ -285,12 +285,12 @@ void ViewProviderDragger::updatePlacementFromDragger(ViewProviderDragger* sudoTh if (numberOfFieldChanged == 0) return; assert(numberOfFieldChanged == 1); - + //helper lamdas. auto getVectorX = [&pMatrix]() {return Base::Vector3d(pMatrix[0], pMatrix[4], pMatrix[8]);}; auto getVectorY = [&pMatrix]() {return Base::Vector3d(pMatrix[1], pMatrix[5], pMatrix[9]);}; auto getVectorZ = [&pMatrix]() {return Base::Vector3d(pMatrix[2], pMatrix[6], pMatrix[10]);}; - + if (tCountX) { Base::Vector3d movementVector(getVectorX()); @@ -333,7 +333,7 @@ void ViewProviderDragger::updatePlacementFromDragger(ViewProviderDragger* sudoTh freshPlacement.setRotation(rotation * freshPlacement.getRotation()); geoFeature->Placement.setValue(freshPlacement); } - + draggerIn->clearIncrementCounts(); } diff --git a/src/Gui/ViewProviderDragger.h b/src/Gui/ViewProviderDragger.h index 80119d78c8..e8f247ff35 100644 --- a/src/Gui/ViewProviderDragger.h +++ b/src/Gui/ViewProviderDragger.h @@ -74,7 +74,7 @@ protected: private: static void dragStartCallback(void * data, SoDragger * d); static void dragFinishCallback(void * data, SoDragger * d); - + static void updatePlacementFromDragger(ViewProviderDragger *sudoThis, SoFCCSysDragger *draggerIn); bool checkLink(); diff --git a/src/Gui/ViewProviderExtension.cpp b/src/Gui/ViewProviderExtension.cpp index b68e5f2378..047b3cedca 100644 --- a/src/Gui/ViewProviderExtension.cpp +++ b/src/Gui/ViewProviderExtension.cpp @@ -35,7 +35,7 @@ using namespace Gui; EXTENSION_PROPERTY_SOURCE(Gui::ViewProviderExtension, App::Extension) -ViewProviderExtension::ViewProviderExtension() +ViewProviderExtension::ViewProviderExtension() { initExtensionType(Gui::ViewProviderExtension::getExtensionClassTypeId()); } @@ -47,13 +47,13 @@ ViewProviderExtension::~ViewProviderExtension() const ViewProviderDocumentObject* ViewProviderExtension::getExtendedViewProvider() const{ - assert(getExtendedContainer()->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())); + assert(getExtendedContainer()->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())); return static_cast(getExtendedContainer()); } ViewProviderDocumentObject* ViewProviderExtension::getExtendedViewProvider() { - assert(getExtendedContainer()->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())); + assert(getExtendedContainer()->isDerivedFrom(ViewProviderDocumentObject::getClassTypeId())); return static_cast(getExtendedContainer()); } diff --git a/src/Gui/ViewProviderExtension.h b/src/Gui/ViewProviderExtension.h index 4d195e9bae..49549a00fb 100644 --- a/src/Gui/ViewProviderExtension.h +++ b/src/Gui/ViewProviderExtension.h @@ -54,8 +54,8 @@ public: virtual bool extensionOnDelete(const std::vector &){ return true;} virtual void extensionBeforeDelete(){} - - virtual std::vector extensionClaimChildren(void) const { + + virtual std::vector extensionClaimChildren(void) const { return std::vector(); } virtual bool extensionCanDragObjects() const { return false; } @@ -65,14 +65,14 @@ public: virtual bool extensionCanDropObject(App::DocumentObject*) const { return true; } virtual bool extensionCanDragAndDropObject(App::DocumentObject*) const { return true; } virtual void extensionDropObject(App::DocumentObject*) { } - virtual bool extensionCanDropObjectEx(App::DocumentObject *, App::DocumentObject *, + virtual bool extensionCanDropObjectEx(App::DocumentObject *, App::DocumentObject *, const char *, const std::vector &) const { return false; } - virtual std::string extensionDropObjectEx(App::DocumentObject *obj, App::DocumentObject *, - const char *, const std::vector &) + virtual std::string extensionDropObjectEx(App::DocumentObject *obj, App::DocumentObject *, + const char *, const std::vector &) { extensionDropObject(obj); return std::string(); } - virtual int extensionReplaceObject(App::DocumentObject* /*oldValue*/, App::DocumentObject* /*newValue*/) + virtual int extensionReplaceObject(App::DocumentObject* /*oldValue*/, App::DocumentObject* /*newValue*/) { return -1; } /// Hides the view provider @@ -108,7 +108,7 @@ public: virtual bool extensionGetElementPicked(const SoPickedPoint *, std::string &) const {return false;} virtual bool extensionGetDetailPath(const char *, SoFullPath *, SoDetail *&) const {return false;} - + private: bool m_ignoreOverlayIcon = false; //Gui::ViewProviderDocumentObject* m_viewBase = nullptr; diff --git a/src/Gui/ViewProviderExtern.cpp b/src/Gui/ViewProviderExtern.cpp index eb917a214a..54fbae5d88 100644 --- a/src/Gui/ViewProviderExtern.cpp +++ b/src/Gui/ViewProviderExtern.cpp @@ -115,7 +115,7 @@ void ViewProviderExtern::setModeBySoInput(const char* name, SoInput &ivFileInput else { throw Base::RuntimeError("No valid Inventor input"); } - + return; } diff --git a/src/Gui/ViewProviderFeature.cpp b/src/Gui/ViewProviderFeature.cpp index 0cf8496e70..1615b324a4 100644 --- a/src/Gui/ViewProviderFeature.cpp +++ b/src/Gui/ViewProviderFeature.cpp @@ -25,12 +25,12 @@ #ifndef _PreComp_ # include -# include +# include # include # include # include # include -# include +# include #endif #include diff --git a/src/Gui/ViewProviderFeature.h b/src/Gui/ViewProviderFeature.h index ad3906ce7c..3cb026e533 100644 --- a/src/Gui/ViewProviderFeature.h +++ b/src/Gui/ViewProviderFeature.h @@ -24,7 +24,7 @@ #ifndef GUI_VIEWPROVIDER_FEATURE_H #define GUI_VIEWPROVIDER_FEATURE_H -#include +#include #include #include "ViewProviderDocumentObject.h" diff --git a/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp b/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp index b03ff0823f..572a82322e 100644 --- a/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp +++ b/src/Gui/ViewProviderGeoFeatureGroupExtension.cpp @@ -75,7 +75,7 @@ std::vector ViewProviderGeoFeatureGroupExtension::extensio for (auto obj: model) { //stuff in another geofeaturegroup is not in the model anyway if (!obj || obj->hasExtension(App::GeoFeatureGroupExtension::getExtensionClassTypeId())) { continue; } - + Gui::ViewProvider* vp = Gui::Application::Instance->getViewProvider ( obj ); if (!vp || vp == getExtendedViewProvider()) { continue; } @@ -88,7 +88,7 @@ std::vector ViewProviderGeoFeatureGroupExtension::extensio for(auto obj : model) { if(!obj || !obj->getNameInDocument()) continue; - if(outSet.count(obj)) + if(outSet.count(obj)) obj->setStatus(App::ObjectStatus::GeoExcluded,true); else { obj->setStatus(App::ObjectStatus::GeoExcluded,false); diff --git a/src/Gui/ViewProviderGeometryObject.cpp b/src/Gui/ViewProviderGeometryObject.cpp index bf315e0cf0..2b035ac3c4 100644 --- a/src/Gui/ViewProviderGeometryObject.cpp +++ b/src/Gui/ViewProviderGeometryObject.cpp @@ -39,9 +39,9 @@ # include # include # include -# include +# include # include -# include +# include #endif /// Here the FreeCAD includes sorted by Base,App,Gui...... @@ -90,12 +90,12 @@ ViewProviderGeometryObject::ViewProviderGeometryObject() } else { unsigned long shcol = hGrp->GetUnsigned("DefaultShapeColor",3435973887UL); // light gray (204,204,204) - r = ((shcol >> 24) & 0xff) / 255.0; - g = ((shcol >> 16) & 0xff) / 255.0; + r = ((shcol >> 24) & 0xff) / 255.0; + g = ((shcol >> 16) & 0xff) / 255.0; b = ((shcol >> 8) & 0xff) / 255.0; } - static const char *dogroup = "Display Options"; + static const char *dogroup = "Display Options"; static const char *sgroup = "Selection"; static const char *osgroup = "Object Style"; diff --git a/src/Gui/ViewProviderGeometryObject.h b/src/Gui/ViewProviderGeometryObject.h index 7d693bab38..e0da40eef6 100644 --- a/src/Gui/ViewProviderGeometryObject.h +++ b/src/Gui/ViewProviderGeometryObject.h @@ -72,7 +72,7 @@ public: /** * Returns a list of picked points from the geometry under \a getRoot(). * If \a pickAll is false (the default) only the intersection point closest to the camera will be picked, otherwise - * all intersection points will be picked. + * all intersection points will be picked. */ SoPickedPointList getPickedPoints(const SbVec2s& pos, const View3DInventorViewer& viewer,bool pickAll=false) const; /** diff --git a/src/Gui/ViewProviderGroupExtension.cpp b/src/Gui/ViewProviderGroupExtension.cpp index 29ca221742..fd251d108f 100644 --- a/src/Gui/ViewProviderGroupExtension.cpp +++ b/src/Gui/ViewProviderGroupExtension.cpp @@ -68,7 +68,7 @@ void ViewProviderGroupExtension::extensionDragObject(App::DocumentObject* obj) { Gui::Command::doCommand(Gui::Command::Doc,"App.getDocument(\"%s\").getObject(\"%s\").removeObject(" "App.getDocument(\"%s\").getObject(\"%s\"))", - getExtendedViewProvider()->getObject()->getDocument()->getName(), getExtendedViewProvider()->getObject()->getNameInDocument(), + getExtendedViewProvider()->getObject()->getDocument()->getName(), getExtendedViewProvider()->getObject()->getNameInDocument(), obj->getDocument()->getName(), obj->getNameInDocument() ); } @@ -86,7 +86,7 @@ bool ViewProviderGroupExtension::extensionCanDropObject(App::DocumentObject* obj //we cannot drop thing of this group into it again if (group->hasObject(obj)) - return false; + return false; if (group->allowObject(obj)) return true; @@ -112,7 +112,7 @@ void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) { std::vector< App::DocumentObject* > ViewProviderGroupExtension::extensionClaimChildren(void) const { - auto* group = getExtendedViewProvider()->getObject()->getExtensionByType(); + auto* group = getExtendedViewProvider()->getObject()->getExtensionByType(); return std::vector(group->Group.getValues()); } @@ -149,7 +149,7 @@ void ViewProviderGroupExtension::extensionHide(void) { // Property::User1 is used by ViewProviderDocumentObject to mark for // temporary visibility changes. Do not propagate the change to children. if (!getExtendedViewProvider()->isRestoring() - && !getExtendedViewProvider()->Visibility.testStatus(App::Property::User1)) + && !getExtendedViewProvider()->Visibility.testStatus(App::Property::User1)) { auto* group = getExtendedViewProvider()->getObject()->getExtensionByType(); for(auto obj : group->Group.getValues()) { @@ -165,10 +165,10 @@ bool ViewProviderGroupExtension::extensionOnDelete(const std::vector< std::strin auto* group = getExtendedViewProvider()->getObject()->getExtensionByType(); // If the group is nonempty ask the user if he wants to delete its content if (group->Group.getSize() > 0) { - QMessageBox::StandardButton choice = + QMessageBox::StandardButton choice = QMessageBox::question(getMainWindow(), QObject::tr ( "Delete group content?" ), QObject::tr ( "The %1 is not empty, delete its content as well?") - .arg ( QString::fromUtf8 ( getExtendedViewProvider()->getObject()->Label.getValue () ) ), + .arg ( QString::fromUtf8 ( getExtendedViewProvider()->getObject()->Label.getValue () ) ), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes ); if (choice == QMessageBox::Yes) { diff --git a/src/Gui/ViewProviderGroupExtension.h b/src/Gui/ViewProviderGroupExtension.h index 2023f4e9d9..7c0a026252 100644 --- a/src/Gui/ViewProviderGroupExtension.h +++ b/src/Gui/ViewProviderGroupExtension.h @@ -40,13 +40,13 @@ public: virtual ~ViewProviderGroupExtension(); virtual std::vector extensionClaimChildren(void)const override; - virtual bool extensionCanDragObjects() const override; + virtual bool extensionCanDragObjects() const override; virtual bool extensionCanDragObject(App::DocumentObject*) const override; virtual void extensionDragObject(App::DocumentObject*) override; virtual bool extensionCanDropObjects() const override; virtual bool extensionCanDropObject(App::DocumentObject*) const override; - virtual void extensionDropObject(App::DocumentObject*) override; - + virtual void extensionDropObject(App::DocumentObject*) override; + virtual void extensionHide(void) override; virtual void extensionShow(void) override; diff --git a/src/Gui/ViewProviderLine.cpp b/src/Gui/ViewProviderLine.cpp index 6d81cbcf31..6294d73bf9 100644 --- a/src/Gui/ViewProviderLine.cpp +++ b/src/Gui/ViewProviderLine.cpp @@ -43,7 +43,7 @@ PROPERTY_SOURCE(Gui::ViewProviderLine, Gui::ViewProviderOriginFeature) ViewProviderLine::ViewProviderLine() -{ +{ sPixmap = "Std_Axis"; } diff --git a/src/Gui/ViewProviderLink.cpp b/src/Gui/ViewProviderLink.cpp index a8a298e679..52de2acea1 100644 --- a/src/Gui/ViewProviderLink.cpp +++ b/src/Gui/ViewProviderLink.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2017 Zheng, Lei (realthunder) * + * Copyright (c) 2017 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -187,7 +187,7 @@ public: } LinkInfo(ViewProviderDocumentObject *vp) - :ref(0),pcLinked(vp) + :ref(0),pcLinked(vp) { FC_LOG("new link to " << pcLinked->getObject()->getFullName()); connChangeIcon = vp->signalChangeIcon.connect( @@ -215,7 +215,7 @@ public: } bool isLinked() const { - return pcLinked && pcLinked->getObject() && + return pcLinked && pcLinked->getObject() && pcLinked->getObject()->getNameInDocument(); } @@ -268,7 +268,7 @@ public: if(!isLinked() || !pcLinkedSwitch) return; int index = pcLinkedSwitch->whichChild.getValue(); for(size_t i=0;igetNumChildren(); if((index<0 && i==LinkView::SnapshotChild) || !count) @@ -287,7 +287,7 @@ public: inline void release(){ int r = --ref; assert(r>=0); - if(r==0) + if(r==0) delete this; else if(r==1) { if(pcLinked) { @@ -348,7 +348,7 @@ public: return 0; SoSeparator *root; - if(!isLinked() || !(root=pcLinked->getRoot())) + if(!isLinked() || !(root=pcLinked->getRoot())) return 0; if(sensor.getAttachedNode()!=root) { @@ -368,7 +368,7 @@ public: pcSnapshot->boundingBoxCaching = SoSeparator::OFF; pcSnapshot->renderCaching = SoSeparator::OFF; std::ostringstream ss; - ss << pcLinked->getObject()->getNameInDocument() + ss << pcLinked->getObject()->getNameInDocument() << "(" << type << ')'; pcSnapshot->setName(ss.str().c_str()); pcModeSwitch = new SoSwitch; @@ -437,18 +437,18 @@ public: } void update() { - if(!isLinked() || pcLinked->isRestoring()) + if(!isLinked() || pcLinked->isRestoring()) return; - + updateChildren(); - for(size_t i=0;igetChildRoot()) { @@ -483,17 +483,17 @@ public: this->nodeMap.swap(nodeMap); } - bool getElementPicked(bool addname, int type, - const SoPickedPoint *pp, std::ostream &str) const + bool getElementPicked(bool addname, int type, + const SoPickedPoint *pp, std::ostream &str) const { if(!pp || !isLinked() || !pcLinked->isSelectable()) return false; - if(addname) + if(addname) str << getLinkedName() <<'.'; - + auto pcSwitch = pcSwitches[type]; - if(pcChildGroup && pcSwitch && pcSwitch->whichChild.getValue()>=0 && + if(pcChildGroup && pcSwitch && pcSwitch->whichChild.getValue()>=0 && pcSwitch->getChild(pcSwitch->whichChild.getValue())==pcChildGroup) { SoPath *path = pp->getPath(); @@ -530,8 +530,8 @@ public: return subname; } - bool getDetail(bool checkname, int type, const char* subname, - SoDetail *&det, SoFullPath *path) const + bool getDetail(bool checkname, int type, const char* subname, + SoDetail *&det, SoFullPath *path) const { if(!isLinked()) return false; @@ -641,22 +641,22 @@ public: void slotChangeIcon() { iconMap.clear(); - if(!isLinked()) + if(!isLinked()) return; LinkInfoPtr me(this); - for(auto link : links) + for(auto link : links) link->onLinkedIconChange(me); } QIcon getIcon(QPixmap px) { static int iconSize = -1; - if(iconSize < 0) + if(iconSize < 0) iconSize = QApplication::style()->standardPixmap(QStyle::SP_DirClosedIcon).width(); if(!isLinked()) return QIcon(); - if(px.isNull()) + if(px.isNull()) return pcLinked->getIcon(); QIcon &iconLink = iconMap[px.cacheKey()]; if(iconLink.isNull()) { @@ -710,13 +710,13 @@ void ViewProviderLinkObserver::setLinkVisible(bool visible) { } void ViewProviderLinkObserver::extensionBeforeDelete() { - if(linkInfo) + if(linkInfo) linkInfo->detach(false); } void ViewProviderLinkObserver::extensionReattach(App::DocumentObject *) { if(linkInfo) { - linkInfo->pcLinked = + linkInfo->pcLinked = Base::freecad_dynamic_cast(getExtendedContainer()); linkInfo->update(); } @@ -740,8 +740,8 @@ void ViewProviderLinkObserver::extensionModeSwitchChange() { } void ViewProviderLinkObserver::extensionUpdateData(const App::Property *prop) { - if(linkInfo && linkInfo->pcLinked && linkInfo->pcLinked->getObject() && - prop != &linkInfo->pcLinked->getObject()->Visibility) + if(linkInfo && linkInfo->pcLinked && linkInfo->pcLinked->getObject() && + prop != &linkInfo->pcLinked->getObject()->Visibility) linkInfo->updateData(prop); } @@ -798,7 +798,7 @@ public: return; unlink(); linkInfo = LinkInfo::get(obj,this); - if(linkInfo) + if(linkInfo) pcNode->addChild(linkInfo->getSnapshot(LinkView::SnapshotTransform)); } @@ -853,7 +853,7 @@ public: return; unlink(); linkInfo = LinkInfo::get(obj,this); - if(isLinked()) + if(isLinked()) pcRoot->addChild(linkInfo->getSnapshot(handle.childType)); } @@ -896,12 +896,12 @@ void LinkView::setInvalid(void) { Base::BoundBox3d _getBoundBox(ViewProviderDocumentObject *vpd, SoNode *rootNode) { auto doc = vpd->getDocument(); - if(!doc) + if(!doc) LINK_THROW(Base::RuntimeError,"no document"); Gui::MDIView* view = doc->getViewOfViewProvider(vpd); if(!view) LINK_THROW(Base::RuntimeError,"no view"); - + Gui::View3DInventorViewer* viewer = static_cast(view)->getViewer(); SoGetBoundingBoxAction bboxAction(viewer->getSoRenderManager()->getViewportRegion()); bboxAction.apply(rootNode); @@ -938,7 +938,7 @@ bool LinkView::isLinked() const{ void LinkView::setDrawStyle(int style, double lineWidth, double pointSize) { if(!pcDrawStyle) { - if(!style) + if(!style) return; pcDrawStyle = new SoDrawStyle; pcDrawStyle->style = SoDrawStyle::FILLED; @@ -1016,7 +1016,7 @@ void LinkView::setLinkViewObject(ViewProviderDocumentObject *vpd, if(!isLinked() || linkInfo->pcLinked != vpd) { unlink(linkInfo); linkInfo = LinkInfo::get(vpd,this); - if(!linkInfo) + if(!linkInfo) return; } subInfo.clear(); @@ -1102,7 +1102,7 @@ void LinkView::setTransform(SoTransform *pcTransform, const Base::Matrix4D &mat) void LinkView::setSize(int _size) { size_t size = _size<0?0:(size_t)_size; - if(childType<0 && size==nodeArray.size()) + if(childType<0 && size==nodeArray.size()) return; resetRoot(); if(!size || childType>=0) { @@ -1145,7 +1145,7 @@ void LinkView::resetRoot() { } void LinkView::setChildren(const std::vector &children, - const boost::dynamic_bitset<> &vis, SnapshotType type) + const boost::dynamic_bitset<> &vis, SnapshotType type) { if(children.empty()) { if(nodeArray.size()) { @@ -1243,7 +1243,7 @@ bool LinkView::isElementVisible(int idx) const { ViewProviderDocumentObject *LinkView::getLinkedView() const { auto link = linkInfo; - if(autoSubLink && subInfo.size()==1) + if(autoSubLink && subInfo.size()==1) link = subInfo.begin()->second->linkInfo; return link?link->pcLinked:0; } @@ -1264,7 +1264,7 @@ std::vector LinkView::getSubNames() const { void LinkView::setNodeType(SnapshotType type, bool sublink) { autoSubLink = sublink; if(nodeType==type) return; - if(type>=SnapshotMax || + if(type>=SnapshotMax || (type<0 && type!=SnapshotContainer && type!=SnapshotContainerTransform)) LINK_THROW(Base::ValueError,"LinkView: invalid node type"); @@ -1285,14 +1285,14 @@ void LinkView::setNodeType(SnapshotType type, bool sublink) { } void LinkView::replaceLinkedRoot(SoSeparator *root) { - if(root==pcLinkedRoot) + if(root==pcLinkedRoot) return; if(nodeArray.empty()) { - if(pcLinkedRoot && root) + if(pcLinkedRoot && root) pcLinkRoot->replaceChild(pcLinkedRoot,root); else if(root) pcLinkRoot->addChild(root); - else + else resetRoot(); }else if(childType<0) { if(pcLinkedRoot && root) { @@ -1318,8 +1318,8 @@ void LinkView::onLinkedUpdateData(LinkInfoPtr info, const App::Property *prop) { if(info!=linkInfo || !linkOwner || !linkOwner->isLinked() || info==linkOwner) return; auto ext = linkOwner->pcLinked->getObject()->getExtensionByType(true); - if (ext && !(prop->getType() & App::Prop_Output) && - !prop->testStatus(App::Property::Output)) + if (ext && !(prop->getType() & App::Prop_Output) && + !prop->testStatus(App::Property::Output)) { // propagate the signalChangedObject to potentially multiple levels // of links, to inform tree view of children change, and other @@ -1398,13 +1398,13 @@ void LinkView::updateLink() { replaceLinkedRoot(linkedRoot); } -bool LinkView::linkGetElementPicked(const SoPickedPoint *pp, std::string &subname) const +bool LinkView::linkGetElementPicked(const SoPickedPoint *pp, std::string &subname) const { std::ostringstream ss; CoinPtr path = pp->getPath(); if(nodeArray.size()) { auto idx = path->findNode(pcLinkRoot); - if(idx<0 || idx+2>=path->getLength()) + if(idx<0 || idx+2>=path->getLength()) return false; auto node = path->getNode(idx+1); auto it = nodeMap.find(node); @@ -1485,7 +1485,7 @@ bool LinkView::getGroupHierarchy(int index, SoFullPath *path) const { return true; } -bool LinkView::linkGetDetailPath(const char *subname, SoFullPath *path, SoDetail *&det) const +bool LinkView::linkGetDetailPath(const char *subname, SoFullPath *path, SoDetail *&det) const { if(!subname || *subname==0) return true; auto len = path->getLength(); @@ -1493,7 +1493,7 @@ bool LinkView::linkGetDetailPath(const char *subname, SoFullPath *path, SoDetail appendPath(path,pcLinkRoot); }else{ int idx = App::LinkBaseExtension::getArrayIndex(subname,&subname); - if(idx<0 || idx>=(int)nodeArray.size()) + if(idx<0 || idx>=(int)nodeArray.size()) return false; auto &info = *nodeArray[idx]; @@ -1503,7 +1503,7 @@ bool LinkView::linkGetDetailPath(const char *subname, SoFullPath *path, SoDetail appendPath(path,info.pcSwitch); appendPath(path,info.pcRoot); - if(*subname == 0) + if(*subname == 0) return true; if(info.isLinked()) { @@ -1525,14 +1525,14 @@ bool LinkView::linkGetDetailPath(const char *subname, SoFullPath *path, SoDetail if(autoSubLink && subInfo.size()==1) nextsub = subname; else{ - if(!boost::algorithm::starts_with(subname,v.first)) + if(!boost::algorithm::starts_with(subname,v.first)) continue; nextsub = subname+v.first.size(); - if(*nextsub != '.') + if(*nextsub != '.') continue; ++nextsub; } - if(*nextsub && sub.subElements.size() && + if(*nextsub && sub.subElements.size() && sub.subElements.find(nextsub)==sub.subElements.end()) break; appendPath(path,sub.pcNode); @@ -1566,7 +1566,7 @@ void LinkView::unlink(LinkInfoPtr info) { else { for(auto &info : nodeArray) { int idx; - if(!info->isLinked() && + if(!info->isLinked() && (idx=info->pcRoot->findChild(pcLinkedRoot))>=0) info->pcRoot->removeChild(idx); } @@ -1579,7 +1579,7 @@ void LinkView::unlink(LinkInfoPtr info) { QIcon LinkView::getLinkedIcon(QPixmap px) const { auto link = linkInfo; - if(autoSubLink && subInfo.size()==1) + if(autoSubLink && subInfo.size()==1) link = subInfo.begin()->second->linkInfo; if(!link || !link->isLinked()) return QIcon(); @@ -1850,7 +1850,7 @@ void ViewProviderLink::updateDataPrivate(App::LinkBaseExtension *ext, const App: if(ext->_getShowElementValue()) updateElementList(ext); - else + else updateDataPrivate(ext,ext->_getElementCountProperty()); // applyColors(); @@ -1888,7 +1888,7 @@ void ViewProviderLink::updateDataPrivate(App::LinkBaseExtension *ext, const App: Application::Instance->getViewProvider(element)); if(!vp) continue; overrideMaterial = overrideMaterial || vp->OverrideMaterial.getValue(); - hasMaterial = overrideMaterial || hasMaterial + hasMaterial = overrideMaterial || hasMaterial || vp->ShapeMaterial.getValue()!=ShapeMaterial.getValue(); materials.push_back(vp->ShapeMaterial.getValue()); overrideMaterials[i] = vp->OverrideMaterial.getValue(); @@ -1903,7 +1903,7 @@ void ViewProviderLink::updateDataPrivate(App::LinkBaseExtension *ext, const App: MaterialList.setStatus(App::Property::User3,true); MaterialList.setValue(materials); MaterialList.setStatus(App::Property::User3,false); - + linkView->setSize(ext->_getElementCountValue()); updateDataPrivate(ext,ext->getVisibilityListProperty()); applyMaterial(); @@ -1911,19 +1911,19 @@ void ViewProviderLink::updateDataPrivate(App::LinkBaseExtension *ext, const App: } } }else if(prop==ext->getScaleListProperty() || prop==ext->getPlacementListProperty()) { - if(!prop->testStatus(App::Property::User3) && - linkView->getSize() && - !ext->_getShowElementValue()) + if(!prop->testStatus(App::Property::User3) && + linkView->getSize() && + !ext->_getShowElementValue()) { auto propPlacements = ext->getPlacementListProperty(); auto propScales = ext->getScaleListProperty(); if(propPlacements && linkView->getSize()) { - const auto &touched = + const auto &touched = prop==propScales?propScales->getTouchList():propPlacements->getTouchList(); if(touched.empty()) { for(int i=0;igetSize();++i) { Base::Matrix4D mat; - if(propPlacements->getSize()>i) + if(propPlacements->getSize()>i) mat = (*propPlacements)[i].toMatrix(); if(propScales && propScales->getSize()>i) { Base::Matrix4D s; @@ -1937,7 +1937,7 @@ void ViewProviderLink::updateDataPrivate(App::LinkBaseExtension *ext, const App: if(i<0 || i>=linkView->getSize()) continue; Base::Matrix4D mat; - if(propPlacements->getSize()>i) + if(propPlacements->getSize()>i) mat = (*propPlacements)[i].toMatrix(); if(propScales && propScales->getSize()>i) { Base::Matrix4D s; @@ -2013,7 +2013,7 @@ void ViewProviderLink::applyMaterial() { linkView->setMaterial(-1,&ShapeMaterial.getValue()); else { for(int i=0;igetSize();++i) { - if(MaterialList.getSize()>i && + if(MaterialList.getSize()>i && OverrideMaterialList.getSize()>i && OverrideMaterialList[i]) linkView->setMaterial(i,&MaterialList[i]); else @@ -2068,9 +2068,9 @@ bool ViewProviderLink::isGroup(const App::LinkBaseExtension *ext, bool plainGrou } ViewProvider *ViewProviderLink::getLinkedView( - bool real,const App::LinkBaseExtension *ext) const + bool real,const App::LinkBaseExtension *ext) const { - if(!ext) + if(!ext) ext = getLinkExtension(); auto obj = ext&&real?ext->getTrueLinkedObject(true): getObject()->getLinkedObject(true); @@ -2137,7 +2137,7 @@ void ViewProviderLink::dragObject(App::DocumentObject* obj) { } return; } - if(hasElements(ext)) + if(hasElements(ext)) return; auto linked = getLinkedView(false); if(linked) @@ -2160,8 +2160,8 @@ bool ViewProviderLink::canDropObjects() const { return true; } -bool ViewProviderLink::canDropObjectEx(App::DocumentObject *obj, - App::DocumentObject *owner, const char *subname, +bool ViewProviderLink::canDropObjectEx(App::DocumentObject *obj, + App::DocumentObject *owner, const char *subname, const std::vector &subElements) const { if(pcObject == obj || pcObject == owner) @@ -2182,16 +2182,16 @@ bool ViewProviderLink::canDropObjectEx(App::DocumentObject *obj, return linked->canDropObjectEx(obj,owner,subname,subElements); } } - if(obj->getDocument() != getObject()->getDocument() && + if(obj->getDocument() != getObject()->getDocument() && !freecad_dynamic_cast(ext->getLinkedObjectProperty())) return false; return true; } -std::string ViewProviderLink::dropObjectEx(App::DocumentObject* obj, - App::DocumentObject *owner, const char *subname, - const std::vector &subElements) +std::string ViewProviderLink::dropObjectEx(App::DocumentObject* obj, + App::DocumentObject *owner, const char *subname, + const std::vector &subElements) { auto ext = getLinkExtension(); if (!ext) @@ -2234,7 +2234,7 @@ bool ViewProviderLink::canDragAndDropObject(App::DocumentObject* obj) const { return false; if(!hasSubName) { auto linked = getLinkedView(false,ext); - if(linked) + if(linked) return linked->canDragAndDropObject(obj); } return false; @@ -2267,7 +2267,7 @@ bool ViewProviderLink::getElementPicked(const SoPickedPoint *pp, std::string &su } bool ViewProviderLink::getDetailPath( - const char *subname, SoFullPath *pPath, bool append, SoDetail *&det) const + const char *subname, SoFullPath *pPath, bool append, SoDetail *&det) const { auto ext = getLinkExtension(); if(!ext) return false; @@ -2284,7 +2284,7 @@ bool ViewProviderLink::getDetailPath( return false; } std::string _subname; - if(subname && subname[0] && + if(subname && subname[0] && (isGroup(ext,true) || hasElements(ext) || ext->getElementCountValue())) { int index = ext->getElementIndex(subname,&subname); if(index>=0) { @@ -2318,7 +2318,7 @@ bool ViewProviderLink::linkEdit(const App::LinkBaseExtension *ext) const { ext = getLinkExtension(); if(!ext || (!ext->_getShowElementValue() && ext->_getElementCountValue()) || - hasElements(ext) || + hasElements(ext) || isGroup(ext) || hasSubName) { @@ -2486,7 +2486,7 @@ ViewProvider *ViewProviderLink::startEditing(int mode) { if(mode==ViewProvider::Transform) { if(_pendingTransform && doc) doc->setEditingTransform(_editingTransform); - + if(!initDraggingPlacement()) return 0; if(useCenterballDragger) @@ -2870,19 +2870,19 @@ std::map ViewProviderLink::getElementColors(const char } } else if (std::isdigit(subname[0])) { const char *dot = strchr(subname,'.'); - if(dot) + if(dot) offset = dot-subname+1; } } if(isPrefix) { - if(!boost::starts_with(sub.first,subname+offset) + if(!boost::starts_with(sub.first,subname+offset) && !boost::starts_with(sub.second,subname+offset)) continue; }else if(sub.first!=subname+offset && sub.second!=subname+offset) continue; - if(offset) + if(offset) colors.emplace(std::string(subname,offset)+sub.second, OverrideColorList[i]); else colors[sub.second] = OverrideColorList[i]; @@ -2939,7 +2939,7 @@ void ViewProviderLink::setElementColors(const std::map faceColor = v.second; continue; } - + if(element_count && v.first.size() && std::isdigit(v.first[0])) { // In case of array, check if there are override of the same // sub-element for every array element. And collapse those overrides @@ -3116,7 +3116,7 @@ void ViewProviderLink::getPropertyList(std::vector &List) const } ViewProviderDocumentObject *ViewProviderLink::getLinkedViewProvider( - std::string *subname, bool recursive) const + std::string *subname, bool recursive) const { auto self = const_cast(this); auto ext = getLinkExtension(); diff --git a/src/Gui/ViewProviderLink.h b/src/Gui/ViewProviderLink.h index a87e3c723f..f679cccb1d 100644 --- a/src/Gui/ViewProviderLink.h +++ b/src/Gui/ViewProviderLink.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2017 Zheng, Lei (realthunder) * + * Copyright (c) 2017 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -94,10 +94,10 @@ public: void updateLink(); void setLink(App::DocumentObject *obj, - const std::vector &subs = std::vector()); + const std::vector &subs = std::vector()); void setLinkViewObject(ViewProviderDocumentObject *vpd, - const std::vector &subs = std::vector()); + const std::vector &subs = std::vector()); std::vector getChildren() const; @@ -113,7 +113,7 @@ public: enum SnapshotType { //three type of snapshot to override linked root node: - + //override transform and visibility SnapshotTransform = 0, //override visibility @@ -131,7 +131,7 @@ public: void setNodeType(SnapshotType type, bool sublink=true); void setChildren(const std::vector &children, - const boost::dynamic_bitset<> &vis, SnapshotType type=SnapshotVisible); + const boost::dynamic_bitset<> &vis, SnapshotType type=SnapshotVisible); bool linkGetDetailPath(const char *, SoFullPath *, SoDetail *&) const; bool linkGetElementPicked(const SoPickedPoint *, std::string &) const; @@ -221,9 +221,9 @@ public: void dragObject(App::DocumentObject*) override; bool canDropObjects() const override; bool canDragAndDropObject(App::DocumentObject*) const override; - bool canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, + bool canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, const char *subname, const std::vector &subElements) const override; - std::string dropObjectEx(App::DocumentObject*, App::DocumentObject*, + std::string dropObjectEx(App::DocumentObject*, App::DocumentObject*, const char *subname, const std::vector &subElements) override; bool onDelete(const std::vector &) override; diff --git a/src/Gui/ViewProviderLinkPyImp.cpp b/src/Gui/ViewProviderLinkPyImp.cpp index b23f2f742a..b418f0f32f 100644 --- a/src/Gui/ViewProviderLinkPyImp.cpp +++ b/src/Gui/ViewProviderLinkPyImp.cpp @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2017 Zheng, Lei (realthunder) * + * Copyright (c) 2017 Zheng Lei (realthunder) * * * * This file is part of the FreeCAD CAx development system. * * * @@ -79,5 +79,5 @@ PyObject *ViewProviderLinkPy::getCustomAttributes(const char* /*attr*/) const int ViewProviderLinkPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) { - return 0; + return 0; } diff --git a/src/Gui/ViewProviderMaterialObject.cpp b/src/Gui/ViewProviderMaterialObject.cpp index c4a0344cab..9937ed1581 100644 --- a/src/Gui/ViewProviderMaterialObject.cpp +++ b/src/Gui/ViewProviderMaterialObject.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) * + * Copyright (c) 2013 Jürgen Riegel * * * * This file is part of the FreeCAD CAx development system. * * * @@ -49,7 +49,7 @@ PROPERTY_SOURCE(Gui::ViewProviderMaterialObject, Gui::ViewProviderDocumentObject /** * Creates the view provider for an object group. */ -ViewProviderMaterialObject::ViewProviderMaterialObject() +ViewProviderMaterialObject::ViewProviderMaterialObject() { } diff --git a/src/Gui/ViewProviderMaterialObject.h b/src/Gui/ViewProviderMaterialObject.h index 76c4a6b58c..76e890b5aa 100644 --- a/src/Gui/ViewProviderMaterialObject.h +++ b/src/Gui/ViewProviderMaterialObject.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) * + * Copyright (c) 2013 Jürgen Riegel * * * * This file is part of the FreeCAD CAx development system. * * * diff --git a/src/Gui/ViewProviderMeasureDistance.cpp b/src/Gui/ViewProviderMeasureDistance.cpp index b1f295bab8..5b4be8f4bb 100644 --- a/src/Gui/ViewProviderMeasureDistance.cpp +++ b/src/Gui/ViewProviderMeasureDistance.cpp @@ -59,7 +59,7 @@ using namespace Gui; PROPERTY_SOURCE(Gui::ViewProviderMeasureDistance, Gui::ViewProviderDocumentObject) -ViewProviderMeasureDistance::ViewProviderMeasureDistance() +ViewProviderMeasureDistance::ViewProviderMeasureDistance() { ADD_PROPERTY(TextColor,(1.0f,1.0f,1.0f)); ADD_PROPERTY(LineColor,(1.0f,1.0f,1.0f)); @@ -171,7 +171,7 @@ void ViewProviderMeasureDistance::attach(App::DocumentObject* pcObject) lineSep->addChild(pCoords); lineSep->addChild(pLines); SoMarkerSet* points = new SoMarkerSet(); - points->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex("CROSS", + points->markerIndex = Gui::Inventor::MarkerBitmaps::getMarkerIndex("CROSS", ViewParams::instance()->getMarkerSize()); points->numPoints=2; lineSep->addChild(points); diff --git a/src/Gui/ViewProviderOrigin.h b/src/Gui/ViewProviderOrigin.h index da4810bd6d..e9fd870706 100644 --- a/src/Gui/ViewProviderOrigin.h +++ b/src/Gui/ViewProviderOrigin.h @@ -69,7 +69,7 @@ public: /// Reset the visibility void resetTemporaryVisibility (); ///@} - + virtual bool canDragObjects() const { return false; } diff --git a/src/Gui/ViewProviderOriginGroup.cpp b/src/Gui/ViewProviderOriginGroup.cpp index bb8a959698..a54d768fee 100644 --- a/src/Gui/ViewProviderOriginGroup.cpp +++ b/src/Gui/ViewProviderOriginGroup.cpp @@ -49,6 +49,6 @@ ViewProviderOriginGroup::ViewProviderOriginGroup () initExtension(this); } -ViewProviderOriginGroup::~ViewProviderOriginGroup () +ViewProviderOriginGroup::~ViewProviderOriginGroup () { } diff --git a/src/Gui/ViewProviderOriginGroupExtension.cpp b/src/Gui/ViewProviderOriginGroupExtension.cpp index 495409e8fa..6cfac12db0 100644 --- a/src/Gui/ViewProviderOriginGroupExtension.cpp +++ b/src/Gui/ViewProviderOriginGroupExtension.cpp @@ -66,7 +66,7 @@ std::vector ViewProviderOriginGroupExtension::constructChi auto* group = getExtendedViewProvider()->getObject()->getExtensionByType(); if(!group) return children; - + App::DocumentObject *originObj = group->Origin.getValue(); // Origin must be first @@ -100,13 +100,13 @@ void ViewProviderOriginGroupExtension::extensionAttach(App::DocumentObject *pcOb connectChangedObjectApp = adoc->signalChangedObject.connect ( boost::bind ( &ViewProviderOriginGroupExtension::slotChangedObjectApp, this, bp::_1) ); - + connectChangedObjectGui = gdoc->signalChangedObject.connect ( boost::bind ( &ViewProviderOriginGroupExtension::slotChangedObjectGui, this, bp::_1) ); } void ViewProviderOriginGroupExtension::extensionUpdateData( const App::Property* prop ) { - + auto* group = getExtendedViewProvider()->getObject()->getExtensionByType(); if ( group && prop == &group->Group ) { updateOriginSize(); @@ -124,7 +124,7 @@ void ViewProviderOriginGroupExtension::slotChangedObjectApp ( const App::Documen void ViewProviderOriginGroupExtension::slotChangedObjectGui ( const Gui::ViewProviderDocumentObject& vp) { if ( !vp.isDerivedFrom ( Gui::ViewProviderOriginFeature::getClassTypeId () )) { - // Ignore origins to avoid infinite recursion (not likely in a well-formed document, + // Ignore origins to avoid infinite recursion (not likely in a well-formed document, // but may happen in documents designed in old versions of assembly branch ) auto* group = getExtendedViewProvider()->getObject()->getExtensionByType(); App::DocumentObject *obj = vp.getObject (); @@ -137,12 +137,12 @@ void ViewProviderOriginGroupExtension::slotChangedObjectGui ( const Gui::ViewPro void ViewProviderOriginGroupExtension::updateOriginSize () { auto owner = getExtendedViewProvider()->getObject(); - + if(!owner->getNameInDocument() || owner->isRemoving() || owner->getDocument()->testStatus(App::Document::Restoring)) return; - + auto* group = owner->getExtensionByType(); if(!group) return; @@ -167,13 +167,13 @@ void ViewProviderOriginGroupExtension::updateOriginSize () { } Gui::Document* gdoc = getExtendedViewProvider()->getDocument(); - if(!gdoc) + if(!gdoc) return; - + Gui::MDIView* view = gdoc->getViewOfViewProvider(getExtendedViewProvider()); if(!view) return; - + Gui::View3DInventorViewer* viewer = static_cast(view)->getViewer(); SoGetBoundingBoxAction bboxAction(viewer->getSoRenderManager()->getViewportRegion()); @@ -188,7 +188,7 @@ void ViewProviderOriginGroupExtension::updateOriginSize () { bboxAction.apply ( vp->getRoot () ); bbox.extendBy ( bboxAction.getBoundingBox () ); }; - + // get the bounding box values SbVec3f max = bbox.getMax(); SbVec3f min = bbox.getMin(); diff --git a/src/Gui/ViewProviderOriginGroupExtension.h b/src/Gui/ViewProviderOriginGroupExtension.h index 4804aa9d80..1a28f7fe4e 100644 --- a/src/Gui/ViewProviderOriginGroupExtension.h +++ b/src/Gui/ViewProviderOriginGroupExtension.h @@ -45,7 +45,7 @@ public: virtual void extensionAttach(App::DocumentObject *pcObject) override; virtual void extensionUpdateData(const App::Property* prop) override; - + void updateOriginSize(); protected: diff --git a/src/Gui/ViewProviderPart.cpp b/src/Gui/ViewProviderPart.cpp index 00c8c5b148..b39fdd109a 100644 --- a/src/Gui/ViewProviderPart.cpp +++ b/src/Gui/ViewProviderPart.cpp @@ -53,7 +53,7 @@ PROPERTY_SOURCE_WITH_EXTENSIONS(Gui::ViewProviderPart, Gui::ViewProviderDragger) * Creates the view provider for an object group. */ ViewProviderPart::ViewProviderPart() -{ +{ initExtension(this); sPixmap = "Geofeaturegroup.svg"; @@ -90,7 +90,7 @@ bool ViewProviderPart::doubleClicked(void) if(!activeDoc) activeDoc = getDocument(); auto activeView = activeDoc->setActiveView(this); - if(!activeView) + if(!activeView) return false; activePart = activeView->getActiveObject (PARTKEY); diff --git a/src/Gui/ViewProviderPlane.cpp b/src/Gui/ViewProviderPlane.cpp index 593d0bb3f7..c93e1b8fd9 100644 --- a/src/Gui/ViewProviderPlane.cpp +++ b/src/Gui/ViewProviderPlane.cpp @@ -43,7 +43,7 @@ PROPERTY_SOURCE(Gui::ViewProviderPlane, Gui::ViewProviderOriginFeature) ViewProviderPlane::ViewProviderPlane() -{ +{ sPixmap = "Std_Plane"; } diff --git a/src/Gui/ViewProviderPyImp.cpp b/src/Gui/ViewProviderPyImp.cpp index 11cae60f63..c8669d99f8 100644 --- a/src/Gui/ViewProviderPyImp.cpp +++ b/src/Gui/ViewProviderPyImp.cpp @@ -129,28 +129,28 @@ PyObject* ViewProviderPy::supportedProperties(PyObject *args) PyObject* ViewProviderPy::show(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { - getViewProviderPtr()->show(); + getViewProviderPtr()->show(); Py_Return; } PY_CATCH; } PyObject* ViewProviderPy::hide(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { - getViewProviderPtr()->hide(); + getViewProviderPtr()->hide(); Py_Return; } PY_CATCH; } PyObject* ViewProviderPy::isVisible(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { return Py_BuildValue("O", (getViewProviderPtr()->isShow() ? Py_True : Py_False)); } PY_CATCH; @@ -275,7 +275,7 @@ PyObject* ViewProviderPy::replaceObject(PyObject *args) { PyObject *oldObj; PyObject *newObj; - if (!PyArg_ParseTuple(args, "O!O!", + if (!PyArg_ParseTuple(args, "O!O!", &App::DocumentObjectPy::Type,&oldObj, &App::DocumentObjectPy::Type,&newObj)) return NULL; @@ -312,11 +312,11 @@ PyObject* ViewProviderPy::addDisplayMode(PyObject * args) PyObject* ViewProviderPy::listDisplayModes(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { - std::vector modes = getViewProviderPtr()->getDisplayModes(); - PyObject* pyList = PyList_New(modes.size()); + std::vector modes = getViewProviderPtr()->getDisplayModes(); + PyObject* pyList = PyList_New(modes.size()); int i=0; for ( std::vector::iterator it = modes.begin(); it != modes.end(); ++it ) { @@ -334,8 +334,8 @@ PyObject* ViewProviderPy::listDisplayModes(PyObject *args) PyObject* ViewProviderPy::toString(PyObject *args) { - if (!PyArg_ParseTuple(args, "")) // convert args: Python->C - return NULL; // NULL triggers exception + if (!PyArg_ParseTuple(args, "")) // convert args: Python->C + return NULL; // NULL triggers exception PY_TRY { std::string buffer = getViewProviderPtr()->toString(); return Py::new_reference_to(Py::String(buffer)); @@ -429,7 +429,7 @@ PyObject* ViewProviderPy::partialRender(PyObject* args) PyObject* ViewProviderPy::getElementColors(PyObject* args) { const char *element = 0; - if (!PyArg_ParseTuple(args, "|s", &element)) + if (!PyArg_ParseTuple(args, "|s", &element)) return 0; Py::Dict dict; @@ -444,7 +444,7 @@ PyObject* ViewProviderPy::getElementColors(PyObject* args) PyObject* ViewProviderPy::setElementColors(PyObject* args) { PyObject *pyObj; - if (!PyArg_ParseTuple(args, "O", &pyObj)) + if (!PyArg_ParseTuple(args, "O", &pyObj)) return 0; if(!PyDict_Check(pyObj)) @@ -473,7 +473,7 @@ PyObject* ViewProviderPy::getElementPicked(PyObject* args) void *ptr = 0; Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPickedPoint", obj, &ptr, 0); SoPickedPoint *pp = reinterpret_cast(ptr); - if(!pp) + if(!pp) throw Base::TypeError("type must be of coin.SoPickedPoint"); std::string name; if(!getViewProviderPtr()->getElementPicked(pp,name)) @@ -491,7 +491,7 @@ PyObject* ViewProviderPy::getDetailPath(PyObject* args) void *ptr = 0; Base::Interpreter().convertSWIGPointerObj("pivy.coin", "_p_SoPath", path, &ptr, 0); SoPath *pPath = reinterpret_cast(ptr); - if(!pPath) + if(!pPath) throw Base::TypeError("type must be of coin.SoPath"); SoDetail *det = 0; if(!getViewProviderPtr()->getDetailPath( @@ -655,7 +655,7 @@ void ViewProviderPy::setDefaultMode(Py::Int arg) return getViewProviderPtr()->setDefaultMode(arg); } -Py::Boolean ViewProviderPy::getCanRemoveChildrenFromRoot() const +Py::Boolean ViewProviderPy::getCanRemoveChildrenFromRoot() const { return Py::Boolean(getViewProviderPtr()->canRemoveChildrenFromRoot()); } diff --git a/src/Gui/ViewProviderPythonFeature.cpp b/src/Gui/ViewProviderPythonFeature.cpp index 0cd46cd67d..5a46a48b0d 100644 --- a/src/Gui/ViewProviderPythonFeature.cpp +++ b/src/Gui/ViewProviderPythonFeature.cpp @@ -44,10 +44,10 @@ # include # include # include -# include +# include # include -# include -# include +# include +# include #endif #include "ViewProviderDocumentObjectPy.h" @@ -157,7 +157,7 @@ private: // original implementation didn't do that in every case, causing // memory leak. We now simply stores the python object with // reference counting, so no need to worry about deleting - + Py::Object viewObject(const_cast(pe->view)->getPyObject(),true); if(viewObject.ptr() != pe->info.viewObject.ptr()) { if(FC_LOG_INSTANCE.isEnabled(FC_LOGLEVEL_LOG)) @@ -365,7 +365,7 @@ QIcon ViewProviderPythonFeatureImp::getIcon() const wrap.loadGuiModule(); wrap.loadWidgetsModule(); QIcon *picon = wrap.toQIcon(ret.ptr()); - if(picon) + if(picon) return *picon; } } @@ -381,7 +381,7 @@ QIcon ViewProviderPythonFeatureImp::getIcon() const return QIcon(); } -bool ViewProviderPythonFeatureImp::claimChildren(std::vector &children) const +bool ViewProviderPythonFeatureImp::claimChildren(std::vector &children) const { _FC_PY_CALL_CHECK(claimChildren,return(false)); @@ -891,7 +891,7 @@ void ViewProviderPythonFeatureImp::finishRestoring() ViewProviderPythonFeatureImp::ValueT ViewProviderPythonFeatureImp::onDelete(const std::vector & sub) { - FC_PY_CALL_CHECK(onDelete); + FC_PY_CALL_CHECK(onDelete); Base::PyGILStateLocker lock; try { @@ -1263,7 +1263,7 @@ ViewProviderPythonFeatureImp::canDropObjectEx(App::DocumentObject* obj, return Rejected; } -bool ViewProviderPythonFeatureImp::dropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, +bool ViewProviderPythonFeatureImp::dropObjectEx(App::DocumentObject* obj, App::DocumentObject *owner, const char *subname, const std::vector &elements,std::string &ret) { _FC_PY_CALL_CHECK(dropObjectEx, return(false)); @@ -1318,7 +1318,7 @@ ViewProviderPythonFeatureImp::isShow() const } -ViewProviderPythonFeatureImp::ValueT +ViewProviderPythonFeatureImp::ValueT ViewProviderPythonFeatureImp::canRemoveChildrenFromRoot() const { FC_PY_CALL_CHECK(canRemoveChildrenFromRoot); @@ -1362,7 +1362,7 @@ bool ViewProviderPythonFeatureImp::getDropPrefix(std::string &prefix) const { return true; } -ViewProviderPythonFeatureImp::ValueT +ViewProviderPythonFeatureImp::ValueT ViewProviderPythonFeatureImp::replaceObject( App::DocumentObject *oldObj, App::DocumentObject *newObj) { diff --git a/src/Gui/ViewProviderPythonFeature.h b/src/Gui/ViewProviderPythonFeature.h index ba1460d1bd..94b1647c3d 100644 --- a/src/Gui/ViewProviderPythonFeature.h +++ b/src/Gui/ViewProviderPythonFeature.h @@ -110,7 +110,7 @@ public: /** Return false to force drop only operation for a give object*/ ValueT canDragAndDropObject(App::DocumentObject*) const; /** Query object dropping with full quanlified name */ - ValueT canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *, + ValueT canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *, const char *,const std::vector &elements) const; /** Add an object with full quanlified name to the view provider by drag and drop */ bool dropObjectEx(App::DocumentObject *obj, App::DocumentObject *, @@ -118,7 +118,7 @@ public: ValueT replaceObject(App::DocumentObject *, App::DocumentObject *); //@} - bool getLinkedViewProvider(ViewProviderDocumentObject *&res, + bool getLinkedViewProvider(ViewProviderDocumentObject *&res, std::string *subname, bool recursive) const; ValueT canAddToSceneGraph() const; @@ -407,7 +407,7 @@ public: return ViewProviderT::canDragAndDropObject(obj); } } - virtual bool canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, + virtual bool canDropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, const char *subname, const std::vector &elements) const override { switch (imp->canDropObjectEx(obj,owner,subname,elements)) { @@ -420,7 +420,7 @@ public: } } /** Add an object with full quanlified name to the view provider by drag and drop */ - virtual std::string dropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, + virtual std::string dropObjectEx(App::DocumentObject *obj, App::DocumentObject *owner, const char *subname, const std::vector &elements) override { App::AutoTransaction committer; diff --git a/src/Gui/WaitCursor.cpp b/src/Gui/WaitCursor.cpp index 43a3cc187e..b441ad8b58 100644 --- a/src/Gui/WaitCursor.cpp +++ b/src/Gui/WaitCursor.cpp @@ -127,7 +127,7 @@ bool WaitCursorP::isModalDialog(QObject* o) const bool WaitCursorP::eventFilter(QObject* o, QEvent* e) { - // Note: This might cause problems when we want to open a modal dialog at the lifetime + // Note: This might cause problems when we want to open a modal dialog at the lifetime // of a WaitCursor instance because the incoming events are still filtered. if (e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease) { @@ -150,8 +150,8 @@ bool WaitCursorP::eventFilter(QObject* o, QEvent* e) int WaitCursor::instances = 0; /** - * Constructs this object and shows the wait cursor immediately. If you need to open a dialog as - * long as an instance of WaitCursor exists you must call restoreCursor() before and setWaitCursor() + * Constructs this object and shows the wait cursor immediately. If you need to open a dialog as + * long as an instance of WaitCursor exists you must call restoreCursor() before and setWaitCursor() * afterwards because all key events and mouse button events are filtered, otherwise you will run * into strange behaviour. */ diff --git a/src/Gui/WaitCursor.h b/src/Gui/WaitCursor.h index 3761f89562..f3db88d5d2 100644 --- a/src/Gui/WaitCursor.h +++ b/src/Gui/WaitCursor.h @@ -29,8 +29,8 @@ namespace Gui { /** - * This class sets a waitcursor automatically while a slow operation is running. - * Therefore you just have to create an instance of WaitCursor before the time + * This class sets a waitcursor automatically while a slow operation is running. + * Therefore you just have to create an instance of WaitCursor before the time * consuming operation starts. * * \code: @@ -39,7 +39,7 @@ namespace Gui { * ... // slow operation * ... * \endcode - * + * * Sometimes you have two slow operations with some user interactions in between them. * Avoiding to show the waiting cursor then you have to call the methods @ref restoreCursor() * and setWaitCursor manually, like: @@ -55,7 +55,7 @@ namespace Gui { * ... * ... // 2nd slow operation * \endcode - * + * * @author Werner Mayer */ class GuiExport WaitCursor @@ -84,5 +84,5 @@ private: } // namespace Gui -#endif // GUI_WAIT_CURSOR_H +#endif // GUI_WAIT_CURSOR_H diff --git a/src/Gui/WhatsThis.cpp b/src/Gui/WhatsThis.cpp index cb00f01b43..55b57e12f4 100644 --- a/src/Gui/WhatsThis.cpp +++ b/src/Gui/WhatsThis.cpp @@ -63,7 +63,7 @@ Action * StdCmdDescription::createAction(void) void StdCmdDescription::activated(int iMsg) { - Q_UNUSED(iMsg); + Q_UNUSED(iMsg); if ( !inDescriptionMode() ) enterDescriptionMode(); else diff --git a/src/Gui/WidgetFactory.cpp b/src/Gui/WidgetFactory.cpp index 1a539396fa..7441d75389 100644 --- a/src/Gui/WidgetFactory.cpp +++ b/src/Gui/WidgetFactory.cpp @@ -682,7 +682,7 @@ void WidgetFactoryInst::destruct () /** * Creates a widget with the name \a sName which is a child of \a parent. - * To create an instance of this widget once it must has been registered. + * To create an instance of this widget once it must has been registered. * If there is no appropriate widget registered 0 is returned. */ QWidget* WidgetFactoryInst::createWidget (const char* sName, QWidget* parent) const @@ -724,7 +724,7 @@ QWidget* WidgetFactoryInst::createWidget (const char* sName, QWidget* parent) co /** * Creates a widget with the name \a sName which is a child of \a parent. - * To create an instance of this widget once it must has been registered. + * To create an instance of this widget once it must has been registered. * If there is no appropriate widget registered 0 is returned. */ Gui::Dialog::PreferencePage* WidgetFactoryInst::createPreferencePage (const char* sName, QWidget* parent) const @@ -762,9 +762,9 @@ Gui::Dialog::PreferencePage* WidgetFactoryInst::createPreferencePage (const char } /** - * Creates a preference widget with the name \a sName and the preference name \a sPref + * Creates a preference widget with the name \a sName and the preference name \a sPref * which is a child of \a parent. - * To create an instance of this widget once it must has been registered. + * To create an instance of this widget once it must has been registered. * If there is no appropriate widget registered 0 is returned. * After creation of this widget its recent preferences are restored automatically. */ @@ -1434,7 +1434,7 @@ void PyResource::load(const char* name) /** * Makes a connection between the sender widget \a sender and its signal \a signal * of the created resource and Python callback function \a cb. - * If the sender widget does not exist or no resource has been loaded this method returns false, + * If the sender widget does not exist or no resource has been loaded this method returns false, * otherwise it returns true. */ bool PyResource::connect(const char* sender, const char* signal, PyObject* cb) diff --git a/src/Gui/WidgetFactory.h b/src/Gui/WidgetFactory.h index 9957461752..d1d1ecf6eb 100644 --- a/src/Gui/WidgetFactory.h +++ b/src/Gui/WidgetFactory.h @@ -76,7 +76,7 @@ private: Py::Object loadUi(const Py::Tuple& args); }; -/** +/** * The widget factory provides methods for the dynamic creation of widgets. * To create these widgets once they must be registered to the factory. * To register them use WidgetProducer or any subclasses; to register a @@ -108,7 +108,7 @@ inline WidgetFactoryInst& WidgetFactory() // -------------------------------------------------------------------- /** - * The UiLoader class provides the abitlity to use the widget factory + * The UiLoader class provides the abitlity to use the widget factory * framework of FreeCAD within the framework provided by Qt. This class * extends QUiLoader by the creation of FreeCAD specific widgets. * @author Werner Mayer @@ -123,7 +123,7 @@ public: * Creates a widget of the type \a className with the parent \a parent. * For more details see the documentation to QWidgetFactory. */ - QWidget* createWidget(const QString & className, QWidget * parent=0, + QWidget* createWidget(const QString & className, QWidget * parent=0, const QString& name = QString()); private: QStringList cw; @@ -131,7 +131,7 @@ private: // -------------------------------------------------------------------- -class UiLoaderPy : public Py::PythonExtension +class UiLoaderPy : public Py::PythonExtension { public: static void init_type(void); // announce properties and methods @@ -153,15 +153,15 @@ private: // -------------------------------------------------------------------- /** - * The WidgetProducer class is a value-based template class that provides - * the ability to create widgets dynamically. + * The WidgetProducer class is a value-based template class that provides + * the ability to create widgets dynamically. * \author Werner Mayer */ template class WidgetProducer : public Base::AbstractProducer { public: - /** + /** * Register a special type of widget to the WidgetFactoryInst. */ WidgetProducer () @@ -172,7 +172,7 @@ public: virtual ~WidgetProducer (){} - /** + /** * Creates an instance of the specified widget. */ virtual void* Produce () const @@ -184,15 +184,15 @@ public: // -------------------------------------------------------------------- /** - * The PrefPageProducer class is a value-based template class that provides - * the ability to create preference pages dynamically. + * The PrefPageProducer class is a value-based template class that provides + * the ability to create preference pages dynamically. * \author Werner Mayer */ template class PrefPageProducer : public Base::AbstractProducer { public: - /** + /** * Register a special type of preference page to the WidgetFactoryInst. */ PrefPageProducer (const char* group) @@ -228,7 +228,7 @@ public: class GuiExport PrefPageUiProducer : public Base::AbstractProducer { public: - /** + /** * Register a special type of preference page to the WidgetFactoryInst. */ PrefPageUiProducer (const char* filename, const char* group); @@ -250,7 +250,7 @@ private: class GuiExport PrefPagePyProducer : public Base::AbstractProducer { public: - /** + /** * Register a special type of preference page to the WidgetFactoryInst. */ PrefPagePyProducer (const Py::Object&, const char* group); @@ -267,15 +267,15 @@ private: // -------------------------------------------------------------------- /** - * The CustomPageProducer class is a value-based template class that provides - * the ability to create custom pages dynamically. + * The CustomPageProducer class is a value-based template class that provides + * the ability to create custom pages dynamically. * \author Werner Mayer */ template class CustomPageProducer : public Base::AbstractProducer { public: - /** + /** * Register a special type of customize page to the WidgetFactoryInst. */ CustomPageProducer () @@ -294,7 +294,7 @@ public: virtual ~CustomPageProducer (){} - /** + /** * Creates an instance of the specified widget. */ virtual void* Produce () const @@ -360,10 +360,10 @@ private: * d = Gui.createDialog("test.ui") * \endcode * - * you can create a PyResource object containing the widget. If a relative file name - * is given PyResource looks first in the current working directory and afterwards in + * you can create a PyResource object containing the widget. If a relative file name + * is given PyResource looks first in the current working directory and afterwards in * the home path where FreeCAD resides. - * + * * If the appropriate .ui file cannot be found or creation fails an exception is thrown. * In case the widget in the .ui file does not inherit from QDialog it is embedded in a * \ref ContainerDialog object. diff --git a/src/Gui/Widgets.cpp b/src/Gui/Widgets.cpp index 75d6759d1e..0c5c9f123c 100644 --- a/src/Gui/Widgets.cpp +++ b/src/Gui/Widgets.cpp @@ -66,7 +66,7 @@ using namespace Base; CommandIconView::CommandIconView ( QWidget * parent ) : QListWidget(parent) { - connect(this, SIGNAL (currentItemChanged(QListWidgetItem *, QListWidgetItem *)), + connect(this, SIGNAL (currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT (onSelectionChanged(QListWidgetItem *, QListWidgetItem *)) ); } @@ -78,7 +78,7 @@ CommandIconView::~CommandIconView () } /** - * Stores the name of the selected commands for drag and drop. + * Stores the name of the selected commands for drag and drop. */ void CommandIconView::startDrag (Qt::DropActions supportedActions) { @@ -106,7 +106,7 @@ void CommandIconView::startDrag (Qt::DropActions supportedActions) } /** - * This slot is called when a new item becomes current. \a item is the new current item + * This slot is called when a new item becomes current. \a item is the new current item * (or 0 if no item is now current). This slot emits the emitSelectionChanged() * signal for its part. */ @@ -633,8 +633,8 @@ ColorButton::~ColorButton() delete d; } -/** - * Sets the color \a c to the button. +/** + * Sets the color \a c to the button. */ void ColorButton::setColor(const QColor& c) { @@ -643,7 +643,7 @@ void ColorButton::setColor(const QColor& c) update(); } -/** +/** * Returns the current color of the button. */ QColor ColorButton::color() const @@ -716,7 +716,7 @@ void ColorButton::paintEvent (QPaintEvent * e) } } - // overpaint the rectangle to paint icon and text + // overpaint the rectangle to paint icon and text QStyleOptionButton opt; opt.init(this); opt.text = text(); @@ -1023,7 +1023,7 @@ bool ToolTip::eventFilter(QObject* o, QEvent*e) removeEventFilter(); this->hidden = true; } - else if (e->type() == QEvent::Timer && + else if (e->type() == QEvent::Timer && !this->hidden && displayTime.elapsed() < 5000) { return true; } @@ -1354,8 +1354,8 @@ void LabelEditor::setInputType(InputType t) // -------------------------------------------------------------------- -ExpLineEdit::ExpLineEdit(QWidget* parent, bool expressionOnly) - : QLineEdit(parent), autoClose(expressionOnly) +ExpLineEdit::ExpLineEdit(QWidget* parent, bool expressionOnly) + : QLineEdit(parent), autoClose(expressionOnly) { defaultPalette = palette(); @@ -1372,12 +1372,12 @@ ExpLineEdit::ExpLineEdit(QWidget* parent, bool expressionOnly) setStyleSheet(QString::fromLatin1("QLineEdit { padding-right: %1px } ").arg(iconHeight+frameWidth)); QObject::connect(iconLabel, SIGNAL(clicked()), this, SLOT(openFormulaDialog())); - if(expressionOnly) + if(expressionOnly) QMetaObject::invokeMethod(this, "openFormulaDialog", Qt::QueuedConnection, QGenericReturnArgument()); } bool ExpLineEdit::apply(const std::string& propName) { - + if (!ExpressionBinding::apply(propName)) { if(!autoClose) { QString val = QString::fromUtf8(Base::Interpreter().strToPython(text().toUtf8()).c_str()); @@ -1390,7 +1390,7 @@ bool ExpLineEdit::apply(const std::string& propName) { } void ExpLineEdit::bind(const ObjectIdentifier& _path) { - + ExpressionBinding::bind(_path); int frameWidth = style()->pixelMetric(QStyle::PM_SpinBoxFrameWidth); @@ -1416,7 +1416,7 @@ void ExpLineEdit::setExpression(boost::shared_ptr expr) } void ExpLineEdit::onChange() { - + if (getExpression()) { std::unique_ptr result(getExpression()->eval()); if(result->isDerivedFrom(App::StringExpression::getClassTypeId())) @@ -1511,7 +1511,7 @@ void ExpLineEdit::finishFormulaDialog() box->deleteLater(); - if(autoClose) + if(autoClose) this->deleteLater(); } diff --git a/src/Gui/Widgets.h b/src/Gui/Widgets.h index d8ec8c8007..c27dba24b0 100644 --- a/src/Gui/Widgets.h +++ b/src/Gui/Widgets.h @@ -248,7 +248,7 @@ private: /** * A text label where a url can specified. When the user clicks on the text label the system browser - * gets opened with the specified url. + * gets opened with the specified url. * * This can be used for e.g. in the about dialog where the url of the maintainer of an application * can be specified. @@ -414,7 +414,7 @@ public: LabelEditor (QWidget * parent = 0); virtual ~LabelEditor(); - /** + /** * Returns the text. */ QString text() const; diff --git a/src/Gui/Window.cpp b/src/Gui/Window.cpp index a0746c9f3c..af56378fb8 100644 --- a/src/Gui/Window.cpp +++ b/src/Gui/Window.cpp @@ -83,8 +83,8 @@ ParameterGrp::handle WindowParameter::getWindowParameter(void) return _handle; } -/** - * Returns a handle to the parameter group to the user parameter +/** + * Returns a handle to the parameter group to the user parameter * under BaseApp/Preferences. */ ParameterGrp::handle WindowParameter::getDefaultParameter(void) diff --git a/src/Gui/Workbench.cpp b/src/Gui/Workbench.cpp index 5c0eee3f45..cc3d1bec6a 100644 --- a/src/Gui/Workbench.cpp +++ b/src/Gui/Workbench.cpp @@ -120,7 +120,7 @@ using namespace Gui; * return root; * } * }; - * + * * \endcode * * \subsection customizeWorkbench Customizing the workbench @@ -542,7 +542,7 @@ void StdWorkbench::setupContextMenu(const char* recipient, MenuItem* item) const if (Gui::Selection().countObjectsOfType(App::DocumentObject::getClassTypeId()) > 0) { *item << "Separator" << "Std_SetAppearance" << "Std_ToggleVisibility" - << "Std_ToggleSelectability" << "Std_TreeSelection" + << "Std_ToggleSelectability" << "Std_TreeSelection" << "Std_RandomColor" << "Separator" << "Std_Delete" << "Std_SendToPythonConsole"; } @@ -551,9 +551,9 @@ void StdWorkbench::setupContextMenu(const char* recipient, MenuItem* item) const { if (Gui::Selection().countObjectsOfType(App::DocumentObject::getClassTypeId()) > 0) { *item << "Std_ToggleVisibility" << "Std_ShowSelection" << "Std_HideSelection" - << "Std_ToggleSelectability" << "Std_TreeSelectAllInstances" << "Separator" - << "Std_SetAppearance" << "Std_RandomColor" << "Separator" - << "Std_Cut" << "Std_Copy" << "Std_Paste" << "Std_Delete" + << "Std_ToggleSelectability" << "Std_TreeSelectAllInstances" << "Separator" + << "Std_SetAppearance" << "Std_RandomColor" << "Separator" + << "Std_Cut" << "Std_Copy" << "Std_Paste" << "Std_Delete" << "Std_SendToPythonConsole" << "Separator"; } } @@ -574,8 +574,8 @@ MenuItem* StdWorkbench::setupMenuBar() const file->setCommand("&File"); *file << "Std_New" << "Std_Open" << "Separator" << "Std_CloseActiveWindow" << "Std_CloseAllWindows" << "Separator" << "Std_Save" << "Std_SaveAs" - << "Std_SaveCopy" << "Std_SaveAll" << "Std_Revert" << "Separator" << "Std_Import" - << "Std_Export" << "Std_MergeProjects" << "Std_ProjectInfo" + << "Std_SaveCopy" << "Std_SaveAll" << "Std_Revert" << "Separator" << "Std_Import" + << "Std_Export" << "Std_MergeProjects" << "Std_ProjectInfo" << "Separator" << "Std_Print" << "Std_PrintPreview" << "Std_PrintPdf" << "Separator" << "Std_RecentFiles" << "Separator" << "Std_Quit"; @@ -584,7 +584,7 @@ MenuItem* StdWorkbench::setupMenuBar() const edit->setCommand("&Edit"); *edit << "Std_Undo" << "Std_Redo" << "Separator" << "Std_Cut" << "Std_Copy" << "Std_Paste" << "Std_DuplicateSelection" << "Separator" - << "Std_Refresh" << "Std_BoxSelection" << "Std_BoxElementSelection" + << "Std_Refresh" << "Std_BoxSelection" << "Std_BoxElementSelection" << "Std_SelectAll" << "Std_Delete" << "Std_SendToPythonConsole" << "Separator" << "Std_Placement" /*<< "Std_TransformManip"*/ << "Std_Alignment" << "Std_Edit" << "Separator" << "Std_DlgPreferences"; @@ -607,7 +607,7 @@ MenuItem* StdWorkbench::setupMenuBar() const // stereo MenuItem* view3d = new MenuItem; view3d->setCommand("&Stereo"); - *view3d << "Std_ViewIvStereoRedGreen" << "Std_ViewIvStereoQuadBuff" + *view3d << "Std_ViewIvStereoRedGreen" << "Std_ViewIvStereoQuadBuff" << "Std_ViewIvStereoInterleavedRows" << "Std_ViewIvStereoInterleavedColumns" << "Std_ViewIvStereoOff" << "Separator" << "Std_ViewIvIssueCamPos"; @@ -621,7 +621,7 @@ MenuItem* StdWorkbench::setupMenuBar() const visu->setCommand("Visibility"); *visu << "Std_ToggleVisibility" << "Std_ShowSelection" << "Std_HideSelection" << "Std_SelectVisibleObjects" - << "Separator" << "Std_ToggleObjects" << "Std_ShowObjects" << "Std_HideObjects" + << "Separator" << "Std_ToggleObjects" << "Std_ShowObjects" << "Std_HideObjects" << "Separator" << "Std_ToggleSelectability" << "Separator" << "View_Measure_Toggle_All" << "View_Measure_Clear_All"; @@ -632,14 +632,14 @@ MenuItem* StdWorkbench::setupMenuBar() const << stdviews << "Std_FreezeViews" << "Std_DrawStyle" << "Std_SelBoundingBox" << "Separator" << view3d << zoom << "Std_ViewDockUndockFullscreen" << "Std_AxisCross" << "Std_ToggleClipPlane" - << "Std_TextureMapping" + << "Std_TextureMapping" #ifdef BUILD_VR << "Std_ViewVR" -#endif +#endif << "Separator" << visu << "Std_ToggleVisibility" << "Std_ToggleNavigation" - << "Std_SetAppearance" << "Std_RandomColor" << "Separator" - << "Std_Workbench" << "Std_ToolBarMenu" << "Std_DockViewMenu" << "Separator" + << "Std_SetAppearance" << "Std_RandomColor" << "Separator" + << "Std_Workbench" << "Std_ToolBarMenu" << "Std_DockViewMenu" << "Separator" << "Std_TreeViewActions" << "Std_ViewStatusBar"; @@ -772,7 +772,7 @@ DockWindowItems* StdWorkbench::setupDockWindows() const root->addDockWidget("Std_ComboView", Qt::LeftDockWidgetArea, false, false); root->addDockWidget("Std_ReportView", Qt::BottomDockWidgetArea, true, true); root->addDockWidget("Std_PythonView", Qt::BottomDockWidgetArea, true, true); - + //Dagview through parameter. ParameterGrp::handle group = App::GetApplication().GetUserParameter(). GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("DockWindows")->GetGroup("DAGView"); @@ -780,7 +780,7 @@ DockWindowItems* StdWorkbench::setupDockWindows() const bool enabled = group->GetBool("Enabled", false); if (enabled) root->addDockWidget("Std_DAGView", Qt::RightDockWidgetArea, false, false); - + return root; } diff --git a/src/Gui/Workbench.h b/src/Gui/Workbench.h index a5ee834246..46c70b9eeb 100644 --- a/src/Gui/Workbench.h +++ b/src/Gui/Workbench.h @@ -42,10 +42,10 @@ class DockWindowItems; class WorkbenchManager; /** - * This is the base class for the workbench facility. Each FreeCAD module can provide its own - * workbench implementation. The workbench defines which GUI elements (such as toolbars, menus, - * dockable windows, ...) are added to the mainwindow and which gets removed or hidden. - * When a workbench object gets activated the first time the module - it stands for - gets + * This is the base class for the workbench facility. Each FreeCAD module can provide its own + * workbench implementation. The workbench defines which GUI elements (such as toolbars, menus, + * dockable windows, ...) are added to the mainwindow and which gets removed or hidden. + * When a workbench object gets activated the first time the module - it stands for - gets * loaded into RAM. * @author Werner Mayer */ @@ -69,15 +69,15 @@ public: * The default implementation returns an instance of @ref WorkbenchPy. */ PyObject* getPyObject(); - /** Sets up the contextmenu for this workbench. + /** Sets up the contextmenu for this workbench. * The default implementation does nothing. */ virtual void setupContextMenu(const char* recipient,MenuItem*) const; - /** Sets up the contextmenu for the main window for this workbench. + /** Sets up the contextmenu for the main window for this workbench. * The default implementation does nothing. */ virtual void createMainWindowPopupMenu(MenuItem*) const; - /** + /** * Activates the workbench and adds/removes GUI elements. */ bool activate(); @@ -130,7 +130,7 @@ private: }; /** - * The StdWorkbench class defines the standard menus, toolbars, commandbars etc. + * The StdWorkbench class defines the standard menus, toolbars, commandbars etc. * To define own workbenches you should inherit from StdWorkbench instead of Workbench * to have defined the standard GUI elements. * @author Werner Mayer @@ -162,7 +162,7 @@ protected: }; /** - * The BlankWorkbench class defines a complete empty workbench. + * The BlankWorkbench class defines a complete empty workbench. * @author Werner Mayer */ class GuiExport BlankWorkbench : public Workbench @@ -192,7 +192,7 @@ protected: }; /** - * The NoneWorkbench class defines a slim workbench. + * The NoneWorkbench class defines a slim workbench. * @author Werner Mayer */ class GuiExport NoneWorkbench : public StdWorkbench @@ -323,4 +323,4 @@ protected: } // namespace Gui -#endif // GUI_WORKBENCH_H +#endif // GUI_WORKBENCH_H diff --git a/src/Gui/WorkbenchFactory.h b/src/Gui/WorkbenchFactory.h index e137a8e8bf..5f92d03bae 100644 --- a/src/Gui/WorkbenchFactory.h +++ b/src/Gui/WorkbenchFactory.h @@ -31,7 +31,7 @@ namespace Gui { class Workbench; -/** +/** * The workbench factory provides methods for the dynamic creation of * special workbenches for each module. To create these workbenches once * they must be registered through a subclass of WorkbenchProducer. @@ -47,7 +47,7 @@ public: static void destruct (); /** Creates the workbench with \a name. If no such workbench is registered - * 0 is returned. + * 0 is returned. */ Workbench* createWorkbench ( const char* sName ) const; /** Returns a list of all registered workbench classes. */ @@ -68,7 +68,7 @@ inline GuiExport WorkbenchFactoryInst& WorkbenchFactory() // -------------------------------------------------------------------- /** - * The WorkbenchProducer template class allos the registration and the creation of workbench + * The WorkbenchProducer template class allows the registration and the creation of workbench * classes. * @author Werner Mayer */ @@ -88,6 +88,6 @@ public: } }; -} // namespace Gui +} // namespace Gui -#endif // GUI_WORKBENCHFACTORY_H +#endif // GUI_WORKBENCHFACTORY_H diff --git a/src/Gui/WorkbenchManager.cpp b/src/Gui/WorkbenchManager.cpp index 3305c3a19c..ee8466f0d5 100644 --- a/src/Gui/WorkbenchManager.cpp +++ b/src/Gui/WorkbenchManager.cpp @@ -131,7 +131,7 @@ bool WorkbenchManager::activate(const std::string& name, const std::string& clas wb->activate(); return true; } - + return false; } diff --git a/src/Gui/WorkbenchManager.h b/src/Gui/WorkbenchManager.h index 4596271f17..f7482ffc43 100644 --- a/src/Gui/WorkbenchManager.h +++ b/src/Gui/WorkbenchManager.h @@ -34,7 +34,7 @@ class Workbench; * The WorkbenchManager class manages all workbench objects. * @author Werner Mayer */ -class GuiExport WorkbenchManager +class GuiExport WorkbenchManager { public: /** Creates the only instance of the WorkbenchManager. */ @@ -51,7 +51,7 @@ public: */ void removeWorkbench(const std::string& name); /** Returns an instance of the workbench with name \a name. If there is - * no such workbench 0 is returned. + * no such workbench 0 is returned. */ Workbench* getWorkbench (const std::string& name) const; /** Activates the workbench with name \a name. */ @@ -74,4 +74,4 @@ private: } // namespace Gui -#endif // GUI_WORKBENCHMANAGER_H +#endif // GUI_WORKBENCHMANAGER_H diff --git a/src/Gui/WorkbenchPyImp.cpp b/src/Gui/WorkbenchPyImp.cpp index 2cd3001363..3982446ed9 100644 --- a/src/Gui/WorkbenchPyImp.cpp +++ b/src/Gui/WorkbenchPyImp.cpp @@ -67,9 +67,9 @@ PyObject* WorkbenchPy::activate(PyObject *args) return nullptr; PY_TRY { - std::string name = getWorkbenchPtr()->name(); + std::string name = getWorkbenchPtr()->name(); WorkbenchManager::instance()->activate( name, getWorkbenchPtr()->getTypeId().getName() ); - Py_Return; + Py_Return; }PY_CATCH; } @@ -152,5 +152,5 @@ PyObject* WorkbenchPy::getCustomAttributes(const char*) const int WorkbenchPy::setCustomAttributes(const char*, PyObject *) { - return 0; + return 0; } diff --git a/src/Gui/core-gui.dox b/src/Gui/core-gui.dox index 602dacd556..59a191873f 100644 --- a/src/Gui/core-gui.dox +++ b/src/Gui/core-gui.dox @@ -1,6 +1,6 @@ /** \defgroup GUI Gui - * \ingroup CORE - * \brief The Graphical User Interface of FreeCAD and the 3D View + * \ingroup CORE + * \brief The Graphical User Interface of FreeCAD and the 3D View */ /** \namespace Gui diff --git a/src/Gui/lex.SelectionFilter.c b/src/Gui/lex.SelectionFilter.c index 58d3088c8d..1518012aa4 100644 --- a/src/Gui/lex.SelectionFilter.c +++ b/src/Gui/lex.SelectionFilter.c @@ -1,3 +1,23 @@ +/*************************************************************************** + * Copyright (c) 2011 Werner Mayer * + * * + * This library is free software; you can redistribute it and/or * + * modify it under the terms of the GNU Library General Public * + * License as published by the Free Software Foundation; either * + * version 2 of the License, or (at your option) any later version. * + * * + * This library 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 this library; see the file COPYING.LIB. If not, * + * write to the Free Software Foundation, Inc., 59 Temple Place, * + * Suite 330, Boston, MA 02111-1307, USA * + * * + ***************************************************************************/ + #line 2 "lex.SelectionFilter.c" #line 4 "lex.SelectionFilter.c" @@ -509,20 +529,20 @@ char *SelectionFiltertext; /* Copyright (c) 2010 Jürgen Riegel LGPL */ /* flex -o lex.SelectionFilter.c SelectionFilter.l */ - -#include - -#include "stdio.h" - - -/* This disables inclusion of unistd.h, which is not available under Visual C++ - * on Win32. The C++ scanner uses STL streams instead. */ -#define YY_NO_UNISTD_H - -/*** Flex Declarations and Options ***/ -/* change the name of the scanner class. results in "SelectionFilterFlexLexer" */ -/* the manual says "somewhat more optimized" */ -/* no support for include files is planned */ + +#include + +#include "stdio.h" + + +/* This disables inclusion of unistd.h, which is not available under Visual C++ + * on Win32. The C++ scanner uses STL streams instead. */ +#define YY_NO_UNISTD_H + +/*** Flex Declarations and Options ***/ +/* change the name of the scanner class. results in "SelectionFilterFlexLexer" */ +/* the manual says "somewhat more optimized" */ +/* no support for include files is planned */ #line 527 "lex.SelectionFilter.c" #define INITIAL 0 @@ -741,8 +761,8 @@ YY_DECL { #line 30 "SelectionFilter.l" - - + + #line 747 "lex.SelectionFilter.c" while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ @@ -799,55 +819,55 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP #line 33 "SelectionFilter.l" -; +; YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP #line 34 "SelectionFilter.l" -; +; YY_BREAK case 3: YY_RULE_SETUP #line 35 "SelectionFilter.l" -return TSUB; +return TSUB; YY_BREAK case 4: YY_RULE_SETUP #line 36 "SelectionFilter.l" -return TSELECT; +return TSELECT; YY_BREAK case 5: YY_RULE_SETUP #line 37 "SelectionFilter.l" -return TCOUNT; +return TCOUNT; YY_BREAK case 6: YY_RULE_SETUP #line 38 "SelectionFilter.l" -return TSLICE; +return TSLICE; YY_BREAK case 7: YY_RULE_SETUP #line 39 "SelectionFilter.l" -return TNAMESPACE; +return TNAMESPACE; YY_BREAK case 8: YY_RULE_SETUP #line 41 "SelectionFilter.l" -{ - yylval.string = new std::string(SelectionFiltertext); - return TIDENTIFIER; - } +{ + yylval.string = new std::string(SelectionFiltertext); + return TIDENTIFIER; + } YY_BREAK case 9: YY_RULE_SETUP #line 45 "SelectionFilter.l" -{ - long n = strtol (SelectionFiltertext, NULL, 10); - yylval.number = n; - return TNUMBER; - } +{ + long n = strtol (SelectionFiltertext, NULL, 10); + yylval.number = n; + return TNUMBER; + } YY_BREAK case 10: YY_RULE_SETUP diff --git a/src/Gui/resource.cpp b/src/Gui/resource.cpp index c0c8e74f05..4449b09b3b 100644 --- a/src/Gui/resource.cpp +++ b/src/Gui/resource.cpp @@ -60,7 +60,7 @@ using namespace Gui::Dialog; */ WidgetFactorySupplier::WidgetFactorySupplier() { - // ADD YOUR PREFERENCE PAGES HERE + // ADD YOUR PREFERENCE PAGES HERE // // new PrefPageProducer ( QT_TRANSLATE_NOOP("QObject","General") );