MCPcopy Create free account
hub / github.com/Kitware/ParaView / updateTime

Method updateTime

Web/Python/paraview/web/protocols.py:1346–1373  ·  view source on GitHub ↗
(self, action)

Source from the content-addressed store, hash-verified

1344 # RpcName: updateTime => pv.vcr.action
1345 @exportRpc("pv.vcr.action")
1346 def updateTime(self, action):
1347 view = simple.GetRenderView()
1348 animationScene = simple.GetAnimationScene()
1349 currentTime = view.ViewTime
1350
1351 if action == "next":
1352 animationScene.GoToNext()
1353 if currentTime == view.ViewTime:
1354 animationScene.GoToFirst()
1355 if action == "prev":
1356 animationScene.GoToPrevious()
1357 if currentTime == view.ViewTime:
1358 animationScene.GoToLast()
1359 if action == "first":
1360 animationScene.GoToFirst()
1361 if action == "last":
1362 animationScene.GoToLast()
1363
1364 timestep = list(animationScene.TimeKeeper.TimestepValues).index(
1365 animationScene.TimeKeeper.Time
1366 )
1367 self.publish(
1368 "pv.time.change", {"time": float(view.ViewTime), "timeStep": timestep}
1369 )
1370
1371 self.getApplication().InvokeEvent("UpdateEvent")
1372
1373 return view.ViewTime
1374
1375 @exportRpc("pv.time.index.set")
1376 def setTimeStep(self, timeIdx):

Callers 1

nextPlayMethod · 0.95

Calls 7

publishMethod · 0.80
GetAnimationSceneMethod · 0.45
GoToNextMethod · 0.45
GoToFirstMethod · 0.45
GoToPreviousMethod · 0.45
GoToLastMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected