VTK  9.2.6
vtkAnimationScene.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAnimationScene.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/
42 #ifndef vtkAnimationScene_h
43 #define vtkAnimationScene_h
44 
45 #include "vtkAnimationCue.h"
46 #include "vtkCommonDataModelModule.h" // For export macro
47 
48 class vtkAnimationCue;
49 class vtkCollection;
51 class vtkTimerLog;
52 
53 class VTKCOMMONDATAMODEL_EXPORT vtkAnimationScene : public vtkAnimationCue
54 {
55 public:
57  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
61 
68  vtkSetMacro(PlayMode, int);
69  void SetModeToSequence() { this->SetPlayMode(PLAYMODE_SEQUENCE); }
70  void SetModeToRealTime() { this->SetPlayMode(PLAYMODE_REALTIME); }
71  vtkGetMacro(PlayMode, int);
73 
75 
80  vtkSetMacro(FrameRate, double);
81  vtkGetMacro(FrameRate, double);
83 
85 
89  void AddCue(vtkAnimationCue* cue);
91  void RemoveAllCues();
94 
99  virtual void Play();
100 
104  void Stop();
105 
107 
110  vtkSetMacro(Loop, int);
111  vtkGetMacro(Loop, int);
113 
117  void SetAnimationTime(double time);
118 
123  void SetTimeMode(int mode) override;
124 
128  int IsInPlay() { return this->InPlay; }
129 
131  {
132  PLAYMODE_SEQUENCE = 0,
133  PLAYMODE_REALTIME = 1
134  };
135 
136 protected:
138  ~vtkAnimationScene() override;
139 
141 
145  void TickInternal(double currenttime, double deltatime, double clocktime) override;
146  void StartCueInternal() override;
147  void EndCueInternal() override;
149 
152 
153  int PlayMode;
154  double FrameRate;
155  int Loop;
156  int InPlay;
157  int StopPlay;
158 
162 
163 private:
164  vtkAnimationScene(const vtkAnimationScene&) = delete;
165  void operator=(const vtkAnimationScene&) = delete;
166 };
167 
168 #endif
a seqin an animation.
the animation scene manager.
void SetModeToSequence()
Get/Set the PlayMode for running/playing the animation scene.
void SetAnimationTime(double time)
Makes the state of the scene same as the given time.
void TickInternal(double currenttime, double deltatime, double clocktime) override
Called on every valid tick.
int IsInPlay()
Returns if the animation is being played.
void RemoveCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the Scene.
void StartCueInternal() override
Called on every valid tick.
void EndCueInternal() override
Called on every valid tick.
~vtkAnimationScene() override
void InitializeChildren()
int GetNumberOfCues()
Add/Remove an AnimationCue to/from the Scene.
static vtkAnimationScene * New()
void AddCue(vtkAnimationCue *cue)
Add/Remove an AnimationCue to/from the Scene.
void RemoveAllCues()
Add/Remove an AnimationCue to/from the Scene.
vtkTimerLog * AnimationTimer
void SetModeToRealTime()
Get/Set the PlayMode for running/playing the animation scene.
void SetTimeMode(int mode) override
Overridden to allow change to Normalized mode only if none of the constituent cues is in Relative tim...
void Stop()
Stops the animation scene that is running.
vtkCollection * AnimationCues
virtual void Play()
Starts playing the animation scene.
vtkCollectionIterator * AnimationCuesIterator
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
iterator through a vtkCollection.
create and manipulate ordered lists of objects
Definition: vtkCollection.h:56
a simple class to control print indentation
Definition: vtkIndent.h:49
Timer support and logging.
Definition: vtkTimerLog.h:105
@ mode
Definition: vtkX3D.h:253
@ time
Definition: vtkX3D.h:503