vtkTimestepsAnimationPlayer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkTimestepsAnimationPlayer_h
13 #define vtkTimestepsAnimationPlayer_h
14 
15 #include "vtkAnimationPlayer.h"
16 #include "vtkRemotingAnimationModule.h" // needed for export macro
17 
18 class vtkTimestepsAnimationPlayerSetOfDouble;
19 
21 {
22 public:
25  void PrintSelf(ostream& os, vtkIndent indent) override;
26 
28 
31  void AddTimeStep(double time);
32  void RemoveTimeStep(double time);
34 
38  void RemoveAllTimeSteps();
39 
43  unsigned int GetNumberOfTimeSteps();
44 
46 
49  vtkSetClampMacro(FramesPerTimestep, unsigned long, 1, VTK_UNSIGNED_LONG_MAX);
50  vtkGetMacro(FramesPerTimestep, unsigned long);
52 
57  double GetNextTimeStep(double time);
58 
60 
64  double GetPreviousTimeStep(double time);
65 
66 protected:
68  ~vtkTimestepsAnimationPlayer() override;
70 
72 
75  // Initialize inner variables. Call it before any GetNextTime/GetPreviousTime call.
76  void StartLoop(double, double, double, double* playbackWindow) override;
77  void EndLoop() override{};
78  // Get next time in loop. Take Count and Stride into account.
79  double GetNextTime(double currentime) override;
80  // Get previous time in loop. Take Count and Stride into account.
81  double GetPreviousTime(double currenttime) override;
83 
84  double GoToNext(double, double, double currenttime) override
85  {
86  return this->GetNextTimeStep(currenttime);
87  }
88 
89  double GoToPrevious(double, double, double currenttime) override
90  {
91  return this->GetPreviousTimeStep(currenttime);
92  }
93 
94  double PlaybackWindow[2];
95  unsigned long FramesPerTimestep;
96  unsigned long Count;
97 
98 private:
100  void operator=(const vtkTimestepsAnimationPlayer&) = delete;
101 
105  double GetNextInternal(double time, double defaultVal);
106 
107  vtkTimestepsAnimationPlayerSetOfDouble* TimeSteps;
108 };
109 
110 #endif
virtual double GetNextTime(double currentime)=0
Manage loop inside playbackwindow.
Abstract superclass for an animation player.
virtual void StartLoop(double starttime, double endtime, double curtime, double *playbackWindow)=0
Manage loop inside playbackwindow.
double GoToNext(double, double, double currenttime) override
Return next/previous time knowing start, end and current.
double GoToPrevious(double, double, double currenttime) override
Return next/previous time knowing start, end and current.
#define VTKREMOTINGANIMATION_EXPORT
virtual double GetPreviousTime(double currenttime)=0
Manage loop inside playbackwindow.
vtkAnimationPlayer subclass that plays through a discrete set of time values.
void PrintSelf(ostream &os, vtkIndent indent) override
void EndLoop() override
Manage loop inside playbackwindow.
static vtkObject * New()