From 29e5cc9229f7b155fd356d8ac3a2a9a135d690f3 Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 1 Nov 2006 11:49:42 +0000 Subject: [PATCH] To use TimeStampsRange as universal way to iterate through availble timestamps --- src/VISU_SWIG/visu_change_input.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/VISU_SWIG/visu_change_input.py b/src/VISU_SWIG/visu_change_input.py index fed21181..c55ee548 100644 --- a/src/VISU_SWIG/visu_change_input.py +++ b/src/VISU_SWIG/visu_change_input.py @@ -34,8 +34,8 @@ def WalkTroughTimeStamps(theVISUType, theResult, theMeshName,theEntity, theFieldName, theTimeStampNumber, theViewManager): anOldFactoryMethod = GetPrsType2OldFactoryMethod(theVISUType) - aPrs3d = anOldFactoryMethod(theResult, theMeshName, theEntity, theFieldName, theTimeStampNumber) + aPrs3d = myVisu.CreatePrs3d(theVISUType, myVisu.GetCurrentStudy()) aPrs3d.SetResultObject(theResult) aPrs3d.SetMeshName(theMeshName) @@ -50,20 +50,16 @@ def WalkTroughTimeStamps(theVISUType, print "\ttheTimeStampNumber = %s" % theTimeStampNumber return - aRange = aPrs3d.GetTimeStampsRange() - for anInfo in aRange: - print "%d (%s); " % (anInfo.myNumber, anInfo.myTime), - pass - print - aView = theViewManager.Create3DView(); aView.SetTitle("To test presentation of %s type" % theVISUType) aView.Display(aPrs3d); aView.FitAll() aDelay = 0.0 - for aTimeStampNumber in xrange(1,7): - aPrs3d.SetTimeStampNumber(aTimeStampNumber) + aRange = aPrs3d.GetTimeStampsRange() + for anInfo in aRange: + print "%d (%s); " % (anInfo.myNumber, anInfo.myTime) + aPrs3d.SetTimeStampNumber(anInfo.myNumber) aPrs3d.Apply() aView.Update(); time.sleep(aDelay) @@ -98,6 +94,8 @@ aTimeStampNumber = 1 aViewManager = myVisu.GetViewManager(); +WalkTroughTimeStamps(VISU.TSCALARMAPONDEFORMEDSHAPE, aResult, aMeshName, anEntity, aFieldName, aTimeStampNumber, aViewManager) + for aVISUType in PRS3D_TYPE_LIST: WalkTroughTimeStamps(aVISUType, aResult, aMeshName, anEntity, aFieldName, aTimeStampNumber, aViewManager) pass -- 2.39.2