{
SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
+ OB_Browser* ob = getApp()->objectBrowser();
+ bool isOBClient = (ob && theClient == ob->popupClientType());
+
SalomeApp_SelectionMgr* aSelectionMgr = GetSelectionMgr(this);
SALOME_ListIO aListIO;
aSelectionMgr->selectedObjects(aListIO);
SALOME_ListIteratorOfListIO It (aListIO);
for (; It.More(); It.Next()) {
Handle(SALOME_InteractiveObject)& anIO = It.Value();
- /*std::vector<VISU::Prs3d_i*> aPrsList = GetPrs3dList(this, anIO);
- nbPrs += aPrsList.size();*/
if (!anIO.IsNull() && anIO->hasEntry()) {
_PTR(SObject) aSObject = aCStudy->FindObjectID(anIO->getEntry());
theMenu->insertSeparator();
// Check if some (nb > 0) removable objects selected
- if (IsRemovableSelected(this)) {
+ if (isOBClient && IsRemovableSelected(this)) {
action( VISU_DELETE_OBJS )->addTo(theMenu);
}
if (aType == VISU::TANIMATION) {
action( VISU_SHOW_ANIMATION )->addTo(theMenu);
- } else if (IsSObjectTable(SO)) {
- OB_Browser* ob = getApp()->objectBrowser();
- if (ob && theClient == ob->popupClientType()) {
+ } else if (isOBClient) {
+ if (IsSObjectTable(SO)) {
action( VISU_SHOW_TABLE )->addTo(theMenu);
action( VISU_CREATE_CURVES )->addTo(theMenu);
action( VISU_EXPORT_TABLE )->addTo(theMenu);
theMenu->insertSeparator();
- }
- } else {
- if (!CORBA::is_nil(anObject)) {
- SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
- if (!CORBA::is_nil(aMED.in())) {
- action( VISU_IMPORT_MED_STRUCTURE )->addTo(theMenu);
- }
-
- SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject); // "Import Structure"
- if (!CORBA::is_nil(aField)) {
- action( VISU_IMPORT_MED_TIMESTAMP )->addTo(theMenu); // "Import TimeStamp"
- }
} else {
- _PTR(SObject) aSFather = SO->GetFather();
- if (aSFather) {
- _PTR(GenericAttribute) anAttr;
- aSFather->FindAttribute(anAttr, "AttributeName");
- if (anAttr) {
- _PTR(AttributeName) aName (anAttr);
- std::string aValue = aName->Value();
- if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
- action( VISU_IMPORT_MED_FIELD )->addTo(theMenu); // "Import Field"
+ if (!CORBA::is_nil(anObject)) {
+ SALOME_MED::MED_var aMED = SALOME_MED::MED::_narrow(anObject);
+ if (!CORBA::is_nil(aMED.in())) {
+ action( VISU_IMPORT_MED_STRUCTURE )->addTo(theMenu);
+ }
+
+ SALOME_MED::FIELD_var aField = SALOME_MED::FIELD::_narrow(anObject); // "Import Structure"
+ if (!CORBA::is_nil(aField)) {
+ action( VISU_IMPORT_MED_TIMESTAMP )->addTo(theMenu); // "Import TimeStamp"
+ }
+ } else {
+ _PTR(SObject) aSFather = SO->GetFather();
+ if (aSFather) {
+ _PTR(GenericAttribute) anAttr;
+ aSFather->FindAttribute(anAttr, "AttributeName");
+ if (anAttr) {
+ _PTR(AttributeName) aName (anAttr);
+ std::string aValue = aName->Value();
+ if (strcmp(aValue.c_str(), "MEDFIELD") == 0) {
+ action( VISU_IMPORT_MED_FIELD )->addTo(theMenu); // "Import Field"
+ }
}
}
}