|
|
|
|
@ -5,7 +5,6 @@
|
|
|
|
|
#include "nmPebiResultSceneController.h"
|
|
|
|
|
#include "nmWxPebiResultAnimationSettingsDlg.h"
|
|
|
|
|
#include "nmWxPebiResultColorScaleSettingsDlg.h"
|
|
|
|
|
#include "nmVTKColorMapCatalog.h"
|
|
|
|
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QCoreApplication>
|
|
|
|
|
@ -131,14 +130,11 @@ void nmWxPebiResultControlBar::onColorSettingsClicked()
|
|
|
|
|
m_pPlaybackController->pause();
|
|
|
|
|
nmWxPebiResultColorScaleSettingsDlg oDialog(
|
|
|
|
|
m_pSceneController, this);
|
|
|
|
|
connect(&oDialog, SIGNAL(displaySettingsApplied()),
|
|
|
|
|
this, SLOT(refreshColorPreview()));
|
|
|
|
|
connect(&oDialog, SIGNAL(displaySettingsApplied()),
|
|
|
|
|
this, SIGNAL(operationSucceeded()));
|
|
|
|
|
connect(&oDialog, SIGNAL(operationFailed(QString)),
|
|
|
|
|
this, SLOT(forwardOperationFailure(QString)));
|
|
|
|
|
oDialog.exec();
|
|
|
|
|
refreshColorPreview();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::onFirstFrameClicked()
|
|
|
|
|
@ -207,7 +203,6 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
m_listDisplayedPropertyIds.clear();
|
|
|
|
|
m_pPropertyCombo->setEnabled(false);
|
|
|
|
|
m_pColorSettingsButton->setEnabled(false);
|
|
|
|
|
m_pColorSettingsButton->setIcon(QIcon());
|
|
|
|
|
m_pFirstButton->setEnabled(false);
|
|
|
|
|
m_pPreviousButton->setEnabled(false);
|
|
|
|
|
m_pNextButton->setEnabled(false);
|
|
|
|
|
@ -215,7 +210,7 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
m_pPlayPauseButton->setEnabled(false);
|
|
|
|
|
m_pSettingsButton->setEnabled(false);
|
|
|
|
|
m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath(
|
|
|
|
|
QString::fromLatin1("Continue.png"))));
|
|
|
|
|
QString::fromLatin1("NmStartAnimation.png"))));
|
|
|
|
|
m_pPlayPauseButton->setToolTip(tr("Play"));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -252,7 +247,6 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
m_pPropertyCombo->blockSignals(bPropertyBlocked);
|
|
|
|
|
m_pPropertyCombo->setEnabled(true);
|
|
|
|
|
m_pColorSettingsButton->setEnabled(true);
|
|
|
|
|
refreshColorPreview();
|
|
|
|
|
|
|
|
|
|
const bool bTimeDependent =
|
|
|
|
|
m_pPlaybackController->isPropertyTimeDependent(sPropertyId);
|
|
|
|
|
@ -294,8 +288,8 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
|
|
|
|
|
const bool bPlaying = m_pPlaybackController->isPlaying();
|
|
|
|
|
m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath(
|
|
|
|
|
bPlaying ? QString::fromLatin1("Pause.png")
|
|
|
|
|
: QString::fromLatin1("Continue.png"))));
|
|
|
|
|
bPlaying ? QString::fromLatin1("NmStopAnimation.png")
|
|
|
|
|
: QString::fromLatin1("NmStartAnimation.png"))));
|
|
|
|
|
m_pPlayPauseButton->setToolTip(
|
|
|
|
|
bPlaying ? tr("Pause") : tr("Play"));
|
|
|
|
|
}
|
|
|
|
|
@ -306,19 +300,6 @@ void nmWxPebiResultControlBar::forwardOperationFailure(
|
|
|
|
|
emit operationFailed(sError);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::refreshColorPreview()
|
|
|
|
|
{
|
|
|
|
|
nmPebiResultDisplaySettings oSettings;
|
|
|
|
|
if(m_pSceneController == nullptr ||
|
|
|
|
|
!m_pSceneController->getCurrentDisplaySettings(oSettings)) {
|
|
|
|
|
m_pColorSettingsButton->setIcon(QIcon());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
m_pColorSettingsButton->setIcon(QIcon(
|
|
|
|
|
nmVTKColorMapCatalog::createPreviewPixmap(
|
|
|
|
|
oSettings.m_sColorMapId, QSize(44, 14))));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::createUi()
|
|
|
|
|
{
|
|
|
|
|
QHBoxLayout* pLayout = new QHBoxLayout(this);
|
|
|
|
|
@ -333,14 +314,15 @@ void nmWxPebiResultControlBar::createUi()
|
|
|
|
|
m_pPropertyCombo->setToolTip(tr("Display property"));
|
|
|
|
|
|
|
|
|
|
m_pColorSettingsButton = createControlButton(
|
|
|
|
|
this, QString(), tr("Color settings"));
|
|
|
|
|
m_pColorSettingsButton->setFixedSize(52, 24);
|
|
|
|
|
m_pColorSettingsButton->setIconSize(QSize(44, 14));
|
|
|
|
|
this, QString::fromLatin1("NmColorScaleSettings.png"),
|
|
|
|
|
tr("Color settings"));
|
|
|
|
|
|
|
|
|
|
m_pFirstButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("First.png"), tr("First frame"));
|
|
|
|
|
this, QString::fromLatin1("NmFirstStep.png"),
|
|
|
|
|
tr("First frame"));
|
|
|
|
|
m_pPreviousButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("Prev.png"), tr("Previous frame"));
|
|
|
|
|
this, QString::fromLatin1("NmPreviousStep.png"),
|
|
|
|
|
tr("Previous frame"));
|
|
|
|
|
m_pTimeCombo = new QComboBox(this);
|
|
|
|
|
m_pTimeCombo->setMinimumWidth(150);
|
|
|
|
|
m_pTimeCombo->setFixedHeight(24);
|
|
|
|
|
@ -348,13 +330,16 @@ void nmWxPebiResultControlBar::createUi()
|
|
|
|
|
QSizePolicy::Expanding, QSizePolicy::Fixed);
|
|
|
|
|
m_pTimeCombo->setToolTip(tr("Result time"));
|
|
|
|
|
m_pNextButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("Next.png"), tr("Next frame"));
|
|
|
|
|
this, QString::fromLatin1("NmNextStep.png"),
|
|
|
|
|
tr("Next frame"));
|
|
|
|
|
m_pLastButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("Last.png"), tr("Last frame"));
|
|
|
|
|
this, QString::fromLatin1("NmLastStep.png"),
|
|
|
|
|
tr("Last frame"));
|
|
|
|
|
m_pPlayPauseButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("Continue.png"), tr("Play"));
|
|
|
|
|
this, QString::fromLatin1("NmStartAnimation.png"),
|
|
|
|
|
tr("Play"));
|
|
|
|
|
m_pSettingsButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("SysTools.png"),
|
|
|
|
|
this, QString::fromLatin1("NmAnimationSettings.png"),
|
|
|
|
|
tr("Animation settings"));
|
|
|
|
|
|
|
|
|
|
pLayout->addWidget(m_pPropertyCombo);
|
|
|
|
|
|