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 "vtkParaViewDeprecation.h" // For PARAVIEW_DEPRECATED_IN_5_13_0
28 #include "vtkRemotingAnimationModule.h" //needed for exports
29 
32 class vtkSMProxy;
33 class vtkSMViewProxy;
34 
36 {
37 public:
38  static vtkSMAnimationScene* New();
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43 
47  void AddCue(vtkAnimationCue* cue);
48  void RemoveCue(vtkAnimationCue* cue);
49  void RemoveAllCues();
50  int GetNumberOfCues();
52 
54 
59  void AddViewProxy(vtkSMViewProxy* proxy);
60  void RemoveViewProxy(vtkSMViewProxy* proxy);
61  void RemoveAllViewProxies();
63 
65 
68  unsigned int GetNumberOfViewProxies();
69  vtkSMViewProxy* GetViewProxy(unsigned int cc);
71 
73 
77  void SetTimeKeeper(vtkSMProxy*);
78  vtkGetObjectMacro(TimeKeeper, vtkSMProxy);
80 
82 
86  vtkSetMacro(LockStartTime, bool);
87  vtkGetMacro(LockStartTime, bool);
88  vtkBooleanMacro(LockStartTime, bool);
90 
92 
96  vtkSetMacro(LockEndTime, bool);
97  vtkGetMacro(LockEndTime, bool);
98  vtkBooleanMacro(LockEndTime, bool);
100 
102 
105  void SetSceneTime(double time)
106  {
107  if (this->InTick)
108  {
109  // Since this method can be called during a Tick() event handler.
110  return;
111  }
112  this->Initialize();
113  this->Tick(time, 0, time);
114  }
116 
117  // Get the time of the most recent tick.
118  // The only difference between this and AnimationTime (or ClockTime) defined
119  // in the superclass is that, unlike the latter this is defined even outside
120  // AnimationCueTickEvent handlers.
121  vtkGetMacro(SceneTime, double);
122 
124 
134  vtkSetVector2Macro(PlaybackTimeWindow, double);
135  vtkGetVector2Macro(PlaybackTimeWindow, double);
137 
139 
142  void SetLoop(int val);
143  int GetLoop();
144  void Play();
145  void Reverse();
146  void Stop();
147  void GoToNext();
148  void GoToPrevious();
149  void GoToFirst();
150  void GoToLast();
151  void SetPlayMode(int val);
152  int GetPlayMode();
153  void SetNumberOfFrames(int val);
154 
155  void SetFramesPerTimestep(int val);
156  void SetStride(int val);
157  int GetStride();
158  bool GetInPlay();
160 
161  enum
162  {
163  // Fired whenever the vtkAnimationScene wants to request the
164  // vtkSMAnimationSceneProxy to update the start/end times.
165  // The calldata is a vtkVector2d with the suggested time-range.
166  UpdateStartEndTimesEvent = vtkCommand::UserEvent
167  };
168 
170 
175  vtkSetMacro(ForceDisableCaching, bool);
176  vtkGetMacro(ForceDisableCaching, bool);
178 
184  vtkSetMacro(OverrideStillRender, bool);
185  vtkGetMacro(OverrideStillRender, bool);
186 
188 
192  PARAVIEW_DEPRECATED_IN_6_0_0("Use vtkPVGeneralSettings::SetCacheGeometryForAnimation")
193  static void SetGlobalUseGeometryCache(bool);
194  PARAVIEW_DEPRECATED_IN_6_0_0("Use vtkPVGeneralSettings::GetCacheGeometryForAnimation")
195  static bool GetGlobalUseGeometryCache();
197 
198 protected:
200  ~vtkSMAnimationScene() override;
201 
203 
207  void StartCueInternal() override;
208  void TickInternal(double currenttime, double deltatime, double clocktime) override;
209  void EndCueInternal() override;
211 
213 
216  void TimeKeeperTimeRangeChanged();
217  void TimeKeeperTimestepsChanged();
219 
220  bool LockStartTime;
221  bool LockEndTime;
222  bool InTick;
223  double SceneTime;
224  double PlaybackTimeWindow[2];
225  bool ForceDisableCaching;
226  vtkSMProxy* TimeKeeper;
227  vtkCompositeAnimationPlayer* AnimationPlayer;
229 
230  bool OverrideStillRender;
231 
232 private:
233  vtkSMAnimationScene(const vtkSMAnimationScene&) = delete;
234  void operator=(const vtkSMAnimationScene&) = delete;
235 
236  class vtkInternals;
237  vtkInternals* Internals;
238  unsigned long TimeRangeObserverID;
239  unsigned long TimestepValuesObserverID;
240 };
241 
242 #endif
static vtkAnimationCue * New()
virtual void Tick(double currenttime, double deltatime, double clocktime)
Superclass for all view proxies.
This is composite animation player that can me made to play an animation using the active player...
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
#define const
Definition: zconf.h:238
#define PARAVIEW_DEPRECATED_IN_6_0_0(reason)
object for general options.
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE