From dc0cabde0516396f5f4458574d1d56c857478200 Mon Sep 17 00:00:00 2001 From: vsv Date: Wed, 2 Nov 2016 16:06:45 +0300 Subject: [PATCH] Issue #1834: Fix length of lines --- cpplint.cfg | 3 + src/PartSet/PartSet_SketcherMgr.cpp | 39 ++++++----- src/XGUI/XGUI_ActionsMgr.cpp | 12 ++-- src/XGUI/XGUI_ActionsMgr.h | 3 +- src/XGUI/XGUI_ColorDialog.cpp | 3 +- src/XGUI/XGUI_ColorDialog.h | 13 ++-- src/XGUI/XGUI_ContextMenuMgr.cpp | 9 ++- src/XGUI/XGUI_CustomPrs.cpp | 6 +- src/XGUI/XGUI_DataModel.cpp | 9 ++- src/XGUI/XGUI_DataModel.h | 14 ++-- src/XGUI/XGUI_Displayer.cpp | 65 ++++++++++++------ src/XGUI/XGUI_Displayer.h | 26 +++++--- src/XGUI/XGUI_ErrorMgr.cpp | 3 +- src/XGUI/XGUI_HistoryMenu.cpp | 1 + src/XGUI/XGUI_HistoryMenu.h | 1 + src/XGUI/XGUI_MenuGroup.h | 4 +- src/XGUI/XGUI_MenuMgr.cpp | 13 ++-- src/XGUI/XGUI_MenuMgr.h | 4 +- src/XGUI/XGUI_ModuleConnector.cpp | 3 +- src/XGUI/XGUI_ObjectsBrowser.cpp | 13 ++-- src/XGUI/XGUI_OperationMgr.cpp | 65 ++++++++++++------ src/XGUI/XGUI_PropertyPanel.cpp | 6 +- src/XGUI/XGUI_QtEvents.cpp | 3 +- src/XGUI/XGUI_SalomeConnector.h | 6 +- src/XGUI/XGUI_Selection.cpp | 14 ++-- src/XGUI/XGUI_Selection.h | 3 +- src/XGUI/XGUI_SelectionMgr.cpp | 6 +- src/XGUI/XGUI_Tools.cpp | 9 ++- src/XGUI/XGUI_Workshop.cpp | 100 ++++++++++++++++++---------- src/XGUI/XGUI_Workshop.h | 7 +- src/XGUI/XGUI_WorkshopListener.cpp | 39 ++++++----- src/XGUI/XGUI_WorkshopListener.h | 7 +- 32 files changed, 330 insertions(+), 179 deletions(-) create mode 100644 cpplint.cfg diff --git a/cpplint.cfg b/cpplint.cfg new file mode 100644 index 000000000..f90ce4245 --- /dev/null +++ b/cpplint.cfg @@ -0,0 +1,3 @@ +linelength=100 +filter=-whitespace,+whitespace/line_length,-readability,-build,-runtime +root=src diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 5d5a26e5b..e91a55170 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -98,8 +98,8 @@ //#define DEBUG_CURSOR /// Fills attribute and result lists by the selected owner. In case if the attribute is found, -/// by the owner shape, it is put to the list. Otherwise if type of owner shape is edge, put the function -/// result as is to the list of results. +/// by the owner shape, it is put to the list. Otherwise if type of owner shape is edge, +/// put the function result as is to the list of results. /// \param theOwner a viewer selected owner /// \param theFeature a feature, where the attribute is searched /// \param theSketch a current sketch @@ -287,7 +287,7 @@ void PartSet_SketcherMgr::onAfterValuesChangedInPropertyPanel() myModule->sketchReentranceMgr()->updateInternalEditActiveState(); return; } - // it is necessary to restore current selection in order to restore it after the values are modified + // it is necessary to restore current selection in order to restore it after values are modified restoreSelection(); myCurrentSelection.clear(); @@ -485,7 +485,7 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEve // the feature is to be erased here, but it is correct to call canDisplayObject because // there can be additional check (e.g. editor widget in distance constraint) ModuleBase_OperationFeature* aFOperation = dynamic_cast - (getCurrentOperation()); + (getCurrentOperation()); if (aFOperation) { FeaturePtr aFeature = aFOperation->feature(); visualizeFeature(aFeature, aFOperation->isEditOperation(), canDisplayObject(aFeature)); @@ -495,7 +495,8 @@ void PartSet_SketcherMgr::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEve //myClickedPoint.clear(); if (myIsDragging) { - // 1. the current selection is saved in the mouse press method in order to restore it after moving + // 1. the current selection is saved in the mouse press method in order to restore it after + // moving // 2. the enable selection in the viewer should be temporary switched off in order to ignore // mouse press signal in the viewer(it call Select for AIS context and the dragged objects are // deselected). This flag should be restored in the slot, processed the mouse release signal. @@ -1172,11 +1173,13 @@ bool PartSet_SketcherMgr::canDisplayObject(const ObjectPtr& theObject) const #ifndef DEBUG_DO_NOT_BY_ENTER if (isNestedCreateOperation(getCurrentOperation(), activeSketch())) { ModuleBase_ModelWidget* anActiveWidget = getActiveWidget(); - ModuleBase_WidgetEditor* anEditorWdg = anActiveWidget ? dynamic_cast(anActiveWidget) : 0; - // the active widget editor should not influence here. The presentation should be visible always - // when this widget is active. + ModuleBase_WidgetEditor* anEditorWdg = + anActiveWidget ? dynamic_cast(anActiveWidget) : 0; + // the active widget editor should not influence here. The presentation should be visible + // always when this widget is active. if (!anEditorWdg && !myIsPopupMenuActive) { - // during a nested create operation, the feature is redisplayed only if the mouse over view + // during a nested create operation, the feature is redisplayed only + // if the mouse over view // of there was a value modified in the property panel after the mouse left the view aCanDisplay = canDisplayCurrentCreatedFeature(); } @@ -1489,13 +1492,15 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature, SelectMgr_IndexedMapOfOwner aSelectedOwners; aConnector->workshop()->selector()->selection()->entityOwners(anAISIO, aSelectedOwners); for ( Standard_Integer i = 1, n = aSelectedOwners.Extent(); i <= n; i++ ) { - Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(aSelectedOwners(i)); + Handle(StdSelect_BRepOwner) anOwner = + Handle(StdSelect_BRepOwner)::DownCast(aSelectedOwners(i)); if ( anOwner.IsNull() || !anOwner->HasShape() ) continue; const TopoDS_Shape& aShape = anOwner->Shape(); TopAbs_ShapeEnum aShapeType = aShape.ShapeType(); if (aShapeType == TopAbs_VERTEX) { - AttributePtr aPntAttr = PartSet_Tools::findAttributeBy2dPoint(theFeature, aShape, theSketch); + AttributePtr aPntAttr = + PartSet_Tools::findAttributeBy2dPoint(theFeature, aShape, theSketch); if (aPntAttr.get() != NULL && aSelectedAttributes.find(aPntAttr) != aSelectedAttributes.end()) { theOwnersToSelect.Add(anOwner); @@ -1511,7 +1516,8 @@ void PartSet_SketcherMgr::getSelectionOwners(const FeaturePtr& theFeature, } } -void PartSet_SketcherMgr::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, const bool isToConnect) +void PartSet_SketcherMgr::connectToPropertyPanel(ModuleBase_ModelWidget* theWidget, + const bool isToConnect) { if (isToConnect) { connect(theWidget, SIGNAL(beforeValuesChanged()), @@ -1637,7 +1643,8 @@ void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly) // 1. it is necessary to save current selection in order to restore it after the features moving myCurrentSelection.clear(); - QList::const_iterator anIt = aStoredPrs.begin(), aLast = aStoredPrs.end(); + QList::const_iterator anIt = aStoredPrs.begin(), + aLast = aStoredPrs.end(); CompositeFeaturePtr aSketch = activeSketch(); for (; anIt != aLast; anIt++) { @@ -1657,7 +1664,8 @@ void PartSet_SketcherMgr::storeSelection(const bool theHighlightedOnly) std::set aSelectedAttributes; std::set aSelectedResults; if (myCurrentSelection.find(aFeature) != myCurrentSelection.end()) { - std::pair, std::set > aPair = myCurrentSelection.find(aFeature).value(); + std::pair, std::set > aPair = + myCurrentSelection.find(aFeature).value(); aSelectedAttributes = aPair.first; aSelectedResults = aPair.second; } @@ -1769,7 +1777,8 @@ void PartSet_SketcherMgr::updateSelectionPriority(ObjectPtr theObject, // 3. External objects (violet color) // 4. Auxiliary segments (dotted) // StdSelect_BRepSelectionTool::Load uses priority calculating: - // Standard_Integer aPriority = (thePriority == -1) ? GetStandardPriority (theShape, theType) : thePriority; + // Standard_Integer aPriority = + // (thePriority == -1) ? GetStandardPriority (theShape, theType) : thePriority; // Priority of Vertex is 8, edge(segment) is 7. // It might be not corrected as provides the condition above. bool isExternal = aSPFeature->isExternal(); diff --git a/src/XGUI/XGUI_ActionsMgr.cpp b/src/XGUI/XGUI_ActionsMgr.cpp index 129a595da..510c56c33 100644 --- a/src/XGUI/XGUI_ActionsMgr.cpp +++ b/src/XGUI/XGUI_ActionsMgr.cpp @@ -159,7 +159,8 @@ void XGUI_ActionsMgr::updateOnViewSelection() ModelAPI_ValidatorsFactory::Validators::iterator aValidatorIt = aValidators.begin(); for (; aValidatorIt != aValidators.end(); ++aValidatorIt) { const ModuleBase_SelectionValidator* aSelValidator = - dynamic_cast(aFactory->validator(aValidatorIt->first)); + dynamic_cast + (aFactory->validator(aValidatorIt->first)); if (aSelValidator) setActionEnabled(aId, aSelValidator->isValid(aSelection, theOperation)); } @@ -251,7 +252,8 @@ QAction* XGUI_ActionsMgr::operationStateAction(OperationStateActionId theId) } break; case Preview: { - aResult = ModuleBase_Tools::createAction(QIcon(), tr("See preview"), aParent, 0, 0, "Compute preview"); + aResult = ModuleBase_Tools::createAction(QIcon(), tr("See preview"), + aParent, 0, 0, "Compute preview"); aResult->setStatusTip(aResult->toolTip()); } break; @@ -313,7 +315,8 @@ void XGUI_ActionsMgr::setNestedCommandsEnabled(bool theEnabled, const QString& t void XGUI_ActionsMgr::setNestedStackEnabled(ModuleBase_Operation* theOperation) { - ModuleBase_OperationFeature* anOperation = dynamic_cast(theOperation); + ModuleBase_OperationFeature* anOperation = + dynamic_cast(theOperation); if(!anOperation || !anOperation->feature()) return; FeaturePtr aFeature = anOperation->feature(); @@ -327,7 +330,8 @@ void XGUI_ActionsMgr::setNestedStackEnabled(ModuleBase_Operation* theOperation) QStringList XGUI_ActionsMgr::allNestedCommands(ModuleBase_Operation* theOperation) { QStringList aFeatures; - ModuleBase_OperationFeature* anOperation = dynamic_cast(theOperation); + ModuleBase_OperationFeature* anOperation = + dynamic_cast(theOperation); if(!anOperation || !anOperation->feature()) return aFeatures; FeaturePtr aFeature = anOperation->feature(); diff --git a/src/XGUI/XGUI_ActionsMgr.h b/src/XGUI/XGUI_ActionsMgr.h index ab650ed8d..191965da6 100644 --- a/src/XGUI/XGUI_ActionsMgr.h +++ b/src/XGUI/XGUI_ActionsMgr.h @@ -84,7 +84,8 @@ class XGUI_EXPORT XGUI_ActionsMgr : public QObject, public Events_Listener /// Return an action by the given id, if it was registered in the manager QAction* action(const QString& theId); - /// Return info (icon, text, etc) about the action by the given id, if it was registered in the manager + /// Return info (icon, text, etc) about the action by the given id, + /// if it was registered in the manager ActionInfo actionInfoById(const QString& theId); private: diff --git a/src/XGUI/XGUI_ColorDialog.cpp b/src/XGUI/XGUI_ColorDialog.cpp index 16cb5167b..0df84128d 100644 --- a/src/XGUI/XGUI_ColorDialog.cpp +++ b/src/XGUI/XGUI_ColorDialog.cpp @@ -85,7 +85,8 @@ void appendValues(std::vector& theRGB, const int theRed, const int theGreen bool containsValues(std::map >& theColorMap, std::vector& theValues) { - std::map >::const_iterator anIt = theColorMap.begin(), aLast = theColorMap.end(); + std::map >::const_iterator anIt = theColorMap.begin(), + aLast = theColorMap.end(); bool isFound = false; for (; anIt != aLast && !isFound; anIt++) { std::vector aValues = anIt->second; diff --git a/src/XGUI/XGUI_ColorDialog.h b/src/XGUI/XGUI_ColorDialog.h index 1b41916a4..6dbee367e 100644 --- a/src/XGUI/XGUI_ColorDialog.h +++ b/src/XGUI/XGUI_ColorDialog.h @@ -17,8 +17,8 @@ class QtxColorButton; /** * \ingroup GUI * A class of dialog to chose a color. The color can be set in two ways: use a random value or -* a certain color. There is a radio button to provide this choice. The color button is visualized to -* select a certain color. +* a certain color. There is a radio button to provide this choice. The color button is +* visualized to select a certain color. */ class XGUI_ColorDialog : public QDialog { @@ -38,12 +38,15 @@ public: /// \param theValue an RGB components value void setColor(const std::vector& theValue); - /// Returns a container with the current color value. These are tree int values for RGB definition. - /// These value is depend on the random choice and eighter a next random color or a certain color. + /// Returns a container with the current color value. + /// These are tree int values for RGB definition. + /// These value is depend on the random choice and eighter + /// a next random color or a certain color. /// \return a vector of values std::vector getColor() const; - /// Returns a container with the current color value. These are tree int values for RGB definition. + /// Returns a container with the current color value. + /// These are tree int values for RGB definition. /// It returns the next random color. /// \return a vector of values std::vector getRandomColor() const; diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 7cca98e11..1bef5f51f 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -340,7 +340,8 @@ void XGUI_ContextMenuMgr::updateViewerMenu() XGUI_SelectionMgr* aSelMgr = myWorkshop->selector(); XGUI_Displayer* aDisplayer = myWorkshop->displayer(); - QList aPrsList = aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer); + QList aPrsList = + aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer); if (aPrsList.size() > 0) { bool isVisible = false; bool isShading = false; @@ -352,7 +353,8 @@ void XGUI_ContextMenuMgr::updateViewerMenu() if (aRes && aRes->isDisplayed()) { isVisible = true; canBeShaded = myWorkshop->displayer()->canBeShaded(aObject); - isShading = (myWorkshop->displayer()->displayMode(aObject) == XGUI_Displayer::Shading); + isShading = + (myWorkshop->displayer()->displayMode(aObject) == XGUI_Displayer::Shading); break; } } @@ -564,7 +566,8 @@ void XGUI_ContextMenuMgr::addObjBrowserMenu(QMenu* theMenu) const void XGUI_ContextMenuMgr::addViewerMenu(QMenu* theMenu) const { XGUI_SelectionMgr* aSelMgr = myWorkshop->selector(); - QList aPrsList = aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer); + QList aPrsList = + aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer); int aSelected = aPrsList.size(); QActionsList aActions; diff --git a/src/XGUI/XGUI_CustomPrs.cpp b/src/XGUI/XGUI_CustomPrs.cpp index fc9b7fb08..8b2b3eee8 100644 --- a/src/XGUI/XGUI_CustomPrs.cpp +++ b/src/XGUI/XGUI_CustomPrs.cpp @@ -45,7 +45,8 @@ void getColor(const ResultPtr& theResult, std::vector& theColor) { theColor.clear(); // get color from the attribute of the result - if (theResult.get() != NULL && theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() != NULL) { + if (theResult.get() != NULL && + theResult->data()->attribute(ModelAPI_Result::COLOR_ID()).get() != NULL) { AttributeIntArrayPtr aColorAttr = theResult->data()->intArray(ModelAPI_Result::COLOR_ID()); if (aColorAttr.get() && aColorAttr->size()) { theColor.push_back(aColorAttr->value(0)); @@ -136,7 +137,8 @@ bool XGUI_CustomPrs::customisePresentation(ResultPtr theResult, AISObjectPtr the SessionPtr aMgr = ModelAPI_Session::get(); if (aMgr->activeDocument() != theResult->document()) { QColor aQColor(aColor[0], aColor[1], aColor[2]); - QColor aNewColor = QColor::fromHsvF(aQColor.hueF(), aQColor.saturationF()/3., aQColor.valueF()); + QColor aNewColor = + QColor::fromHsvF(aQColor.hueF(), aQColor.saturationF()/3., aQColor.valueF()); aColor[0] = aNewColor.red(); aColor[1] = aNewColor.green(); aColor[2] = aNewColor.blue(); diff --git a/src/XGUI/XGUI_DataModel.cpp b/src/XGUI/XGUI_DataModel.cpp index 1296ae94d..724553906 100644 --- a/src/XGUI/XGUI_DataModel.cpp +++ b/src/XGUI/XGUI_DataModel.cpp @@ -439,7 +439,8 @@ QVariant XGUI_DataModel::data(const QModelIndex& theIndex, int theRole) const { if (aObj->groupName() == ModelAPI_ResultParameter::group()) { ModelAPI_ResultParameter* aParam = dynamic_cast(aObj); - AttributeDoublePtr aValueAttribute = aParam->data()->real(ModelAPI_ResultParameter::VALUE()); + AttributeDoublePtr aValueAttribute = + aParam->data()->real(ModelAPI_ResultParameter::VALUE()); QString aVal = QString::number(aValueAttribute->value()); QString aTitle = QString(aObj->data()->name().c_str()); return aTitle + " = " + aVal; @@ -599,11 +600,13 @@ QModelIndex XGUI_DataModel::index(int theRow, int theColumn, const QModelIndex & } } else { // Check for composite object - ModelAPI_CompositeFeature* aCompFeature = dynamic_cast(aParentObj); + ModelAPI_CompositeFeature* aCompFeature = + dynamic_cast(aParentObj); if (aCompFeature) { aIndex = objectIndex(aCompFeature->subFeature(theRow)); } else { - ModelAPI_ResultCompSolid* aCompRes = dynamic_cast(aParentObj); + ModelAPI_ResultCompSolid* aCompRes = + dynamic_cast(aParentObj); if (aCompRes) aIndex = objectIndex(aCompRes->subResult(theRow)); } diff --git a/src/XGUI/XGUI_DataModel.h b/src/XGUI/XGUI_DataModel.h index 24bcf9cc7..a6918f628 100644 --- a/src/XGUI/XGUI_DataModel.h +++ b/src/XGUI/XGUI_DataModel.h @@ -26,7 +26,8 @@ class Config_DataModelReader; * - Non Valid Index - root index * - An index with internal Id == -1 is a folder of root document * - An index which contains internal pointer as ModelAPI_Object its the object - * - An index which contains internal pointer as ModelAPI_Document is a folder which belongs to this document + * - An index which contains internal pointer as ModelAPI_Document is + * a folder which belongs to this document */ class XGUI_EXPORT XGUI_DataModel : public QAbstractItemModel, public Events_Listener { @@ -80,7 +81,8 @@ public: /// \param theParent a parent model index virtual int columnCount(const QModelIndex& theParent = QModelIndex()) const; - /// Returns the index of the item in the model specified by the given row, column and parent index. + /// Returns the index of the item in the model specified by the given row, + /// column and parent index. /// \param theRow a row /// \param theColumn a column /// \param theParent a parent model index @@ -132,15 +134,17 @@ private: /// \param theDoc the document object QModelIndex findDocumentRootIndex(const ModelAPI_Document* theDoc) const; - /// Returns number of folders in document. Considered folders which has to be shown only if they are not empty. - /// \param theDoc document which has to be checked. If 0 then Root document will be considered + /// Returns number of folders in document. + /// Considered folders which has to be shown only if they are not empty. + /// \param theDoc document which has to be checked. If 0 then Root document will be considered int foldersCount(ModelAPI_Document* theDoc = 0) const; /// Retrurns indexes of folders which can not be shown because they are empty /// \param theDoc document which has to be checked. If 0 then Root document will be considered QIntList missedFolderIndexes(ModelAPI_Document* theDoc = 0) const; - /// Returns Id (row) of a folder taking into consideration folders which can not be shown non empty + /// Returns Id (row) of a folder taking into consideration + /// folders which can not be shown non empty /// \param theType Type of the folder /// \param theDoc a document which contains this folder int folderId(std::string theType, ModelAPI_Document* theDoc = 0); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 24e7b9eb6..d10b58ebd 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -63,7 +63,8 @@ #include -const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse selection sensitivity +/// defines the local context mouse selection sensitivity +const int MOUSE_SENSITIVITY_IN_PIXEL = 10; //#define DEBUG_ACTIVATE_OBJECTS //#define DEBUG_DEACTIVATE @@ -133,7 +134,8 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) bool aDisplayed = false; if (isVisible(theObject)) { #ifdef DEBUG_COMPOSILID_DISPLAY - ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(theObject); + ResultCompSolidPtr aCompsolidResult = + std::dynamic_pointer_cast(theObject); if (aCompsolidResult.get()) { for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { ResultPtr aSubResult = aCompsolidResult->subResult(i); @@ -168,7 +170,8 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aResult.get() != NULL) { #ifdef DEBUG_COMPOSILID_DISPLAY - ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(theObject); + ResultCompSolidPtr aCompsolidResult = + std::dynamic_pointer_cast(theObject); if (aCompsolidResult.get()) { for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { ResultPtr aSubResult = aCompsolidResult->subResult(i); @@ -183,7 +186,8 @@ bool XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer) std::shared_ptr aShapePtr = ModelAPI_Tools::shape(aResult); if (aShapePtr.get() != NULL) { anAIS = AISObjectPtr(new GeomAPI_AISObject()); - Handle(AIS_InteractiveObject) anAISPrs = myWorkshop->module()->createPresentation(aResult); + Handle(AIS_InteractiveObject) anAISPrs = + myWorkshop->module()->createPresentation(aResult); if (anAISPrs.IsNull()) anAISPrs = new ModuleBase_ResultPrs(aResult); else { @@ -338,7 +342,8 @@ bool XGUI_Displayer::redisplay(ObjectPtr theObject, bool theUpdateViewer) bool isCustomized = customizeObject(theObject); #ifdef DEBUG_FEATURE_REDISPLAY qDebug(QString("Redisplay: %1, isEqualShapes=%2, isCustomized=%3"). - arg(!isEqualShapes || isCustomized).arg(isEqualShapes).arg(isCustomized).toStdString().c_str()); + arg(!isEqualShapes || isCustomized).arg(isEqualShapes) + .arg(isCustomized).toStdString().c_str()); #endif if (!isEqualShapes || isCustomized) { /// if shapes are equal and presentation are customized, selection should be restored @@ -404,7 +409,8 @@ void XGUI_Displayer::deactivate(ObjectPtr theObject, const bool theUpdateViewer) deactivateAIS(anAIS); // the selection from the previous activation modes should be cleared manually (#26172) aContext->LocalContext()->ClearOutdatedSelection(anAIS, true); - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::deactivate -- ClearOutdatedSelection"); + ModuleBase_Tools::selectionInfo(aContext, + "XGUI_Displayer::deactivate -- ClearOutdatedSelection"); if (theUpdateViewer) updateViewer(); } @@ -458,10 +464,12 @@ bool XGUI_Displayer::isVisible(XGUI_Displayer* theDisplayer, const ObjectPtr& th ResultPtr aResult = std::dynamic_pointer_cast(theObject); if (aPrs.get() || aResult.get()) { aVisible = theDisplayer->isVisible(theObject); - // compsolid is not visualized in the viewer, but should have presentation when all sub solids are + // compsolid is not visualized in the viewer, + // but should have presentation when all sub solids are // visible. It is useful for highlight presentation where compsolid shape is selectable if (!aVisible && aResult.get() && aResult->groupName() == ModelAPI_ResultCompSolid::group()) { - ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(aResult); + ResultCompSolidPtr aCompsolidResult = + std::dynamic_pointer_cast(aResult); if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids bool anAllSubsVisible = aCompsolidResult->numberOfSubs() > 0; for(int i = 0; i < aCompsolidResult->numberOfSubs() && anAllSubsVisible; i++) { @@ -604,7 +612,8 @@ bool XGUI_Displayer::isActive(ObjectPtr theObject) const } -void XGUI_Displayer::setSelected(const QList& theValues, bool theUpdateViewer) +void XGUI_Displayer::setSelected(const QList& theValues, + bool theUpdateViewer) { Handle(AIS_InteractiveContext) aContext = AISContext(); if (aContext.IsNull()) @@ -612,7 +621,8 @@ void XGUI_Displayer::setSelected(const QList& theValue if (aContext->HasOpenedContext()) { aContext->UnhilightSelected(false); aContext->ClearSelected(false); - NCollection_DataMap> aShapesToBeSelected; + NCollection_DataMap> + aShapesToBeSelected; foreach (ModuleBase_ViewerPrsPtr aPrs, theValues) { const GeomShapePtr& aGeomShape = aPrs->shape(); @@ -665,7 +675,8 @@ void XGUI_Displayer::setSelected(const QList& theValue } } } - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::setSelected -- AddOrRemoveSelected/UnhilightCurrents(no local context)"); + ModuleBase_Tools::selectionInfo(aContext, + "XGUI_Displayer::setSelected -- AddOrRemoveSelected/UnhilightCurrents(no local context)"); if (theUpdateViewer) updateViewer(); } @@ -923,10 +934,14 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO, if (theIO->Width() > 1) { double aPrecision = theIO->Width() + 2; if (theMode == getSelectionMode(TopAbs_VERTEX)) - aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "point-selection-sensitivity", 20); - else if ((theMode == getSelectionMode(TopAbs_EDGE)) || (theMode == getSelectionMode(TopAbs_WIRE))) + aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", + "point-selection-sensitivity", + 20); + else if ((theMode == getSelectionMode(TopAbs_EDGE)) || + (theMode == getSelectionMode(TopAbs_WIRE))) aPrecision = theIO->Width() + - ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", "edge-selection-sensitivity", 2); + ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer", + "edge-selection-sensitivity", 2); aContext->SetSelectionSensitivity(theIO, theMode, aPrecision); } ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activateAIS -- Activate"); @@ -934,14 +949,16 @@ void XGUI_Displayer::activateAIS(const Handle(AIS_InteractiveObject)& theIO, #ifdef DEBUG_ACTIVATE_AIS ObjectPtr anObject = getObject(theIO); anInfo.append(ModuleBase_Tools::objectInfo((*anIt))); - qDebug(QString("activateAIS: theMode = %1, object = %2").arg(theMode).arg(anInfo).toStdString().c_str()); + qDebug(QString("activateAIS: theMode = %1, object = %2").arg(theMode) + .arg(anInfo).toStdString().c_str()); #endif if (theUpdateViewer) updateViewer(); } } -void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode) const +void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, + const int theMode) const { Handle(AIS_InteractiveContext) aContext = AISContext(); if (!aContext.IsNull()) { @@ -954,7 +971,8 @@ void XGUI_Displayer::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, c #ifdef DEBUG_DEACTIVATE_AIS ObjectPtr anObject = getObject(theIO); anInfo.append(ModuleBase_Tools::objectInfo((*anIt))); - qDebug(QString("deactivateAIS: theMode = %1, object = %2").arg(theMode).arg(anInfo).toStdString().c_str()); + qDebug(QString("deactivateAIS: theMode = %1, object = %2").arg(theMode) + .arg(anInfo).toStdString().c_str()); #endif } } @@ -1108,7 +1126,8 @@ void XGUI_Displayer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFi aCompositeFilter->Remove(theFilter); #ifdef DEBUG_SELECTION_FILTERS int aCount = aCompositeFilter->StoredFilters().Extent(); - qDebug(QString("removeSelectionFilter: filters.count() = %1").arg(aCount).toStdString().c_str()); + qDebug(QString("removeSelectionFilter: filters.count() = %1") + .arg(aCount).toStdString().c_str()); #endif } } @@ -1192,7 +1211,8 @@ bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO, // If the selection problem happens again, it is possible to write a test scenario and create // a bug. The bug steps are the following: // Create two IO, activate them in 5 modes, select the first IO, deactivate 3 modes for both, - // with clicked SHIFT select the second object. The result is the selection of the first IO is lost. + // with clicked SHIFT select the second object. + // The result is the selection of the first IO is lost. TColStd_ListOfInteger aTColModes; aContext->ActivatedModes(theIO, aTColModes); TColStd_ListIteratorOfListOfInteger itr( aTColModes ); @@ -1213,7 +1233,8 @@ bool XGUI_Displayer::activate(const Handle(AIS_InteractiveObject)& theIO, // the selection from the previous activation modes should be cleared manually (#26172) theIO->ClearSelected(); aContext->LocalContext()->ClearOutdatedSelection(theIO, true); - ModuleBase_Tools::selectionInfo(aContext, "XGUI_Displayer::activate -- ClearSelected/ClearOutdatedSelection"); + ModuleBase_Tools::selectionInfo(aContext, + "XGUI_Displayer::activate -- ClearSelected/ClearOutdatedSelection"); // For performance issues //if (theUpdateViewer) // updateViewer(); @@ -1272,7 +1293,9 @@ bool XGUI_Displayer::customizeObject(ObjectPtr theObject) } -QColor XGUI_Displayer::setObjectColor(ObjectPtr theObject, const QColor& theColor, bool theUpdateViewer) +QColor XGUI_Displayer::setObjectColor(ObjectPtr theObject, + const QColor& theColor, + bool theUpdateViewer) { if (!isVisible(theObject)) return Qt::black; diff --git a/src/XGUI/XGUI_Displayer.h b/src/XGUI/XGUI_Displayer.h index fce5e0c9b..aa1723060 100644 --- a/src/XGUI/XGUI_Displayer.h +++ b/src/XGUI/XGUI_Displayer.h @@ -68,9 +68,10 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// \return true if the object visibility state is changed bool display(ObjectPtr theObject, bool theUpdateViewer = true); - /// Display the given AIS object. This object is not added to the displayer internal map of objects - /// So, it can not be obtained from displayer. This is just a wrap method of OCC display in order - /// to perform the display with correct flags. + /// Display the given AIS object. + /// This object is not added to the displayer internal map of objects + /// So, it can not be obtained from displayer. This is just a wrap method of OCC display in + /// order to perform the display with correct flags. /// \param theAIS AIOS object to display /// \param toActivateInSelectionModes boolean value whether the presentation should be /// activated in the current selection modes @@ -93,7 +94,8 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// empty, select it, otherwise select the result. /// \param theValues a list of presentation to be selected /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly - void setSelected(const QList>& theValues, bool theUpdateViewer = true); + void setSelected(const QList>& theValues, + bool theUpdateViewer = true); /// Unselect all objects /// \param theUpdateViewer the parameter whether the viewer should be update immediatelly @@ -142,7 +144,8 @@ class XGUI_EXPORT XGUI_Displayer: public QObject /// Sets a flag to the displayer whether the internal viewer can be updated by /// the updateViewer method call. If it is not enabled, this method do nothing. /// This state maintain recurse, if the update is blocked twice or three times, the - /// viewer will not be updated until it is unblocked necessary times(twice or three in the example). + /// viewer will not be updated until it is unblocked necessary times + /// (twice or three in the example). /// \param isEnabled a boolean value bool enableUpdateViewer(const bool isEnabled); @@ -159,7 +162,8 @@ class XGUI_EXPORT XGUI_Displayer: public QObject void activateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode, const bool theUpdateViewer) const; - /// Activate interactive context. It is necessary to call ClearOutdatedSelection after deactivation + /// Activate interactive context. It is necessary to call ClearOutdatedSelection + /// after deactivation /// \param theIO an interactive object /// \param theMode a mode to deactivate. When theMode=-1 then all modes will be deactivated void deactivateAIS(const Handle(AIS_InteractiveObject)& theIO, const int theMode = -1) const; @@ -336,14 +340,13 @@ private: /// in OCCT but improved for performance. The modification is to iterates by a list /// of owners in the context only once. /// \param theContext a viewer context. It has opened local context - /// \param theShapesToBeSelected a map of shapes. Owner's shape is searched in the map and the owner - /// is selected if it is found there. Only first owner is processed(according to OCCT logic) + /// \param theShapesToBeSelected a map of shapes. Owner's shape is searched in the map and the + /// owner is selected if it is found there. + /// Only first owner is processed(according to OCCT logic) static void AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) theContext, const NCollection_DataMap>& theShapesToBeSelected); - //const NCollection_Map& theShapesToBeSelected); - protected: /// Reference to workshop XGUI_Workshop* myWorkshop; @@ -351,7 +354,8 @@ private: /// A container for selection filters Handle(SelectMgr_AndFilter) myAndFilter; - /// A default custom presentation, which is used if the displayed feature is not a custom presentation + /// A default custom presentation, which is used if the displayed feature is not + /// a custom presentation GeomCustomPrsPtr myCustomPrs; /// Definition of a type of map which defines correspondance between objects and presentations diff --git a/src/XGUI/XGUI_ErrorMgr.cpp b/src/XGUI/XGUI_ErrorMgr.cpp index 317babf1e..249dfe004 100644 --- a/src/XGUI/XGUI_ErrorMgr.cpp +++ b/src/XGUI/XGUI_ErrorMgr.cpp @@ -96,7 +96,8 @@ void XGUI_ErrorMgr::updateAcceptAllAction(const FeaturePtr& theFeature) QString anError = ""; /// to allow the module have the button always enabled - bool isActionStateEnabled = myWorkshop->module()->isActionEnableStateFixed(XGUI_ActionsMgr::AcceptAll); + bool isActionStateEnabled = + myWorkshop->module()->isActionEnableStateFixed(XGUI_ActionsMgr::AcceptAll); if (!isActionStateEnabled) { anError = myWorkshop->module()->getFeatureError(theFeature); if (anError.isEmpty()) { diff --git a/src/XGUI/XGUI_HistoryMenu.cpp b/src/XGUI/XGUI_HistoryMenu.cpp index 5f1ee6fa8..2e21fb377 100644 --- a/src/XGUI/XGUI_HistoryMenu.cpp +++ b/src/XGUI/XGUI_HistoryMenu.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> /* * XGUI_HistoryMenu.cpp * diff --git a/src/XGUI/XGUI_HistoryMenu.h b/src/XGUI/XGUI_HistoryMenu.h index 267ce67f7..83107e3bf 100644 --- a/src/XGUI/XGUI_HistoryMenu.h +++ b/src/XGUI/XGUI_HistoryMenu.h @@ -1,3 +1,4 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D /* * XGUI_HistoryMenu.h * diff --git a/src/XGUI/XGUI_MenuGroup.h b/src/XGUI/XGUI_MenuGroup.h index c265608a4..eae5cb046 100755 --- a/src/XGUI/XGUI_MenuGroup.h +++ b/src/XGUI/XGUI_MenuGroup.h @@ -42,7 +42,9 @@ class XGUI_EXPORT XGUI_MenuGroup private: std::string myName; /// a name of the workbench - std::list > myFeatureInfo; /// container of existing features + + /// container of existing features + std::list > myFeatureInfo; }; #endif /* XGUI_MENUGROUP_H_ */ diff --git a/src/XGUI/XGUI_MenuMgr.cpp b/src/XGUI/XGUI_MenuMgr.cpp index 47c8f178b..7a56457d2 100755 --- a/src/XGUI/XGUI_MenuMgr.cpp +++ b/src/XGUI/XGUI_MenuMgr.cpp @@ -43,7 +43,8 @@ XGUI_MenuMgr::XGUI_MenuMgr(XGUI_Workshop* theWorkshop) void XGUI_MenuMgr::processEvent(const std::shared_ptr& theMessage) { //A message to start feature creation received. - if (theMessage->eventID() == Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { + if (theMessage->eventID() == + Events_Loop::loop()->eventByName(Config_FeatureMessage::GUI_EVENT())) { std::shared_ptr aFeatureMsg = std::dynamic_pointer_cast(theMessage); if (!aFeatureMsg->isInternal()) { @@ -129,7 +130,8 @@ std::shared_ptr XGUI_MenuMgr::findWorkbench(const std::strin aResultWorkbench = aWorkbench; } if (!aResultWorkbench) { - aResultWorkbench = std::shared_ptr(new XGUI_MenuWorkbench(theWorkbenchName)); + aResultWorkbench = + std::shared_ptr(new XGUI_MenuWorkbench(theWorkbenchName)); myWorkbenches.push_back(aResultWorkbench); } return aResultWorkbench; @@ -150,9 +152,10 @@ void XGUI_MenuMgr::createFeatureActions() for (; aGIt != aGLast; aGIt++) { const std::shared_ptr aGroup = *aGIt; std::string aGName = aGroup->getName(); - const std::list >& aFeaturesInfo = aGroup->featuresInfo(); - std::list >::const_iterator aFIt = aFeaturesInfo.begin(), - aFLast = aFeaturesInfo.end(); + const std::list >& aFeaturesInfo = + aGroup->featuresInfo(); + std::list >::const_iterator aFIt = + aFeaturesInfo.begin(), aFLast = aFeaturesInfo.end(); int aFSize = aFeaturesInfo.size(); for(int i = 0; aFIt != aFLast; aFIt++, i++) { std::shared_ptr aMessage = *aFIt; diff --git a/src/XGUI/XGUI_MenuMgr.h b/src/XGUI/XGUI_MenuMgr.h index cef7810a1..f0259d873 100755 --- a/src/XGUI/XGUI_MenuMgr.h +++ b/src/XGUI/XGUI_MenuMgr.h @@ -61,7 +61,9 @@ protected: private: XGUI_Workshop* myWorkshop; ///< the current workshop - std::list< std::shared_ptr > myWorkbenches; ///< container of existing workbenchs + + /// container of existing workbenchs + std::list< std::shared_ptr > myWorkbenches; }; #endif /* XGUI_MENUMGR_H_ */ diff --git a/src/XGUI/XGUI_ModuleConnector.cpp b/src/XGUI/XGUI_ModuleConnector.cpp index c3b079f05..805144797 100644 --- a/src/XGUI/XGUI_ModuleConnector.cpp +++ b/src/XGUI/XGUI_ModuleConnector.cpp @@ -135,7 +135,8 @@ void XGUI_ModuleConnector::processLaunchOperation(ModuleBase_Operation* theOpera XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr(); if (anOperationMgr->startOperation(theOperation)) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(theOperation); if (aFOperation) { workshop()->propertyPanel()->updateContentWidget(aFOperation->feature()); workshop()->propertyPanel()->createContentPanel(aFOperation->feature()); diff --git a/src/XGUI/XGUI_ObjectsBrowser.cpp b/src/XGUI/XGUI_ObjectsBrowser.cpp index f1a119cf4..841318435 100644 --- a/src/XGUI/XGUI_ObjectsBrowser.cpp +++ b/src/XGUI/XGUI_ObjectsBrowser.cpp @@ -40,7 +40,8 @@ class XGUI_TreeViewItemDelegate: public QStyledItemDelegate public: /// Constructor /// \param theParent a parent of the delegate - XGUI_TreeViewItemDelegate(XGUI_DataTree* theParent):QStyledItemDelegate(theParent), myTreedView(theParent) {} + XGUI_TreeViewItemDelegate(XGUI_DataTree* theParent):QStyledItemDelegate(theParent), + myTreedView(theParent) {} /// Set data for item editor (name of the item) /// \param editor a widget of editor @@ -105,8 +106,8 @@ void XGUI_DataTree::commitData(QWidget* theEditor) { static int aEntrance = 0; if (aEntrance == 0) { - // We have to check number of enter and exit of this function because it can be called recursively by Qt - // in order to avoid double modifying of a data + // We have to check number of enter and exit of this function because it can be called + // recursively by Qt in order to avoid double modifying of a data aEntrance = 1; QLineEdit* aEditor = dynamic_cast(theEditor); if (aEditor) { @@ -204,7 +205,8 @@ void XGUI_TreeViewStyle::drawPrimitive(PrimitiveElement theElement, QPainter* thePainter, const QWidget* theWidget) const { if ((theElement == QStyle::PE_PanelItemViewRow) || (theElement == QStyle::PE_PanelItemViewItem)) { - const QStyleOptionViewItemV4* aOptions = qstyleoption_cast(theOption); + const QStyleOptionViewItemV4* aOptions = + qstyleoption_cast(theOption); if (myIndex.isValid() && ((myIndex.flags() & Qt::ItemIsSelectable) == 0)) { QStyle::State aState = aOptions->state; if ((aState & QStyle::State_MouseOver) != 0) @@ -241,7 +243,8 @@ void XGUI_ActiveDocLbl::setTreeView(QTreeView* theView) QColor aHighlightText = aPalet.highlightedText().color(); myPreSelectionStyle = "QLabel {background-color: "; - myPreSelectionStyle += "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 white, stop:1 " + aHighlight.lighter(170).name() + ");"; + myPreSelectionStyle += "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 white, stop:1 " + + aHighlight.lighter(170).name() + ");"; myPreSelectionStyle += "border: 1px solid lightblue; border-radius: 2px }"; QString aName = aPalet.color(QPalette::Base).name(); diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 9eed33074..7810ef773 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -150,7 +150,8 @@ QStringList XGUI_OperationMgr::operationList() const { QStringList result; foreach(ModuleBase_Operation* eachOperation, myOperations) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast(eachOperation); + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(eachOperation); if (aFOperation) { FeaturePtr aFeature = aFOperation->feature(); if(aFeature) { @@ -279,7 +280,8 @@ void XGUI_OperationMgr::updateApplyOfOperations(ModuleBase_Operation* theOperati { XGUI_ErrorMgr* anErrorMgr = XGUI_Tools::workshop(myWorkshop)->errorMgr(); if (theOperation) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(theOperation); if (aFOperation) anErrorMgr->updateAcceptAllAction(aFOperation->feature()); } @@ -346,7 +348,8 @@ void XGUI_OperationMgr::setCurrentFeature(const FeaturePtr& theFeature) DocumentPtr aDoc = aMgr->activeDocument(); bool aIsOp = aMgr->isOperation(); if (!aIsOp) - aMgr->startOperation(QString("Set current feature: %1").arg(theFeature->getKind().c_str()).toStdString()); + aMgr->startOperation(QString("Set current feature: %1") + .arg(theFeature->getKind().c_str()).toStdString()); aDoc->setCurrentFeature(theFeature, false); if (!aIsOp) aMgr->finishOperation(); @@ -431,18 +434,20 @@ void XGUI_OperationMgr::onBeforeOperationStarted() return; /// Set current feature and remeber old current feature - ModuleBase_OperationFeature* aFOperation = dynamic_cast(aCurrentOperation); + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(aCurrentOperation); if (aFOperation) { SessionPtr aMgr = ModelAPI_Session::get(); DocumentPtr aDoc = aMgr->activeDocument(); - // the parameter of current feature should be false, we should use all feature, not only visible - // in order to correctly save the previous feature of the nested operation, where the + // the parameter of current feature should be false, we should use all feature, not only + // visible in order to correctly save the previous feature of the nested operation, where the // features can be not visible in the tree. The problem case is Edit sketch entitity(line) // in the Sketch, created in ExtrusionCut operation. The entity disappears by commit. // When sketch entity operation started, the sketch should be cashed here as the current. // Otherwise(the flag is true), the ExtrusionCut is cashed, when commit happens, the sketch // is disabled, sketch entity is disabled as extrusion cut is created earliest then sketch. - // As a result the sketch disappears from the viewer. However after commit it is displayed back. + // As a result the sketch disappears from the viewer. + // However after commit it is displayed back. aFOperation->setPreviousCurrentFeature(aDoc->currentFeature(false)); #ifdef DEBUG_CURRENT_FEATURE @@ -453,15 +458,17 @@ void XGUI_OperationMgr::onBeforeOperationStarted() .arg(ModuleBase_Tools::objectInfo(aFeature)).toStdString().c_str()); qDebug(QString("\tdocument->currentFeature(false) = %1").arg( - ModuleBase_Tools::objectInfo(ModelAPI_Session::get()->activeDocument()->currentFeature(false))).toStdString().c_str()); + ModuleBase_Tools::objectInfo( + ModelAPI_Session::get()->activeDocument()->currentFeature(false))) + .toStdString().c_str()); #endif if (aFOperation->isEditOperation()) {// it should be performed by the feature edit only // in create operation, the current feature is changed by addFeature() aDoc->setCurrentFeature(aFOperation->feature(), false); - // this is the only place where flushes must be called after setCurrentFeature for the current - // moment: after this the opertion is not finished, so, the ObjectBrowser state may be corrupted - // (issue #1457) + // this is the only place where flushes must be called after setCurrentFeature for the + // current moment: after this the opertion is not finished, so, the ObjectBrowser + // state may be corrupted (issue #1457) static Events_Loop* aLoop = Events_Loop::loop(); static Events_ID aCreateEvent = aLoop->eventByName(EVENT_OBJECT_CREATED); aLoop->flush(aCreateEvent); @@ -472,7 +479,9 @@ void XGUI_OperationMgr::onBeforeOperationStarted() #ifdef DEBUG_CURRENT_FEATURE qDebug("\tdocument->setCurrentFeature"); qDebug(QString("\tdocument->currentFeature(false) = %1").arg( - ModuleBase_Tools::objectInfo(ModelAPI_Session::get()->activeDocument()->currentFeature(false))).toStdString().c_str()); + ModuleBase_Tools::objectInfo( + ModelAPI_Session::get()->activeDocument()->currentFeature(false))) + .toStdString().c_str()); #endif } } @@ -503,7 +512,8 @@ void XGUI_OperationMgr::onBeforeOperationCommitted() return; /// Restore the previous current feature - ModuleBase_OperationFeature* aFOperation = dynamic_cast(aCurrentOperation); + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(aCurrentOperation); if (aFOperation) { #ifdef DEBUG_CURRENT_FEATURE QString aKind = aFOperation->feature()->getKind().c_str(); @@ -512,7 +522,9 @@ void XGUI_OperationMgr::onBeforeOperationCommitted() .arg(ModuleBase_Tools::objectInfo(aFOperation->feature())).toStdString().c_str()); qDebug(QString("\tdocument->currentFeature(false) = %1").arg( - ModuleBase_Tools::objectInfo(ModelAPI_Session::get()->activeDocument()->currentFeature(false))).toStdString().c_str()); + ModuleBase_Tools::objectInfo( + ModelAPI_Session::get()->activeDocument()->currentFeature(false))) + .toStdString().c_str()); #endif if (aFOperation->isEditOperation()) { @@ -520,8 +532,10 @@ void XGUI_OperationMgr::onBeforeOperationCommitted() setCurrentFeature(aFOperation->previousCurrentFeature()); } else { // create operation - // the Top created feature should stays the current. In nested operations, like Line in the Sketch or - // Sketch in ExtrusionCut, a previous feature should be restored on commit. It is performed here + // the Top created feature should stays the current. In nested operations, + // like Line in the Sketch or + // Sketch in ExtrusionCut, a previous feature should be restored on commit. + // It is performed here // in order to perform it in the current transaction without opening a new one. if (myOperations.front() != aFOperation) setCurrentFeature(aFOperation->previousCurrentFeature()); @@ -529,7 +543,9 @@ void XGUI_OperationMgr::onBeforeOperationCommitted() #ifdef DEBUG_CURRENT_FEATURE qDebug("\tdocument->setCurrentFeature"); qDebug(QString("\tdocument->currentFeature(false) = %1").arg( - ModuleBase_Tools::objectInfo(ModelAPI_Session::get()->activeDocument()->currentFeature(false))).toStdString().c_str()); + ModuleBase_Tools::objectInfo( + ModelAPI_Session::get()->activeDocument()->currentFeature(false))) + .toStdString().c_str()); #endif ModuleBase_IModule* aModule = myWorkshop->module(); if (aModule) @@ -638,7 +654,8 @@ bool XGUI_OperationMgr::onProcessEnter(QObject* theObject) bool isAborted = false; if (!anActiveWgt) { QWidget* aFocusWidget = aPanel->focusWidget(); - QToolButton* aCancelBtn = dynamic_cast(aPanel)->findButton(PROP_PANEL_CANCEL); + QToolButton* aCancelBtn = + dynamic_cast(aPanel)->findButton(PROP_PANEL_CANCEL); if (aFocusWidget && aCancelBtn && aFocusWidget == aCancelBtn) { abortOperation(aOperation); isAccepted = true; @@ -648,12 +665,16 @@ bool XGUI_OperationMgr::onProcessEnter(QObject* theObject) if (!isAborted) { isAccepted = anActiveWgt && anActiveWgt->processEnter(); if (!isAccepted) { - isAccepted = myWorkshop->module()->processEnter(anActiveWgt ? anActiveWgt->attributeID() : ""); + isAccepted = + myWorkshop->module()->processEnter(anActiveWgt ? anActiveWgt->attributeID() : ""); if (!isAccepted) { /// functionality is similar to Apply click - ModuleBase_OperationFeature* aFOperation = dynamic_cast(currentOperation()); - if (!aFOperation || myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) { - // key released is emitted to apply the current value to the model if it was modified in PP + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(currentOperation()); + if (!aFOperation || + myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) { + // key released is emitted to apply the current value to the model + // if it was modified in PP emit keyEnterReleased(); commitOperation(); isAccepted = true; diff --git a/src/XGUI/XGUI_PropertyPanel.cpp b/src/XGUI/XGUI_PropertyPanel.cpp index 82c99cf8c..fc50a6d73 100755 --- a/src/XGUI/XGUI_PropertyPanel.cpp +++ b/src/XGUI/XGUI_PropertyPanel.cpp @@ -217,7 +217,8 @@ void XGUI_PropertyPanel::onActivateNextWidget(ModuleBase_ModelWidget* theWidget) // sketch multi rotation -> single/full point) // it is important to check the widget visibility to do not check of the next widget visible // state if the current is not shown. (example: sketch circle re-entrant operation after mouse - // release in the viewer, next, radius, widget should be activated but the first is not visualized) + // release in the viewer, next, radius, + // widget should be activated but the first is not visualized) bool isVisible = theWidget->isVisible(); activateNextWidget(theWidget, isVisible); } @@ -322,7 +323,8 @@ void findDirectChildren(QWidget* theParent, QList& theWidgets, const b if (aWidget) aWidgetTypes.append(aWidget->objectName()); } - QString anInfo = QString("theWidgets[%1]: %2").arg(theWidgets.count()).arg(aWidgetTypes.join(",")); + QString anInfo = QString("theWidgets[%1]: %2") + .arg(theWidgets.count()).arg(aWidgetTypes.join(",")); qDebug(anInfo.toStdString().c_str()); } #endif diff --git a/src/XGUI/XGUI_QtEvents.cpp b/src/XGUI/XGUI_QtEvents.cpp index 72c94c4f4..c7af483a0 100644 --- a/src/XGUI/XGUI_QtEvents.cpp +++ b/src/XGUI/XGUI_QtEvents.cpp @@ -9,7 +9,8 @@ #include "XGUI_QtEvents.h" -QEvent::Type PostponeMessageQtEvent::PostponeMessageQtEventType = QEvent::Type(QEvent::registerEventType()); +QEvent::Type PostponeMessageQtEvent::PostponeMessageQtEventType = + QEvent::Type(QEvent::registerEventType()); std::shared_ptr PostponeMessageQtEvent::postponedMessage() diff --git a/src/XGUI/XGUI_SalomeConnector.h b/src/XGUI/XGUI_SalomeConnector.h index b00b630f3..01625afc5 100644 --- a/src/XGUI/XGUI_SalomeConnector.h +++ b/src/XGUI/XGUI_SalomeConnector.h @@ -38,8 +38,10 @@ class XGUI_EXPORT XGUI_SalomeConnector //! \param isAddSeparator boolean flag about adding separator after the action //! returns created action virtual QAction* addFeature(const QString& theWBName, const QString& theId, - const QString& theTitle, const QString& theTip, const QIcon& theIcon, - const QKeySequence& theKeys, bool isCheckable, const bool isAddSeparator, + const QString& theTitle, const QString& theTip, + const QIcon& theIcon, + const QKeySequence& theKeys, bool isCheckable, + const bool isAddSeparator, const QString& theStatusTip) = 0; //! Creates a feature (command) in SALOME desktop diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index ee6c1971f..584c9fd36 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -132,15 +132,16 @@ void XGUI_Selection::fillPresentation(ModuleBase_ViewerPrsPtr& thePrs, // for one feature Handle(StdSelect_BRepOwner) aBRO = Handle(StdSelect_BRepOwner)::DownCast(theOwner); if( !aBRO.IsNull() && aBRO->HasShape() ) { - // the located method is called in the context to obtain the shape by the SelectedShape() method, - // so the shape is located by the same rules + // the located method is called in the context to obtain the shape by the SelectedShape() + // method, so the shape is located by the same rules TopoDS_Shape aShape = aBRO->Shape().Located (aBRO->Location() * aBRO->Shape().Location()); #ifndef DEBUG_DELIVERY if (aShape.IsNull()) aShape = findAxisShape(anIO); #endif if (!aShape.IsNull()) { - std::shared_ptr aGeomShape = std::shared_ptr(new GeomAPI_Shape()); + std::shared_ptr aGeomShape = + std::shared_ptr(new GeomAPI_Shape()); aGeomShape->setImpl(new TopoDS_Shape(aShape)); thePrs->setShape(aGeomShape); } @@ -247,13 +248,14 @@ QList XGUI_Selection::getHighlighted() const aPrs->setInteractive(anIO); ObjectPtr aResult = aDisplayer->getObject(anIO); - // we should not check the appearance of this feature because there can be some selected shapes - // for one feature + // we should not check the appearance of this feature because there can be some selected + // shapes for one feature aPrs->setObject(aResult); if (aContext->HasOpenedContext()) { TopoDS_Shape aShape = aContext->DetectedShape(); if (!aShape.IsNull()) { - std::shared_ptr aGeomShape = std::shared_ptr(new GeomAPI_Shape()); + std::shared_ptr aGeomShape = + std::shared_ptr(new GeomAPI_Shape()); aGeomShape->setImpl(new TopoDS_Shape(aShape)); aPrs->setShape(aGeomShape); } diff --git a/src/XGUI/XGUI_Selection.h b/src/XGUI/XGUI_Selection.h index 8cd8d7cc6..785aa18a4 100644 --- a/src/XGUI/XGUI_Selection.h +++ b/src/XGUI/XGUI_Selection.h @@ -36,7 +36,8 @@ class XGUI_EXPORT XGUI_Selection : public ModuleBase_ISelection /// Returns a list of viewer selected presentations /// \return list of presentations - virtual QList> getSelected(const SelectionPlace& thePlace = Browser) const; + virtual QList> + getSelected(const SelectionPlace& thePlace = Browser) const; /// Fills the viewer presentation parameters by the parameters from the owner /// \param thePrs a container for selection diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index 0d9b701f6..f32ed5012 100755 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -65,7 +65,8 @@ void XGUI_SelectionMgr::setSelectedOwners(const SelectMgr_IndexedMapOfOwner& the aContext->AddOrRemoveSelected(anOwner, isUpdateViewer); } } - ModuleBase_Tools::selectionInfo(aContext, "XGUI_SelectionMgr::setSelectedOwners -- AddOrRemoveSelected"); + ModuleBase_Tools::selectionInfo(aContext, + "XGUI_SelectionMgr::setSelectedOwners -- AddOrRemoveSelected"); } //************************************************************** @@ -144,7 +145,8 @@ void XGUI_SelectionMgr::onViewerSelection() FeaturePtr aFeature; Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext(); if (!aContext.IsNull()) { - QList aPresentations = selection()->getSelected(ModuleBase_ISelection::Viewer); + QList aPresentations = + selection()->getSelected(ModuleBase_ISelection::Viewer); foreach(ModuleBase_ViewerPrsPtr aPrs, aPresentations) { if (aPrs->object().get()) { if (!aFeatures.contains(aPrs->object())) diff --git a/src/XGUI/XGUI_Tools.cpp b/src/XGUI/XGUI_Tools.cpp index a60b1f219..e1aa82f7c 100644 --- a/src/XGUI/XGUI_Tools.cpp +++ b/src/XGUI/XGUI_Tools.cpp @@ -44,7 +44,8 @@ QString dir(const QString& path, bool isAbs) QString file(const QString& path, bool withExt) { QString fPath = path; - while (!fPath.isEmpty() && (fPath[fPath.length() - 1] == '\\' || fPath[fPath.length() - 1] == '/')) + while (!fPath.isEmpty() && (fPath[fPath.length() - 1] == '\\' || + fPath[fPath.length() - 1] == '/')) fPath.remove(fPath.length() - 1, 1); if (withExt) @@ -132,8 +133,10 @@ bool canRename(const ObjectPtr& theObject, const QString& theName) if (ModelAPI_Tools::findVariable(theObject->document(), FeaturePtr(), qPrintable(theName), aValue, aParam)) { QString aErrMsg(QObject::tr("Selected parameter can not be renamed to: %1. \ - There is a parameter with the same name. Its value is: %2.").arg(qPrintable(theName)).arg(aValue)); - // We can not use here a dialog box for message - it will crash editing process in ObjectBrowser + There is a parameter with the same name. Its value is: %2.") + .arg(qPrintable(theName)).arg(aValue)); + // We can not use here a dialog box for message - + // it will crash editing process in ObjectBrowser Events_InfoMessage("XGUI_Tools", aErrMsg.toStdString()).send(); return false; } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index ef2aa7042..8f01c2d62 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -203,16 +203,22 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) Config_Prop::Color, ModelAPI_ResultBody::DEFAULT_COLOR()); Config_PropManager::registerProp("Visualization", "result_group_color", "Group color", Config_Prop::Color, ModelAPI_ResultGroup::DEFAULT_COLOR()); - Config_PropManager::registerProp("Visualization", "result_construction_color", "Construction color", - Config_Prop::Color, ModelAPI_ResultConstruction::DEFAULT_COLOR()); + Config_PropManager::registerProp("Visualization", "result_construction_color", + "Construction color", + Config_Prop::Color, + ModelAPI_ResultConstruction::DEFAULT_COLOR()); Config_PropManager::registerProp("Visualization", "result_part_color", "Part color", Config_Prop::Color, ModelAPI_ResultPart::DEFAULT_COLOR()); - Config_PropManager::registerProp("Visualization", "body_deflection", "Body deflection coefficient", - Config_Prop::Double, ModelAPI_ResultBody::DEFAULT_DEFLECTION());//"0.001"); + Config_PropManager::registerProp("Visualization", "body_deflection", + "Body deflection coefficient", + Config_Prop::Double, + ModelAPI_ResultBody::DEFAULT_DEFLECTION());//"0.001"); - Config_PropManager::registerProp("Visualization", "construction_deflection", "Construction deflection coefficient", - Config_Prop::Double, ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());//"0.0001"); + Config_PropManager::registerProp("Visualization", "construction_deflection", + "Construction deflection coefficient", + Config_Prop::Double, + ModelAPI_ResultConstruction::DEFAULT_DEFLECTION());//"0.0001"); if (ModuleBase_Preferences::resourceMgr()->booleanValue("Viewer", "face-selection", true)) myViewerSelMode.append(TopAbs_FACE); @@ -320,7 +326,8 @@ void XGUI_Workshop::initMenu() QAction* aAction = salomeConnector()->addDesktopCommand("UNDO_CMD", tr("Undo"), tr("Undo last command"), QIcon(":pictures/undo.png"), - QKeySequence::Undo, false, "MEN_DESK_EDIT"); + QKeySequence::Undo, false, + "MEN_DESK_EDIT"); QString aToolBarTitle = tr( "INF_DESK_TOOLBAR_STANDARD" ); salomeConnector()->addActionInToolbar( aAction,aToolBarTitle ); @@ -336,7 +343,8 @@ void XGUI_Workshop::initMenu() addHistoryMenu(aAction, SIGNAL(updateRedoHistory(const QList&)), SLOT(onRedo(int))); salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT"); - //aAction = salomeConnector()->addDesktopCommand("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"), + //aAction = salomeConnector()->addDesktopCommand("REBUILD_CMD", tr("Rebuild"), + // tr("Rebuild data objects"), // QIcon(":pictures/rebuild.png"), QKeySequence(), // false, "MEN_DESK_EDIT"); //salomeConnector()->addActionInToolbar( aAction, aToolBarTitle ); @@ -344,12 +352,14 @@ void XGUI_Workshop::initMenu() //connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onRebuild())); //salomeConnector()->addDesktopMenuSeparator("MEN_DESK_EDIT"); - aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Export native..."), tr("Export the current document into a native file"), + aAction = salomeConnector()->addDesktopCommand("SAVEAS_CMD", tr("Export native..."), + tr("Export the current document into a native file"), QIcon(), QKeySequence(), false, "MEN_DESK_FILE"); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onSaveAs())); - aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Import native..."), tr("Import native file"), + aAction = salomeConnector()->addDesktopCommand("OPEN_CMD", tr("Import native..."), + tr("Import native file"), QIcon(), QKeySequence(), false, "MEN_DESK_FILE"); connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onOpen())); @@ -496,7 +506,8 @@ bool XGUI_Workshop::isFeatureOfNested(const FeaturePtr& theFeature) void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(theOperation); if (!aFOperation) return; @@ -518,7 +529,8 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation) if (!aWidget->attributeID().empty() && !aFeature->attribute(aWidget->attributeID()).get()) { std::string anErrorMsg = "The feature '%1' has no attribute '%2' used by widget '%3'."; Events_InfoMessage("XGUI_Workshop", anErrorMsg) - .arg(aFeatureKind).arg(aWidget->attributeID()).arg(aWidget->metaObject()->className()).send(); + .arg(aFeatureKind).arg(aWidget->attributeID()) + .arg(aWidget->metaObject()->className()).send(); myPropertyPanel->cleanContent(); return; } @@ -538,7 +550,8 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation) // update visible state of Preview button #ifdef HAVE_SALOME - bool anIsAutoPreview = mySalomeConnector->featureInfo(aFeatureKind.c_str())->isAutoPreview(); + bool anIsAutoPreview = + mySalomeConnector->featureInfo(aFeatureKind.c_str())->isAutoPreview(); #else AppElements_MainMenu* aMenuBar = mainWindow()->menuObject(); AppElements_Command* aCommand = aMenuBar->feature(aFeatureKind.c_str()); @@ -561,8 +574,9 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation) myPropertyPanel->setWindowTitle(theOperation->getDescription()->description()); #else std::string aFeatureName = aFeature->name(); - myPropertyPanel->setWindowTitle(QString("%1: %2").arg(theOperation->getDescription()->description()) - .arg(aFeatureName.c_str())); + myPropertyPanel->setWindowTitle(QString("%1: %2") + .arg(theOperation->getDescription()->description()) + .arg(aFeatureName.c_str())); #endif myErrorMgr->setPropertyPanel(myPropertyPanel); @@ -656,7 +670,8 @@ void XGUI_Workshop::onOperationAborted(ModuleBase_Operation* theOperation) void XGUI_Workshop::setGrantedFeatures(ModuleBase_Operation* theOperation) { - ModuleBase_OperationFeature* aFOperation = dynamic_cast(theOperation); + ModuleBase_OperationFeature* aFOperation = + dynamic_cast(theOperation); if (!aFOperation) return; @@ -865,7 +880,8 @@ bool XGUI_Workshop::onSaveAs() if (aDir.exists() && !aDir.entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries).isEmpty()) { int answer = QMessageBox::question( desktop(), - //: Title of the dialog which asks user if he wants to save study in existing non-empty folder + // Title of the dialog which asks user if he wants to save study + // in existing non-empty folder tr("Save"), tr("The directory already contains some files, save anyway?"), QMessageBox::Save | QMessageBox::Cancel); @@ -909,8 +925,8 @@ void XGUI_Workshop::onRedo(int theTimes) { // the viewer update should be blocked in order to avoid the features blinking. For the created // feature a results are created, the flush of the created signal caused the viewer redisplay for - // each created result. After a redisplay signal is flushed. So, the viewer update is blocked until - // redo of all possible objects happens + // each created result. After a redisplay signal is flushed. So, the viewer update is blocked + // until redo of all possible objects happens bool isUpdateEnabled = myDisplayer->enableUpdateViewer(false); objectBrowser()->treeView()->setCurrentIndex(QModelIndex()); @@ -1130,7 +1146,9 @@ void XGUI_Workshop::updateHistory() QDockWidget* XGUI_Workshop::createObjectBrowser(QWidget* theParent) { QDockWidget* aObjDock = new QDockWidget(theParent); - aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); + aObjDock->setAllowedAreas(Qt::LeftDockWidgetArea | + Qt::RightDockWidgetArea | + Qt::BottomDockWidgetArea); aObjDock->setWindowTitle(tr("Object browser")); aObjDock->setStyleSheet( "::title { position: relative; padding-left: 5px; text-align: left center }"); @@ -1155,7 +1173,9 @@ void XGUI_Workshop::createDockWidgets() aDesktop->addDockWidget(Qt::LeftDockWidgetArea, aObjDock); myPropertyPanel = new XGUI_PropertyPanel(aDesktop, myOperationMgr); myPropertyPanel->setupActions(myActionsMgr); - myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea | Qt::BottomDockWidgetArea); + myPropertyPanel->setAllowedAreas(Qt::LeftDockWidgetArea | + Qt::RightDockWidgetArea | + Qt::BottomDockWidgetArea); aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel); hidePropertyPanel(); ///name().c_str()); } QString anInfoStr = anInfo.join(";\t"); - qDebug(QString("cleanHistory for: [%1] - %2").arg(aFeatures.size()).arg(anInfoStr).toStdString().c_str()); + qDebug(QString("cleanHistory for: [%1] - %2"). + arg(aFeatures.size()).arg(anInfoStr).toStdString().c_str()); #endif std::map > aReferences; ModelAPI_Tools::findAllReferences(aFeatures, aReferences, true, false); - // find for each object whether all reference values are in the map as key, that means that there is - // no other reference in the model to this object, so it might be removed by cleaning history + // find for each object whether all reference values are in the map as key, that means that there + // is no other reference in the model to this object, so it might be removed by cleaning history // sk_1(ext_1, vertex_1) + (sk_3, bool_1) - cann't be deleted, dependency to bool_1 // ext_1(bool_1, sk_3) - cann't be deleted, dependency to bool_1 // vertex_1() @@ -1428,7 +1449,8 @@ void XGUI_Workshop::cleanHistory() for (; aMainIt != aMainLast; aMainIt++) { FeaturePtr aMainListFeature = aMainIt->first; std::set aMainRefList = aMainIt->second; - std::set::const_iterator aRefIt = aMainRefList.begin(), aRefLast = aMainRefList.end(); + std::set::const_iterator aRefIt = aMainRefList.begin(), + aRefLast = aMainRefList.end(); bool aFeatureOutOfTheList = false; for (; aRefIt != aRefLast && !aFeatureOutOfTheList; aRefIt++) { FeaturePtr aRefFeature = *aRefIt; @@ -1444,7 +1466,8 @@ void XGUI_Workshop::cleanHistory() FeaturePtr aFeature = *aFIt; anInfo.append(aFeature->name().c_str()); } - qDebug(QString("unused objects: [%1] - %2").arg(anInfo.size()).arg(anInfo.join(";\t")).toStdString().c_str()); + qDebug(QString("unused objects: [%1] - %2"). + arg(anInfo.size()).arg(anInfo.join(";\t")).toStdString().c_str()); #endif // warn about the references remove, break the delete operation if the user chose it @@ -1465,14 +1488,15 @@ void XGUI_Workshop::cleanHistory() aMessageBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes); aMessageBox.setDefaultButton(QMessageBox::No); - QString aText = QString(tr("Unused features are the following: %1.\nThese features will be deleted.\nWould you like to continue?") - .arg(anUnusedNames)); + QString aText = QString(tr("Unused features are the following: \ +%1.\nThese features will be deleted.\nWould you like to continue?").arg(anUnusedNames)); aMessageBox.setText(aText); if (aMessageBox.exec() == QMessageBox::No) return; // 1. start operation - aDescription += "by deleting of " + aDescription.arg(XGUI_Tools::unionOfObjectNames(anObjects, ", ")); + aDescription += "by deleting of " + + aDescription.arg(XGUI_Tools::unionOfObjectNames(anObjects, ", ")); ModuleBase_OperationAction* anOpAction = new ModuleBase_OperationAction(aDescription, module()); operationMgr()->startOperation(anOpAction); @@ -1610,15 +1634,18 @@ std::list toCurrentFeatures(const ObjectPtr& theObject) DocumentPtr aDocument = theObject->document(); std::list anAllFeatures = allFeatures(aDocument); // find the object iterator - std::list::iterator aObjectIt = std::find(anAllFeatures.begin(), anAllFeatures.end(), theObject); + std::list::iterator aObjectIt = + std::find(anAllFeatures.begin(), anAllFeatures.end(), theObject); if (aObjectIt == anAllFeatures.end()) return aResult; // find the current feature iterator - std::list::iterator aCurrentIt = std::find(anAllFeatures.begin(), anAllFeatures.end(), aDocument->currentFeature(true)); + std::list::iterator aCurrentIt = + std::find(anAllFeatures.begin(), anAllFeatures.end(), aDocument->currentFeature(true)); if (aCurrentIt == anAllFeatures.end()) return aResult; // check the right order - if (std::distance(aObjectIt, anAllFeatures.end()) <= std::distance(aCurrentIt, anAllFeatures.end())) + if (std::distance(aObjectIt, anAllFeatures.end()) <= + std::distance(aCurrentIt, anAllFeatures.end())) return aResult; // exclude the object std::advance(aObjectIt, 1); @@ -1774,10 +1801,12 @@ void XGUI_Workshop::changeColor(const QObjectPtrList& theObjects) foreach(ObjectPtr anObj, theObjects) { ResultPtr aResult = std::dynamic_pointer_cast(anObj); if (aResult.get() != NULL) { - ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(aResult); + ResultCompSolidPtr aCompsolidResult = + std::dynamic_pointer_cast(aResult); if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { - setColor(aCompsolidResult->subResult(i), !isRandomColor ? aColorResult : aDlg->getRandomColor()); + setColor(aCompsolidResult->subResult(i), !isRandomColor ? aColorResult : + aDlg->getRandomColor()); } } setColor(aResult, !isRandomColor ? aColorResult : aDlg->getRandomColor()); @@ -1860,7 +1889,8 @@ void XGUI_Workshop::changeDeflection(const QObjectPtrList& theObjects) foreach(ObjectPtr anObj, theObjects) { ResultPtr aResult = std::dynamic_pointer_cast(anObj); if (aResult.get() != NULL) { - ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(aResult); + ResultCompSolidPtr aCompsolidResult = + std::dynamic_pointer_cast(aResult); if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) { setDeflection(aCompsolidResult->subResult(i), aDeflection); diff --git a/src/XGUI/XGUI_Workshop.h b/src/XGUI/XGUI_Workshop.h index ba9814db7..c8e6b6435 100755 --- a/src/XGUI/XGUI_Workshop.h +++ b/src/XGUI/XGUI_Workshop.h @@ -283,11 +283,14 @@ Q_OBJECT /// Has to be called in order to display objects with visibility status = true void synchronizeViewer(); - /// Has to be called in order to display objects from a cpecifed group with visibility status = true + /// Has to be called in order to display objects from a specifed group + /// with visibility status = true /// \param theDoc the document for objects synchronisation /// \param theGroup the group name /// \param theUpdateViewer update viewer flag - void synchronizeGroupInViewer(const DocumentPtr& theDoc, const std::string& theGroup, bool theUpdateViewer); + void synchronizeGroupInViewer(const DocumentPtr& theDoc, + const std::string& theGroup, + bool theUpdateViewer); /// Update the property panel content by the XML description of the operation and set the panel /// into the operation diff --git a/src/XGUI/XGUI_WorkshopListener.cpp b/src/XGUI/XGUI_WorkshopListener.cpp index dff5b6209..640603e43 100755 --- a/src/XGUI/XGUI_WorkshopListener.cpp +++ b/src/XGUI/XGUI_WorkshopListener.cpp @@ -138,7 +138,8 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& } else if (theMessage->eventID() == Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION)) { ModuleBase_ModelWidget* aWidget = workshop()->propertyPanel()->activeWidget(); if (aWidget) { - ModuleBase_WidgetSelector* aWidgetSelector = dynamic_cast(aWidget); + ModuleBase_WidgetSelector* aWidgetSelector = + dynamic_cast(aWidget); if (aWidgetSelector) myWorkshop->setSelected(aWidgetSelector->getAttributeSelection()); } @@ -176,7 +177,8 @@ void XGUI_WorkshopListener::processEvent(const std::shared_ptr& aDisplayer->enableUpdateViewer(true); } else { //Show error dialog if error message received. - std::shared_ptr anIngfoMsg = std::dynamic_pointer_cast(theMessage); + std::shared_ptr anIngfoMsg = + std::dynamic_pointer_cast(theMessage); if (anIngfoMsg) { emit errorOccurred(anIngfoMsg); } @@ -202,7 +204,8 @@ void XGUI_WorkshopListener::onFeatureUpdatedMsg( anInfo.append(ModuleBase_Tools::objectInfo((*aIt))); } QString anInfoStr = anInfo.join(";\t"); - qDebug(QString("onFeatureUpdatedMsg: %1, %2").arg(anObjects.size()).arg(anInfoStr).toStdString().c_str()); + qDebug(QString("onFeatureUpdatedMsg: %1, %2") + .arg(anObjects.size()).arg(anInfoStr).toStdString().c_str()); #endif std::set aFeatures = theMsg->objects(); XGUI_OperationMgr* anOperationMgr = workshop()->operationMgr(); @@ -228,7 +231,8 @@ void XGUI_WorkshopListener::onFeatureUpdatedMsg( } //****************************************************** -void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr& theMsg) +void XGUI_WorkshopListener:: + onFeatureRedisplayMsg(const std::shared_ptr& theMsg) { std::set anObjects = theMsg->objects(); std::set::const_iterator aIt; @@ -239,7 +243,8 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr(aRes); if (aCompSolidRes.get()) { - qDebug(QString("COMPSOLID, numberOfSubs = %1").arg(aCompSolidRes->numberOfSubs()).toStdString().c_str()); + qDebug(QString("COMPSOLID, numberOfSubs = %1") + .arg(aCompSolidRes->numberOfSubs()).toStdString().c_str()); } if (ModelAPI_Tools::compSolidOwner(aRes)) qDebug("COMPSOLID sub-object"); @@ -287,16 +293,16 @@ void XGUI_WorkshopListener::onFeatureRedisplayMsg(const std::shared_ptr