From 443eaeca792944ec5445f2cb08061bd9abe7c66e Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 28 Sep 2009 10:28:07 +0000 Subject: [PATCH] Getting result by SObject --- idl/VISU_Gen.idl | 2 ++ src/ENGINE/VISU_Engine_i.cc | 5 +++++ src/ENGINE/VISU_Engine_i.hh | 2 ++ src/VISU_I/VISU_Gen_i.cc | 18 ++++++++++++++++++ src/VISU_I/VISU_Gen_i.hh | 3 +++ src/VISU_I/VISU_Result_i.cc | 6 +++++- 6 files changed, 35 insertions(+), 1 deletion(-) diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index 7ff5beb8..d0a7c449 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -2353,6 +2353,8 @@ module VISU { in string theMeshName, in double_array theTStamps ); + Result GetResult(in SALOMEDS::SObject theResultObj); + }; /*! \brief %View interface diff --git a/src/ENGINE/VISU_Engine_i.cc b/src/ENGINE/VISU_Engine_i.cc index 887f2da1..f75f45a7 100644 --- a/src/ENGINE/VISU_Engine_i.cc +++ b/src/ENGINE/VISU_Engine_i.cc @@ -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); + } + }; diff --git a/src/ENGINE/VISU_Engine_i.hh b/src/ENGINE/VISU_Engine_i.hh index 93847a27..bd609c21 100644 --- a/src/ENGINE/VISU_Engine_i.hh +++ b/src/ENGINE/VISU_Engine_i.hh @@ -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); }; }; diff --git a/src/VISU_I/VISU_Gen_i.cc b/src/VISU_I/VISU_Gen_i.cc index 9862db83..4552148c 100644 --- a/src/VISU_I/VISU_Gen_i.cc +++ b/src/VISU_I/VISU_Gen_i.cc @@ -406,6 +406,7 @@ namespace VISU aFiles); } } + if(MYDEBUG) MESSAGE("VISU_Gen_i::Save - aFileNames.size() - "<GetObject(); + if (CORBA::is_nil(anObject)) + return Result::_nil(); + + VISU::Result_i* aResult = dynamic_cast(GetServant(anObject).in()); + + return aResult->_this(); + } + } diff --git a/src/VISU_I/VISU_Gen_i.hh b/src/VISU_I/VISU_Gen_i.hh index baee2831..b4317915 100644 --- a/src/VISU_I/VISU_Gen_i.hh +++ b/src/VISU_I/VISU_Gen_i.hh @@ -401,6 +401,9 @@ namespace VISU const char* theMeshName, const VISU::double_array& theTStamps); + + virtual Result_ptr GetResult(SALOMEDS::SObject_ptr theResultObj); + }; } diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index 2ffa6bee..01da0512 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -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){ -- 2.39.2