mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4994 Make ComparisonView mode for InfoBox and animation progress
This commit is contained in:
parent
c27c19ce96
commit
e78b0d4204
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "Rim3dOverlayInfoConfig.h"
|
||||||
#include "RimGridView.h"
|
#include "RimGridView.h"
|
||||||
|
|
||||||
#include "RiuViewer.h"
|
#include "RiuViewer.h"
|
||||||
@ -50,6 +51,7 @@ void RicCompareTo3dViewFeature::onActionTriggered( bool isChecked )
|
|||||||
{
|
{
|
||||||
activeView->setComparisonView( view );
|
activeView->setComparisonView( view );
|
||||||
activeView->scheduleCreateDisplayModelAndRedraw();
|
activeView->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
activeView->overlayInfoConfig()->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,9 @@
|
|||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "Rim3dOverlayInfoConfig.h"
|
||||||
#include "Rim3dView.h"
|
#include "Rim3dView.h"
|
||||||
|
#include "RimGridView.h"
|
||||||
|
|
||||||
#include "RiuViewer.h"
|
#include "RiuViewer.h"
|
||||||
#include "RiuViewerCommands.h"
|
#include "RiuViewerCommands.h"
|
||||||
@ -48,6 +50,9 @@ public:
|
|||||||
{
|
{
|
||||||
m_activeView->setComparisonView( nullptr );
|
m_activeView->setComparisonView( nullptr );
|
||||||
m_activeView->scheduleCreateDisplayModelAndRedraw();
|
m_activeView->scheduleCreateDisplayModelAndRedraw();
|
||||||
|
|
||||||
|
auto gridView = dynamic_cast<RimGridView*>( m_activeView );
|
||||||
|
if ( gridView ) gridView->overlayInfoConfig()->updateConnectedEditors();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -425,11 +425,11 @@ bool Rim2dIntersectionView::hasResults()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
int Rim2dIntersectionView::timeStepCount()
|
size_t Rim2dIntersectionView::onTimeStepCountRequested()
|
||||||
{
|
{
|
||||||
if ( isTimeStepDependentDataVisible() )
|
if ( isTimeStepDependentDataVisible() )
|
||||||
{
|
{
|
||||||
return static_cast<int>( this->ownerCase()->timeStepStrings().size() );
|
return this->ownerCase()->timeStepStrings().size();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -484,9 +484,9 @@ void Rim2dIntersectionView::onCreateDisplayModel()
|
|||||||
|
|
||||||
nativeOrOverrideViewer()->removeAllFrames( isUsingOverrideViewer() );
|
nativeOrOverrideViewer()->removeAllFrames( isUsingOverrideViewer() );
|
||||||
|
|
||||||
int tsCount = this->timeStepCount();
|
size_t tsCount = this->timeStepCount();
|
||||||
|
|
||||||
for ( int i = 0; i < tsCount; ++i )
|
for ( size_t i = 0; i < tsCount; ++i )
|
||||||
{
|
{
|
||||||
nativeOrOverrideViewer()->addFrame( new cvf::Scene(), isUsingOverrideViewer() );
|
nativeOrOverrideViewer()->addFrame( new cvf::Scene(), isUsingOverrideViewer() );
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,8 @@ protected:
|
|||||||
bool* useOptionsOnly ) override;
|
bool* useOptionsOnly ) override;
|
||||||
|
|
||||||
bool hasResults();
|
bool hasResults();
|
||||||
int timeStepCount();
|
|
||||||
|
virtual size_t onTimeStepCountRequested() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString createAutoName() const override;
|
QString createAutoName() const override;
|
||||||
|
@ -926,7 +926,7 @@ void Rim3dOverlayInfoConfig::update3DInfo()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_viewDef->viewer()->showInfoText( m_showCaseInfo() || m_showResultInfo() );
|
m_viewDef->viewer()->showInfoText( m_showCaseInfo() || ( m_showResultInfo() && !m_viewDef->activeComparisonView() ) );
|
||||||
m_viewDef->viewer()->showHistogram( false );
|
m_viewDef->viewer()->showHistogram( false );
|
||||||
m_viewDef->viewer()->showAnimationProgress( m_showAnimProgress() );
|
m_viewDef->viewer()->showAnimationProgress( m_showAnimProgress() );
|
||||||
m_viewDef->viewer()->showVersionInfo( m_showVersionInfo() );
|
m_viewDef->viewer()->showVersionInfo( m_showVersionInfo() );
|
||||||
@ -1024,6 +1024,12 @@ void Rim3dOverlayInfoConfig::defineUiOrdering( QString uiConfigName, caf::PdmUiO
|
|||||||
}
|
}
|
||||||
statGroup->add( &m_statisticsCellRange );
|
statGroup->add( &m_statisticsCellRange );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isUsingComparisonView = m_viewDef->activeComparisonView();
|
||||||
|
m_showResultInfo.uiCapability()->setUiReadOnly( isUsingComparisonView );
|
||||||
|
m_showVolumeWeightedMean.uiCapability()->setUiReadOnly( isUsingComparisonView );
|
||||||
|
m_showHistogram.uiCapability()->setUiReadOnly( isUsingComparisonView );
|
||||||
|
|
||||||
uiOrdering.skipRemainingFields( true );
|
uiOrdering.skipRemainingFields( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,6 +453,14 @@ bool Rim3dView::isTimeStepDependentDataVisibleInThisOrComparisonView() const
|
|||||||
return ( isTimeStepDependentDataVisible() || ( otherView && otherView->isTimeStepDependentDataVisible() ) );
|
return ( isTimeStepDependentDataVisible() || ( otherView && otherView->isTimeStepDependentDataVisible() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t Rim3dView::timeStepCount()
|
||||||
|
{
|
||||||
|
return this->onTimeStepCountRequested();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -142,10 +142,12 @@ public:
|
|||||||
void forceShowWindowOn();
|
void forceShowWindowOn();
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
int currentTimeStep() const;
|
int currentTimeStep() const;
|
||||||
void setCurrentTimeStep( int frameIdx );
|
void setCurrentTimeStep( int frameIdx );
|
||||||
void setCurrentTimeStepAndUpdate( int frameIdx ) override;
|
void setCurrentTimeStepAndUpdate( int frameIdx ) override;
|
||||||
bool isTimeStepDependentDataVisibleInThisOrComparisonView() const;
|
bool isTimeStepDependentDataVisibleInThisOrComparisonView() const;
|
||||||
|
size_t timeStepCount();
|
||||||
|
QString timeStepName( int frameIdx ) const override;
|
||||||
|
|
||||||
// Updating
|
// Updating
|
||||||
void scheduleCreateDisplayModelAndRedraw();
|
void scheduleCreateDisplayModelAndRedraw();
|
||||||
@ -200,10 +202,12 @@ protected:
|
|||||||
|
|
||||||
// Abstract methods to implement in subclasses
|
// Abstract methods to implement in subclasses
|
||||||
|
|
||||||
virtual void onCreateDisplayModel() = 0;
|
virtual void onCreateDisplayModel() = 0;
|
||||||
virtual void onUpdateDisplayModelForCurrentTimeStep() = 0;
|
virtual void onUpdateDisplayModelForCurrentTimeStep() = 0;
|
||||||
virtual void onUpdateDisplayModelVisibility(){};
|
virtual void onUpdateDisplayModelVisibility(){};
|
||||||
virtual void onClampCurrentTimestep() = 0;
|
virtual void onClampCurrentTimestep() = 0;
|
||||||
|
virtual size_t onTimeStepCountRequested() = 0;
|
||||||
|
|
||||||
virtual void onClearReservoirCellVisibilitiesIfNeccessary(){};
|
virtual void onClearReservoirCellVisibilitiesIfNeccessary(){};
|
||||||
virtual bool isTimeStepDependentDataVisible() const = 0;
|
virtual bool isTimeStepDependentDataVisible() const = 0;
|
||||||
virtual void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) = 0;
|
virtual void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) = 0;
|
||||||
@ -258,8 +262,7 @@ private:
|
|||||||
void setCameraPosition( const cvf::Mat4d& cameraPosition ) override;
|
void setCameraPosition( const cvf::Mat4d& cameraPosition ) override;
|
||||||
void setCameraPointOfInterest( const cvf::Vec3d& cameraPointOfInterest ) override;
|
void setCameraPointOfInterest( const cvf::Vec3d& cameraPointOfInterest ) override;
|
||||||
|
|
||||||
QString timeStepName( int frameIdx ) const override;
|
void endAnimation() override;
|
||||||
void endAnimation() override;
|
|
||||||
|
|
||||||
caf::PdmObjectHandle* implementingPdmObject() override;
|
caf::PdmObjectHandle* implementingPdmObject() override;
|
||||||
|
|
||||||
|
@ -268,6 +268,19 @@ void RimEclipseView::onClampCurrentTimestep()
|
|||||||
if ( m_currentTimeStep < 0 ) m_currentTimeStep = 0;
|
if ( m_currentTimeStep < 0 ) m_currentTimeStep = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RimEclipseView::onTimeStepCountRequested()
|
||||||
|
{
|
||||||
|
if ( this->currentGridCellResults() )
|
||||||
|
{
|
||||||
|
return this->currentGridCellResults()->maxTimeStepCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -186,7 +186,9 @@ private:
|
|||||||
|
|
||||||
void syncronizeWellsWithResults();
|
void syncronizeWellsWithResults();
|
||||||
|
|
||||||
void onClampCurrentTimestep() override;
|
void onClampCurrentTimestep() override;
|
||||||
|
size_t onTimeStepCountRequested() override;
|
||||||
|
|
||||||
void setVisibleGridParts( const std::vector<RivCellSetEnum>& cellSets );
|
void setVisibleGridParts( const std::vector<RivCellSetEnum>& cellSets );
|
||||||
void setVisibleGridPartsWatertight();
|
void setVisibleGridPartsWatertight();
|
||||||
|
|
||||||
|
@ -725,6 +725,19 @@ void RimGeoMechView::onClampCurrentTimestep()
|
|||||||
if ( m_currentTimeStep < 0 ) m_currentTimeStep = 0;
|
if ( m_currentTimeStep < 0 ) m_currentTimeStep = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RimGeoMechView::onTimeStepCountRequested()
|
||||||
|
{
|
||||||
|
if ( m_geomechCase )
|
||||||
|
{
|
||||||
|
return m_geomechCase->geoMechData()->femPartResults()->frameCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -121,7 +121,8 @@ private:
|
|||||||
|
|
||||||
void onUpdateScaleTransform() override;
|
void onUpdateScaleTransform() override;
|
||||||
|
|
||||||
void onClampCurrentTimestep() override;
|
void onClampCurrentTimestep() override;
|
||||||
|
size_t onTimeStepCountRequested() override;
|
||||||
|
|
||||||
void onUpdateDisplayModelForCurrentTimeStep() override;
|
void onUpdateDisplayModelForCurrentTimeStep() override;
|
||||||
void onUpdateStaticCellColors() override;
|
void onUpdateStaticCellColors() override;
|
||||||
|
@ -118,6 +118,20 @@ RiuViewer::RiuViewer( const QGLFormat& format, QWidget* parent )
|
|||||||
m_infoLabel->setFont( font );
|
m_infoLabel->setFont( font );
|
||||||
m_showInfoText = true;
|
m_showInfoText = true;
|
||||||
|
|
||||||
|
m_shortInfoLabel = new QLabel();
|
||||||
|
m_shortInfoLabel->setObjectName( "ShortInfoLabel" );
|
||||||
|
m_shortInfoLabel->setFrameShape( QFrame::Box );
|
||||||
|
m_shortInfoLabel->setFrameShadow( QFrame::Plain );
|
||||||
|
m_shortInfoLabel->setMinimumWidth( 100 );
|
||||||
|
m_shortInfoLabel->setFont( font );
|
||||||
|
|
||||||
|
m_shortInfoLabelCompView = new QLabel();
|
||||||
|
m_shortInfoLabelCompView->setObjectName( "ShortInfoLabelCompView" );
|
||||||
|
m_shortInfoLabelCompView->setFrameShape( QFrame::Box );
|
||||||
|
m_shortInfoLabelCompView->setFrameShadow( QFrame::Plain );
|
||||||
|
m_shortInfoLabelCompView->setMinimumWidth( 100 );
|
||||||
|
m_shortInfoLabelCompView->setFont( font );
|
||||||
|
|
||||||
// Version info label
|
// Version info label
|
||||||
m_versionInfoLabel = new QLabel();
|
m_versionInfoLabel = new QLabel();
|
||||||
m_versionInfoLabel->setFrameShape( QFrame::NoFrame );
|
m_versionInfoLabel->setFrameShape( QFrame::NoFrame );
|
||||||
@ -144,6 +158,13 @@ RiuViewer::RiuViewer( const QGLFormat& format, QWidget* parent )
|
|||||||
m_animationProgress->setObjectName( "AnimationProgress" );
|
m_animationProgress->setObjectName( "AnimationProgress" );
|
||||||
m_animationProgress->setFont( font );
|
m_animationProgress->setFont( font );
|
||||||
|
|
||||||
|
m_animationProgressCompView = new caf::QStyledProgressBar( "AnimationProgress" );
|
||||||
|
m_animationProgressCompView->setFormat( "Time Step: %v/%m" );
|
||||||
|
m_animationProgressCompView->setTextVisible( true );
|
||||||
|
m_animationProgressCompView->setAlignment( Qt::AlignCenter );
|
||||||
|
m_animationProgressCompView->setObjectName( "AnimationProgress" );
|
||||||
|
m_animationProgressCompView->setFont( font );
|
||||||
|
|
||||||
m_showAnimProgress = false;
|
m_showAnimProgress = false;
|
||||||
|
|
||||||
// Histogram
|
// Histogram
|
||||||
@ -158,6 +179,8 @@ RiuViewer::RiuViewer( const QGLFormat& format, QWidget* parent )
|
|||||||
regTestFont.setPixelSize( 11 );
|
regTestFont.setPixelSize( 11 );
|
||||||
|
|
||||||
m_infoLabel->setFont( regTestFont );
|
m_infoLabel->setFont( regTestFont );
|
||||||
|
m_shortInfoLabel->setFont( regTestFont );
|
||||||
|
m_shortInfoLabelCompView->setFont( regTestFont );
|
||||||
m_versionInfoLabel->setFont( regTestFont );
|
m_versionInfoLabel->setFont( regTestFont );
|
||||||
m_animationProgress->setFont( regTestFont );
|
m_animationProgress->setFont( regTestFont );
|
||||||
m_histogramWidget->setFont( regTestFont );
|
m_histogramWidget->setFont( regTestFont );
|
||||||
@ -198,7 +221,10 @@ RiuViewer::~RiuViewer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete m_infoLabel;
|
delete m_infoLabel;
|
||||||
|
delete m_shortInfoLabel;
|
||||||
|
delete m_shortInfoLabelCompView;
|
||||||
delete m_animationProgress;
|
delete m_animationProgress;
|
||||||
|
delete m_animationProgressCompView;
|
||||||
delete m_histogramWidget;
|
delete m_histogramWidget;
|
||||||
delete m_gridBoxGenerator;
|
delete m_gridBoxGenerator;
|
||||||
delete m_comparisonGridBoxGenerator;
|
delete m_comparisonGridBoxGenerator;
|
||||||
@ -255,9 +281,9 @@ void RiuViewer::mouseReleaseEvent( QMouseEvent* event )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !m_infoLabelOverlayArea.isNull() )
|
if ( !m_infoPickArea.isNull() )
|
||||||
{
|
{
|
||||||
if ( m_infoLabelOverlayArea.contains( event->x(), event->y() ) )
|
if ( m_infoPickArea.contains( event->x(), event->y() ) )
|
||||||
{
|
{
|
||||||
m_rimView->selectOverlayInfoConfig();
|
m_rimView->selectOverlayInfoConfig();
|
||||||
|
|
||||||
@ -265,6 +291,18 @@ void RiuViewer::mouseReleaseEvent( QMouseEvent* event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !m_infoPickAreaCompView.isNull() )
|
||||||
|
{
|
||||||
|
if ( m_infoPickAreaCompView.contains( event->x(), event->y() ) )
|
||||||
|
{
|
||||||
|
Rim3dView* compView = dynamic_cast<Rim3dView*>( m_rimView.p() )->activeComparisonView();
|
||||||
|
|
||||||
|
if ( compView ) compView->selectOverlayInfoConfig();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
m_viewerCommands->handlePickAction( event->x(), event->y(), event->modifiers() );
|
m_viewerCommands->handlePickAction( event->x(), event->y(), event->modifiers() );
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -366,8 +404,9 @@ void RiuViewer::paintOverlayItems( QPainter* painter )
|
|||||||
int edgeAxisFrameBorderWidth = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderWidth() : 0;
|
int edgeAxisFrameBorderWidth = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderWidth() : 0;
|
||||||
int edgeAxisFrameBorderHeight = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderHeight() : 0;
|
int edgeAxisFrameBorderHeight = m_showWindowEdgeAxes ? m_windowEdgeAxisOverlay->frameBorderHeight() : 0;
|
||||||
|
|
||||||
int margin = 5;
|
int margin = 5;
|
||||||
int yPos = margin + edgeAxisFrameBorderHeight;
|
int startYPos = margin + edgeAxisFrameBorderHeight;
|
||||||
|
int yPos = startYPos;
|
||||||
|
|
||||||
bool showAnimBar = false;
|
bool showAnimBar = false;
|
||||||
if ( isAnimationActive() && frameCount() > 1 ) showAnimBar = true;
|
if ( isAnimationActive() && frameCount() > 1 ) showAnimBar = true;
|
||||||
@ -376,37 +415,101 @@ void RiuViewer::paintOverlayItems( QPainter* painter )
|
|||||||
|
|
||||||
int columnPos = this->width() - columnWidth - margin - edgeAxisFrameBorderWidth;
|
int columnPos = this->width() - columnWidth - margin - edgeAxisFrameBorderWidth;
|
||||||
|
|
||||||
|
if ( this->isComparisonViewActive() )
|
||||||
|
{
|
||||||
|
Rim3dView* compView = dynamic_cast<Rim3dView*>( m_rimView.p() )->activeComparisonView();
|
||||||
|
columnWidth = 200;
|
||||||
|
|
||||||
|
// int sliderPos = this->width() * this->comparisonViewVisibleNormalizedRect().min().x();
|
||||||
|
int sliderPos = 0.5 * this->width();
|
||||||
|
int compViewItemsXPos = sliderPos + 0.5 * ( this->width() - sliderPos ) - 0.5 * columnWidth;
|
||||||
|
columnPos = 0.5 * sliderPos - 0.5 * columnWidth;
|
||||||
|
|
||||||
|
if ( m_showInfoText )
|
||||||
|
{
|
||||||
|
{
|
||||||
|
Rim3dView* view = dynamic_cast<Rim3dView*>( m_rimView.p() );
|
||||||
|
m_shortInfoLabel->setText( "<center>" + view->ownerCase()->caseUserDescription() + "</center>" );
|
||||||
|
|
||||||
|
QPoint topLeft = QPoint( columnPos, yPos );
|
||||||
|
m_shortInfoLabel->resize( columnWidth, m_shortInfoLabel->sizeHint().height() );
|
||||||
|
m_shortInfoLabel->render( painter, topLeft );
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
m_shortInfoLabelCompView->setText( "<center>" + compView->ownerCase()->caseUserDescription() +
|
||||||
|
"</center>" );
|
||||||
|
QPoint topLeft = QPoint( compViewItemsXPos, yPos );
|
||||||
|
m_shortInfoLabelCompView->resize( columnWidth, m_shortInfoLabelCompView->sizeHint().height() );
|
||||||
|
m_shortInfoLabelCompView->render( painter, topLeft );
|
||||||
|
}
|
||||||
|
|
||||||
|
yPos += m_shortInfoLabel->height();
|
||||||
|
}
|
||||||
|
|
||||||
|
int pickAreaHeight = yPos - startYPos;
|
||||||
|
if ( m_showAnimProgress && isAnimationActive( true ) && compView->timeStepCount() > 1 )
|
||||||
|
{
|
||||||
|
QString stepName = compView->timeStepName( compView->currentTimeStep() );
|
||||||
|
|
||||||
|
m_animationProgressCompView->setFormat( "Time Step: %v/%m " + stepName );
|
||||||
|
m_animationProgressCompView->setMinimum( 0 );
|
||||||
|
m_animationProgressCompView->setMaximum( static_cast<int>( compView->timeStepCount() ) - 1 );
|
||||||
|
m_animationProgressCompView->setValue( compView->currentTimeStep() );
|
||||||
|
|
||||||
|
m_animationProgressCompView->resize( columnWidth, m_animationProgressCompView->sizeHint().height() );
|
||||||
|
|
||||||
|
m_animationProgressCompView->render( painter, QPoint( compViewItemsXPos, yPos ) );
|
||||||
|
|
||||||
|
pickAreaHeight += m_animationProgressCompView->height();
|
||||||
|
}
|
||||||
|
|
||||||
|
m_infoPickArea.setLeft( columnPos );
|
||||||
|
m_infoPickArea.setWidth( columnWidth );
|
||||||
|
m_infoPickArea.setHeight( pickAreaHeight );
|
||||||
|
m_infoPickArea.setTop( startYPos );
|
||||||
|
|
||||||
|
m_infoPickAreaCompView.setLeft( compViewItemsXPos );
|
||||||
|
m_infoPickAreaCompView.setWidth( columnWidth );
|
||||||
|
m_infoPickAreaCompView.setHeight( pickAreaHeight );
|
||||||
|
m_infoPickAreaCompView.setTop( startYPos );
|
||||||
|
}
|
||||||
|
|
||||||
if ( showAnimBar && m_showAnimProgress )
|
if ( showAnimBar && m_showAnimProgress )
|
||||||
{
|
{
|
||||||
QString stepName = m_rimView->timeStepName( currentFrameIndex() );
|
Rim3dView* view = dynamic_cast<Rim3dView*>( m_rimView.p() );
|
||||||
|
|
||||||
|
QString stepName = view->timeStepName( view->currentTimeStep() );
|
||||||
|
|
||||||
m_animationProgress->setFormat( "Time Step: %v/%m " + stepName );
|
m_animationProgress->setFormat( "Time Step: %v/%m " + stepName );
|
||||||
m_animationProgress->setMinimum( 0 );
|
m_animationProgress->setMinimum( 0 );
|
||||||
m_animationProgress->setMaximum( static_cast<int>( frameCount() ) - 1 );
|
m_animationProgress->setMaximum( static_cast<int>( view->timeStepCount() ) - 1 );
|
||||||
m_animationProgress->setValue( currentFrameIndex() );
|
m_animationProgress->setValue( view->currentTimeStep() );
|
||||||
m_animationProgress->resize( columnWidth, m_animationProgress->sizeHint().height() );
|
|
||||||
|
|
||||||
|
m_animationProgress->resize( columnWidth, m_animationProgress->sizeHint().height() );
|
||||||
m_animationProgress->render( painter, QPoint( columnPos, yPos ) );
|
m_animationProgress->render( painter, QPoint( columnPos, yPos ) );
|
||||||
|
|
||||||
yPos += m_animationProgress->height() + margin;
|
yPos += m_animationProgress->height() + margin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_showInfoText )
|
if ( m_showInfoText && !this->isComparisonViewActive() )
|
||||||
{
|
{
|
||||||
QPoint topLeft = QPoint( columnPos, yPos );
|
QPoint topLeft = QPoint( columnPos, yPos );
|
||||||
m_infoLabel->resize( columnWidth, m_infoLabel->sizeHint().height() );
|
m_infoLabel->resize( columnWidth, m_infoLabel->sizeHint().height() );
|
||||||
m_infoLabel->render( painter, topLeft );
|
m_infoLabel->render( painter, topLeft );
|
||||||
|
|
||||||
m_infoLabelOverlayArea.setTopLeft( topLeft );
|
m_infoPickArea.setTopLeft( topLeft );
|
||||||
m_infoLabelOverlayArea.setBottom( yPos + m_infoLabel->height() );
|
m_infoPickArea.setBottom( yPos + m_infoLabel->height() );
|
||||||
m_infoLabelOverlayArea.setRight( columnPos + columnWidth );
|
m_infoPickArea.setRight( columnPos + columnWidth );
|
||||||
|
|
||||||
yPos += m_infoLabel->height() + margin;
|
yPos += m_infoLabel->height() + margin;
|
||||||
}
|
}
|
||||||
else
|
else if ( !this->isComparisonViewActive() )
|
||||||
{
|
{
|
||||||
m_infoLabelOverlayArea = QRect();
|
m_infoPickArea = QRect();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( m_showHistogram )
|
if ( m_showHistogram && !this->isComparisonViewActive() )
|
||||||
{
|
{
|
||||||
m_histogramWidget->resize( columnWidth, 40 );
|
m_histogramWidget->resize( columnWidth, 40 );
|
||||||
m_histogramWidget->render( painter, QPoint( columnPos, yPos ) );
|
m_histogramWidget->render( painter, QPoint( columnPos, yPos ) );
|
||||||
@ -808,7 +911,7 @@ void RiuViewer::updateLegendLayout()
|
|||||||
const int xPos = width() - (int)scaleLegendSize.x() - margin - edgeAxisBorderWidth;
|
const int xPos = width() - (int)scaleLegendSize.x() - margin - edgeAxisBorderWidth;
|
||||||
const int yPos = margin + edgeAxisBorderHeight + margin + otherItemsHeight;
|
const int yPos = margin + edgeAxisBorderHeight + margin + otherItemsHeight;
|
||||||
|
|
||||||
m_scaleLegend->setLayoutFixedPosition( { xPos, yPos } );
|
m_scaleLegend->setLayoutFixedPosition( {xPos, yPos} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1185,9 +1288,9 @@ void RiuViewer::showScaleLegend( bool show )
|
|||||||
if ( show )
|
if ( show )
|
||||||
{
|
{
|
||||||
if ( m_scaleLegend->orientation() == caf::OverlayScaleLegend::HORIZONTAL )
|
if ( m_scaleLegend->orientation() == caf::OverlayScaleLegend::HORIZONTAL )
|
||||||
m_scaleLegend->setRenderSize( { 280, 45 } );
|
m_scaleLegend->setRenderSize( {280, 45} );
|
||||||
else
|
else
|
||||||
m_scaleLegend->setRenderSize( { 50, 280 } );
|
m_scaleLegend->setRenderSize( {50, 280} );
|
||||||
|
|
||||||
overlayItemsRendering()->addOverlayItem( m_scaleLegend.p() );
|
overlayItemsRendering()->addOverlayItem( m_scaleLegend.p() );
|
||||||
}
|
}
|
||||||
@ -1233,7 +1336,10 @@ void RiuViewer::updateFonts()
|
|||||||
|
|
||||||
m_zScaleLabel->setFont( font );
|
m_zScaleLabel->setFont( font );
|
||||||
m_infoLabel->setFont( font );
|
m_infoLabel->setFont( font );
|
||||||
|
m_shortInfoLabel->setFont( font );
|
||||||
|
m_shortInfoLabelCompView->setFont( font );
|
||||||
m_animationProgress->setFont( font );
|
m_animationProgress->setFont( font );
|
||||||
|
m_animationProgressCompView->setFont( font );
|
||||||
m_versionInfoLabel->setFont( font );
|
m_versionInfoLabel->setFont( font );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1337,6 +1443,16 @@ void RiuViewer::updateOverlayItemsStyle()
|
|||||||
contrastColor,
|
contrastColor,
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
backgroundFrameColor ) );
|
backgroundFrameColor ) );
|
||||||
|
m_shortInfoLabel->setStyleSheet( caf::StyleSheetTools::createFrameStyleSheet( "QLabel",
|
||||||
|
"ShortInfoLabel",
|
||||||
|
contrastColor,
|
||||||
|
backgroundColor,
|
||||||
|
backgroundFrameColor ) );
|
||||||
|
m_shortInfoLabelCompView->setStyleSheet( caf::StyleSheetTools::createFrameStyleSheet( "QLabel",
|
||||||
|
"ShortInfoLabelCompView",
|
||||||
|
contrastColor,
|
||||||
|
backgroundColor,
|
||||||
|
backgroundFrameColor ) );
|
||||||
m_histogramWidget->setStyleSheet( caf::StyleSheetTools::createFrameStyleSheet( "",
|
m_histogramWidget->setStyleSheet( caf::StyleSheetTools::createFrameStyleSheet( "",
|
||||||
"HistogramWidget",
|
"HistogramWidget",
|
||||||
contrastColor,
|
contrastColor,
|
||||||
@ -1354,6 +1470,10 @@ void RiuViewer::updateOverlayItemsStyle()
|
|||||||
backgroundColor,
|
backgroundColor,
|
||||||
backgroundFrameColor,
|
backgroundFrameColor,
|
||||||
progressColor );
|
progressColor );
|
||||||
|
m_animationProgressCompView->setTextBackgroundAndProgressColor( contrastColor,
|
||||||
|
backgroundColor,
|
||||||
|
backgroundFrameColor,
|
||||||
|
progressColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -166,7 +166,11 @@ private:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QLabel* m_infoLabel;
|
QLabel* m_infoLabel;
|
||||||
QRect m_infoLabelOverlayArea;
|
QRect m_infoPickArea;
|
||||||
|
QRect m_infoPickAreaCompView;
|
||||||
|
|
||||||
|
QLabel* m_shortInfoLabel; // Used when in comparison view mode
|
||||||
|
QLabel* m_shortInfoLabelCompView;
|
||||||
|
|
||||||
QLabel* m_versionInfoLabel;
|
QLabel* m_versionInfoLabel;
|
||||||
bool m_showInfoText;
|
bool m_showInfoText;
|
||||||
@ -178,6 +182,7 @@ private:
|
|||||||
double m_zScale;
|
double m_zScale;
|
||||||
|
|
||||||
caf::QStyledProgressBar* m_animationProgress;
|
caf::QStyledProgressBar* m_animationProgress;
|
||||||
|
caf::QStyledProgressBar* m_animationProgressCompView;
|
||||||
bool m_showAnimProgress;
|
bool m_showAnimProgress;
|
||||||
RiuSimpleHistogramWidget* m_histogramWidget;
|
RiuSimpleHistogramWidget* m_histogramWidget;
|
||||||
bool m_showHistogram;
|
bool m_showHistogram;
|
||||||
|
Loading…
Reference in New Issue
Block a user