Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GUI/Client/vtkPVSimpleAnimationCue.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkPVSimpleAnimationCue.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00026 #ifndef __vtkPVSimpleAnimationCue_h
00027 #define __vtkPVSimpleAnimationCue_h
00028 
00029 #include "vtkPVTracedWidget.h"
00030 class vtkPVSimpleAnimationCueObserver;
00031 class vtkCollectionIterator;
00032 class vtkCollection;
00033 class vtkSMAnimationCueProxy;
00034 class vtkSMKeyFrameAnimationCueManipulatorProxy;
00035 class vtkPVKeyFrame;
00036 class vtkSMProxy;
00037 class vtkSMProperty;
00038 class vtkSMPropertyStatusManager;
00039 
00040 class VTK_EXPORT vtkPVSimpleAnimationCue : public vtkPVTracedWidget
00041 {
00042 public:
00043   static vtkPVSimpleAnimationCue* New();
00044   vtkTypeRevisionMacro(vtkPVSimpleAnimationCue, vtkPVTracedWidget);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048   virtual void Create(vtkKWApplication* app);
00049 
00051 
00053   vtkGetMacro(Virtual, int);
00055 
00058   virtual char* GetTextRepresentation();
00059 
00061 
00064   void SetParentAnimationCue(vtkPVSimpleAnimationCue* cue)
00065     { this->ParentCue = cue; }
00067 
00069 
00070   vtkSetStringMacro(LabelText);
00071   vtkGetStringMacro(LabelText);
00073 
00075   unsigned long GetKeyFramesMTime();
00076 
00078   int GetNumberOfKeyFrames();
00079 
00082   double GetKeyFrameTime(int id);
00083 
00086   void SetKeyFrameTime(int id, double time);
00087 
00094   int AddNewKeyFrame(double time);
00095 
00100   virtual int CreateAndAddKeyFrame(double time, int type);
00101 
00105   int AppendNewKeyFrame();
00106  
00108   virtual void RemoveAllKeyFrames();
00109 
00114   void RemoveKeyFrame(vtkPVKeyFrame* keyframe);
00115 
00120   int RemoveKeyFrame(int id);
00121 
00125   void DeleteKeyFrame(int id);
00126 
00128   int CanDeleteKeyFrame(int index);
00129 
00131   int CanDeleteSelectedKeyFrame();
00132 
00134   vtkPVKeyFrame* GetKeyFrame(int id);
00135 
00140   vtkPVKeyFrame* GetKeyFrame(const char* name);
00141 
00144   vtkPVKeyFrame* GetSelectedKeyFrame();
00145 
00148   virtual void ReplaceKeyFrame(vtkPVKeyFrame* oldFrame, vtkPVKeyFrame* newFrame);
00149 
00153   virtual int IsKeyFrameTypeSupported(int type);
00154   
00156 
00158   virtual void SetAnimatedProxy(vtkSMProxy* proxy);
00159   vtkSMProxy* GetAnimatedProxy();
00160   virtual void SetAnimatedPropertyName(const char* name);
00161   const char* GetAnimatedPropertyName();
00162   void SetAnimatedDomainName(const char* name);
00163   const char* GetAnimatedDomainName();
00164   void SetAnimatedElement(int index);
00165   int GetAnimatedElement();
00167 
00170   virtual void StartRecording();
00171 
00173   virtual void StopRecording();
00174 
00175   virtual void RecordState(double ntime, double offset);
00176 
00178 
00180   vtkGetObjectMacro(CueProxy, vtkSMAnimationCueProxy);
00182 
00193   void SetCueProxy(vtkSMAnimationCueProxy* cueProxy);
00194 
00197   void InitializeKeyFrameUsingCurrentState(vtkPVKeyFrame* keyframe);
00198 
00199   virtual void UpdateEnableState();
00200 
00202   virtual void SelectKeyFrame(int id);
00203 
00205 
00206   vtkGetMacro(SelectedKeyFrameIndex, int);
00208 //BTX
00209   // Event saying that the Keyframes managed by this cue have changed.
00210   // In non-virtual mode, this is triggered when the KeyFrameManipulatorProxy
00211   // is modified. In Virtual mode, since there is no KeyFrameManipulatorProxy,
00212   // this class itself triggers this event when it modifies the end time points.
00213   enum {
00214     KeysModifiedEvent = 3001,
00215     SelectionChangedEvent
00216   };
00217 //ETX
00218 
00220 
00224   virtual void SetTimeBounds(double bounds[2], int enable_scaling=0);
00225   virtual int GetTimeBounds(double* bounds);
00227 
00229 
00231   void SetKeyFrameParent(vtkKWWidget* kfParent);
00232   vtkGetObjectMacro(KeyFrameParent, vtkKWWidget);
00234 
00236 
00237   void SetDuration(double duration);
00238   vtkGetMacro(Duration, double);
00240 
00241 
00243 
00244   vtkGetMacro(DefaultKeyFrameType, int);
00245   vtkSetMacro(DefaultKeyFrameType, int);
00247 
00248   //BTX
00250 
00251   enum {
00252     RAMP = 0,
00253     STEP,
00254     EXPONENTIAL,
00255     SINUSOID,
00256     CAMERA,
00257     LAST_NOT_USED
00258   };
00259   //ETX
00261 
00266   vtkPVKeyFrame* ReplaceKeyFrame(int type, vtkPVKeyFrame* replaceFrame = NULL);
00267 
00271   vtkPVKeyFrame* NewKeyFrame(int type);
00272 
00274 
00275   int GetKeyFrameType(vtkPVKeyFrame* kf);
00276   int GetKeyFrameType(vtkSMProxy* kf);
00278 
00279 protected:
00280   vtkPVSimpleAnimationCue();
00281   ~vtkPVSimpleAnimationCue();
00282 
00283   virtual void SelectKeyFrameInternal(int id);
00285   virtual void CreateProxy();
00286 
00288   void CleanupKeyFramesGUI();
00289 
00291   void InitializeGUIFromProxy();
00292 
00293 
00296   vtkPVKeyFrame* CreateNewKeyFrameAndInit(int type);
00297 
00299 
00302   vtkSetMacro(Virtual, int);
00304 
00306   int AddKeyFrame(vtkPVKeyFrame* keyframe);
00307 
00308 
00309   vtkKWWidget* KeyFrameParent;
00310   vtkCollection* PVKeyFrames;
00311   vtkCollectionIterator* PVKeyFramesIterator;
00312 
00313   vtkSMPropertyStatusManager* PropertyStatusManager;
00314   vtkPVSimpleAnimationCue* ParentCue;
00315 
00316   int Virtual;
00317   int NumberOfPoints;
00318   double PointParameters[2];
00319   vtkSMAnimationCueProxy* CueProxy;
00320   char* CueProxyName;
00321   vtkSetStringMacro(CueProxyName);
00322 
00323   vtkSMKeyFrameAnimationCueManipulatorProxy* KeyFrameManipulatorProxy;
00324   void SetKeyFrameManipulatorProxy(vtkSMKeyFrameAnimationCueManipulatorProxy*);
00325 
00329   void SetupManipulatorProxy();
00330   
00331   char* KeyFrameManipulatorProxyName;
00332   vtkSetStringMacro(KeyFrameManipulatorProxyName);
00333   char* KeyFrameManipulatorProxyXMLName;
00334   vtkSetStringMacro(KeyFrameManipulatorProxyXMLName);
00335 
00336   char* LabelText;
00337   int ProxiesRegistered;
00338 
00339   int InRecording;
00340   int SelectedKeyFrameIndex;
00341 
00344   int PreviousStepKeyFrameAdded;
00345 
00349   int KeyFramesCreatedCount;
00350 
00352   int DefaultKeyFrameType;
00353 
00355 
00360   virtual void RegisterProxies();
00361   virtual void UnregisterProxies(); 
00363 //BTX
00364   friend class vtkPVSimpleAnimationCueObserver;
00365   vtkPVSimpleAnimationCueObserver* Observer;
00366   void Observe(vtkObject* toObserver, unsigned long event);
00367   virtual void ExecuteEvent(vtkObject* wdg, unsigned long event, void*data);
00368 //ETX
00369 
00370   double Duration;
00371 
00372 private:
00373   vtkPVSimpleAnimationCue(const vtkPVSimpleAnimationCue&); // Not implemented.
00374   void operator=(const vtkPVSimpleAnimationCue&); // Not implemented.
00375 };
00376 
00377 
00378 #endif

Generated on Tue May 30 12:31:40 2006 for ParaView by doxygen 1.3.5