#4981 Fix well target manipulators not responding

Moved z scale change notification to method setting zscale for label
Was always done, and recreated target manipulators at first mousemove
Avoid updating cached values in scene on repeated calls to show gridbox
This commit is contained in:
Jacob Støren 2019-11-04 17:11:31 +01:00
parent c6e4641725
commit 3c3c207bbc
2 changed files with 12 additions and 5 deletions

View File

@ -93,6 +93,7 @@ std::unique_ptr<QCursor> RiuViewer::s_hoverCursor;
RiuViewer::RiuViewer( const QGLFormat& format, QWidget* parent )
: caf::Viewer( format, parent )
, m_isNavigationRotationEnabled( true )
, m_zScale( 1.0 )
{
cvf::Font* standardFont = RiaGuiApplication::instance()->defaultSceneFont();
QFont font = RiaGuiApplication::instance()->font();
@ -490,7 +491,12 @@ void RiuViewer::showZScaleLabel( bool enable )
//--------------------------------------------------------------------------------------------------
void RiuViewer::setZScale( int scale )
{
bool isScaleChanged = m_zScale != scale;
m_zScale = scale;
m_zScaleLabel->setText( QString( "Z: %1" ).arg( scale ) );
if ( isScaleChanged ) m_selectionVisualizerManager->updateVisibleEditors();
}
//--------------------------------------------------------------------------------------------------
@ -531,14 +537,16 @@ void RiuViewer::setHistogramPercentiles( double pmin, double pmax, double mean )
//--------------------------------------------------------------------------------------------------
void RiuViewer::showGridBox( bool enable )
{
this->removeStaticModel( m_gridBoxGenerator->model() );
this->removeStaticModel( m_comparisonGridBoxGenerator->model() );
if ( enable )
{
this->addStaticModelOnce( m_gridBoxGenerator->model(), false );
this->addStaticModelOnce( m_comparisonGridBoxGenerator->model(), true );
}
else
{
this->removeStaticModel( m_gridBoxGenerator->model() );
this->removeStaticModel( m_comparisonGridBoxGenerator->model() );
}
}
//--------------------------------------------------------------------------------------------------
@ -930,8 +938,6 @@ void RiuViewer::updateGridBoxData( double scaleZ,
m_comparisonGridBoxGenerator->setGridBoxDomainCoordBoundingBox( domainCoordBoundingBox );
m_comparisonGridBoxGenerator->createGridBoxParts();
m_selectionVisualizerManager->updateVisibleEditors();
}
//--------------------------------------------------------------------------------------------------

View File

@ -175,6 +175,7 @@ private:
QLabel* m_zScaleLabel;
bool m_showZScaleLabel;
bool m_hideZScaleCheckbox;
double m_zScale;
caf::QStyledProgressBar* m_animationProgress;
bool m_showAnimProgress;