]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Getting result by SObject BR_PARAVIS_DEV PARAVIS_2009_FINAL PARAVIS_28102009 PARAVIS_29092009
authorvsv <vsv@opencascade.com>
Mon, 28 Sep 2009 10:28:07 +0000 (10:28 +0000)
committervsv <vsv@opencascade.com>
Mon, 28 Sep 2009 10:28:07 +0000 (10:28 +0000)
idl/VISU_Gen.idl
src/ENGINE/VISU_Engine_i.cc
src/ENGINE/VISU_Engine_i.hh
src/VISU_I/VISU_Gen_i.cc
src/VISU_I/VISU_Gen_i.hh
src/VISU_I/VISU_Result_i.cc

index 7ff5beb88abcb401b88dd34a08c5797abebede0b..d0a7c4495c7bb5ea8dc128c358489641f3ce0117 100644 (file)
@@ -2353,6 +2353,8 @@ module VISU {
                      in string theMeshName,
                      in double_array theTStamps );
 
+    Result GetResult(in SALOMEDS::SObject theResultObj);
+
   };
 
   /*! \brief %View interface
index 887f2da125d1748309985e83c906160324f8cac5..f75f45a76687ee7b1aa46b1eee3bc20a92c09dbb 100644 (file)
@@ -527,4 +527,9 @@ namespace VISU{
     return myVisuGen->VTK2MED(theVTKFiles, theMEDFile, theMeshName, theTStamps);
   }   
 
+  Result_ptr VISU_Gen_i::GetResult(SALOMEDS::SObject_ptr theResultObj)
+  {
+    return myVisuGen->GetResult(theResultObj);
+  }
+
 };
index 93847a27f4ab837ff8849c4cdb8f503da8bf732e..bd609c21cf0747ba91fc4d4df59c2ffa7d767120 100644 (file)
@@ -262,6 +262,8 @@ namespace VISU
                                     const char* theMEDFile,
                                     const char* theMeshName,
                                     const VISU::double_array& theTStamps );
+
+    virtual Result_ptr GetResult(SALOMEDS::SObject_ptr theResultObj);
   };
 };
 
index 9862db8362460ee999b4071cbb34f9473b313cc9..4552148c7b9c68df9679619db3d94fe7713e7880 100644 (file)
@@ -406,6 +406,7 @@ namespace VISU
                      aFiles);
       }
     }
+
     if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<<aFileNames.size());
 
     SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile(0);
@@ -1556,4 +1557,21 @@ namespace VISU
 
     return res == 0;
   }
+
+
+  Result_ptr VISU_Gen_i::GetResult(SALOMEDS::SObject_ptr theResultObj)
+  {
+    if(CORBA::is_nil(myStudyDocument))
+      return Result::_nil();
+
+    //CORBA::Object_var anObject = SObjectToObject(theResultObj);
+    CORBA::Object_var anObject = theResultObj->GetObject();
+    if (CORBA::is_nil(anObject))
+      return Result::_nil();
+
+    VISU::Result_i* aResult = dynamic_cast<VISU::Result_i*>(GetServant(anObject).in());
+
+    return aResult->_this();
+  }
+
 }
index baee283131ba4498ee354655a184a20b4ca93518..b4317915a9dab179f8bd3c6788e905da93b99a61 100644 (file)
@@ -401,6 +401,9 @@ namespace VISU
            const char* theMeshName,
            const VISU::double_array& theTStamps);
 
+
+    virtual Result_ptr GetResult(SALOMEDS::SObject_ptr theResultObj);
+
   };
 }
 
index 2ffa6bee0612aa811db43c38e62b64f6765059e1..01da0512abcf4ee05a8532e791969d0349d8e305 100644 (file)
@@ -390,6 +390,10 @@ VISU::Result_i
     aPixmap = SALOMEDS::AttributePixMap::_narrow( anAttr );
     aPixmap ->SetPixMap("ICON_TREE_RESULT");
 
+    anAttr  = aStudyBuilder->FindOrCreateAttribute( mySObject, "AttributeLocalID" );
+    SALOMEDS::AttributeLocalID_var  aId = SALOMEDS::AttributeLocalID::_narrow( anAttr );
+    aId->SetValue(VISU::TRESULT);
     if(theIsBuildAll)
       return BuildAll();
     return true;
@@ -552,7 +556,7 @@ VISU::Result_i
 
     if(myInput){
       if(myIsBuildImmediately)
-       Build(SALOMEDS::SObject::_nil());
+        Build(SALOMEDS::SObject::_nil());
       return this;
     }
   }catch(std::exception& exc){