mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-02-12 15:53:08 +05:00
0021689: [CEA 571] Improve visualization of selected object in GEOM
- Show the name of the selected object in the contextual menu
This commit is contained in:
parent
f333eac72c
commit
b0cc47d13b
@ -1667,41 +1667,19 @@ LightApp_Selection* GeometryGUI::createSelection() const
|
|||||||
void GeometryGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title )
|
void GeometryGUI::contextMenuPopup( const QString& client, QMenu* menu, QString& title )
|
||||||
{
|
{
|
||||||
SalomeApp_Module::contextMenuPopup( client, menu, title );
|
SalomeApp_Module::contextMenuPopup( client, menu, title );
|
||||||
|
|
||||||
/*
|
|
||||||
SALOME_ListIO lst;
|
SALOME_ListIO lst;
|
||||||
getApp()->selectionMgr()->selectedObjects(lst);
|
getApp()->selectionMgr()->selectedObjects( lst );
|
||||||
if (lst.Extent() < 1)
|
if ( ( client == "OCCViewer" || client == "VTKViewer" ) && lst.Extent() == 1 ) {
|
||||||
return;
|
Handle(SALOME_InteractiveObject) io = lst.First();
|
||||||
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( application()->activeStudy() );
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(application()->activeStudy());
|
_PTR(Study) study = appStudy->studyDS();
|
||||||
_PTR(Study) study = appStudy->studyDS();
|
_PTR(SObject) obj = study->FindObjectID( io->getEntry() );
|
||||||
|
if ( obj ) {
|
||||||
bool isImported = true;
|
QString aName = QString( obj->GetName().c_str() );
|
||||||
SALOME_ListIteratorOfListIO anIt (lst);
|
aName.remove( QRegExp("\\s+$") );
|
||||||
for (; anIt.More() && isImported; anIt.Next()) {
|
title = aName;
|
||||||
Handle(SALOME_InteractiveObject) io = anIt.Value();
|
|
||||||
_PTR(SObject) aSObj = study->FindObjectID(io->getEntry());
|
|
||||||
if (aSObj) {
|
|
||||||
if (lst.Extent() == 1) {
|
|
||||||
// Set context menu title
|
|
||||||
if (client == "OCCViewer" || client == "VTKViewer")
|
|
||||||
title = QString(aSObj->GetName().c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
CORBA::Object_var anObj = GeometryGUI::ClientSObjectToObject(aSObj);
|
|
||||||
GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_narrow(anObj);
|
|
||||||
if (CORBA::is_nil(aGeomObj) || aGeomObj->GetType() != GEOM_IMPORT)
|
|
||||||
isImported = false;
|
|
||||||
} else {
|
|
||||||
isImported = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isImported) {
|
|
||||||
menu->addAction(action(GEOMOp::OpReimport)); // Reload imported shape
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryGUI::createPreferences()
|
void GeometryGUI::createPreferences()
|
||||||
|
Loading…
Reference in New Issue
Block a user