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 "vtkRemotingAnimationModule.h" // needed for export macro
29 
30 class vtkTimestepsAnimationPlayerSetOfDouble;
31 
32 class VTKREMOTINGANIMATION_EXPORT vtkTimestepsAnimationPlayer : public vtkAnimationPlayer
33 {
34 public:
37  void PrintSelf(ostream& os, vtkIndent indent) override;
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:
80  ~vtkTimestepsAnimationPlayer() override;
82 
83  void StartLoop(double, double, double, double*) override;
84  void EndLoop() override{};
85 
89  double GetNextTime(double currentime) override;
90 
91  double GoToNext(double, double, double currenttime) override
92  {
93  return this->GetNextTimeStep(currenttime);
94  }
95 
96  double GoToPrevious(double, double, double currenttime) override
97  {
98  return this->GetPreviousTimeStep(currenttime);
99  }
100 
101  double PlaybackWindow[2];
102  unsigned long FramesPerTimestep;
103  unsigned long Count;
104 
105 private:
107  void operator=(const vtkTimestepsAnimationPlayer&) = delete;
108 
109  vtkTimestepsAnimationPlayerSetOfDouble* TimeSteps;
110 };
111 
112 #endif
virtual double GetNextTime(double currentime)=0
Return the next time given the current time.
Abstract superclass for an animation player.
virtual void StartLoop(double starttime, double endtime, double curtime, double *playbackWindow)=0
double GoToNext(double, double, double currenttime) override
double GoToPrevious(double, double, double currenttime) override
vtkAnimationPlayer subclass that plays through a discrete set of time values.
void PrintSelf(ostream &os, vtkIndent indent) override
static vtkObject * New()