]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
PAL20144 EDF 857 VISU: Get time stamp values mergeto_V5_1_main_09Dec10 mergeto_V5_1_main_14Nov10
authorvsr <vsr@opencascade.com>
Wed, 6 Oct 2010 17:16:50 +0000 (17:16 +0000)
committervsr <vsr@opencascade.com>
Wed, 6 Oct 2010 17:16:50 +0000 (17:16 +0000)
idl/VISU_Gen.idl
src/VISU_I/VISU_Result_i.cc
src/VISU_I/VISU_Result_i.hh

index 58d4036870c5a1f2cd7270a2470a5ff601be1903..cadc44b5a496ef65424dd2be22ea8f7fef571547 100644 (file)
@@ -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);
 
index a0315f5ccc663d48a077daffafa4bb3d6d617b78..d5fdbb3aec54760006e9af03eb3cbdb9821e0b1f 100644 (file)
@@ -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
index 676a0e39312fa78f1058a8d05ee7013ca3e85bb0..ffe65bb55d738d2b91140b16a1e989a9581ed7ba 100644 (file)
@@ -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,