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);
161  bool GetInPlay();
163 
164  enum
165  {
166  // Fired whenever the vtkAnimationScene wants to request the
167  // vtkSMAnimationSceneProxy to update the start/end times.
168  // The calldata is a vtkVector2d with the suggested time-range.
169  UpdateStartEndTimesEvent = vtkCommand::UserEvent
170  };
171 
173 
178  vtkSetMacro(ForceDisableCaching, bool);
179  vtkGetMacro(ForceDisableCaching, bool);
181 
187  vtkSetMacro(OverrideStillRender, bool);
188  vtkGetMacro(OverrideStillRender, bool);
189 
191 
195  static void SetGlobalUseGeometryCache(bool);
196  static bool GetGlobalUseGeometryCache();
198 
199 protected:
201  ~vtkSMAnimationScene() override;
202 
204 
208  void StartCueInternal() override;
209  void TickInternal(double currenttime, double deltatime, double clocktime) override;
210  void EndCueInternal() override;
212 
214 
217  void TimeKeeperTimeRangeChanged();
218  void TimeKeeperTimestepsChanged();
220 
223  bool InTick;
224  double SceneTime;
225  double PlaybackTimeWindow[2];
230 
232 
233 private:
234  vtkSMAnimationScene(const vtkSMAnimationScene&) = delete;
235  void operator=(const vtkSMAnimationScene&) = delete;
236 
237  class vtkInternals;
238  vtkInternals* Internals;
239  unsigned long TimeRangeObserverID;
240  unsigned long TimestepValuesObserverID;
241 
242  static bool GlobalUseGeometryCache;
243 };
244 
245 #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