]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Added methods
authorouv <ouv@opencascade.com>
Tue, 7 Nov 2006 15:15:29 +0000 (15:15 +0000)
committerouv <ouv@opencascade.com>
Tue, 7 Nov 2006 15:15:29 +0000 (15:15 +0000)
GetTimeStampNumberByIndex(long) and
GetTimeStampIndexByNumber(long)

src/VISU_I/VISU_ColoredPrs3d_i.cc
src/VISU_I/VISU_ColoredPrs3d_i.hh

index 93e16afd91db85178ffcafafe03d109e609d1e79..f2979693441b108105fbc71b8f61c6a6f541e274 100644 (file)
@@ -234,6 +234,44 @@ VISU::ColoredPrs3d_i
 }
 
 
+//----------------------------------------------------------------------------
+CORBA::Long
+VISU::ColoredPrs3d_i
+::GetTimeStampNumberByIndex( CORBA::Long theIndex )
+{
+  VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = GetTimeStampsRange();
+  CORBA::Long aLength = aTimeStampsRange->length();
+
+  if( theIndex >= 0 && theIndex < aLength )
+  {
+    VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ theIndex ];
+    return anInfo.myNumber;
+  }
+
+  return -1;
+}
+
+
+//----------------------------------------------------------------------------
+CORBA::Long
+VISU::ColoredPrs3d_i
+::GetTimeStampIndexByNumber( CORBA::Long theNumber )
+{
+  VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = GetTimeStampsRange();
+  CORBA::Long aLength = aTimeStampsRange->length();
+
+  for( int index = 0; index < aLength; index++ )
+  {
+    VISU::ColoredPrs3d::TimeStampInfo anInfo = aTimeStampsRange[ index ];
+
+    if( anInfo.myNumber == theNumber )
+      return index;
+  }
+
+  return -1;
+}
+
+
 //----------------------------------------------------------------------------
 const VISU::PValForTime&
 VISU::ColoredPrs3d_i
index 427d88ae5f44ecb92d1bbd436e83d3571ed69cc8..fbf58227397a1a837810359a58a214cba23f0163 100644 (file)
@@ -97,6 +97,14 @@ namespace VISU
     CORBA::Long
     GetTimeStampNumber();
 
+    virtual
+    CORBA::Long
+    GetTimeStampNumberByIndex( CORBA::Long theIndex );
+
+    virtual
+    CORBA::Long
+    GetTimeStampIndexByNumber( CORBA::Long theNumber );
+
     virtual 
     const VISU::PValForTime&
     GetValForTime() const;