]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Impossible to Delete a presentation object through the reference on it. Regression...
authordmv <dmv@opencascade.com>
Tue, 7 Oct 2008 05:41:12 +0000 (05:41 +0000)
committerdmv <dmv@opencascade.com>
Tue, 7 Oct 2008 05:41:12 +0000 (05:41 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Tools.cxx

index 08e0e8605ed7c93675990a4dbcc58baa69af8ff2..54906ff27cbb34fbcce0aadfc4c6dd84404c2c80 100644 (file)
@@ -1355,11 +1355,22 @@ VisuGUI
   Handle(SALOME_InteractiveObject) anIO;
   for (SALOME_ListIteratorOfListIO it (aList); it.More(); it.Next()) {
     anIO = it.Value();
-    aNameList.append("\n    - ");
-    aNameList.append(anIO->getName());
     if (anIO->hasEntry()) {
-      if (IsRemovable(anIO->getEntry(), this))
-        anEntries[i++] = anIO->getEntry();
+      if (IsRemovable(anIO->getEntry(), this)) {
+       aNameList.append("\n    - ");
+       // Get Name Of the Main Object if it's a referenced object
+       VISU::TObjectInfo anObjectInfo = GetObjectByEntry(GetAppStudy(this), anIO->getEntry());
+       if(_PTR(SObject) aSObject = anObjectInfo.mySObject){
+         _PTR(SObject) aRefSObject;
+         if (aSObject->ReferencedObject(aRefSObject)) {
+           QString aRefName = QString::fromStdString ( aRefSObject->GetName() );
+           aNameList.append( aRefName );
+         }
+         else
+           aNameList.append(anIO->getName());
+       }
+       anEntries[i++] = anIO->getEntry();
+      }
     }
   }
   nbSelected = i;
index 07b5fa49e2229ce476fece649e69db9d4875baf0..44eeeca35d6e07e9ec51bf43274f59abefc2b36f 100644 (file)
@@ -420,7 +420,7 @@ namespace VISU
          // It can be a reference on curve, published under a container. IPAL 20317
          VISU::TObjectInfo aRefObjectInfo = GetObjectByEntry(GetAppStudy(theModule), aRefSObject->GetID());
          VISU::Base_i* aRefBase = aRefObjectInfo.myBase;
-         if(aRefBase && aRefBase->GetType() == VISU::TCURVE)
+         if( (aRefBase && aRefBase->GetType() == VISU::TCURVE) || (aRefBase && aRefBase->GetType() == VISU::TMESH) )
            return true;
        }