]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To use TimeStampsRange as universal way to iterate through availble timestamps
authorapo <apo@opencascade.com>
Wed, 1 Nov 2006 11:49:42 +0000 (11:49 +0000)
committerapo <apo@opencascade.com>
Wed, 1 Nov 2006 11:49:42 +0000 (11:49 +0000)
src/VISU_SWIG/visu_change_input.py

index fed211812fb2ca1b9c6c45a86e18af03139f1f55..c55ee54894fd7cfa4c908403a605c5cb36efc263 100644 (file)
@@ -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