|
|
|
|
@ -71,7 +71,8 @@ nmWxPebiResultControlBar::nmWxPebiResultControlBar(
|
|
|
|
|
m_pExportButton(nullptr),
|
|
|
|
|
m_bExportInProgress(false),
|
|
|
|
|
m_nDisplayedBindingRevision(0),
|
|
|
|
|
m_nDisplayedTimeFrameCount(-1)
|
|
|
|
|
m_nDisplayedTimeFrameCount(-1),
|
|
|
|
|
m_bDisplayedPlaying(false)
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(pSceneController != nullptr);
|
|
|
|
|
createUi();
|
|
|
|
|
@ -287,7 +288,8 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
m_pDisplayModeCombo,
|
|
|
|
|
QVariant(static_cast<int>(
|
|
|
|
|
m_pSceneController->getMeshDisplayMode())));
|
|
|
|
|
if(nDisplayModeIndex >= 0) {
|
|
|
|
|
if(nDisplayModeIndex >= 0 &&
|
|
|
|
|
m_pDisplayModeCombo->currentIndex() != nDisplayModeIndex) {
|
|
|
|
|
const bool bDisplayModeBlocked =
|
|
|
|
|
m_pDisplayModeCombo->blockSignals(true);
|
|
|
|
|
m_pDisplayModeCombo->setCurrentIndex(nDisplayModeIndex);
|
|
|
|
|
@ -316,9 +318,7 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
m_pPlayPauseButton->setEnabled(false);
|
|
|
|
|
m_pSettingsButton->setEnabled(false);
|
|
|
|
|
m_pExportAction->setEnabled(false);
|
|
|
|
|
m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath(
|
|
|
|
|
QString::fromLatin1("NmStartAnimation.png"))));
|
|
|
|
|
m_pPlayPauseButton->setToolTip(tr("Play"));
|
|
|
|
|
updatePlayPauseButton(false);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -349,9 +349,11 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
m_pPlaybackController->getCurrentPropertyId();
|
|
|
|
|
const int nPropertyIndex = findItemByData(
|
|
|
|
|
m_pPropertyCombo, QVariant(sPropertyId));
|
|
|
|
|
if(m_pPropertyCombo->currentIndex() != nPropertyIndex) {
|
|
|
|
|
const bool bPropertyBlocked = m_pPropertyCombo->blockSignals(true);
|
|
|
|
|
m_pPropertyCombo->setCurrentIndex(nPropertyIndex);
|
|
|
|
|
m_pPropertyCombo->blockSignals(bPropertyBlocked);
|
|
|
|
|
}
|
|
|
|
|
const bool bTimeDependent =
|
|
|
|
|
m_pPlaybackController->isPropertyTimeDependent(sPropertyId);
|
|
|
|
|
const int nFrameCount = bTimeDependent
|
|
|
|
|
@ -366,12 +368,17 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
const int nCurrentFrame =
|
|
|
|
|
m_pPlaybackController->getCurrentFrameIndex();
|
|
|
|
|
if(bTimeDependent) {
|
|
|
|
|
const int nTimeIndex = findItemByData(
|
|
|
|
|
m_pTimeCombo, QVariant(nCurrentFrame));
|
|
|
|
|
// rebuildTimeItems 按帧号完整构建,索引与帧号一致,无需每帧线性搜索。
|
|
|
|
|
const int nTimeIndex = nCurrentFrame >= 0 &&
|
|
|
|
|
nCurrentFrame < m_pTimeCombo->count() &&
|
|
|
|
|
m_pTimeCombo->itemData(nCurrentFrame) == QVariant(nCurrentFrame)
|
|
|
|
|
? nCurrentFrame : -1;
|
|
|
|
|
if(m_pTimeCombo->currentIndex() != nTimeIndex) {
|
|
|
|
|
const bool bTimeBlocked = m_pTimeCombo->blockSignals(true);
|
|
|
|
|
m_pTimeCombo->setCurrentIndex(nTimeIndex);
|
|
|
|
|
m_pTimeCombo->blockSignals(bTimeBlocked);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const bool bHasCompleteTimeList = bTimeDependent &&
|
|
|
|
|
nFrameCount > 0 && m_pTimeCombo->count() == nFrameCount;
|
|
|
|
|
@ -408,9 +415,16 @@ void nmWxPebiResultControlBar::refreshFromController()
|
|
|
|
|
m_pExportAction->setToolTip(sExportTip);
|
|
|
|
|
m_pExportAction->setStatusTip(sExportTip);
|
|
|
|
|
|
|
|
|
|
m_pPlayPauseButton->setIcon(QIcon(resultControlIconPath(
|
|
|
|
|
bPlaying ? QString::fromLatin1("NmStopAnimation.png")
|
|
|
|
|
: QString::fromLatin1("NmStartAnimation.png"))));
|
|
|
|
|
updatePlayPauseButton(bPlaying);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxPebiResultControlBar::updatePlayPauseButton(bool bPlaying)
|
|
|
|
|
{
|
|
|
|
|
if(m_bDisplayedPlaying == bPlaying) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
m_bDisplayedPlaying = bPlaying;
|
|
|
|
|
m_pPlayPauseButton->setIcon(bPlaying ? m_oPauseIcon : m_oPlayIcon);
|
|
|
|
|
m_pPlayPauseButton->setToolTip(
|
|
|
|
|
bPlaying ? tr("Pause") : tr("Play"));
|
|
|
|
|
}
|
|
|
|
|
@ -499,6 +513,9 @@ void nmWxPebiResultControlBar::createUi()
|
|
|
|
|
m_pPlayPauseButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("NmStartAnimation.png"),
|
|
|
|
|
tr("Play"));
|
|
|
|
|
m_oPlayIcon = m_pPlayPauseButton->icon();
|
|
|
|
|
m_oPauseIcon = QIcon(resultControlIconPath(
|
|
|
|
|
QString::fromLatin1("NmStopAnimation.png")));
|
|
|
|
|
m_pSettingsButton = createControlButton(
|
|
|
|
|
this, QString::fromLatin1("NmAnimationSettings.png"),
|
|
|
|
|
tr("Animation settings"));
|
|
|
|
|
|