From: ouv Date: Tue, 7 Nov 2006 15:15:29 +0000 (+0000) Subject: Added methods X-Git-Tag: WP1_2_3_09-11-2006_change_prs_input~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3fd4338b273b22b9096d3a3d71fef1f68b92d10;p=modules%2Fvisu.git Added methods GetTimeStampNumberByIndex(long) and GetTimeStampIndexByNumber(long) --- diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index 93e16afd..f2979693 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -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 diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index 427d88ae..fbf58227 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -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;