<li><b>Select Only</b> provides a filter for exclusive selection of objects of a certain type.</li>
</ul>
-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 <br>
<ul>
<li>\ref work_with_groups_page "Create Group" - allows creating groups of geometrical objects.</li>
-<li><b>Hide Children</b> / <b>Show Children</b> - hides / shows child
+
+<li><b>Conceal child items</b> / <b>Disclose child items</b> - 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.</li>
+<li><b>Show Only Children</b> - erase in current viewer all objects
+and then display only children of the selected object(s).
+</li>
+
<li><b>Unpublish</b> - 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 <b>Geometry</b> root object <b>Publish...</b> item.
// 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 <GeometryGUI.h>
#include "GeometryGUI_Operations.h"
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;
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<SalomeApp_Study*>(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
// 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
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();
// 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"
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" )
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<SalomeApp_Study*>( 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<SalomeApp_Study*>( study() );
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<SalomeApp_Study*>( study() );
// 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
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;
<source>MEN_DISPLAY_ONLY</source>
<translation>Show Only</translation>
</message>
+ <message>
+ <source>MEN_SHOW_ONLY_CHILDREN</source>
+ <translation>Show Only Children</translation>
+ </message>
<message>
<source>MEN_BRING_TO_FRONT</source>
<translation>Bring To Front</translation>
<translation>Create Group</translation>
</message>
<message>
- <source>MEN_POP_SHOW_CHILDREN</source>
- <translation>Show Children</translation>
+ <source>MEN_POP_DISCLOSE_CHILDREN</source>
+ <translation>Disclose child items</translation>
</message>
<message>
- <source>MEN_POP_HIDE_CHILDREN</source>
- <translation>Hide Children</translation>
+ <source>MEN_POP_CONCEAL_CHILDREN</source>
+ <translation>Conceal child items</translation>
</message>
<message>
<source>MEN_POP_UNPUBLISH_OBJ</source>
<source>STB_DISPLAY_ONLY</source>
<translation>Show only</translation>
</message>
+ <message>
+ <source>STB_SHOW_ONLY_CHILDREN</source>
+ <translation>Show Only Children</translation>
+ </message>
<message>
<source>STB_EDGE</source>
<translation>Build an edge</translation>
<source>STB_POP_CREATE_GROUP</source>
<translation>Create Group</translation>
</message>
- <message>
- <source>STB_POP_SHOW_CHILDREN</source>
- <translation>Show child objects</translation>
- </message>
<message>
<source>STB_POP_UNPUBLISH_OBJ</source>
<translation>Unpublish object</translation>
<translation>Publish object</translation>
</message>
<message>
- <source>STB_POP_HIDE_CHILDREN</source>
- <translation>Hide child objects</translation>
+ <source>STB_POP_DISCLOSE_CHILDREN</source>
+ <translation>Disclose child items</translation>
+ </message>
+ <message>
+ <source>STB_POP_CONCEAL_CHILDREN</source>
+ <translation>Conceal child items</translation>
</message>
<message>
<source>STB_POP_ISOS</source>
<source>TOP_DISPLAY_ONLY</source>
<translation>Show only</translation>
</message>
+ <message>
+ <source>TOP_SHOW_ONLY_CHILDREN</source>
+ <translation>Show Only Children</translation>
+ </message>
<message>
<source>TOP_EDGE</source>
<translation>Build edge</translation>
<source>TOP_POP_CREATE_GROUP</source>
<translation>Create Group</translation>
</message>
- <message>
- <source>TOP_POP_SHOW_CHILDREN</source>
- <translation>Show Children</translation>
- </message>
<message>
<source>TOP_POP_UNPUBLISH_OBJ</source>
<translation>Unpublish object</translation>
<translation>Publish object</translation>
</message>
<message>
- <source>TOP_POP_HIDE_CHILDREN</source>
- <translation>Hide Children</translation>
+ <source>TOP_POP_DISCLOSE_CHILDREN</source>
+ <translation>Disclose child items</translation>
+ </message>
+ <message>
+ <source>TOP_POP_CONCEAL_CHILDREN</source>
+ <translation>Conceal child items</translation>
</message>
<message>
<source>TOP_POP_ISOS</source>
NotViewerDependentCommands << GEOMOp::OpDelete
<< GEOMOp::OpShow
<< GEOMOp::OpShowOnly
- << GEOMOp::OpShowChildren
- << GEOMOp::OpHideChildren
+ << GEOMOp::OpShowOnlyChildren
+ << GEOMOp::OpDiscloseChildren
+ << GEOMOp::OpConcealChildren
<< GEOMOp::OpUnpublishObject
<< GEOMOp::OpPublishObject
<< GEOMOp::OpPointMarker;
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
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
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" );
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" );
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 ); // -----------
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
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
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
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();
void OnNbIsos( ActionType actionType = SHOWDLG );
void OnDeflection();
void OnSelectOnly(int mode);
- void OnShowHideChildren( bool );
+ void OnDiscloseConcealChildren( bool );
void OnUnpublishObject();
void OnPublishObject() ;
void OnPointMarker();
}
}
-void GEOMToolsGUI::OnShowHideChildren( bool show )
+void GEOMToolsGUI::OnDiscloseConcealChildren( bool show )
{
SALOME_ListIO selected;
SalomeApp_Application* app =