From: vsr Date: Wed, 6 Oct 2010 17:16:50 +0000 (+0000) Subject: PAL20144 EDF 857 VISU: Get time stamp values X-Git-Tag: mergeto_V5_1_main_09Dec10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=14060e3bb0d7ca9a943a215458d626511633d586;p=modules%2Fvisu.git PAL20144 EDF 857 VISU: Get time stamp values --- diff --git a/idl/VISU_Gen.idl b/idl/VISU_Gen.idl index 58d40368..cadc44b5 100644 --- a/idl/VISU_Gen.idl +++ b/idl/VISU_Gen.idl @@ -2253,6 +2253,9 @@ module VISU { /*! Gets existing numbers of time stamps for the given mesh name, entity and name of field */ TimeStampNumbers GetTimeStampNumbers(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName); + /*! Gets time values of time stamps for the given mesh name, entity and name of field */ + double_array GetTimeStampValues(in EntityName theMeshName, in Entity theEntity, in EntityName theFieldName); + /*! Gets existing parts of multi resolution structure for the given mesh name */ EntityNames GetPartNames(in EntityName theMeshName); diff --git a/src/VISU_I/VISU_Result_i.cc b/src/VISU_I/VISU_Result_i.cc index a0315f5c..d5fdbb3a 100644 --- a/src/VISU_I/VISU_Result_i.cc +++ b/src/VISU_I/VISU_Result_i.cc @@ -1213,6 +1213,65 @@ VISU::Result_i } +//--------------------------------------------------------------- +VISU::double_array* +VISU::Result_i +::GetTimeStampValues(const char* theMeshName, + VISU::Entity theEntity, + const char* theFieldName) +{ + VISU::double_array_var aResult = new VISU::double_array(); + const VISU::TMeshMap& aMeshMap = GetInput()->GetMeshMap(); + if(aMeshMap.empty()) + return aResult._retn(); + + VISU::TMeshMap::const_iterator anIter = aMeshMap.find(theMeshName); + if(anIter == aMeshMap.end()) + return aResult._retn(); + + const VISU::PMesh& aMesh = anIter->second; + const VISU::TMeshOnEntityMap& aMeshOnEntityMap = aMesh->myMeshOnEntityMap; + if(aMeshOnEntityMap.empty()) + return aResult._retn(); + + { + VISU::TEntity anEntity = VISU::TEntity(theEntity); + VISU::TMeshOnEntityMap::const_iterator anIter = aMeshOnEntityMap.find(anEntity); + if(anIter == aMeshOnEntityMap.end()) + return aResult._retn(); + + const VISU::PMeshOnEntity& aMeshOnEntity = anIter->second; + const VISU::TFieldMap& aFieldMap = aMeshOnEntity->myFieldMap; + if(aFieldMap.empty()) + return aResult._retn(); + + { + VISU::TFieldMap::const_iterator anIter = aFieldMap.find(theFieldName); + if(anIter == aFieldMap.end()) + return aResult._retn(); + + { + const VISU::PField& aField = anIter->second; + const VISU::TValField& aValField = aField->myValField; + if(aValField.empty()) + return aResult._retn(); + + { + aResult->length(aValField.size()); + VISU::TValField::const_iterator anIter = aValField.begin(); + for(size_t anId = 0; anIter != aValField.end(); anIter++, anId++){ + const PValForTime& aValForTime = anIter->second; + aResult[anId] = aValForTime->myTime.first; + } + } + } + } + } + + return aResult._retn(); +} + + //--------------------------------------------------------------- CORBA::Long VISU::Result_i diff --git a/src/VISU_I/VISU_Result_i.hh b/src/VISU_I/VISU_Result_i.hh index 676a0e39..ffe65bb5 100644 --- a/src/VISU_I/VISU_Result_i.hh +++ b/src/VISU_I/VISU_Result_i.hh @@ -166,6 +166,12 @@ namespace VISU Entity theEntity, const char* theFieldName); + virtual + VISU::double_array* + GetTimeStampValues(const char* theMeshName, + Entity theEntity, + const char* theFieldName); + virtual CORBA::Long GetNumberOfComponents(const char* theMeshName,