vtkSMAnimationScene.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
34 #ifndef vtkSMAnimationScene_h
35 #define vtkSMAnimationScene_h
36 
37 #include "vtkAnimationCue.h"
38 #include "vtkCommand.h" // needed for vtkCommand::UserEvent
39 #include "vtkRemotingAnimationModule.h" //needed for exports
40 
43 class vtkSMProxy;
44 class vtkSMViewProxy;
45 
47 {
48 public:
49  static vtkSMAnimationScene* New();
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
58  void AddCue(vtkAnimationCue* cue);
59  void RemoveCue(vtkAnimationCue* cue);
60  void RemoveAllCues();
61  int GetNumberOfCues();
63 
65 
70  void AddViewProxy(vtkSMViewProxy* proxy);
71  void RemoveViewProxy(vtkSMViewProxy* proxy);
72  void RemoveAllViewProxies();
74 
76 
79  unsigned int GetNumberOfViewProxies();
80  vtkSMViewProxy* GetViewProxy(unsigned int cc);
82 
84 
88  void SetTimeKeeper(vtkSMProxy*);
89  vtkGetObjectMacro(TimeKeeper, vtkSMProxy);
91 
93 
97  vtkSetMacro(LockStartTime, bool);
98  vtkGetMacro(LockStartTime, bool);
99  vtkBooleanMacro(LockStartTime, bool);
101 
103 
107  vtkSetMacro(LockEndTime, bool);
108  vtkGetMacro(LockEndTime, bool);
109  vtkBooleanMacro(LockEndTime, bool);
111 
113 
116  void SetSceneTime(double time)
117  {
118  if (this->InTick)
119  {
120  // Since this method can be called during a Tick() event handler.
121  return;
122  }
123  this->Initialize();
124  this->Tick(time, 0, time);
125  }
127 
128  // Get the time of the most recent tick.
129  // The only difference between this and AnimationTime (or ClockTime) defined
130  // in the superclass is that, unlike the latter this is defined even outside
131  // AnimationCueTickEvent handlers.
132  vtkGetMacro(SceneTime, double);
133 
135 
145  vtkSetVector2Macro(PlaybackTimeWindow, double);
146  vtkGetVector2Macro(PlaybackTimeWindow, double);
148 
150 
153  void SetLoop(int val);
154  int GetLoop();
155  void Play();
156  void Stop();
157  void GoToNext();
158  void GoToPrevious();
159  void GoToFirst();
160  void GoToLast();
161  void SetPlayMode(int val);
162  int GetPlayMode();
163  void SetNumberOfFrames(int val);
164  void SetDuration(int val);
165  void SetFramesPerTimestep(int val);
167 
168  enum
169  {
170  // Fired whenever the vtkAnimationScene wants to request the
171  // vtkSMAnimationSceneProxy to update the start/end times.
172  // The calldata is a vtkVector2d with the suggested time-range.
173  UpdateStartEndTimesEvent = vtkCommand::UserEvent
174  };
175 
177 
182  vtkSetMacro(ForceDisableCaching, bool);
183  vtkGetMacro(ForceDisableCaching, bool);
185 
191  vtkSetMacro(OverrideStillRender, bool);
192  vtkGetMacro(OverrideStillRender, bool);
193 
195 
199  static void SetGlobalUseGeometryCache(bool);
200  static bool GetGlobalUseGeometryCache();
202 
203 protected:
205  ~vtkSMAnimationScene() override;
206 
208 
212  void StartCueInternal() override;
213  void TickInternal(double currenttime, double deltatime, double clocktime) override;
214  void EndCueInternal() override;
216 
218 
221  void TimeKeeperTimeRangeChanged();
222  void TimeKeeperTimestepsChanged();
224 
227  bool InTick;
228  double SceneTime;
229  double PlaybackTimeWindow[2];
234 
236 
237 private:
238  vtkSMAnimationScene(const vtkSMAnimationScene&) = delete;
239  void operator=(const vtkSMAnimationScene&) = delete;
240 
241  class vtkInternals;
242  vtkInternals* Internals;
243  unsigned long TimeRangeObserverID;
244  unsigned long TimestepValuesObserverID;
245 
246  static bool GlobalUseGeometryCache;
247 };
248 
249 #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:152
#define VTKREMOTINGANIMATION_EXPORT
void operator=(const vtkObjectBase &)
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE