]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To improve CheckResult method
authorapo <apo@opencascade.com>
Mon, 10 Oct 2005 05:53:04 +0000 (05:53 +0000)
committerapo <apo@opencascade.com>
Mon, 10 Oct 2005 05:53:04 +0000 (05:53 +0000)
src/VISUGUI/VisuGUI_Tools.cxx

index 85a6db882e48af453b96dec01ea7a9c561ce7ba1..6db5b293be0b6516bcbf02ead14e045e79801148 100644 (file)
@@ -521,6 +521,9 @@ namespace VISU
               _PTR(SObject)           theSource,
               VISU::Result_var&       theResult)
   {
+    if(theSource->Depth() < 3) // Bug of SALOMEDS : can\t get father from root object
+      return NULL;
+      
     _PTR(SObject) aSObj = theSource->GetFather();
     if (!aSObj)
       return NULL;
@@ -545,13 +548,7 @@ namespace VISU
       return NULL;
 
     theResult = VISU::Result::_narrow(anObject);
-    VISU::Result_i* pResult = dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
-    if (pResult == NULL)
-      SUIT_MessageBox::warn1(GetDesktop(theModule),
-                             QObject::tr("WRN_VISU"),
-                             QObject::tr("WRN_NO_AVAILABLE_DATA"),
-                             QObject::tr("BUT_OK"));
-    return pResult;
+    return dynamic_cast<VISU::Result_i*>(VISU::GetServant(anObject).in());
   }
 
   //************************************************************