ParaView
pqAnimationCue.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqAnimationCue.h
5 
6  Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 ========================================================================*/
32 #ifndef pqAnimationCue_h
33 #define pqAnimationCue_h
34 
35 #include "pqProxy.h"
36 
37 class vtkSMProxy;
38 class vtkSMProperty;
39 
40 class PQCORE_EXPORT pqAnimationCue : public pqProxy
41 {
42  Q_OBJECT
43  typedef pqProxy Superclass;
44 public:
45  pqAnimationCue(const QString& group, const QString& name,
46  vtkSMProxy* proxy, pqServer* server, QObject* parent=NULL);
47  virtual ~pqAnimationCue();
48 
49  // Returns the number of keyframes in this cue.
50  int getNumberOfKeyFrames() const;
51 
52  // Returns a list of the keyframes.
53  QList<vtkSMProxy*> getKeyFrames() const;
54 
55  // Insert a new keyframe at the given index.
56  // The time for the key frame is computed using the times
57  // for the neighbouring keyframes if any.
58  // Returns the newly created keyframe proxy on success,
59  // NULL otherwise.
60  vtkSMProxy* insertKeyFrame(int index);
61 
62  // Deletes the keyframe at the given index.
63  // Consequently, the keyframesModified() signal will get fired.
64  void deleteKeyFrame(int index);
65 
66  // Returns keyframe at a given index, if one exists,
67  // NULL otherwise.
68  vtkSMProxy* getKeyFrame(int index) const;
69 
70  // Returns the animated proxy, if any.
71  vtkSMProxy* getAnimatedProxy() const;
72 
73  // Returns the property that is animated by this cue, if any.
74  vtkSMProperty* getAnimatedProperty() const;
75 
76  // Returns the index of the property being animated.
77  int getAnimatedPropertyIndex() const;
78 
81  void setKeyFrameType(const QString& type)
82  { this->KeyFrameType = type; }
83 
87  { emit this->keyframesModified(); }
88 
90  void setEnabled(bool enable);
91  bool isEnabled() const;
92 
93 signals:
94  // emitted when something about the keyframes changes.
95  void keyframesModified();
96 
97  // Fired when the animated proxy/property/index
98  // changes.
99  void modified();
100 
102  void enabled(bool);
103 
104 private slots:
106  void onEnabledModified();
107 
108 private:
109  Q_DISABLE_COPY(pqAnimationCue)
110 
111 
112  void addKeyFrameInternal(vtkSMProxy*);
113  void removeKeyFrameInternal(vtkSMProxy*);
114  QString KeyFrameType;
115 };
116 #endif
void setKeyFrameType(const QString &type)
Set the type of the keyframe created by default.
void triggerKeyFramesModified()
Used by editors to trigger keyframesModified() signal after bulk of modifications have been made to t...
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:52
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:62