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 "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_11_0
38 #include <QObject>
39 #include <QPointer>
40 
41 class pqPipelineSource;
42 class pqAnimationScene;
43 class vtkObject;
44 
45 // pqVCRController is the QObject that encapsulates the
46 // VCR control functionality.
47 // It provides a slot to set the scene that this object
48 // is using for animation. Typically, one would connect this
49 // slot to a pqAnimationManager like object which keeps track
50 // of the active animation scene.
51 class PQCOMPONENTS_EXPORT pqVCRController : public QObject
52 {
53  Q_OBJECT
54 public:
55  pqVCRController(QObject* parent = nullptr);
56  ~pqVCRController() override;
57 
58 Q_SIGNALS:
59  void timestepChanged();
60 
61  // deprecated in 5.11.0
62  PARAVIEW_DEPRECATED_IN_5_11_0("Use overload with additional reversed argument.")
63  void playing(bool);
64 
65  // emitted as `playing(true, reversed)` when playback
66  // begins and `playing(false, reversed)` when playback ends.
67  // The value of `reversed` argument is true if
68  // playback was requested in backward direction.
69  void playing(bool, bool);
70 
71  // Fired when the enable state of the VCR control changes.
72  // fired each time setAnimationScene() is called. If
73  // called when a valid scene enabled(true) is fired,
74  // else enabled(false).
75  void enabled(bool);
76 
77  // Emitted to update the check state
78  // of the loop.
79  void loop(bool);
80 
81  void timeRanges(double, double);
82 
83 public Q_SLOTS:
84  // Set the animation scene. If null, the VCR control is disabled
85  // (emits enabled(false)).
86  void setAnimationScene(pqAnimationScene*);
87 
88  // Called when timeranges change.
89  void onTimeRangesChanged();
90 
91  // Connect these signals to appropriate VCR buttons.
92  void onFirstFrame();
93  void onPreviousFrame();
94  void onNextFrame();
95  void onLastFrame();
96  void onPlay();
97  void onReverse();
98  void onPause();
99  void onLoop(bool checked);
100 
101 protected Q_SLOTS:
102  void onTick();
103  void onLoopPropertyChanged();
104  void onBeginPlay(vtkObject* caller, unsigned long, void*, void* reversed);
105  void onEndPlay(vtkObject* caller, unsigned long, void*, void* reversed);
106 
107 private:
108  Q_DISABLE_COPY(pqVCRController)
109 
110  QPointer<pqAnimationScene> Scene;
111 };
112 
113 #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.
#define PARAVIEW_DEPRECATED_IN_5_11_0(reason)