vtkSMAnimationScene.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
22 #ifndef vtkSMAnimationScene_h
23 #define vtkSMAnimationScene_h
24 
25 #include "vtkAnimationCue.h"
26 #include "vtkCommand.h" // needed for vtkCommand::UserEvent
27 #include "vtkRemotingAnimationModule.h" // needed for exports
28 
31 class vtkSMProxy;
32 class vtkSMViewProxy;
33 
35 {
36 public:
37  static vtkSMAnimationScene* New();
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42 
46  void AddCue(vtkAnimationCue* cue);
47  void RemoveCue(vtkAnimationCue* cue);
48  void RemoveAllCues();
49  int GetNumberOfCues();
51 
53 
58  void AddViewProxy(vtkSMViewProxy* proxy);
59  void RemoveViewProxy(vtkSMViewProxy* proxy);
60  void RemoveAllViewProxies();
62 
64 
67  unsigned int GetNumberOfViewProxies();
68  vtkSMViewProxy* GetViewProxy(unsigned int cc);
70 
72 
76  void SetTimeKeeper(vtkSMProxy*);
77  vtkGetObjectMacro(TimeKeeper, vtkSMProxy);
79 
81 
85  vtkSetMacro(LockStartTime, bool);
86  vtkGetMacro(LockStartTime, bool);
87  vtkBooleanMacro(LockStartTime, bool);
89 
91 
95  vtkSetMacro(LockEndTime, bool);
96  vtkGetMacro(LockEndTime, bool);
97  vtkBooleanMacro(LockEndTime, bool);
99 
101 
104  void SetSceneTime(double time)
105  {
106  if (this->InTick)
107  {
108  // Since this method can be called during a Tick() event handler.
109  return;
110  }
111  this->Initialize();
112  this->Tick(time, 0, time);
113  }
115 
116  // Get the time of the most recent tick.
117  // The only difference between this and AnimationTime (or ClockTime) defined
118  // in the superclass is that, unlike the latter this is defined even outside
119  // AnimationCueTickEvent handlers.
120  vtkGetMacro(SceneTime, double);
121 
123 
133  vtkSetVector2Macro(PlaybackTimeWindow, double);
134  vtkGetVector2Macro(PlaybackTimeWindow, double);
136 
138 
141  void SetLoop(int val);
142  int GetLoop();
143  void Play();
144  void Reverse();
145  void Stop();
146  void GoToNext();
147  void GoToPrevious();
148  void GoToFirst();
149  void GoToLast();
150  void SetPlayMode(int val);
151  int GetPlayMode();
152  void SetNumberOfFrames(int val);
153 
154  void SetFramesPerTimestep(int val);
155  void SetStride(int val);
156  int GetStride();
157  bool GetInPlay();
159 
160  enum
161  {
162  // Fired whenever the vtkAnimationScene wants to request the
163  // vtkSMAnimationSceneProxy to update the start/end times.
164  // The calldata is a vtkVector2d with the suggested time-range.
165  UpdateStartEndTimesEvent = vtkCommand::UserEvent
166  };
167 
169 
174  vtkSetMacro(ForceDisableCaching, bool);
175  vtkGetMacro(ForceDisableCaching, bool);
177 
183  vtkSetMacro(OverrideStillRender, bool);
184  vtkGetMacro(OverrideStillRender, bool);
185 
186 protected:
188  ~vtkSMAnimationScene() override;
189 
191 
195  void StartCueInternal() override;
196  void TickInternal(double currenttime, double deltatime, double clocktime) override;
197  void EndCueInternal() override;
199 
201 
204  void TimeKeeperTimeRangeChanged();
205  void TimeKeeperTimestepsChanged();
207 
210  bool InTick;
211  double SceneTime;
212  double PlaybackTimeWindow[2];
217 
219 
220 private:
221  vtkSMAnimationScene(const vtkSMAnimationScene&) = delete;
222  void operator=(const vtkSMAnimationScene&) = delete;
223 
224  class vtkInternals;
225  vtkInternals* Internals;
226  unsigned long TimeRangeObserverID;
227  unsigned long TimestepValuesObserverID;
228 };
229 
230 #endif
virtual void EndCueInternal()
static vtkAnimationCue * New()
virtual void Tick(double currenttime, double deltatime, double clocktime)
vtkEventForwarderCommand * Forwarder
Superclass for all view proxies.
vtkCompositeAnimationPlayer * AnimationPlayer
This is composite animation player that can me made to play an animation using the active player...
virtual void TickInternal(double currenttime, double deltatime, double clocktime)
virtual void StartCueInternal()
void SetSceneTime(double time)
Sets the current animation time.
virtual void Initialize()
animation scene for ParaView.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
#define VTKREMOTINGANIMATION_EXPORT
void operator=(const vtkObjectBase &)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE