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 
29 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_13_0
30 
33 class vtkSMProxy;
34 class vtkSMViewProxy;
35 
37 {
38 public:
39  static vtkSMAnimationScene* New();
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
48  void AddCue(vtkAnimationCue* cue);
49  void RemoveCue(vtkAnimationCue* cue);
50  void RemoveAllCues();
51  int GetNumberOfCues();
53 
55 
60  void AddViewProxy(vtkSMViewProxy* proxy);
61  void RemoveViewProxy(vtkSMViewProxy* proxy);
62  void RemoveAllViewProxies();
64 
66 
69  unsigned int GetNumberOfViewProxies();
70  vtkSMViewProxy* GetViewProxy(unsigned int cc);
72 
74 
78  void SetTimeKeeper(vtkSMProxy*);
79  vtkGetObjectMacro(TimeKeeper, vtkSMProxy);
81 
83 
87  vtkSetMacro(LockStartTime, bool);
88  vtkGetMacro(LockStartTime, bool);
89  vtkBooleanMacro(LockStartTime, bool);
91 
93 
97  vtkSetMacro(LockEndTime, bool);
98  vtkGetMacro(LockEndTime, bool);
99  vtkBooleanMacro(LockEndTime, bool);
101 
103 
106  void SetSceneTime(double time)
107  {
108  if (this->InTick)
109  {
110  // Since this method can be called during a Tick() event handler.
111  return;
112  }
113  this->Initialize();
114  this->Tick(time, 0, time);
115  }
117 
118  // Get the time of the most recent tick.
119  // The only difference between this and AnimationTime (or ClockTime) defined
120  // in the superclass is that, unlike the latter this is defined even outside
121  // AnimationCueTickEvent handlers.
122  vtkGetMacro(SceneTime, double);
123 
125 
135  vtkSetVector2Macro(PlaybackTimeWindow, double);
136  vtkGetVector2Macro(PlaybackTimeWindow, double);
138 
140 
143  void SetLoop(int val);
144  int GetLoop();
145  void Play();
146  void Reverse();
147  void Stop();
148  void GoToNext();
149  void GoToPrevious();
150  void GoToFirst();
151  void GoToLast();
152  void SetPlayMode(int val);
153  int GetPlayMode();
154  void SetNumberOfFrames(int val);
155 
156  PARAVIEW_DEPRECATED_IN_5_13_0("Use `SetStride` instead`")
157  void SetDuration(int vtkNotUsed(val)) {}
158 
159  void SetFramesPerTimestep(int val);
160  void SetStride(int val);
162 
163  enum
164  {
165  // Fired whenever the vtkAnimationScene wants to request the
166  // vtkSMAnimationSceneProxy to update the start/end times.
167  // The calldata is a vtkVector2d with the suggested time-range.
168  UpdateStartEndTimesEvent = vtkCommand::UserEvent
169  };
170 
172 
177  vtkSetMacro(ForceDisableCaching, bool);
178  vtkGetMacro(ForceDisableCaching, bool);
180 
186  vtkSetMacro(OverrideStillRender, bool);
187  vtkGetMacro(OverrideStillRender, bool);
188 
190 
194  static void SetGlobalUseGeometryCache(bool);
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 
222  bool InTick;
223  double SceneTime;
224  double PlaybackTimeWindow[2];
229 
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  static bool GlobalUseGeometryCache;
242 };
243 
244 #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...
#define PARAVIEW_DEPRECATED_IN_5_13_0(reason)
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