1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
/*=========================================================================
Program: ParaView
Module: vtkPVCueManipulator.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkPVCueManipulator
* @brief abstract proxy for manipulators
* used in animation.
*
* An animation cue proxy delegates the operation of modifying the property
* on the proxy being animated to a \b Manipulator. An example of a manipulator
* is a vtkPVKeyFrameCueManipulator. Subclasses must override
* \c UpdateValue to perform the actual property manipulation.
* Just like all proxies involved in Animation, this is a client side proxy,
* with no VTK objects created on the server.
* A manipulator fires two kinds of events:
* \li \b vtkPVCueManipulator::StateModifiedEvent is fired when
* the manipulator modifies the animated proxy.
* \li \b vtkCommand::Modified is fired when properties of the manipulator
* are changed which affects the way the animation is generated e.g in case
* of vtkPVKeyFrameCueManipulator, this event is fired when
* the key frames are changed i.e. added/removed/modified.
* @sa
* vtkPVAnimationCue vtkAnimationCue
*/
#ifndef vtkPVCueManipulator_h
#define vtkPVCueManipulator_h
#include "vtkObject.h"
#include "vtkPVAnimationModule.h" // needed for export macro
class vtkPVAnimationCue;
class VTKPVANIMATION_EXPORT vtkPVCueManipulator : public vtkObject
{
public:
vtkTypeMacro(vtkPVCueManipulator, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* StateModifiedEvent - This event is fired when the manipulator modifies the animated proxy.
* vtkCommand::Modified - is fired when the keyframes are changed i.e. added/removed/modified.
*/
enum
{
StateModifiedEvent = 2000
};
protected:
/**
* This method is called when the AnimationCue's StartAnimationCueEvent is
* triggerred, to let the animation manipulator know that the cue has
* been restarted. This is here for one major reason: after the last key frame,
* the state of the scene must be as it was left a the the last key frame. This does not
* happend automatically, since if while animating the currentime never coincides with the
* last key frame's key time, then it never gets a chance to update the properties value.
* Hence, we note when the cue begins. Then, if the currentime is beyond that of the last key
* frame we pretend that the current time coincides with that of the last key frame and let
* it update the properties. This is done only once per Animation cycle. The Initialize method
* is used to indicate that a new animation cycle has begun.
*/
virtual void Initialize(vtkPVAnimationCue*) {}
/**
* This method is called when the AnimationCue's EndAnimationCueEvent is triggerred.
* Typically, the Manipulator will set the state of the Cue to that at the
* end of the cue.
*/
virtual void Finalize(vtkPVAnimationCue*) {}
/**
* This updates the values based on currenttime.
* currenttime is normalized to the time range of the Cue.
*/
virtual void UpdateValue(double currenttime, vtkPVAnimationCue* cueproxy) = 0;
vtkPVCueManipulator();
~vtkPVCueManipulator();
friend class vtkPVAnimationCue;
private:
vtkPVCueManipulator(const vtkPVCueManipulator&) VTK_DELETE_FUNCTION;
void operator=(const vtkPVCueManipulator&) VTK_DELETE_FUNCTION;
};
#endif
|