ParaView
vtkAnimationPlayer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkAnimationPlayer.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
21 #ifndef vtkAnimationPlayer_h
22 #define vtkAnimationPlayer_h
23 
24 #include "vtkObject.h"
25 #include "vtkPVAnimationModule.h" // needed for export macro
26 #include "vtkWeakPointer.h" // needed for vtkWeakPointer.
27 
29 class VTKPVANIMATION_EXPORT vtkAnimationPlayer : public vtkObject
30 {
31 public:
32  vtkTypeMacro(vtkAnimationPlayer, vtkObject);
33  void PrintSelf(ostream& os, vtkIndent indent);
34 
36 
40  virtual void SetAnimationScene(vtkSMAnimationScene*);
41  vtkSMAnimationScene* GetAnimationScene();
43 
48  void Play();
49 
53  void Stop();
54 
58  int IsInPlay() { return this->InPlay ? 1 : 0; }
59  vtkGetMacro(InPlay, bool);
60 
62 
65  vtkSetMacro(Loop, bool);
66  vtkGetMacro(Loop, bool);
68 
72  void GoToNext();
73 
77  void GoToPrevious();
78 
82  void GoToFirst();
83 
87  void GoToLast();
88 
89 protected:
92 
94 
95  virtual void StartLoop(double starttime, double endtime, double* playbackWindow) = 0;
96  virtual void EndLoop() = 0;
97 
101  virtual double GetNextTime(double currentime) = 0;
102 
103  virtual double GoToNext(double start, double end, double currenttime) = 0;
104  virtual double GoToPrevious(double start, double end, double currenttime) = 0;
105 
106 private:
107  vtkAnimationPlayer(const vtkAnimationPlayer&) VTK_DELETE_FUNCTION;
108  void operator=(const vtkAnimationPlayer&) VTK_DELETE_FUNCTION;
109 
110  vtkWeakPointer<vtkSMAnimationScene> AnimationScene;
111  bool InPlay;
112  bool StopPlay;
113  bool Loop;
114  double CurrentTime;
115 };
116 
117 #endif
int IsInPlay()
Returns if the animation is currently playing.
Abstract superclass for an animation player.
virtual void StartLoop(double starttime, double endtime, double *playbackWindow)
Delegated to the active animation player.
This is composite animation player that can me made to play an animation using the active player...
virtual void EndLoop()
Delegated to the active animation player.
animation scene for ParaView.
virtual double GetNextTime(double currentime)
Delegated to the active animation player.
void GoToPrevious()
Take animation scene to previous frame.
void GoToNext()
Take the animation scene to next frame.