diff --git a/doc/salome/gui/GEOM/images/ob_popup_menu.png b/doc/salome/gui/GEOM/images/ob_popup_menu.png
index 51ae305d7..1d9f0e321 100644
Binary files a/doc/salome/gui/GEOM/images/ob_popup_menu.png and b/doc/salome/gui/GEOM/images/ob_popup_menu.png differ
diff --git a/doc/salome/gui/GEOM/input/viewing_geom_obj.doc b/doc/salome/gui/GEOM/input/viewing_geom_obj.doc
index 44cea48a6..ada09fef1 100644
--- a/doc/salome/gui/GEOM/input/viewing_geom_obj.doc
+++ b/doc/salome/gui/GEOM/input/viewing_geom_obj.doc
@@ -74,18 +74,23 @@ on the viewer background:
Select Only provides a filter for exclusive selection of objects of a certain type.
-The the following commands appear in the Object Browser context menu
+The following commands appear in the Object Browser context menu
under certain conditions:
\image html ob_popup_menu.png
\ref work_with_groups_page "Create Group" - allows creating groups of geometrical objects.
-
Hide Children / Show Children - hides / shows child
+
+
Conceal child items / Disclose child items - hides / shows child
sub-objects in the Object Browser, if the selected geometric object has
child objects. When some child objects are hidden, the name of the
parent object is hilghlighted with bold font.
+
Show Only Children - erase in current viewer all objects
+and then display only children of the selected object(s).
+
+
Unpublish - unpublish the selected geometric object from the Object Browser
and erase it from all viewers. To publish unpublished geometric objects select in the
context menu of the Geometry root object Publish... item.
diff --git a/src/DisplayGUI/DisplayGUI.cxx b/src/DisplayGUI/DisplayGUI.cxx
index 07613982f..67665f66e 100644
--- a/src/DisplayGUI/DisplayGUI.cxx
+++ b/src/DisplayGUI/DisplayGUI.cxx
@@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// GEOM GEOMGUI : GUI for Geometry component
// File : DisplayGUI.cxx
// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
-//
+
#include "DisplayGUI.h"
#include
#include "GeometryGUI_Operations.h"
@@ -110,6 +109,10 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
getGeometryGUI()->EmitSignalDeactivateDialog();
DisplayOnly();
break;
+ case GEOMOp::OpShowOnlyChildren: // POPUP MENU - SHOW ONLY CHILDREN
+ getGeometryGUI()->EmitSignalDeactivateDialog();
+ DisplayOnlyChildren();
+ break;
case GEOMOp::OpHideAll: // MENU VIEW - HIDE ALL
EraseAll();
break;
@@ -217,6 +220,62 @@ void DisplayGUI::DisplayOnly()
Display();
}
+//=====================================================================================
+// function : DisplayGUI::DisplayOnlyChildren()
+// purpose : Display only children of selected GEOM objects and erase other
+//=====================================================================================
+void DisplayGUI::DisplayOnlyChildren()
+{
+ EraseAll();
+
+ SALOME_ListIO listIO;
+
+ SalomeApp_Application* app = getGeometryGUI()->getApp();
+ if (!app) return;
+
+ SalomeApp_Study* anActiveStudy = dynamic_cast(app->activeStudy());
+ if (!anActiveStudy) return;
+
+ LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
+ if (!aSelMgr) return;
+
+ // get selection
+ SALOME_ListIO aList;
+ //aSelMgr->selectedObjects(aList);
+ aSelMgr->selectedObjects(aList, "ObjectBrowser", false);
+ SALOME_ListIteratorOfListIO It (aList);
+
+ SUIT_OverrideCursor();
+
+ for (; It.More(); It.Next()) {
+ Handle(SALOME_InteractiveObject) anIObject = It.Value();
+ if (anIObject->hasEntry()) {
+ _PTR(SObject) SO (anActiveStudy->studyDS()->FindObjectID(anIObject->getEntry()));
+ if (SO) {
+ _PTR(SComponent) SC (SO->GetFatherComponent());
+ if (QString(SO->GetID().c_str()) == QString(SO->GetFatherComponent()->GetID().c_str())) {
+ // if component is selected, pass it
+ }
+ else {
+ _PTR(ChildIterator) anIter (anActiveStudy->studyDS()->NewChildIterator(SO));
+ anIter->InitEx(true);
+ while (anIter->More()) {
+ _PTR(SObject) valSO (anIter->Value());
+ _PTR(SObject) refSO;
+ if (!valSO->ReferencedObject(refSO)) {
+ listIO.Append(new SALOME_InteractiveObject(valSO->GetID().c_str(),
+ SC->ComponentDataType().c_str(),
+ valSO->GetName().c_str()));
+ }
+ anIter->Next();
+ }
+ }
+ }
+ }
+ }
+ GEOM_Displayer(anActiveStudy).Display(listIO, true);
+}
+
//=====================================================================================
// function : DisplayGUI::Display()
// purpose : Display selected GEOM objects
diff --git a/src/DisplayGUI/DisplayGUI.h b/src/DisplayGUI/DisplayGUI.h
index a52fe0352..74de0e22f 100644
--- a/src/DisplayGUI/DisplayGUI.h
+++ b/src/DisplayGUI/DisplayGUI.h
@@ -18,12 +18,11 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// GEOM GEOMGUI : GUI for Geometry component
// File : DisplayGUI.h
// Author : Damien COQUERET, Open CASCADE S.A.S.
-//
+
#ifndef DISPLAYGUI_H
#define DISPLAYGUI_H
@@ -53,6 +52,8 @@ public:
void Display();
// Display selected GEOM objects and erase other
void DisplayOnly();
+ // Display only children of selected GEOM objects and erase other
+ void DisplayOnlyChildren();
// Erase selected GEOM objects
void Erase();
diff --git a/src/GEOMGUI/GEOMGUI_Selection.cxx b/src/GEOMGUI/GEOMGUI_Selection.cxx
index 734234269..0aa1da20a 100644
--- a/src/GEOMGUI/GEOMGUI_Selection.cxx
+++ b/src/GEOMGUI/GEOMGUI_Selection.cxx
@@ -18,11 +18,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// File : GEOMGUI_Selection.cxx
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
-//
+
#include "GEOMGUI_Selection.h"
#include "GeometryGUI.h"
@@ -159,10 +158,12 @@ QVariant GEOMGUI_Selection::parameter( const int idx, const QString& p ) const
v = isVectorsMode( idx );
else if ( p == "topLevel" )
v = topLevel( idx );
- else if ( p == "hasHiddenChildren" )
- v = hasHiddenChildren( idx );
- else if ( p == "hasShownChildren" )
- v = hasShownChildren( idx );
+ else if ( p == "hasChildren" )
+ v = hasChildren( idx );
+ else if ( p == "hasConcealedChildren" )
+ v = hasConcealedChildren( idx );
+ else if ( p == "hasDisclosedChildren" )
+ v = hasDisclosedChildren( idx );
else if ( p == "compoundOfVertices" )
v = compoundOfVertices( idx );
else if ( p == "imported" )
@@ -446,7 +447,23 @@ bool GEOMGUI_Selection::isCompoundOfVertices( GEOM::GEOM_Object_ptr obj )
return ret;
}
-bool GEOMGUI_Selection::hasHiddenChildren( const int index ) const
+bool GEOMGUI_Selection::hasChildren( const int index ) const
+{
+ bool ok = false;
+ SalomeApp_Study* appStudy = dynamic_cast( study() );
+
+ if ( appStudy ) {
+ QString anEntry = entry( index );
+ _PTR(Study) study = appStudy->studyDS();
+ if ( study && !anEntry.isEmpty() ) {
+ _PTR(SObject) aSO( study->FindObjectID( anEntry.toStdString() ) );
+ ok = hasChildren( aSO );
+ }
+ }
+ return ok;
+}
+
+bool GEOMGUI_Selection::hasConcealedChildren( const int index ) const
{
bool OK = false;
SalomeApp_Study* appStudy = dynamic_cast( study() );
@@ -462,7 +479,7 @@ bool GEOMGUI_Selection::hasHiddenChildren( const int index ) const
return OK;
}
-bool GEOMGUI_Selection::hasShownChildren( const int index ) const
+bool GEOMGUI_Selection::hasDisclosedChildren( const int index ) const
{
bool OK = false;
SalomeApp_Study* appStudy = dynamic_cast( study() );
diff --git a/src/GEOMGUI/GEOMGUI_Selection.h b/src/GEOMGUI/GEOMGUI_Selection.h
index c6e9b59da..acef7e196 100644
--- a/src/GEOMGUI/GEOMGUI_Selection.h
+++ b/src/GEOMGUI/GEOMGUI_Selection.h
@@ -18,11 +18,10 @@
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
// File : GEOMGUI_Selection.h
// Author : Alexander SOLOVYOV, Open CASCADE S.A.S. (alexander.solovyov@opencascade.com)
-//
+
#ifndef GEOMGUI_SELECTION_H
#define GEOMGUI_SELECTION_H
@@ -66,8 +65,9 @@ private:
QString displayMode( const int ) const;
QString selectionMode() const;
bool isVectorsMode( const int ) const;
- bool hasHiddenChildren( const int ) const;
- bool hasShownChildren( const int ) const;
+ bool hasChildren( const int ) const;
+ bool hasConcealedChildren( const int ) const;
+ bool hasDisclosedChildren( const int ) const;
bool compoundOfVertices( const int ) const;
bool topLevel( const int ) const;
bool isPhysicalMaterial( const int ) const;
diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts
index 71fe07144..d0ec111bb 100644
--- a/src/GEOMGUI/GEOM_msg_en.ts
+++ b/src/GEOMGUI/GEOM_msg_en.ts
@@ -2446,6 +2446,10 @@ Please, select face, shell or solid and try again
Show Only
+
+
+ Show Only Children
+ Bring To Front
@@ -2703,12 +2707,12 @@ Please, select face, shell or solid and try again
Create Group
-
- Show Children
+
+ Disclose child items
-
- Hide Children
+
+ Conceal child items
@@ -3274,6 +3278,10 @@ Please, select face, shell or solid and try again
Show only
+
+
+ Show Only Children
+ Build an edge
@@ -3478,10 +3486,6 @@ Please, select face, shell or solid and try again
Create Group
-
-
- Show child objects
- Unpublish object
@@ -3491,8 +3495,12 @@ Please, select face, shell or solid and try again
Publish object
-
- Hide child objects
+
+ Disclose child items
+
+
+
+ Conceal child items
@@ -3894,6 +3902,10 @@ Please, select face, shell or solid and try again
Show only
+
+
+ Show Only Children
+ Build edge
@@ -4094,10 +4106,6 @@ Please, select face, shell or solid and try again
Create Group
-
-
- Show Children
- Unpublish object
@@ -4107,8 +4115,12 @@ Please, select face, shell or solid and try again
Publish object
-
- Hide Children
+
+ Disclose child items
+
+
+
+ Conceal child items
diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx
index 10eae6910..cfb646deb 100644
--- a/src/GEOMGUI/GeometryGUI.cxx
+++ b/src/GEOMGUI/GeometryGUI.cxx
@@ -376,8 +376,9 @@ void GeometryGUI::OnGUIEvent( int id )
NotViewerDependentCommands << GEOMOp::OpDelete
<< GEOMOp::OpShow
<< GEOMOp::OpShowOnly
- << GEOMOp::OpShowChildren
- << GEOMOp::OpHideChildren
+ << GEOMOp::OpShowOnlyChildren
+ << GEOMOp::OpDiscloseChildren
+ << GEOMOp::OpConcealChildren
<< GEOMOp::OpUnpublishObject
<< GEOMOp::OpPublishObject
<< GEOMOp::OpPointMarker;
@@ -419,8 +420,8 @@ void GeometryGUI::OnGUIEvent( int id )
case GEOMOp::OpDecrNbIsos: // SHORTCUT - DECREASE NB ISOS
case GEOMOp::OpAutoColor: // POPUP MENU - AUTO COLOR
case GEOMOp::OpNoAutoColor: // POPUP MENU - DISABLE AUTO COLOR
- case GEOMOp::OpShowChildren: // POPUP MENU - SHOW CHILDREN
- case GEOMOp::OpHideChildren: // POPUP MENU - HIDE CHILDREN
+ case GEOMOp::OpDiscloseChildren: // POPUP MENU - DISCLOSE CHILD ITEMS
+ case GEOMOp::OpConcealChildren: // POPUP MENU - CONCEAL CHILD ITEMS
case GEOMOp::OpUnpublishObject: // POPUP MENU - UNPUBLISH
case GEOMOp::OpPublishObject: // ROOT GEOM OBJECT - POPUP MENU - PUBLISH
case GEOMOp::OpPointMarker: // POPUP MENU - POINT MARKER
@@ -436,6 +437,7 @@ void GeometryGUI::OnGUIEvent( int id )
case GEOMOp::OpDMShadingWithEdges: // MENU VIEW - SHADING
case GEOMOp::OpShowAll: // MENU VIEW - SHOW ALL
case GEOMOp::OpShowOnly: // MENU VIEW - DISPLAY ONLY
+ case GEOMOp::OpShowOnlyChildren: // MENU VIEW - SHOW ONLY CHILDREN
case GEOMOp::OpHideAll: // MENU VIEW - ERASE ALL
case GEOMOp::OpHide: // MENU VIEW - ERASE
case GEOMOp::OpShow: // MENU VIEW - DISPLAY
@@ -859,6 +861,7 @@ void GeometryGUI::initialize( CAM_Application* app )
createGeomAction( GEOMOp::OpSelectCompound, "COMPOUND_SEL_ONLY", "", 0, true );
createGeomAction( GEOMOp::OpSelectAll, "ALL_SEL_ONLY", "", 0, true );
createGeomAction( GEOMOp::OpShowOnly, "DISPLAY_ONLY" );
+ createGeomAction( GEOMOp::OpShowOnlyChildren, "SHOW_ONLY_CHILDREN" );
createGeomAction( GEOMOp::OpBringToFront, "BRING_TO_FRONT", "", 0, true );
createGeomAction( GEOMOp::OpClsBringToFront, "CLS_BRING_TO_FRONT" );
createGeomAction( GEOMOp::OpHide, "ERASE" );
@@ -878,8 +881,8 @@ void GeometryGUI::initialize( CAM_Application* app )
createGeomAction( GEOMOp::OpAutoColor, "POP_AUTO_COLOR" );
createGeomAction( GEOMOp::OpNoAutoColor, "POP_DISABLE_AUTO_COLOR" );
createGeomAction( GEOMOp::OpGroupCreatePopup, "POP_CREATE_GROUP" );
- createGeomAction( GEOMOp::OpShowChildren, "POP_SHOW_CHILDREN" );
- createGeomAction( GEOMOp::OpHideChildren, "POP_HIDE_CHILDREN" );
+ createGeomAction( GEOMOp::OpDiscloseChildren, "POP_DISCLOSE_CHILDREN" );
+ createGeomAction( GEOMOp::OpConcealChildren, "POP_CONCEAL_CHILDREN" );
createGeomAction( GEOMOp::OpUnpublishObject, "POP_UNPUBLISH_OBJ" );
createGeomAction( GEOMOp::OpPublishObject, "POP_PUBLISH_OBJ" );
createGeomAction( GEOMOp::OpPointMarker, "POP_POINT_MARKER" );
@@ -1242,11 +1245,11 @@ void GeometryGUI::initialize( CAM_Application* app )
mgr->setRule( action( GEOMOp::OpDelete ), QString("$type in {'Shape' 'Group'} and selcount>0"), QtxPopupMgr::VisibleRule );
mgr->insert( action( GEOMOp::OpGroupCreatePopup ), -1, -1 ); // create group
mgr->setRule( action( GEOMOp::OpGroupCreatePopup ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and isOCC=true"), QtxPopupMgr::VisibleRule );
- mgr->insert( action( GEOMOp::OpShowChildren ), -1, -1 ); // show children
- mgr->setRule( action( GEOMOp::OpShowChildren ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and hasHiddenChildren=true"), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpDiscloseChildren ), -1, -1 ); // disclose child items
+ mgr->setRule( action( GEOMOp::OpDiscloseChildren ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and hasConcealedChildren=true"), QtxPopupMgr::VisibleRule );
- mgr->insert( action( GEOMOp::OpHideChildren ), -1, -1 ); // hide children
- mgr->setRule( action( GEOMOp::OpHideChildren ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and hasShownChildren=true"), QtxPopupMgr::VisibleRule );
+ mgr->insert( action( GEOMOp::OpConcealChildren ), -1, -1 ); // conceal shild items
+ mgr->setRule( action( GEOMOp::OpConcealChildren ), QString("client='ObjectBrowser' and type='Shape' and selcount=1 and hasDisclosedChildren=true"), QtxPopupMgr::VisibleRule );
mgr->insert( action( GEOMOp::OpGroupEdit ), -1, -1 ); // edit group
mgr->setRule( action( GEOMOp::OpGroupEdit ), QString("client='ObjectBrowser' and type='Group' and selcount=1 and isOCC=true"), QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
@@ -1353,6 +1356,8 @@ void GeometryGUI::initialize( CAM_Application* app )
mgr->setRule(action(GEOMOp::OpSelectAll), selectOnly + " and selectionmode='ALL'", QtxPopupMgr::ToggleRule);
mgr->insert( action(GEOMOp::OpShowOnly ), -1, -1 ); // display only
mgr->setRule(action(GEOMOp::OpShowOnly ), rule.arg( types ).arg( "true" ), QtxPopupMgr::VisibleRule );
+ mgr->insert( action(GEOMOp::OpShowOnlyChildren ), -1, -1 ); // display only children
+ mgr->setRule(action(GEOMOp::OpShowOnlyChildren ), (canDisplay + "and ($type in {%1}) and client='ObjectBrowser' and hasChildren=true").arg( types ), QtxPopupMgr::VisibleRule );
mgr->insert( separator(), -1, -1 ); // -----------
mgr->insert( action( GEOMOp::OpUnpublishObject ), -1, -1 ); // Unpublish object
diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h
index 89bb954d5..75e45e43f 100644
--- a/src/GEOMGUI/GeometryGUI_Operations.h
+++ b/src/GEOMGUI/GeometryGUI_Operations.h
@@ -50,13 +50,12 @@ namespace GEOMOp {
OpPointMarker = 1210, // POPUP MENU - POINT MARKER
OpSetTexture = 1211, // POPUP MENU - SETTEXTURE
OpMaterialProperties = 1212, // POPUP MENU - MATERIAL PROPERTIES
- OpShowChildren = 1250, // POPUP MENU - SHOW CHILDREN
- OpHideChildren = 1251, // POPUP MENU - HIDE CHILDREN
+ OpDiscloseChildren = 1250, // POPUP MENU - DISCLOSE CHILD ITEMS
+ OpConcealChildren = 1251, // POPUP MENU - CONCEAL CHILD ITEMS
OpUnpublishObject = 1253, // POPUP MENU - UNPUBLISH
OpPublishObject = 1254, // GEOM ROOT OBJECT - POPUP MENU - PUBLISH
OpEdgeWidth = 1260, // POPUP MENU - LINE WIDTH - EDGE WIDTH
OpIsosWidth = 1261, // POPUP MENU - LINE WIDTH - ISOS WIDTH
-
// DisplayGUI ------------------//--------------------------------
OpSwitchVectors = 2001, // MENU VIEW - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION
OpShowAll = 2002, // MENU VIEW - SHOW ALL
@@ -67,6 +66,7 @@ namespace GEOMOp {
OpShow = 2100, // POPUP MENU - SHOW
OpShowOnly = 2101, // POPUP MENU - SHOW ONLY
OpHide = 2102, // POPUP MENU - HIDE
+ OpShowOnlyChildren = 2103, // POPUP MENU - SHOW ONLY CHILDREN
OpWireframe = 2200, // POPUP MENU - DISPLAY MODE - WIREFRAME
OpShading = 2201, // POPUP MENU - DISPLAY MODE - SHADING
OpShadingWithEdges = 2202, // POPUP MENU - DISPLAY MODE - SHADING WITH EDGES
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.cxx b/src/GEOMToolsGUI/GEOMToolsGUI.cxx
index 68d4cefd7..e83523ea4 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI.cxx
+++ b/src/GEOMToolsGUI/GEOMToolsGUI.cxx
@@ -355,9 +355,9 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
case GEOMOp::OpNoAutoColor: // POPUP - DISABLE AUTO COLOR
OnDisableAutoColor();
break;
- case GEOMOp::OpShowChildren: // POPUP - SHOW CHILDREN
- case GEOMOp::OpHideChildren: // POPUP - HIDE CHILDREN
- OnShowHideChildren( theCommandID == GEOMOp::OpShowChildren );
+ case GEOMOp::OpDiscloseChildren: // POPUP - SHOW CHILDREN
+ case GEOMOp::OpConcealChildren: // POPUP - HIDE CHILDREN
+ OnDiscloseConcealChildren( theCommandID == GEOMOp::OpDiscloseChildren );
break;
case GEOMOp::OpPointMarker: // POPUP - POINT MARKER
OnPointMarker();
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI.h b/src/GEOMToolsGUI/GEOMToolsGUI.h
index d980f5ee1..8b6c32c78 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI.h
+++ b/src/GEOMToolsGUI/GEOMToolsGUI.h
@@ -77,7 +77,7 @@ private:
void OnNbIsos( ActionType actionType = SHOWDLG );
void OnDeflection();
void OnSelectOnly(int mode);
- void OnShowHideChildren( bool );
+ void OnDiscloseConcealChildren( bool );
void OnUnpublishObject();
void OnPublishObject() ;
void OnPointMarker();
diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
index a0885473f..c73767ca2 100644
--- a/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
+++ b/src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
@@ -952,7 +952,7 @@ void GEOMToolsGUI::OnSelectOnly(int mode)
}
}
-void GEOMToolsGUI::OnShowHideChildren( bool show )
+void GEOMToolsGUI::OnDiscloseConcealChildren( bool show )
{
SALOME_ListIO selected;
SalomeApp_Application* app =