]> 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:55:13 +0000 (05:55 +0000)
committerdmv <dmv@opencascade.com>
Tue, 7 Oct 2008 05:55:13 +0000 (05:55 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI_Tools.cxx

index b8cdfba0106a522ff2b715597171c4148e653ad6..36dcc5acaf73c6d35734924f65eb88b2974f74aa 100644 (file)
@@ -1339,11 +1339,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))
+      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 ( aRefSObject->GetName() );
+           aNameList.append( aRefName );
+         }
+         else
+           aNameList.append(anIO->getName());
+       }
         anEntries[i++] = anIO->getEntry();
+      }
     }
   }
   nbSelected = i;
index 4e2f4e8e9029df84900e6bca992345dc27e8c820..2cea6bb6db8bb00728c6cf6226b14f1e87c267df 100644 (file)
@@ -416,7 +416,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;
        }