From f3fd4338b273b22b9096d3a3d71fef1f68b92d10 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 7 Nov 2006 15:15:29 +0000 Subject: [PATCH] Added methods GetTimeStampNumberByIndex(long) and GetTimeStampIndexByNumber(long) --- src/VISU_I/VISU_ColoredPrs3d_i.cc | 38 +++++++++++++++++++++++++++++++ src/VISU_I/VISU_ColoredPrs3d_i.hh | 8 +++++++ 2 files changed, 46 insertions(+) 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; -- 2.39.2