From: vsv Date: Wed, 20 Nov 2019 13:54:19 +0000 (+0300) Subject: Issue #3060: Use HideFaces panel for groups creation operation X-Git-Tag: V9_5_0a1~166^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e7c32b05a984a6c8fed81a09362cd3cc6c0ed0fb;p=modules%2Fshaper.git Issue #3060: Use HideFaces panel for groups creation operation --- diff --git a/src/CollectionPlugin/plugin-Collection.xml b/src/CollectionPlugin/plugin-Collection.xml index a02f0bf2f..ea913123b 100644 --- a/src/CollectionPlugin/plugin-Collection.xml +++ b/src/CollectionPlugin/plugin-Collection.xml @@ -18,7 +18,8 @@ tooltip="Create named collection of geometry entities" icon="icons/Collection/shape_group.png" apply_continue="true" - helpfile="groupFeature.html"> + helpfile="groupFeature.html" + hidefaces_panel="true"> diff --git a/src/Config/Config_FeatureMessage.cpp b/src/Config/Config_FeatureMessage.cpp index 47baeae2e..4728b95f8 100644 --- a/src/Config/Config_FeatureMessage.cpp +++ b/src/Config/Config_FeatureMessage.cpp @@ -40,6 +40,7 @@ Config_FeatureMessage::Config_FeatureMessage(const Events_ID theId, const void* myModal = false; myIsTitleInToolbar = true; myIsApplyContinue = false; + myHideFacesPanel = false; } Config_FeatureMessage::~Config_FeatureMessage() @@ -238,3 +239,14 @@ void Config_FeatureMessage::setTitleInToolbar(bool theValue) { myIsTitleInToolbar = theValue; } + +bool Config_FeatureMessage::isHideFacesPanel() const +{ + return myHideFacesPanel; +} + + +void Config_FeatureMessage::setHideFacesPanel(bool theValue) +{ + myHideFacesPanel = theValue; +} diff --git a/src/Config/Config_FeatureMessage.h b/src/Config/Config_FeatureMessage.h index a027bec60..89b7ada65 100644 --- a/src/Config/Config_FeatureMessage.h +++ b/src/Config/Config_FeatureMessage.h @@ -55,6 +55,7 @@ class Config_FeatureMessage : public Events_Message bool myModal; ///setHelpFileName(myLibraryName + "/" + aHelpFile); + bool isHideFaces = getBooleanAttribute(theFeatureNode, HIDEFACES_PANEL, false); + outFeatureMessage->setHideFacesPanel(isHideFaces); + //if (isInternal) { // //Internal feature has no visual representation. // return; diff --git a/src/Config/Config_Keywords.h b/src/Config/Config_Keywords.h index 5637a9891..70ca0db2a 100644 --- a/src/Config/Config_Keywords.h +++ b/src/Config/Config_Keywords.h @@ -78,6 +78,7 @@ const static char* GROUP_TOOLBAR = "toolbar"; const static char* FEATURE_ICON = "icon"; const static char* FEATURE_TEXT = "title"; const static char* HELP_FILE = "helpfile"; +const static char* HIDEFACES_PANEL = "hidefaces_panel"; const static char* FEATURE_KEYSEQUENCE = "keysequence"; const static char* FEATURE_NESTED = "nested"; const static char* FEATURE_WHEN_NESTED = "when_nested"; diff --git a/src/ModuleBase/ModuleBase_ListView.cpp b/src/ModuleBase/ModuleBase_ListView.cpp index d9fe13d2c..5fd8909ee 100644 --- a/src/ModuleBase/ModuleBase_ListView.cpp +++ b/src/ModuleBase/ModuleBase_ListView.cpp @@ -77,6 +77,19 @@ void ModuleBase_ListView::getSelectedIndices(std::set& theIndices) } } +//******************************************************************** +void ModuleBase_ListView::selectIndices(const std::set& theIndices) +{ + myListControl->clearSelection(); + for (int i = 0; i < myListControl->count(); i++) { + QListWidgetItem* anItem = myListControl->item(i); + int aId = anItem->data(ATTRIBUTE_SELECTION_INDEX_ROLE).toInt(); + if (theIndices.find(aId) != theIndices.end()) { + anItem->setSelected(true); + } + } +} + //******************************************************************** void ModuleBase_ListView::removeSelectedItems() { diff --git a/src/ModuleBase/ModuleBase_ListView.h b/src/ModuleBase/ModuleBase_ListView.h index aa973845e..aa0620e90 100644 --- a/src/ModuleBase/ModuleBase_ListView.h +++ b/src/ModuleBase/ModuleBase_ListView.h @@ -118,6 +118,10 @@ public: /// \param theIndices an output container for indices void getSelectedIndices(std::set& theIndices); + /// Selects items with indices + /// \param theIndices indices + void selectIndices(const std::set& theIndices); + /// Removes selected items from the list widget void removeSelectedItems(); diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index b4f4a38b0..305586509 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -50,7 +50,8 @@ ModuleBase_Operation::ModuleBase_Operation(const QString& theId, QObject* theParent) : QObject(theParent), myIsModified(false), - myPropertyPanel(NULL) + myPropertyPanel(NULL), + myHideFacesVisibilityState(false) { myDescription = new ModuleBase_OperationDescription(theId); } diff --git a/src/ModuleBase/ModuleBase_Operation.h b/src/ModuleBase/ModuleBase_Operation.h index 845f63686..ecc4c7c07 100644 --- a/src/ModuleBase/ModuleBase_Operation.h +++ b/src/ModuleBase/ModuleBase_Operation.h @@ -105,6 +105,10 @@ Q_OBJECT myHelpFileName = theName; } + void setHideFacesVisible(bool isVisible) { myHideFacesVisibilityState = isVisible; } + + bool isHideFacesVisible() const { return myHideFacesVisibilityState; } + signals: /// The operation is started void beforeStarted(); @@ -209,6 +213,9 @@ private: ModuleBase_IPropertyPanel* myPropertyPanel; QString myHelpFileName; + + /// Visibility state of HideFaces panel before the operation launch + bool myHideFacesVisibilityState; }; #endif diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index e2d35c87b..9bf101d3f 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -145,7 +145,7 @@ void ModuleBase_ResultPrs::setEdgesDefaultColor() //******************************************************************** -bool ModuleBase_ResultPrs::setSubShapeHidden(const NCollection_List& theShapes) +void ModuleBase_ResultPrs::setSubShapeHidden(const TopoDS_ListOfShape& theShapes) { bool isModified = false; @@ -153,48 +153,16 @@ bool ModuleBase_ResultPrs::setSubShapeHidden(const NCollection_List