pqVCRController.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: pqVCRController.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 
33 #ifndef _pqVCRController_h
34 #define _pqVCRController_h
35 
36 #include "pqComponentsModule.h"
37 #include <QObject>
38 #include <QPointer>
39 
40 class pqPipelineSource;
41 class pqAnimationScene;
42 
43 // pqVCRController is the QObject that encapsulates the
44 // VCR control functionality.
45 // It provides a slot to set the scene that this object
46 // is using for animation. Typically, one would connect this
47 // slot to a pqAnimationManager like object which keeps track
48 // of the active animation scene.
49 class PQCOMPONENTS_EXPORT pqVCRController : public QObject
50 {
51  Q_OBJECT
52 public:
53  pqVCRController(QObject* parent = 0);
54  ~pqVCRController() override;
55 
56 Q_SIGNALS:
57  void timestepChanged();
58 
59  // emitted with playing(true) when play begins and
60  // playing(false) when play ends.
61  void playing(bool);
62 
63  // Fired when the enable state of the VCR control changes.
64  // fired each time setAnimationScene() is called. If
65  // called when a valid scene enabled(true) is fired,
66  // else enabled(false).
67  void enabled(bool);
68 
69  // Emitted to update the check state
70  // of the loop.
71  void loop(bool);
72 
73  void timeRanges(double, double);
74 
75 public Q_SLOTS:
76  // Set the animation scene. If null, the VCR control is disabled
77  // (emits enabled(false)).
78  void setAnimationScene(pqAnimationScene*);
79 
80  // Called when timeranges change.
81  void onTimeRangesChanged();
82 
83  // Connect these signals to appropriate VCR buttons.
84  void onFirstFrame();
85  void onPreviousFrame();
86  void onNextFrame();
87  void onLastFrame();
88  void onPlay();
89  void onPause();
90  void onLoop(bool checked);
91 
92 protected Q_SLOTS:
93  void onTick();
94  void onLoopPropertyChanged();
95  void onBeginPlay();
96  void onEndPlay();
97 
98 private:
99  Q_DISABLE_COPY(pqVCRController)
100 
101  QPointer<pqAnimationScene> Scene;
102 };
103 
104 #endif
#define PQCOMPONENTS_EXPORT
Scene
loop
enabled
PQ representation for a vtkSMProxy that can be involved in a pipeline.
pqAnimationScene is a representation for a vtkSMAnimationScene proxy.