Commit 0fc4f6a6 authored by Cory Quammen's avatar Cory Quammen Committed by Kitware Robot

Merge topic '16877-timestep-selection-animation-view'

e4f51dca Use pqAnimationTimeWidget in pqAnimationViewWidget
a21f7b22 Move pqAnimationTimeWidget to Qt/Components
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !3184
parents 7ad33a4a e4f51dca
Pipeline #134295 pending with stage
......@@ -35,7 +35,6 @@ set(classes
pqAnimationShortcutDecorator
pqAnimationShortcutWidget
pqAnimationTimeToolbar
pqAnimationTimeWidget
pqApplicationComponentsInit
pqApplicationSettingsReaction
pqApplyBehavior
......@@ -207,7 +206,6 @@ if (TARGET ParaView::pqPython)
endif ()
set(ui_files
Resources/UI/pqAnimationTimeWidget.ui
Resources/UI/pqAxesToolbar.ui
Resources/UI/pqBackgroundEditorWidget.ui
Resources/UI/pqBoxPropertyWidget.ui
......
......@@ -36,6 +36,7 @@ set(classes
pqAnimatablePropertiesComboBox
pqAnimatableProxyComboBox
pqAnimationManager
pqAnimationTimeWidget
pqAnimationViewWidget
pqArrayListDomain
pqArraySelectionWidget
......@@ -181,6 +182,7 @@ set(headers
set(ui_files
Resources/UI/pqAbortAnimation.ui
Resources/UI/pqAboutDialog.ui
Resources/UI/pqAnimationTimeWidget.ui
Resources/UI/pqFavoritesDialog.ui
Resources/UI/pqCalculatorWidget.ui
Resources/UI/pqCameraDialog.ui
......
......@@ -32,7 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef pqAnimationTimeWidget_h
#define pqAnimationTimeWidget_h
#include "pqApplicationComponentsModule.h"
#include "pqComponentsModule.h"
#include <QScopedPointer>
#include <QWidget>
......@@ -53,7 +53,7 @@ class vtkSMProxy;
* user to change the play mode by setting playModeReadOnly to true
* (default is false).
*/
class PQAPPLICATIONCOMPONENTS_EXPORT pqAnimationTimeWidget : public QWidget
class PQCOMPONENTS_EXPORT pqAnimationTimeWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(double timeValue READ timeValue WRITE setTimeValue NOTIFY timeValueChanged)
......
......@@ -55,6 +55,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "pqAnimationKeyFrame.h"
#include "pqAnimationModel.h"
#include "pqAnimationScene.h"
#include "pqAnimationTimeWidget.h"
#include "pqAnimationTrack.h"
#include "pqAnimationWidget.h"
#include "pqApplicationCore.h"
......@@ -94,9 +95,8 @@ class pqAnimationViewWidget::pqInternal
public:
pqInternal()
: AnimationWidget(NULL)
, AnimationTimeWidget(NULL)
, PlayMode(NULL)
, Time(NULL)
, TimeLabel(NULL)
, StartTime(NULL)
, StartTimeLabel(NULL)
, EndTime(NULL)
......@@ -116,13 +116,12 @@ public:
QPointer<pqAnimationScene> Scene;
pqAnimationWidget* AnimationWidget;
pqAnimationTimeWidget* AnimationTimeWidget;
QSignalMapper KeyFramesChanged;
typedef QMap<QPointer<pqAnimationCue>, pqAnimationTrack*> TrackMapType;
TrackMapType TrackMap;
QPointer<QDialog> Editor;
QComboBox* PlayMode;
QLineEdit* Time;
QLabel* TimeLabel;
QLineEdit* StartTime;
QLabel* StartTimeLabel;
QLineEdit* EndTime;
......@@ -269,12 +268,10 @@ pqAnimationViewWidget::pqAnimationViewWidget(QWidget* _parent)
this->Internal->PlayMode = new QComboBox(this) << pqSetName("PlayMode");
this->Internal->PlayMode->addItem("Snap to Timesteps");
hboxlayout->addWidget(this->Internal->PlayMode);
this->Internal->TimeLabel = new QLabel("Time:", this);
hboxlayout->addWidget(this->Internal->TimeLabel);
this->Internal->Time = new QLineEdit(this) << pqSetName("Time");
this->Internal->Time->setValidator(new QDoubleValidator(this->Internal->Time));
this->Internal->Time->setMinimumWidth(30);
hboxlayout->addWidget(this->Internal->Time);
this->Internal->AnimationTimeWidget = new pqAnimationTimeWidget(this);
this->Internal->AnimationTimeWidget->setPlayModeReadOnly(true);
hboxlayout->addWidget(this->Internal->AnimationTimeWidget);
this->Internal->StartTimeLabel = new QLabel("Start Time:", this);
hboxlayout->addWidget(this->Internal->StartTimeLabel);
this->Internal->StartTime = new QLineEdit(this) << pqSetName("StartTime");
......@@ -414,9 +411,10 @@ void pqAnimationViewWidget::setScene(pqAnimationScene* scene)
scene->getProxy()->GetProperty("PlayMode"));
// connect time
this->Internal->Links.addTraceablePropertyLink(this->Internal->Time, "text",
SIGNAL(editingFinished()), scene->getProxy(),
this->Internal->Links.addTraceablePropertyLink(this->Internal->AnimationTimeWidget, "timeValue",
SIGNAL(timeValueChanged()), scene->getProxy(),
scene->getProxy()->GetProperty("AnimationTime"));
this->Internal->AnimationTimeWidget->setAnimationScene(scene->getProxy());
// connect start time
this->Internal->Links.addTraceablePropertyLink(this->Internal->StartTime, "text",
SIGNAL(editingFinished()), scene->getProxy(), scene->getProxy()->GetProperty("StartTime"));
......@@ -727,6 +725,8 @@ void pqAnimationViewWidget::updatePlayMode()
this->Internal->DurationLink.removeAllPropertyLinks();
this->Internal->AnimationTimeWidget->setPlayMode(mode);
if (mode == "Real Time")
{
animModel->setMode(pqAnimationModel::Real);
......@@ -742,7 +742,7 @@ void pqAnimationViewWidget::updatePlayMode()
this->Internal->StartTime->setEnabled(true);
this->Internal->EndTime->setEnabled(true);
this->Internal->Time->setEnabled(true);
this->Internal->AnimationTimeWidget->setEnabled(true);
this->Internal->Duration->setEnabled(true);
this->Internal->DurationLabel->setEnabled(true);
this->Internal->DurationLabel->setText("Duration (s):");
......@@ -765,7 +765,6 @@ void pqAnimationViewWidget::updatePlayMode()
this->Internal->StartTime->setEnabled(true);
this->Internal->EndTime->setEnabled(true);
this->Internal->Time->setEnabled(true);
this->Internal->Duration->setEnabled(true);
this->Internal->DurationLabel->setEnabled(true);
this->Internal->DurationLabel->setText("No. Frames:");
......@@ -790,7 +789,6 @@ void pqAnimationViewWidget::updatePlayMode()
this->Internal->DurationLabel->setEnabled(false);
this->Internal->StartTime->setEnabled(false);
this->Internal->EndTime->setEnabled(false);
this->Internal->Time->setEnabled(false);
}
else
{
......@@ -1030,7 +1028,6 @@ void pqAnimationViewWidget::onTimeLabelChanged()
}
// Update labels
this->Internal->TimeLabel->setText(timeName);
this->Internal->StartTimeLabel->setText(QString("Start %1:").arg(timeName));
this->Internal->EndTimeLabel->setText(QString("End %1:").arg(timeName));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment