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 
41 {
42  Q_OBJECT
43  typedef pqProxy Superclass;
44 
45 public:
46  pqAnimationCue(const QString& group, const QString& name, vtkSMProxy* proxy, pqServer* server,
47  QObject* parent = NULL);
48  ~pqAnimationCue() override;
49 
50  // Returns the number of keyframes in this cue.
51  int getNumberOfKeyFrames() const;
52 
53  // Returns a list of the keyframes.
54  QList<vtkSMProxy*> getKeyFrames() const;
55 
56  // Insert a new keyframe at the given index.
57  // The time for the key frame is computed using the times
58  // for the neighbouring keyframes if any.
59  // Returns the newly created keyframe proxy on success,
60  // NULL otherwise.
61  vtkSMProxy* insertKeyFrame(int index);
62 
63  // Deletes the keyframe at the given index.
64  // Consequently, the keyframesModified() signal will get fired.
65  void deleteKeyFrame(int index);
66 
67  // Returns keyframe at a given index, if one exists,
68  // NULL otherwise.
69  vtkSMProxy* getKeyFrame(int index) const;
70 
71  // Returns the animated proxy, if any.
72  vtkSMProxy* getAnimatedProxy() const;
73 
74  // Returns the property that is animated by this cue, if any.
75  vtkSMProperty* getAnimatedProperty() const;
76 
77  // Returns the index of the property being animated.
78  int getAnimatedPropertyIndex() const;
79 
84  void setKeyFrameType(const QString& type) { this->KeyFrameType = type; }
85 
90  void triggerKeyFramesModified() { Q_EMIT this->keyframesModified(); }
91 
95  void setEnabled(bool enable);
96  bool isEnabled() const;
97 
98 Q_SIGNALS:
99  // emitted when something about the keyframes changes.
100  void keyframesModified();
101 
102  // Fired when the animated proxy/property/index
103  // changes.
104  void modified();
105 
109  void enabled(bool);
110 
111 private Q_SLOTS:
115  void onEnabledModified();
116 
117 private:
118  Q_DISABLE_COPY(pqAnimationCue)
119 
120 
123  void addKeyFrameInternal(vtkSMProxy*);
124  void removeKeyFrameInternal(vtkSMProxy*);
125  QString KeyFrameType;
126 };
127 #endif
void setKeyFrameType(const QString &type)
Set the type of the keyframe created by default.
superclass for all SM properties
name
void triggerKeyFramesModified()
Used by editors to trigger keyframesModified() signal after bulk of modifications have been made to t...
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
This class represents any registered Server Manager proxy.
Definition: pqProxy.h:56
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
enabled
index
pqServer (should be renamed to pqSession) is a pqServerManagerModelItem subclass that represents a vt...
Definition: pqServer.h:64