From edba09d1fe9467b19cd320e61f79ee619d424555 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 2 Nov 2006 10:40:27 +0000 Subject: [PATCH] For presentations published under TimeStamp their function GetTimeStamp range will return only one component sequence --- src/VISU_I/VISU_ColoredPrs3d_i.cc | 27 +++++++++++++++++++++------ src/VISU_I/VISU_ColoredPrs3d_i.hh | 1 + 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.cc b/src/VISU_I/VISU_ColoredPrs3d_i.cc index be840816..e30d881b 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.cc +++ b/src/VISU_I/VISU_ColoredPrs3d_i.cc @@ -50,6 +50,7 @@ ColoredPrs3d_i(Result_i* theResult, PrsObject_i(SALOMEDS::Study::_nil()), Prs3d_i(theResult), myPublishInStudyMode(thePublishInStudyMode), + myIsTimeStampFixed(thePublishInStudyMode == EPublishUnderTimeStamp), myScalarMapPL(NULL), myIsFixedRange(false) {} @@ -62,6 +63,7 @@ ColoredPrs3d_i(Result_i* theResult, PrsObject_i(theSObject->GetStudy()), Prs3d_i(theResult,theSObject), myPublishInStudyMode(EDoNotPublish), + myIsTimeStampFixed(true), myScalarMapPL(NULL), myIsFixedRange(false) {} @@ -291,11 +293,23 @@ VISU::ColoredPrs3d::TimeStampsRange* VISU::ColoredPrs3d_i ::GetTimeStampsRange() { + VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange(); + VISU::TValField& aValField = GetField()->myValField; + if(myIsTimeStampFixed){ + aTimeStampsRange->length(1); + PValForTime& aValForTime = aValField[GetTimeStampNumber()]; + std::string aTime = VISU_Convertor::GenerateName(aValForTime->myTime); + VISU::ColoredPrs3d::TimeStampInfo anInfo; + anInfo.myNumber = GetTimeStampNumber(); + anInfo.myTime = aTime.c_str(); + aTimeStampsRange[0] = anInfo; + return aTimeStampsRange._retn(); + } + // To exclude timstamps with repeated time typedef std::map TTimeStampsRange; TTimeStampsRange aRange; { - const VISU::TValField& aValField = GetField()->myValField; VISU::TValField::const_iterator anIter = aValField.begin(); for(; anIter != aValField.end(); anIter++){ vtkIdType aTimeStampNumber = anIter->first; @@ -318,7 +332,6 @@ VISU::ColoredPrs3d_i } // To map the C++ data structures to the corresponding CORBA ones - VISU::ColoredPrs3d::TimeStampsRange_var aTimeStampsRange = new VISU::ColoredPrs3d::TimeStampsRange(); { aTimeStampsRange->length(aRange.size()); TTimeStampsSortedRange::const_iterator anIter = aSortedRange.begin(); @@ -804,6 +817,7 @@ VISU::ColoredPrs3d_i SetEntity((VISU::Entity)VISU::Storable::FindValue(theMap,"myEntity").toInt()); SetFieldName(VISU::Storable::FindValue(theMap,"myFieldName").latin1()); SetTimeStampNumber(VISU::Storable::FindValue(theMap,"myIteration").toInt()); + myIsTimeStampFixed = VISU::Storable::FindValue(theMap,"myIsTimeStampFixed").toInt(); OnSetInput(); Build(ERestore); @@ -846,14 +860,15 @@ VISU::ColoredPrs3d_i { TSuperClass::ToStream(theStr); - Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) ); - Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) ); - Storable::DataToStream( theStr, "myOrientation", myOrientation ); - Storable::DataToStream( theStr, "myMeshName", GetCMeshName() ); Storable::DataToStream( theStr, "myEntity", GetEntity() ); Storable::DataToStream( theStr, "myFieldName", GetCFieldName() ); Storable::DataToStream( theStr, "myIteration", int(GetTimeStampNumber()) ); + Storable::DataToStream( theStr, "myIteration", int(myIsTimeStampFixed) ); + + Storable::DataToStream( theStr, "myScalarMode", int(GetScalarMode()) ); + Storable::DataToStream( theStr, "myNumberOfColors", int(GetNbColors()) ); + Storable::DataToStream( theStr, "myOrientation", myOrientation ); Storable::DataToStream( theStr, "myTitle", myTitle.c_str() ); Storable::DataToStream( theStr, "myNumberOfLabels", myNumberOfLabels ); diff --git a/src/VISU_I/VISU_ColoredPrs3d_i.hh b/src/VISU_I/VISU_ColoredPrs3d_i.hh index afd7f67e..cd53ce7a 100644 --- a/src/VISU_I/VISU_ColoredPrs3d_i.hh +++ b/src/VISU_I/VISU_ColoredPrs3d_i.hh @@ -381,6 +381,7 @@ namespace VISU Entity myEntity; std::string myFieldName; CORBA::Long myTimeStampNumber; + bool myIsTimeStampFixed; PField myField; EPublishInStudyMode myPublishInStudyMode; -- 2.39.2