ParaView
vtkTimestepsAnimationPlayer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkTimestepsAnimationPlayer.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 =========================================================================*/
24 #ifndef vtkTimestepsAnimationPlayer_h
25 #define vtkTimestepsAnimationPlayer_h
26 
27 #include "vtkAnimationPlayer.h"
28 #include "vtkPVAnimationModule.h" // needed for export macro
29 
30 class vtkTimestepsAnimationPlayerSetOfDouble;
31 
32 class VTKPVANIMATION_EXPORT vtkTimestepsAnimationPlayer : public vtkAnimationPlayer
33 {
34 public:
35  static vtkTimestepsAnimationPlayer* New();
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
40 
43  void AddTimeStep(double time);
44  void RemoveTimeStep(double time);
46 
50  void RemoveAllTimeSteps();
51 
55  unsigned int GetNumberOfTimeSteps();
56 
58 
61  vtkSetClampMacro(FramesPerTimestep, unsigned long, 1, VTK_UNSIGNED_LONG_MAX);
62  vtkGetMacro(FramesPerTimestep, unsigned long);
64 
69  double GetNextTimeStep(double time);
70 
72 
76  double GetPreviousTimeStep(double time);
77 
78 protected:
82 
83  virtual void StartLoop(double, double, double*);
84  virtual void EndLoop(){};
85 
89  virtual double GetNextTime(double currentime);
90 
91  virtual double GoToNext(double, double, double currenttime)
92  {
93  return this->GetNextTimeStep(currenttime);
94  }
95 
96  virtual double GoToPrevious(double, double, double currenttime)
97  {
98  return this->GetPreviousTimeStep(currenttime);
99  }
100 
101  double PlaybackWindow[2];
102  unsigned long FramesPerTimestep;
103  unsigned long Count;
104 
105 private:
106  vtkTimestepsAnimationPlayer(const vtkTimestepsAnimationPlayer&) VTK_DELETE_FUNCTION;
107  void operator=(const vtkTimestepsAnimationPlayer&) VTK_DELETE_FUNCTION;
108 
109  vtkTimestepsAnimationPlayerSetOfDouble* TimeSteps;
110 };
111 
112 #endif
virtual double GetNextTime(double currentime)=0
Return the next time given the current time.
virtual double GoToPrevious(double, double, double currenttime)
Abstract superclass for an animation player.
virtual void StartLoop(double starttime, double endtime, double *playbackWindow)=0
void PrintSelf(ostream &os, vtkIndent indent)
virtual double GoToNext(double, double, double currenttime)
vtkAnimationPlayer subclass that plays through a discrete set of time values.