ParaView
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 "vtkPVAnimationModule.h" //needed for exports
40 
42 class vtkEventForwarderCommand;
43 class vtkSMProxy;
44 class vtkSMViewProxy;
45 
46 class VTKPVANIMATION_EXPORT vtkSMAnimationScene : public vtkAnimationCue
47 {
48 public:
49  static vtkSMAnimationScene* New();
50  vtkTypeMacro(vtkSMAnimationScene, vtkAnimationCue);
51  void PrintSelf(ostream& os, vtkIndent indent);
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 
186 protected:
189 
191 
195  virtual void StartCueInternal();
196  virtual void TickInternal(double currenttime, double deltatime, double clocktime);
197  virtual void EndCueInternal();
199 
201 
204  void TimeKeeperTimeRangeChanged();
205  void TimeKeeperTimestepsChanged();
207 
210  bool InTick;
211  double SceneTime;
212  double PlaybackTimeWindow[2];
216  vtkEventForwarderCommand* Forwarder;
217 
220  vtkSetMacro(OverrideStillRender, bool);
221 
222 private:
223  vtkSMAnimationScene(const vtkSMAnimationScene&) VTK_DELETE_FUNCTION;
224  void operator=(const vtkSMAnimationScene&) VTK_DELETE_FUNCTION;
225 
226  class vtkInternals;
227  vtkInternals* Internals;
228  unsigned long TimeRangeObserverID;
229  unsigned long TimestepValuesObserverID;
230 };
231 
232 #endif
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...
void SetSceneTime(double time)
Sets the current animation time.
animation scene for ParaView.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
helper class to write animation images/movies.