Merge pull request #4968 from OPM/feaure-fix-point-picking-in-comparison-view

Fixes several issues from #4857
#4956 Fix List editor background setting
#4880 Fix annotations missing in comparison view
This commit is contained in:
Jacob Støren
2019-11-04 09:44:56 +01:00
committed by GitHub
43 changed files with 489 additions and 382 deletions

View File

@@ -128,7 +128,7 @@ void RicCopyIntersectionsToAllViewsInCaseFeature::copyIntersectionsToOtherViews(
intersection->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
CVF_ASSERT( copy );
destCollection->appendIntersectionAndUpdate( copy );
destCollection->appendIntersectionAndUpdate( copy, false );
// Resolve references after object has been inserted into the project data model
copy->resolveReferencesRecursively();

View File

@@ -119,7 +119,7 @@ void RicNewAzimuthDipIntersectionFeatureCmd::redo()
intersection->setLengthDown( cvf::Math::floor( bBox.extent()[2] / 2 ) );
}
m_intersectionCollection->appendIntersectionAndUpdate( intersection );
m_intersectionCollection->appendIntersectionAndUpdate( intersection, false );
Riu3dSelectionManager::instance()->deleteAllItems();
Riu3DMainWindowTools::selectAsCurrentItem( intersection, false );

View File

@@ -108,7 +108,7 @@ void RicNewPolylineIntersectionFeatureCmd::redo()
intersection->type = RimIntersection::CS_POLYLINE;
intersection->inputPolyLineFromViewerEnabled = true;
m_intersectionCollection->appendIntersectionAndUpdate( intersection );
m_intersectionCollection->appendIntersectionAndUpdate( intersection, false );
Riu3dSelectionManager::instance()->deleteAllItems();

View File

@@ -106,7 +106,7 @@ void RicNewSimWellIntersectionCmd::redo()
intersection->type = RimIntersection::CS_SIMULATION_WELL;
intersection->simulationWell = m_simWell;
m_intersectionCollection->appendIntersectionAndUpdate( intersection );
m_intersectionCollection->appendIntersectionAndUpdate( intersection, false );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -171,7 +171,7 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
viewToModify->faultCollection()->showFaultCollection = false;
viewToModify->faultCollection()->updateConnectedEditors();
viewToModify->updateCurrentTimeStepAndRedraw();
viewToModify->updateDisplayModelForCurrentTimeStepAndRedraw();
viewToModify->scheduleCreateDisplayModelAndRedraw();
}

View File

@@ -29,6 +29,7 @@
#include "cvfModelBasicList.h"
#include "cvfPart.h"
#include "cvfRay.h"
#include "cvfRayIntersectSpec.h"
#include <QDebug>
#include <QMouseEvent>
@@ -50,6 +51,26 @@ RicBoxManipulatorEventHandler::RicBoxManipulatorEventHandler( caf::Viewer* viewe
RicBoxManipulatorEventHandler::~RicBoxManipulatorEventHandler()
{
if ( m_viewer ) m_viewer->removeEventFilter( this );
for ( auto viewer : m_otherViewers )
{
if ( viewer )
{
m_viewer->removeEventFilter( this );
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicBoxManipulatorEventHandler::registerInAdditionalViewer( caf::Viewer* viewer )
{
if ( viewer )
{
m_otherViewers.push_back( viewer );
viewer->installEventFilter( this );
}
}
//--------------------------------------------------------------------------------------------------
@@ -85,6 +106,10 @@ void RicBoxManipulatorEventHandler::appendPartsToModel( cvf::ModelBasicList* mod
//--------------------------------------------------------------------------------------------------
bool RicBoxManipulatorEventHandler::eventFilter( QObject* obj, QEvent* inputEvent )
{
caf::Viewer* viewer = dynamic_cast<caf::Viewer*>( obj );
if ( !viewer ) return false;
if ( inputEvent->type() == QEvent::MouseButtonPress )
{
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>( inputEvent );
@@ -92,7 +117,7 @@ bool RicBoxManipulatorEventHandler::eventFilter( QObject* obj, QEvent* inputEven
if ( mouseEvent->button() == Qt::LeftButton )
{
cvf::HitItemCollection hitItems;
if ( m_viewer->rayPick( mouseEvent->x(), mouseEvent->y(), &hitItems ) )
if ( viewer->rayPick( mouseEvent->x(), mouseEvent->y(), &hitItems ) )
{
m_partManager->tryToActivateManipulator( hitItems.firstItem() );
@@ -111,16 +136,12 @@ bool RicBoxManipulatorEventHandler::eventFilter( QObject* obj, QEvent* inputEven
{
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>( inputEvent );
// qDebug() << "Inside mouse move";
// qDebug() << mouseEvent->pos();
cvf::ref<cvf::RayIntersectSpec> rayIS =
viewer->rayIntersectSpecFromWindowCoordinates( mouseEvent->pos().x(), mouseEvent->pos().y() );
int translatedMousePosX = mouseEvent->pos().x();
int translatedMousePosY = m_viewer->height() - mouseEvent->pos().y();
cvf::ref<cvf::Ray> ray = m_viewer->mainCamera()->rayFromWindowCoordinates( translatedMousePosX,
translatedMousePosY );
if (rayIS.notNull())
{
m_partManager->updateManipulatorFromRay( ray.p() );
m_partManager->updateManipulatorFromRay( rayIS->ray() );
cvf::Vec3d origin;
cvf::Vec3d size;

View File

@@ -52,6 +52,8 @@ public:
explicit RicBoxManipulatorEventHandler( caf::Viewer* viewer );
~RicBoxManipulatorEventHandler() override;
void registerInAdditionalViewer( caf::Viewer* viewer);
void setOrigin( const cvf::Vec3d& origin );
void setSize( const cvf::Vec3d& size );
@@ -66,6 +68,7 @@ protected:
private:
QPointer<caf::Viewer> m_viewer;
std::vector<QPointer<caf::Viewer>> m_otherViewers;
cvf::ref<caf::BoxManipulatorPartManager> m_partManager;
};

View File

@@ -94,7 +94,7 @@ void RicPasteIntersectionsFeature::onActionTriggered( bool isChecked )
if ( i == intersectionObjects.size() - 1 )
{
intersectionCollection->appendIntersectionAndUpdate( intersection );
intersectionCollection->appendIntersectionAndUpdate( intersection, false );
}
else
{

View File

@@ -90,7 +90,7 @@ bool RicContourMapPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
return true;
}
contourMap->setPickPoint( cvf::Vec2d::UNDEFINED );
view->updateCurrentTimeStepAndRedraw();
view->updateDisplayModelForCurrentTimeStepAndRedraw();
return true;
}
}

View File

@@ -87,7 +87,7 @@ void RicFlyToObjectFeature::onActionTriggered( bool isChecked )
destinationViewer->setPointOfInterest( cameraViewRefPoint );
activeView->updateCurrentTimeStepAndRedraw();
activeView->updateDisplayModelForCurrentTimeStepAndRedraw();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -671,9 +671,9 @@ void RicSummaryPlotFeatureImpl::createSummaryPlotsFromArgumentLine( const QStrin
// Needed to avoid unneccessary activation of sub windows (plots)
// which results in population of property editor, and missing deleteLater because we are outside any event
// loop when switching object. Results in stray widgets.
mpw->setBlockSubWindowProjectTreeSelection( true );
mpw->setBlockViewSelectionOnSubWindowActivated( true );
RiuPlotMainWindowTools::showPlotMainWindow();
mpw->setBlockSubWindowProjectTreeSelection( false );
mpw->setBlockViewSelectionOnSubWindowActivated( false );
RiuPlotMainWindowTools::setExpanded( lastPlotCreated );
RiuPlotMainWindowTools::selectAsCurrentItem( lastPlotCreated );

View File

@@ -52,13 +52,14 @@ bool RicIntersectionPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& e
RimGridView* gridView = nullptr;
intersection->firstAncestorOrThisOfTypeAsserted( gridView );
if ( RiaApplication::instance()->activeGridView() != gridView )
if ( RiaApplication::instance()->activeMainOrComparisonGridView() != gridView )
{
return false;
}
cvf::ref<caf::DisplayCoordTransform> transForm = gridView->displayCoordTransform();
cvf::Vec3d domainCoord = transForm->transformToDomainCoord(
cvf::ref<caf::DisplayCoordTransform> transForm = gridView->displayCoordTransform();
cvf::Vec3d domainCoord = transForm->transformToDomainCoord(
eventObject.m_pickItemInfos.front().globalPickedPoint() );
if ( intersection->inputPolyLineFromViewerEnabled() )

View File

@@ -173,7 +173,7 @@ bool Rim2dIntersectionView::isTimeStepDependentDataVisible() const
{
RimGridView* gridView = nullptr;
m_intersection->firstAncestorOrThisOfTypeAsserted( gridView );
return gridView->isTimeStepDependentDataVisible();
return gridView->isTimeStepDependentDataVisibleInThisOrComparisonView();
}
return false;
@@ -468,17 +468,17 @@ bool Rim2dIntersectionView::isWindowVisible() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) {}
void Rim2dIntersectionView::defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::createDisplayModel()
void Rim2dIntersectionView::onCreateDisplayModel()
{
if ( !nativeOrOverrideViewer() ) return;
if ( !m_intersection() ) return;
updateScaleTransform();
onUpdateScaleTransform();
nativeOrOverrideViewer()->removeAllFrames( isUsingOverrideViewer() );
@@ -536,7 +536,6 @@ void Rim2dIntersectionView::createDisplayModel()
if ( this->hasUserRequestedAnimation() )
{
if ( viewer() ) viewer()->setCurrentFrame( m_currentTimeStep );
updateCurrentTimeStep();
}
if ( this->viewer()->mainCamera()->viewMatrix() == sm_defaultViewMatrix )
@@ -548,10 +547,10 @@ void Rim2dIntersectionView::createDisplayModel()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::updateCurrentTimeStep()
void Rim2dIntersectionView::onUpdateDisplayModelForCurrentTimeStep()
{
update3dInfo();
updateLegends();
onUpdateLegends();
if ( m_flatSimWellPipePartMgr.notNull() )
{
@@ -623,7 +622,7 @@ void Rim2dIntersectionView::updateCurrentTimeStep()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::updateLegends()
void Rim2dIntersectionView::onUpdateLegends()
{
m_legendObjectToSelect = nullptr;
@@ -685,7 +684,7 @@ void Rim2dIntersectionView::updateLegends()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::resetLegendsInViewer()
void Rim2dIntersectionView::onResetLegendsInViewer()
{
nativeOrOverrideViewer()->showAxisCross( false );
nativeOrOverrideViewer()->showAnimationProgress( true );
@@ -704,26 +703,22 @@ void Rim2dIntersectionView::resetLegendsInViewer()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::createPartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::onTimeStepChanged() {}
void Rim2dIntersectionView::onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::clampCurrentTimestep() {}
void Rim2dIntersectionView::onClampCurrentTimestep() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::updateStaticCellColors() {}
void Rim2dIntersectionView::onUpdateStaticCellColors() {}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim2dIntersectionView::updateScaleTransform()
void Rim2dIntersectionView::onUpdateScaleTransform()
{
cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
scale( 2, 2 ) = scaleZ();

View File

@@ -82,19 +82,18 @@ public:
bool handleOverlayItemPicked( const cvf::OverlayItem* pickedOverlayItem ) const;
protected:
void updateLegends() override;
void onUpdateLegends() override;
bool isGridVisualizationMode() const override;
void axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
void createDisplayModel() override;
void createPartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) override;
void clampCurrentTimestep() override;
void updateCurrentTimeStep() override;
void onTimeStepChanged() override;
void updateStaticCellColors() override;
void updateScaleTransform() override;
void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
void onCreateDisplayModel() override;
void onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) override;
void onClampCurrentTimestep() override;
void onUpdateDisplayModelForCurrentTimeStep() override;
void onUpdateStaticCellColors() override;
void onUpdateScaleTransform() override;
cvf::Transform* scaleTransform() override;
void resetLegendsInViewer() override;
void onResetLegendsInViewer() override;
void onLoadDataAndUpdate() override;
bool isWindowVisible() const override;

View File

@@ -80,7 +80,7 @@ CAF_PDM_XML_ABSTRACT_SOURCE_INIT( Rim3dView, "GenericView" ); // Do not use. Abs
///
//--------------------------------------------------------------------------------------------------
Rim3dView::Rim3dView( void )
: m_isCallingUpdateTimestepAndRedraw( false )
: m_isCallingUpdateDisplayModelForCurrentTimestepAndRedraw( false )
{
RiaApplication* app = RiaApplication::instance();
RiaPreferences* preferences = app->preferences();
@@ -153,9 +153,9 @@ Rim3dView::Rim3dView( void )
//--------------------------------------------------------------------------------------------------
Rim3dView::~Rim3dView( void )
{
if (RiaApplication::instance()->activeReservoirView() == this)
if ( RiaApplication::instance()->activeReservoirView() == this )
{
RiaApplication::instance()->setActiveReservoirView(nullptr);
RiaApplication::instance()->setActiveReservoirView( nullptr );
}
if ( m_viewer )
@@ -225,6 +225,14 @@ QString Rim3dView::autoName() const
return m_nameConfig->name();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Color3f Rim3dView::backgroundColor() const
{
return m_backgroundColor();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -240,7 +248,7 @@ QWidget* Rim3dView::createViewWidget( QWidget* mainWindowParent )
cvf::String yLabel;
cvf::String zLabel;
this->axisLabels( &xLabel, &yLabel, &zLabel );
this->defineAxisLabels( &xLabel, &yLabel, &zLabel );
m_viewer->setAxisLabels( xLabel, yLabel, zLabel );
updateZScaleLabel();
@@ -254,7 +262,7 @@ void Rim3dView::updateViewWidgetAfterCreation()
{
m_viewer->setDefaultPerspectiveNearPlaneDistance( 10 );
this->resetLegendsInViewer();
this->onResetLegendsInViewer();
m_viewer->updateNavigationPolicy();
m_viewer->enablePerfInfoHud( RiaGuiApplication::instance()->showPerformanceInfo() );
@@ -424,32 +432,6 @@ void Rim3dView::setComparisonView( Rim3dView* compView )
m_comparisonView.uiCapability()->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::setCurrentTimeStepAndUpdate( int frameIndex )
{
setCurrentTimeStep( frameIndex );
this->updateCurrentTimeStep();
if ( Rim3dView* depView = prepareComparisonView() )
{
depView->updateCurrentTimeStep();
depView->appendAnnotationsToModel();
depView->appendMeasurementToModel();
restoreComparisonView();
}
RimProject* project;
firstAncestorOrThisOfTypeAsserted( project );
project->mainPlotCollection()->updateCurrentTimeStepInPlots();
appendAnnotationsToModel();
appendMeasurementToModel();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -480,12 +462,12 @@ void Rim3dView::setCurrentTimeStep( int frameIndex )
const int oldTimeStep = m_currentTimeStep;
m_currentTimeStep = frameIndex;
clampCurrentTimestep();
onClampCurrentTimestep();
if ( m_currentTimeStep != oldTimeStep )
{
RiuTimeStepChangedHandler::instance()->handleTimeStepChanged( this );
this->onTimeStepChanged();
this->onClearReservoirCellVisibilitiesIfNeccessary();
}
this->hasUserRequestedAnimation = true;
@@ -494,17 +476,30 @@ void Rim3dView::setCurrentTimeStep( int frameIndex )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::updateCurrentTimeStepAndRedraw()
void Rim3dView::setCurrentTimeStepAndUpdate( int frameIndex )
{
if ( m_isCallingUpdateTimestepAndRedraw ) return;
setCurrentTimeStep( frameIndex );
updateDisplayModelForCurrentTimeStepAndRedraw();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::updateDisplayModelForCurrentTimeStepAndRedraw()
{
if ( m_isCallingUpdateDisplayModelForCurrentTimestepAndRedraw ) return;
if ( nativeOrOverrideViewer() )
{
this->updateCurrentTimeStep();
this->onUpdateDisplayModelForCurrentTimeStep();
appendAnnotationsToModel();
appendMeasurementToModel();
if ( Rim3dView* depView = prepareComparisonView() )
{
depView->updateCurrentTimeStep();
depView->onUpdateDisplayModelForCurrentTimeStep();
depView->appendAnnotationsToModel();
depView->appendMeasurementToModel();
restoreComparisonView();
}
@@ -512,17 +507,18 @@ void Rim3dView::updateCurrentTimeStepAndRedraw()
nativeOrOverrideViewer()->update();
}
m_isCallingUpdateTimestepAndRedraw = true;
m_isCallingUpdateDisplayModelForCurrentTimestepAndRedraw = true;
std::set<Rim3dView*> containerViews = this->viewsUsingThisAsComparisonView();
if ( !containerViews.empty() && !isUsingOverrideViewer() )
{
for ( auto view : containerViews )
{
view->updateCurrentTimeStepAndRedraw();
view->updateDisplayModelForCurrentTimeStepAndRedraw();
}
}
m_isCallingUpdateTimestepAndRedraw = false;
m_isCallingUpdateDisplayModelForCurrentTimestepAndRedraw = false;
RimProject* project;
firstAncestorOrThisOfTypeAsserted( project );
@@ -536,11 +532,11 @@ void Rim3dView::createDisplayModelAndRedraw()
{
if ( nativeOrOverrideViewer() )
{
this->clampCurrentTimestep();
this->onClampCurrentTimestep();
updateScaleTransform();
onUpdateScaleTransform();
createDisplayModel();
onCreateDisplayModel();
createHighlightAndGridBoxDisplayModel();
updateDisplayModelVisibility();
@@ -561,7 +557,7 @@ void Rim3dView::createDisplayModelAndRedraw()
// But avoid any call back down to this Rim3dView, instead do the update manually to not confuse the
// m_currentTimeStep
nativeOrOverrideViewer()->caf::Viewer::slotSetCurrentFrame( currentTimeStep() );
depView->updateCurrentTimeStep();
depView->updateDisplayModelForCurrentTimeStepAndRedraw();
}
restoreComparisonView();
@@ -619,7 +615,15 @@ void Rim3dView::setDefaultView()
void Rim3dView::endAnimation()
{
this->hasUserRequestedAnimation = false;
this->updateStaticCellColors();
this->onUpdateStaticCellColors();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* Rim3dView::implementingPdmObject()
{
return this;
}
//--------------------------------------------------------------------------------------------------
@@ -716,7 +720,7 @@ void Rim3dView::setSurfaceDrawstyle()
void Rim3dView::disableLighting( bool disable )
{
m_disableLighting = disable;
updateCurrentTimeStepAndRedraw();
updateDisplayModelForCurrentTimeStepAndRedraw();
updateConnectedEditors();
}
@@ -736,6 +740,14 @@ caf::PdmFieldHandle* Rim3dView::userDescriptionField()
return m_nameConfig->nameField();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmFieldHandle* Rim3dView::backgroundColorField()
{
return &m_backgroundColor;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -747,7 +759,7 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
if ( changedField == &meshMode )
{
createDisplayModel();
onCreateDisplayModel();
updateDisplayModelVisibility();
RiuMainWindow::instance()->refreshDrawStyleActions();
RiuMainWindow::instance()->refreshAnimationActions();
@@ -764,18 +776,18 @@ void Rim3dView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
}
else if ( changedField == &surfaceMode )
{
createDisplayModel();
onCreateDisplayModel();
updateDisplayModelVisibility();
RiuMainWindow::instance()->refreshDrawStyleActions();
RiuMainWindow::instance()->refreshAnimationActions();
}
else if ( changedField == &m_showGridBox )
{
createHighlightAndGridBoxDisplayModelWithRedraw();
createHighlightAndGridBoxDisplayModelAndRedraw();
}
else if ( changedField == &m_disableLighting )
{
createDisplayModel();
onCreateDisplayModel();
RiuMainWindow::instance()->refreshDrawStyleActions();
RiuMainWindow::instance()->refreshAnimationActions();
}
@@ -870,7 +882,7 @@ void Rim3dView::addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathMode
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::addAnnotationsToModel( cvf::ModelBasicList* wellPathModelBasicList )
void Rim3dView::addAnnotationsToModel( cvf::ModelBasicList* annotationsModel )
{
if ( !this->ownerCase() ) return;
@@ -884,18 +896,18 @@ void Rim3dView::addAnnotationsToModel( cvf::ModelBasicList* wellPathModelBasicLi
else
{
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
m_annotationsPartManager->appendGeometryPartsToModel( wellPathModelBasicList,
m_annotationsPartManager->appendGeometryPartsToModel( annotationsModel,
transForm.p(),
ownerCase()->allCellsBoundingBox() );
}
wellPathModelBasicList->updateBoundingBoxesRecursive();
annotationsModel->updateBoundingBoxesRecursive();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* wellPathModelBasicList )
void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* measureModel )
{
if ( !this->ownerCase() ) return;
@@ -908,13 +920,15 @@ void Rim3dView::addMeasurementToModel( cvf::ModelBasicList* wellPathModelBasicLi
else
{
cvf::ref<caf::DisplayCoordTransform> transForm = displayCoordTransform();
m_measurementPartManager->appendGeometryPartsToModel( nativeOrOverrideViewer()->mainCamera(),
wellPathModelBasicList,
cvf::Camera* mainOrComparisonCamera = isUsingOverrideViewer() ? nativeOrOverrideViewer()->comparisonMainCamera()
: nativeOrOverrideViewer()->mainCamera();
m_measurementPartManager->appendGeometryPartsToModel( mainOrComparisonCamera,
measureModel,
transForm.p(),
ownerCase()->allCellsBoundingBox() );
}
wellPathModelBasicList->updateBoundingBoxesRecursive();
measureModel->updateBoundingBoxesRecursive();
}
//--------------------------------------------------------------------------------------------------
@@ -940,8 +954,8 @@ void Rim3dView::updateGridBoxData()
{
using BBox = cvf::BoundingBox;
BBox masterDomainBBox = showActiveCellsOnly() ? ownerCase()->activeCellsBoundingBox()
: ownerCase()->allCellsBoundingBox();
BBox masterDomainBBox = isShowingActiveCellsOnly() ? ownerCase()->activeCellsBoundingBox()
: ownerCase()->allCellsBoundingBox();
BBox combinedDomainBBox = masterDomainBBox;
if ( Rim3dView* depView = activeComparisonView() )
@@ -953,8 +967,8 @@ void Rim3dView::updateGridBoxData()
if ( destinationOwnerCase )
{
BBox depDomainBBox = depView->showActiveCellsOnly() ? destinationOwnerCase->activeCellsBoundingBox()
: destinationOwnerCase->allCellsBoundingBox();
BBox depDomainBBox = depView->isShowingActiveCellsOnly() ? destinationOwnerCase->activeCellsBoundingBox()
: destinationOwnerCase->allCellsBoundingBox();
if ( depDomainBBox.isValid() )
{
combinedDomainBBox.add( depDomainBBox.min() );
@@ -1018,7 +1032,7 @@ void Rim3dView::updateScaling()
activeComparisonView()->setScaleZAndUpdate( scaleZ );
}
updateScaleTransform();
onUpdateScaleTransform();
updateGridBoxData();
updateZScaleLabel();
@@ -1058,7 +1072,7 @@ void Rim3dView::createMeasurementDisplayModelAndRedraw()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::createHighlightAndGridBoxDisplayModelWithRedraw()
void Rim3dView::createHighlightAndGridBoxDisplayModelAndRedraw()
{
createHighlightAndGridBoxDisplayModel();
@@ -1086,7 +1100,7 @@ void Rim3dView::createHighlightAndGridBoxDisplayModel()
m_highlightVizModel->removeAllParts();
cvf::Collection<cvf::Part> parts;
createPartCollectionFromSelection( &parts );
onCreatePartCollectionFromSelection( &parts );
if ( parts.size() > 0 )
{
for ( size_t i = 0; i < parts.size(); i++ )
@@ -1131,7 +1145,7 @@ void Rim3dView::applyBackgroundColorAndFontChanges()
}
updateGridBoxData();
updateAnnotationItems();
updateLegends();
onUpdateLegends();
}
//--------------------------------------------------------------------------------------------------
@@ -1191,13 +1205,15 @@ void Rim3dView::updateDisplayModelVisibility()
viewer()->setEnableMask( mask, false );
viewer()->setEnableMask( mask, true );
this->onUpdateDisplayModelVisibility();
viewer()->update();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Rim3dView::showActiveCellsOnly()
bool Rim3dView::isShowingActiveCellsOnly()
{
return false;
}
@@ -1322,6 +1338,22 @@ QWidget* Rim3dView::viewWidget()
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::setCameraPosition( const cvf::Mat4d& cameraPosition )
{
m_cameraPosition = cameraPosition;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Rim3dView::setCameraPointOfInterest( const cvf::Vec3d& cameraPointOfInterest )
{
m_cameraPointOfInterest = cameraPointOfInterest;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -1330,6 +1362,14 @@ void Rim3dView::forceShowWindowOn()
m_showWindow.setValueWithFieldChanged( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int Rim3dView::currentTimeStep() const
{
return m_currentTimeStep;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -105,189 +105,161 @@ public:
caf::PdmField<caf::AppEnum<RiaDefines::MeshModeType>> meshMode;
caf::PdmField<caf::AppEnum<SurfaceModeType>> surfaceMode;
RiuViewer* viewer() const;
virtual RimCase* ownerCase() const = 0;
RiuViewer* viewer() const;
void setName( const QString& name );
QString name() const;
QString autoName() const;
// Implementation of RiuViewerToViewInterface
cvf::Color3f backgroundColor() const override
{
return m_backgroundColor();
}
void setMeshOnlyDrawstyle();
void setMeshSurfDrawstyle();
void setSurfOnlyDrawstyle();
void setFaultMeshSurfDrawstyle();
void setSurfaceDrawstyle();
void setShowGridBox( bool showGridBox );
virtual bool isShowingActiveCellsOnly();
virtual bool isGridVisualizationMode() const = 0;
void setMeshOnlyDrawstyle();
void setMeshSurfDrawstyle();
void setSurfOnlyDrawstyle();
void setFaultMeshSurfDrawstyle();
void setSurfaceDrawstyle();
void setBackgroundColor( const cvf::Color3f& newBackgroundColor );
void setShowGridBox( bool showGridBox );
void applyBackgroundColorAndFontChanges();
void setBackgroundColor( const cvf::Color3f& newBackgroundColor );
cvf::Color3f backgroundColor() const override; // Implementation of RiuViewerToViewInterface
void applyBackgroundColorAndFontChanges();
bool hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const override;
bool applyFontSize( RiaDefines::FontSettingType fontSettingType,
int oldFontSize,
int fontSize,
bool forceChange = false ) override;
void disableLighting( bool disable );
bool isLightingDisabled() const;
virtual bool isGridVisualizationMode() const = 0;
void setScaleZAndUpdate( double scaleZ );
virtual bool showActiveCellsOnly();
virtual bool isUsingFormationNames() const = 0;
virtual bool isUsingFormationNames() const = 0;
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const override;
virtual std::vector<RimLegendConfig*> legendConfigs() const = 0;
QImage snapshotWindowContent() override;
void zoomAll() override;
void forceShowWindowOn();
// Animation
int currentTimeStep() const
{
return m_currentTimeStep;
}
void setCurrentTimeStep( int frameIdx );
void setCurrentTimeStepAndUpdate( int frameIdx ) override;
bool isTimeStepDependentDataVisibleInThisOrComparisonView() const;
virtual bool isTimeStepDependentDataVisible() const = 0;
int currentTimeStep() const;
void setCurrentTimeStep( int frameIdx );
void setCurrentTimeStepAndUpdate( int frameIdx ) override;
bool isTimeStepDependentDataVisibleInThisOrComparisonView() const;
// Updating
void updateCurrentTimeStepAndRedraw() override;
virtual void scheduleGeometryRegen( RivCellSetEnum geometryType ) = 0;
void scheduleCreateDisplayModelAndRedraw();
virtual void scheduleGeometryRegen( RivCellSetEnum geometryType ) = 0;
void createDisplayModelAndRedraw();
void createHighlightAndGridBoxDisplayModelWithRedraw();
void updateDisplayModelForCurrentTimeStepAndRedraw();
void createHighlightAndGridBoxDisplayModelAndRedraw();
void createMeasurementDisplayModelAndRedraw();
void updateGridBoxData();
void updateAnnotationItems();
void setScaleZAndUpdate( double scaleZ );
void updateScaling();
void updateZScaleLabel();
void createMeasurementDisplayModelAndRedraw();
bool isMasterView() const;
Rim3dView* activeComparisonView() const;
bool isScaleZEditable();
void setComparisonView(Rim3dView* compView);
bool isScaleZEditable();
bool isMasterView() const;
Rim3dView* activeComparisonView() const;
void setComparisonView( Rim3dView* compView );
std::set<Rim3dView*> viewsUsingThisAsComparisonView();
cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const override;
virtual RimCase* ownerCase() const = 0;
virtual std::vector<RimLegendConfig*> legendConfigs() const = 0;
bool hasCustomFontSizes( RiaDefines::FontSettingType fontSettingType, int defaultFontSize ) const override;
bool applyFontSize( RiaDefines::FontSettingType fontSettingType,
int oldFontSize,
int fontSize,
bool forceChange = false ) override;
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
protected:
static void removeModelByName( cvf::Scene* scene, const cvf::String& modelName );
virtual void setDefaultView();
void disableGridBoxField();
void disablePerspectiveProjectionField();
cvf::Mat4d cameraPosition() const;
cvf::Vec3d cameraPointOfInterest() const;
RimViewNameConfig* nameConfig() const;
RimWellPathCollection* wellPathCollection() const;
bool hasVisibleTimeStepDependent3dWellLogCurves() const;
void addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
const cvf::BoundingBox& wellPathClipBoundingBox );
void disableGridBoxField();
void disablePerspectiveProjectionField();
void updateDisplayModelVisibility();
bool hasVisibleTimeStepDependent3dWellLogCurves() const;
RimWellPathCollection* wellPathCollection() const;
void addWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
const cvf::BoundingBox& wellPathClipBoundingBox );
void addDynamicWellPathsToModel( cvf::ModelBasicList* wellPathModelBasicList,
const cvf::BoundingBox& wellPathClipBoundingBox );
void addAnnotationsToModel( cvf::ModelBasicList* wellPathModelBasicList );
void addMeasurementToModel( cvf::ModelBasicList* wellPathModelBasicList );
void addAnnotationsToModel( cvf::ModelBasicList* annotationsModel );
void addMeasurementToModel( cvf::ModelBasicList* measureModel );
// Override viewer
RiuViewer* nativeOrOverrideViewer() const;
bool isUsingOverrideViewer() const;
// Implementation of RimNameConfigHolderInterface
void performAutoNameUpdate() override;
// Abstract methods to implement in subclasses
virtual void axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) = 0;
virtual void onCreateDisplayModel() = 0;
virtual void onUpdateDisplayModelForCurrentTimeStep() = 0;
virtual void onUpdateDisplayModelVisibility(){};
virtual void onClampCurrentTimestep() = 0;
virtual void onClearReservoirCellVisibilitiesIfNeccessary(){};
virtual bool isTimeStepDependentDataVisible() const = 0;
virtual void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) = 0;
virtual void onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) = 0;
virtual void onUpdateStaticCellColors() = 0;
virtual void onResetLegendsInViewer() = 0;
virtual void onUpdateLegends() = 0;
virtual void createDisplayModel() = 0;
virtual void updateDisplayModelVisibility();
virtual void clampCurrentTimestep() = 0;
virtual void updateCurrentTimeStep() = 0;
virtual void onTimeStepChanged() = 0;
virtual void createPartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) = 0;
virtual void updateStaticCellColors() = 0;
virtual void updateScaleTransform() = 0;
virtual cvf::Transform* scaleTransform() = 0;
virtual void resetLegendsInViewer() = 0;
protected: // Fields
caf::PdmField<int> m_currentTimeStep;
virtual void onUpdateScaleTransform() = 0;
virtual cvf::Transform* scaleTransform() = 0;
protected:
cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel;
cvf::ref<cvf::ModelBasicList> m_crossSectionVizModel;
cvf::ref<cvf::ModelBasicList> m_highlightVizModel;
cvf::ref<RivWellPathsPartMgr> m_wellPathsPartManager;
cvf::ref<RivAnnotationsPartMgr> m_annotationsPartManager;
cvf::ref<RivMeasurementPartMgr> m_measurementPartManager;
private:
// Overridden PdmObject methods:
caf::PdmFieldHandle* userDescriptionField() override;
caf::PdmFieldHandle* backgroundColorField();
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void initAfterRead() override;
void setupBeforeSave() override;
protected:
caf::PdmFieldHandle* userDescriptionField() override;
caf::PdmFieldHandle* backgroundColorField()
{
return &m_backgroundColor;
}
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
// Overridden ViewWindow methods:
void updateViewWidgetAfterCreation() override;
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
void initAfterRead() override;
protected:
// Timestep Field. Children clamps this differently
caf::PdmField<int> m_currentTimeStep;
// 3D display model data
cvf::ref<cvf::ModelBasicList> m_wellPathPipeVizModel;
cvf::ref<cvf::ModelBasicList> m_crossSectionVizModel;
cvf::ref<RivWellPathsPartMgr> m_wellPathsPartManager;
private:
// Overridden ViewWindow methods:
void updateMdiWindowTitle() override;
void deleteViewWidget() override;
QWidget* viewWidget() override;
// Implementation of RiuViewerToViewInterface
void setCameraPosition( const cvf::Mat4d& cameraPosition ) override
{
m_cameraPosition = cameraPosition;
}
// Implementation of RimNameConfigHolderInterface
void performAutoNameUpdate() override final;
void setCameraPointOfInterest( const cvf::Vec3d& cameraPointOfInterest ) override
{
m_cameraPointOfInterest = cameraPointOfInterest;
}
// Implementation of RiuViewerToViewInterface
void setCameraPosition( const cvf::Mat4d& cameraPosition ) override;
void setCameraPointOfInterest( const cvf::Vec3d& cameraPointOfInterest ) override;
QString timeStepName( int frameIdx ) const override;
void endAnimation() override;
caf::PdmObjectHandle* implementingPdmObject() override
{
return this;
}
caf::PdmObjectHandle* implementingPdmObject() override;
void handleMdiWindowClosed() override;
void setMdiWindowGeometry( const RimMdiWindowGeometry& windowGeometry ) override;
@@ -295,23 +267,21 @@ private:
// Pure private methods
void createHighlightAndGridBoxDisplayModel();
void appendAnnotationsToModel();
void appendMeasurementToModel();
// Pure private methods : Override viewer and comparison view
void setOverrideViewer( RiuViewer* overrideViewer );
Rim3dView* prepareComparisonView();
void restoreComparisonView();
private:
QPointer<RiuViewer> m_viewer;
QPointer<RiuViewer> m_overrideViewer;
int m_comparisonViewOrgTimestep;
double m_comparisonViewOrgZScale;
bool m_isCallingUpdateTimestepAndRedraw; // To avoid infinite recursion if comparison views are pointing to each other.
bool m_isCallingUpdateDisplayModelForCurrentTimestepAndRedraw; // To avoid infinite recursion if comparison views are pointing to each other.
// Fields
caf::PdmField<QString> m_name_OBSOLETE;
caf::PdmChildField<RimViewNameConfig*> m_nameConfig;
@@ -322,4 +292,9 @@ private:
caf::PdmField<bool> m_showGridBox;
caf::PdmField<bool> m_showZScaleLabel;
caf::PdmPtrField<Rim3dView*> m_comparisonView;
// 3D display model data
cvf::ref<cvf::ModelBasicList> m_highlightVizModel;
cvf::ref<RivAnnotationsPartMgr> m_annotationsPartManager;
cvf::ref<RivMeasurementPartMgr> m_measurementPartManager;
};

View File

@@ -146,15 +146,6 @@ void RimEclipseContourMapView::updatePickPointAndRedraw()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseContourMapView::updateCurrentTimeStepAndRedraw()
{
m_contourMapProjection->clearGeometry();
RimEclipseView::updateCurrentTimeStepAndRedraw();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -173,9 +164,9 @@ void RimEclipseContourMapView::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseContourMapView::createDisplayModel()
void RimEclipseContourMapView::onCreateDisplayModel()
{
RimEclipseView::createDisplayModel();
RimEclipseView::onCreateDisplayModel();
if ( !this->isTimeStepDependentDataVisible() )
{
@@ -228,9 +219,11 @@ void RimEclipseContourMapView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseContourMapView::updateCurrentTimeStep()
void RimEclipseContourMapView::onUpdateDisplayModelForCurrentTimeStep()
{
static_cast<RimEclipsePropertyFilterCollection*>( nativePropertyFilterCollection() )->updateFromCurrentTimeStep();
m_contourMapProjection->clearGeometry();
updateGeometry();
}
@@ -251,7 +244,7 @@ void RimEclipseContourMapView::updateGeometry()
progress.setProgress( 30 );
}
updateLegends(); // To make sure the scalar mappers are set up correctly
onUpdateLegends(); // To make sure the scalar mappers are set up correctly
appendWellsAndFracturesToModel();
{ // Step 2: generate geometry. Takes about 60% of the time.
@@ -373,7 +366,7 @@ void RimEclipseContourMapView::appendPickPointVisToModel()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseContourMapView::updateLegends()
void RimEclipseContourMapView::onUpdateLegends()
{
if ( nativeOrOverrideViewer() )
{
@@ -459,7 +452,7 @@ void RimEclipseContourMapView::fieldChangedByUi( const caf::PdmFieldHandle* chan
}
else if ( changedField == &m_showScaleLegend )
{
updateLegends();
onUpdateLegends();
scheduleCreateDisplayModelAndRedraw();
}
}

View File

@@ -37,21 +37,20 @@ public:
QString createAutoName() const override;
void setDefaultCustomName();
void updatePickPointAndRedraw();
void updateCurrentTimeStepAndRedraw() override;
protected:
void initAfterRead() override;
void createDisplayModel() override;
void onCreateDisplayModel() override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
void updateCurrentTimeStep() override;
void onUpdateDisplayModelForCurrentTimeStep() override;
void updateGeometry();
void setFaultVisParameters();
void createContourMapGeometry();
void appendContourMapProjectionToModel();
void appendContourLinesToModel();
void appendPickPointVisToModel();
void updateLegends() override;
void onUpdateLegends() override;
void updateViewWidgetAfterCreation() override;
void updateViewFollowingRangeFilterUpdates() override;
void onLoadDataAndUpdate() override;

View File

@@ -255,7 +255,7 @@ RimVirtualPerforationResults* RimEclipseView::virtualPerforationResult() const
//--------------------------------------------------------------------------------------------------
/// Clamp the current timestep to actual possibilities
//--------------------------------------------------------------------------------------------------
void RimEclipseView::clampCurrentTimestep()
void RimEclipseView::onClampCurrentTimestep()
{
if ( this->currentGridCellResults() )
{
@@ -330,7 +330,7 @@ void RimEclipseView::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::updateScaleTransform()
void RimEclipseView::onUpdateScaleTransform()
{
cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
scale( 2, 2 ) = scaleZ();
@@ -346,7 +346,7 @@ void RimEclipseView::updateScaleTransform()
/// or at least empty scenes as frames that is delivered to the viewer
/// The real geometry generation is done inside RivReservoirViewGeometry and friends
//--------------------------------------------------------------------------------------------------
void RimEclipseView::createDisplayModel()
void RimEclipseView::onCreateDisplayModel()
{
clearReservoirCellVisibilities();
@@ -354,8 +354,8 @@ void RimEclipseView::createDisplayModel()
#if 0 // Debug info
static int callCount = 0;
std::cout << "RimReservoirView::createDisplayModel() " << callCount++ << std::endl;
RiuMainWindow::instance()->setResultInfo(QString("RimReservoirView::createDisplayModel() ") + QString::number(callCount++));
std::cout << "RimEclipseView::onCreateDisplayModel() " << callCount++ << std::endl;
RiuMainWindow::instance()->setResultInfo(QString("RimEclipseView::onCreateDisplayModel() ") + QString::number(callCount++));
#endif
if ( !( m_eclipseCase && m_eclipseCase->eclipseCaseData() ) ) return;
@@ -475,7 +475,7 @@ void RimEclipseView::createDisplayModel()
}
}
// Set static colors
this->updateStaticCellColors();
this->onUpdateStaticCellColors();
}
else
{
@@ -561,7 +561,7 @@ void RimEclipseView::createDisplayModel()
else
{
m_overlayInfoConfig()->update3DInfo();
updateLegends();
onUpdateLegends();
}
std::vector<RimFlowCharacteristicsPlot*> characteristicsPlots;
@@ -590,13 +590,13 @@ void RimEclipseView::createDisplayModel()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::updateCurrentTimeStep()
void RimEclipseView::onUpdateDisplayModelForCurrentTimeStep()
{
clearReservoirCellVisibilities();
m_propertyFilterCollection()->updateFromCurrentTimeStep();
updateLegends(); // To make sure the scalar mappers are set up correctly
onUpdateLegends(); // To make sure the scalar mappers are set up correctly
updateVisibleGeometriesAndCellColors();
@@ -868,7 +868,7 @@ void RimEclipseView::appendWellsAndFracturesToModel()
//--------------------------------------------------------------------------------------------------
void RimEclipseView::onLoadDataAndUpdate()
{
updateScaleTransform();
onUpdateScaleTransform();
if ( m_eclipseCase )
{
@@ -953,7 +953,7 @@ void RimEclipseView::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::updateStaticCellColors()
void RimEclipseView::onUpdateStaticCellColors()
{
updateStaticCellColors( OVERRIDDEN_CELL_VISIBILITY );
updateStaticCellColors( ACTIVE );
@@ -1070,10 +1070,8 @@ QString RimEclipseView::createAutoName() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::updateDisplayModelVisibility()
void RimEclipseView::onUpdateDisplayModelVisibility()
{
Rim3dView::updateDisplayModelVisibility();
faultCollection()->updateConnectedEditors();
// This is required to update the read-only state of simulation wells
@@ -1159,7 +1157,7 @@ std::vector<size_t> RimEclipseView::indicesToVisibleGrids() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::updateLegends()
void RimEclipseView::onUpdateLegends()
{
if ( nativeOrOverrideViewer() )
{
@@ -1560,7 +1558,7 @@ void RimEclipseView::updateDisplayModelForWellResults()
syncronizeWellsWithResults();
createDisplayModel();
onCreateDisplayModel();
updateDisplayModelVisibility();
if ( hasUserRequestedAnimation() && nativeOrOverrideViewer() )
@@ -1821,7 +1819,7 @@ RimEclipseCellColors* RimEclipseView::currentFaultResultColors()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::resetLegendsInViewer()
void RimEclipseView::onResetLegendsInViewer()
{
RimRegularLegendConfig* cellResultNormalLegendConfig = this->cellResult()->legendConfig();
if ( cellResultNormalLegendConfig ) cellResultNormalLegendConfig->recreateLegend();
@@ -1994,7 +1992,7 @@ std::vector<RimLegendConfig*> RimEclipseView::legendConfigs() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimEclipseView::showActiveCellsOnly()
bool RimEclipseView::isShowingActiveCellsOnly()
{
return !m_showInactiveCells;
}
@@ -2002,7 +2000,7 @@ bool RimEclipseView::showActiveCellsOnly()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::createPartCollectionFromSelection( cvf::Collection<cvf::Part>* parts )
void RimEclipseView::onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts )
{
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
std::vector<RiuSelectionItem*> items;
@@ -2047,7 +2045,7 @@ void RimEclipseView::updateIconStateForFilterCollections()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseView::axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel )
void RimEclipseView::defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel )
{
CVF_ASSERT( xLabel && yLabel && zLabel );

View File

@@ -135,7 +135,7 @@ public:
const QVariant& newValue ) override;
void updateIconStateForFilterCollections();
void axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
bool isUsingFormationNames() const override;
@@ -153,40 +153,40 @@ protected:
void onLoadDataAndUpdate() override;
caf::PdmFieldHandle* userDescriptionField() override;
void createPartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) override;
bool showActiveCellsOnly() override;
void updateCurrentTimeStep() override;
void onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) override;
bool isShowingActiveCellsOnly() override;
void onUpdateDisplayModelForCurrentTimeStep() override;
void updateVisibleGeometriesAndCellColors();
void appendWellsAndFracturesToModel();
void createDisplayModel() override;
void onCreateDisplayModel() override;
RimPropertyFilterCollection* nativePropertyFilterCollection();
virtual std::set<RivCellSetEnum> allVisibleFaultGeometryTypes() const;
private:
QString createAutoName() const override;
void updateDisplayModelVisibility() override;
void onUpdateDisplayModelVisibility() override;
std::vector<size_t> indicesToVisibleGrids() const;
void updateScaleTransform() override;
void onUpdateScaleTransform() override;
cvf::Transform* scaleTransform() override;
void updateStaticCellColors() override;
void onUpdateStaticCellColors() override;
void updateStaticCellColors( RivCellSetEnum geometryType );
void updateLegends() override;
void onUpdateLegends() override;
void updateMinMaxValuesAndAddLegendToView( QString legendLabel,
RimEclipseCellColors* resultColors,
RigCaseCellResultsData* cellResultsData );
void resetLegendsInViewer() override;
void onResetLegendsInViewer() override;
void updateVirtualConnectionLegendRanges();
void updateFaultColors();
void syncronizeWellsWithResults();
void clampCurrentTimestep() override;
void onClampCurrentTimestep() override;
void setVisibleGridParts( const std::vector<RivCellSetEnum>& cellSets );
void setVisibleGridPartsWatertight();

View File

@@ -142,15 +142,6 @@ void RimGeoMechContourMapView::updatePickPointAndRedraw()
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechContourMapView::updateCurrentTimeStepAndRedraw()
{
m_contourMapProjection->clearGeometry();
RimGeoMechView::updateCurrentTimeStepAndRedraw();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -185,9 +176,9 @@ void RimGeoMechContourMapView::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechContourMapView::createDisplayModel()
void RimGeoMechContourMapView::onCreateDisplayModel()
{
RimGeoMechView::createDisplayModel();
RimGeoMechView::onCreateDisplayModel();
if ( !this->isTimeStepDependentDataVisible() )
{
@@ -237,8 +228,10 @@ void RimGeoMechContourMapView::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiT
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechContourMapView::updateCurrentTimeStep()
void RimGeoMechContourMapView::onUpdateDisplayModelForCurrentTimeStep()
{
m_contourMapProjection->clearGeometry();
updateGeometry();
}
@@ -254,7 +247,7 @@ void RimGeoMechContourMapView::updateGeometry()
{
m_contourMapProjection->generateResultsIfNecessary( m_currentTimeStep() );
}
updateLegends();
onUpdateLegends();
progress.setProgress( 30 );
}
@@ -366,7 +359,7 @@ void RimGeoMechContourMapView::appendPickPointVisToModel()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechContourMapView::updateLegends()
void RimGeoMechContourMapView::onUpdateLegends()
{
if ( nativeOrOverrideViewer() )
{
@@ -452,7 +445,7 @@ void RimGeoMechContourMapView::fieldChangedByUi( const caf::PdmFieldHandle* chan
}
else if ( changedField == &m_showScaleLegend )
{
updateLegends();
onUpdateLegends();
scheduleCreateDisplayModelAndRedraw();
}
}

View File

@@ -37,23 +37,22 @@ public:
QString createAutoName() const override;
void setDefaultCustomName();
void updatePickPointAndRedraw();
void updateCurrentTimeStepAndRedraw() override;
bool isGridVisualizationMode() const override;
bool isTimeStepDependentDataVisible() const override;
protected:
void initAfterRead() override;
void createDisplayModel() override;
void onCreateDisplayModel() override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
void updateCurrentTimeStep() override;
void onUpdateDisplayModelForCurrentTimeStep() override;
void updateGeometry();
void createContourMapGeometry();
void appendContourMapProjectionToModel();
void appendContourLinesToModel();
void appendPickPointVisToModel();
void updateLegends() override;
void onUpdateLegends() override;
void updateViewWidgetAfterCreation() override;
void updateViewFollowingRangeFilterUpdates() override;
void onLoadDataAndUpdate() override;

View File

@@ -124,7 +124,7 @@ void RimGeoMechView::onLoadDataAndUpdate()
{
caf::ProgressInfo progress( 7, "" );
progress.setNextProgressIncrement( 5 );
updateScaleTransform();
onUpdateScaleTransform();
if ( m_geomechCase )
{
@@ -181,7 +181,7 @@ void RimGeoMechView::onLoadDataAndUpdate()
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::updateScaleTransform()
void RimGeoMechView::onUpdateScaleTransform()
{
cvf::Mat4d scale = cvf::Mat4d::IDENTITY;
scale( 2, 2 ) = scaleZ();
@@ -231,7 +231,7 @@ QString RimGeoMechView::createAutoName() const
/// or at least empty scenes as frames that is delivered to the viewer
/// The real geometry generation is done inside RivReservoirViewGeometry and friends
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::createDisplayModel()
void RimGeoMechView::onCreateDisplayModel()
{
if ( nativeOrOverrideViewer() == nullptr ) return;
@@ -297,7 +297,7 @@ void RimGeoMechView::createDisplayModel()
}
else
{
updateLegends();
onUpdateLegends();
m_vizLogic->updateStaticCellColors( -1 );
m_crossSectionCollection->applySingleColorEffect();
@@ -316,9 +316,9 @@ RimPropertyFilterCollection* RimGeoMechView::nativePropertyFilterCollection()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::updateCurrentTimeStep()
void RimGeoMechView::onUpdateDisplayModelForCurrentTimeStep()
{
updateLegends();
onUpdateLegends();
if ( this->isTimeStepDependentDataVisibleInThisOrComparisonView() )
{
@@ -402,7 +402,7 @@ void RimGeoMechView::updateCurrentTimeStep()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::updateStaticCellColors()
void RimGeoMechView::onUpdateStaticCellColors()
{
m_vizLogic->updateStaticCellColors( -1 );
}
@@ -419,7 +419,7 @@ void RimGeoMechView::setGeoMechCase( RimGeoMechCase* gmCase )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::resetLegendsInViewer()
void RimGeoMechView::onResetLegendsInViewer()
{
this->cellResult()->legendConfig->recreateLegend();
@@ -430,7 +430,7 @@ void RimGeoMechView::resetLegendsInViewer()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::updateLegends()
void RimGeoMechView::onUpdateLegends()
{
if ( nativeOrOverrideViewer() )
{
@@ -711,7 +711,7 @@ RimGeoMechCase* RimGeoMechView::geoMechCase() const
//--------------------------------------------------------------------------------------------------
/// Clamp the current timestep to actual possibilities
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::clampCurrentTimestep()
void RimGeoMechView::onClampCurrentTimestep()
{
int maxFrameCount = 0;
@@ -852,7 +852,7 @@ void RimGeoMechView::calculateCurrentTotalCellVisibility( cvf::UByteArray* total
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::createPartCollectionFromSelection( cvf::Collection<cvf::Part>* parts )
void RimGeoMechView::onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts )
{
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
std::vector<RiuSelectionItem*> items;
@@ -892,7 +892,7 @@ void RimGeoMechView::updateIconStateForFilterCollections()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGeoMechView::axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel )
void RimGeoMechView::defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel )
{
CVF_ASSERT( xLabel && yLabel && zLabel );

View File

@@ -83,7 +83,7 @@ public:
void scheduleGeometryRegen( RivCellSetEnum geometryType ) override;
void updateIconStateForFilterCollections();
void axisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
void defineAxisLabels( cvf::String* xLabel, cvf::String* yLabel, cvf::String* zLabel ) override;
bool isUsingFormationNames() const override;
@@ -111,23 +111,24 @@ protected:
const QVariant& newValue ) override;
void initAfterRead() override;
void createPartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) override;
void createDisplayModel() override;
void onCreatePartCollectionFromSelection( cvf::Collection<cvf::Part>* parts ) override;
void onCreateDisplayModel() override;
RimPropertyFilterCollection* nativePropertyFilterCollection();
private:
QString createAutoName() const override;
void updateScaleTransform() override;
void onUpdateScaleTransform() override;
void clampCurrentTimestep() override;
void onClampCurrentTimestep() override;
void updateCurrentTimeStep() override;
void updateStaticCellColors() override;
void onUpdateDisplayModelForCurrentTimeStep() override;
void onUpdateStaticCellColors() override;
void resetLegendsInViewer() override;
void onResetLegendsInViewer() override;
void updateLegends() override;
void onUpdateLegends() override;
void updateTensorLegendTextAndRanges( RimRegularLegendConfig* legendConfig, int timeStepIndex );

View File

@@ -120,7 +120,7 @@ void RimGridView::showGridCells( bool enableGridCells )
{
m_gridCollection->setActive( enableGridCells );
createDisplayModel();
onCreateDisplayModel();
updateDisplayModelVisibility();
RiuMainWindow::instance()->refreshDrawStyleActions();
RiuMainWindow::instance()->refreshAnimationActions();
@@ -390,7 +390,7 @@ void RimGridView::initAfterRead()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridView::onTimeStepChanged()
void RimGridView::onClearReservoirCellVisibilitiesIfNeccessary()
{
if ( this->propertyFilterCollection() && this->propertyFilterCollection()->hasActiveDynamicFilters() )
{

View File

@@ -72,7 +72,7 @@ public:
protected:
virtual void updateViewFollowingRangeFilterUpdates();
void initAfterRead() override;
void onTimeStepChanged() override;
void onClearReservoirCellVisibilitiesIfNeccessary() override;
virtual void calculateCurrentTotalCellVisibility( cvf::UByteArray* totalVisibility, int timeStep ) = 0;
void selectOverlayInfoConfig() override;

View File

@@ -311,6 +311,13 @@ void RimIntersectionBox::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
{
m_boxManipulator = new RicBoxManipulatorEventHandler( viewer() );
Rim3dView* rimView = nullptr;
this->firstAncestorOrThisOfType( rimView );
for (Rim3dView * mainView : rimView->viewsUsingThisAsComparisonView())
{
m_boxManipulator->registerInAdditionalViewer( mainView->viewer());
}
connect( m_boxManipulator, SIGNAL( notifyRedraw() ), this, SLOT( slotScheduleRedraw() ) );
connect( m_boxManipulator,
SIGNAL( notifyUpdate( const cvf::Vec3d&, const cvf::Vec3d& ) ),

View File

@@ -267,7 +267,7 @@ void RimRegularLegendConfig::fieldChangedByUi( const caf::PdmFieldHandle* change
viewLinker->updateCellResult();
}
view->updateCurrentTimeStepAndRedraw();
view->updateDisplayModelForCurrentTimeStepAndRedraw();
view->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
}

View File

@@ -188,7 +188,7 @@ void RimScaleLegendConfig::fieldChangedByUi( const caf::PdmFieldHandle* changedF
viewLinker->updateCellResult();
}
view->updateCurrentTimeStepAndRedraw();
view->updateDisplayModelForCurrentTimeStepAndRedraw();
view->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
}

View File

@@ -158,7 +158,7 @@ void RimTernaryLegendConfig::fieldChangedByUi( const caf::PdmFieldHandle* change
viewLinker->updateCellResult();
}
view->updateCurrentTimeStepAndRedraw();
view->updateDisplayModelForCurrentTimeStepAndRedraw();
view->crossSectionCollection()->scheduleCreateDisplayModelAndRedraw2dIntersectionViews();
}
}

View File

@@ -1230,7 +1230,7 @@ void RiuMainWindow::slotViewFromBelow()
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
{
if ( blockSubWindowActivation() ) return;
if ( isBlockingSubWindowActivatedSignal() ) return;
Rim3dView* previousActiveReservoirView = RiaApplication::instance()->activeReservoirView();
Rim3dView* activatedView = dynamic_cast<Rim3dView*>( findViewWindowFromSubWindow( subWindow ) );
@@ -1238,9 +1238,9 @@ void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
if ( !activatedView ) return;
RiaApplication::instance()->setActiveReservoirView( activatedView );
if ( !blockSubWindowProjectTreeSelection() )
if ( !isBlockingViewSelectionOnSubWindowActivated() )
{
selectViewInProjectTree( previousActiveReservoirView, activatedView );
selectViewInProjectTreePreservingSubItemSelection( previousActiveReservoirView, activatedView );
}
slotRefreshViewActions();
@@ -1251,7 +1251,8 @@ void RiuMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView )
void RiuMainWindow::selectViewInProjectTreePreservingSubItemSelection( const Rim3dView* previousActiveReservoirView,
Rim3dView* activatedView )
{
bool is3dViewCurrentlySelected = false;
if ( caf::SelectionManager::instance()->selectedItem() )
@@ -1442,9 +1443,9 @@ void RiuMainWindow::selectedObjectsChanged()
// Set focus in MDI area to this window if it exists
if ( selectedReservoirView->viewer() )
{
setBlockSubWindowProjectTreeSelection( true );
setBlockViewSelectionOnSubWindowActivated( true );
setActiveViewer( selectedReservoirView->viewer()->layoutWidget() );
setBlockSubWindowProjectTreeSelection( false );
setBlockViewSelectionOnSubWindowActivated( false );
isActiveViewChanged = true;
}
@@ -2001,14 +2002,14 @@ void RiuMainWindow::tileSubWindows()
// Based on workaround described here
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
bool prevActivationBlock = blockSubWindowActivation();
bool prevActivationBlock = isBlockingSubWindowActivatedSignal();
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
// Force activation order so they end up in the order of the loop.
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
// Activate in reverse order
for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it )
@@ -2020,7 +2021,7 @@ void RiuMainWindow::tileSubWindows()
// Set back the original activation order to avoid messing with the standard ordering
m_mdiArea->setActivationOrder( currentActivationOrder );
m_mdiArea->setActiveSubWindow( a );
setBlockSubWindowActivation( prevActivationBlock );
setBlockSubWindowActivatedSignal( prevActivationBlock );
storeSubWindowTiling( true );
}
@@ -2039,7 +2040,7 @@ void RiuMainWindow::storeSubWindowTiling( bool tiled )
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::clearWindowTiling()
{
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
@@ -2048,7 +2049,7 @@ void RiuMainWindow::clearWindowTiling()
subWindow->showNormal();
}
storeSubWindowTiling( false );
setBlockSubWindowActivation( false );
setBlockSubWindowActivatedSignal( false );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -233,11 +233,13 @@ private slots:
void slotBuildWindowActions();
void slotSubWindowActivated( QMdiSubWindow* subWindow );
void selectViewInProjectTree( const Rim3dView* previousActiveReservoirView, Rim3dView* activatedView );
void selectedObjectsChanged();
void customMenuRequested( const QPoint& pos );
private:
void selectViewInProjectTreePreservingSubItemSelection( const Rim3dView* previousActiveReservoirView,
Rim3dView* activatedView );
// Pdm System :
public:
void setPdmRoot( caf::PdmObject* pdmRoot );

View File

@@ -246,7 +246,7 @@ void RiuMainWindowBase::enableShowFirstVisibleMdiWindowMaximized( bool enable )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindowBase::setBlockSubWindowActivation( bool block )
void RiuMainWindowBase::setBlockSubWindowActivatedSignal( bool block )
{
m_blockSubWindowActivation = block;
}
@@ -254,7 +254,7 @@ void RiuMainWindowBase::setBlockSubWindowActivation( bool block )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuMainWindowBase::blockSubWindowActivation() const
bool RiuMainWindowBase::isBlockingSubWindowActivatedSignal() const
{
return m_blockSubWindowActivation;
}
@@ -262,7 +262,7 @@ bool RiuMainWindowBase::blockSubWindowActivation() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuMainWindowBase::setBlockSubWindowProjectTreeSelection( bool block )
void RiuMainWindowBase::setBlockViewSelectionOnSubWindowActivated( bool block )
{
m_blockSubWindowProjectTreeSelection = block;
}
@@ -270,7 +270,7 @@ void RiuMainWindowBase::setBlockSubWindowProjectTreeSelection( bool block )
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiuMainWindowBase::blockSubWindowProjectTreeSelection() const
bool RiuMainWindowBase::isBlockingViewSelectionOnSubWindowActivated() const
{
return m_blockSubWindowProjectTreeSelection;
}

View File

@@ -76,11 +76,11 @@ public:
virtual void clearWindowTiling() = 0;
virtual bool subWindowsAreTiled() const = 0;
void setBlockSubWindowActivation( bool block );
bool blockSubWindowActivation() const;
void setBlockSubWindowActivatedSignal( bool block );
bool isBlockingSubWindowActivatedSignal() const;
void setBlockSubWindowProjectTreeSelection( bool block );
bool blockSubWindowProjectTreeSelection() const;
void setBlockViewSelectionOnSubWindowActivated( bool block );
bool isBlockingViewSelectionOnSubWindowActivated() const;
protected:
void removeViewerFromMdiArea( QMdiArea* mdiArea, QWidget* viewer );

View File

@@ -58,7 +58,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent )
}
RiuMainWindowBase* mainWindow = dynamic_cast<RiuMainWindowBase*>( window() );
mainWindow->setBlockSubWindowActivation( true );
mainWindow->setBlockSubWindowActivatedSignal( true );
// Workaround for Qt bug #51761: https://bugreports.qt.io/browse/QTBUG-51761
// Set the first window to be the active window then perform resize event and set back.
@@ -70,7 +70,7 @@ void RiuMdiArea::resizeEvent( QResizeEvent* resizeEvent )
setActiveSubWindow( a );
mainWindow->setBlockSubWindowActivation( false );
mainWindow->setBlockSubWindowActivatedSignal( false );
for ( auto subWindow : subWindowList() )
{

View File

@@ -684,14 +684,14 @@ void RiuPlotMainWindow::setPdmRoot( caf::PdmObject* pdmRoot )
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::slotSubWindowActivated( QMdiSubWindow* subWindow )
{
if ( blockSubWindowActivation() ) return;
if ( isBlockingSubWindowActivatedSignal() ) return;
RimViewWindow* activatedView = findViewWindowFromSubWindow( subWindow );
if ( !activatedView ) return;
m_activePlotViewWindow = activatedView;
if ( !blockSubWindowProjectTreeSelection() )
if ( !isBlockingViewSelectionOnSubWindowActivated() )
{
std::vector<caf::PdmUiItem*> currentSelection;
m_projectTreeView->selectedUiItems( currentSelection );
@@ -809,9 +809,9 @@ void RiuPlotMainWindow::selectedObjectsChanged()
{
if ( selectedWindow->viewWidget() )
{
setBlockSubWindowProjectTreeSelection( true );
setBlockViewSelectionOnSubWindowActivated( true );
setActiveViewer( selectedWindow->viewWidget() );
setBlockSubWindowProjectTreeSelection( false );
setBlockViewSelectionOnSubWindowActivated( false );
}
m_activePlotViewWindow = selectedWindow;
@@ -913,12 +913,12 @@ void RiuPlotMainWindow::tileSubWindows()
// Based on workaround described here
// https://forum.qt.io/topic/50053/qmdiarea-tilesubwindows-always-places-widgets-in-activationhistoryorder-in-subwindowview-mode
bool prevActivationBlock = blockSubWindowActivation();
bool prevActivationBlock = isBlockingSubWindowActivatedSignal();
// Force activation order so they end up in the order of the loop.
m_mdiArea->setActivationOrder( QMdiArea::ActivationHistoryOrder );
QMdiSubWindow* a = m_mdiArea->activeSubWindow();
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
// Activate in reverse order
for ( auto it = windowList.rbegin(); it != windowList.rend(); ++it )
{
@@ -929,7 +929,7 @@ void RiuPlotMainWindow::tileSubWindows()
// Set back the original activation order to avoid messing with the standard ordering
m_mdiArea->setActivationOrder( currentActivationOrder );
m_mdiArea->setActiveSubWindow( a );
setBlockSubWindowActivation( prevActivationBlock );
setBlockSubWindowActivatedSignal( prevActivationBlock );
storeSubWindowTiling( true );
}
@@ -948,7 +948,7 @@ void RiuPlotMainWindow::storeSubWindowTiling( bool tiled )
//--------------------------------------------------------------------------------------------------
void RiuPlotMainWindow::clearWindowTiling()
{
setBlockSubWindowActivation( true );
setBlockSubWindowActivatedSignal( true );
QMdiArea::WindowOrder currentActivationOrder = m_mdiArea->activationOrder();
for ( QMdiSubWindow* subWindow : m_mdiArea->subWindowList( currentActivationOrder ) )
@@ -957,7 +957,7 @@ void RiuPlotMainWindow::clearWindowTiling()
subWindow->showNormal();
}
storeSubWindowTiling( false );
setBlockSubWindowActivation( false );
setBlockSubWindowActivatedSignal( false );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -323,7 +323,7 @@ void RiuSelectionChangedHandler::scheduleUpdateForAllVisibleViews() const
for ( size_t i = 0; i < visibleViews.size(); i++ )
{
visibleViews[i]->createHighlightAndGridBoxDisplayModelWithRedraw();
visibleViews[i]->createHighlightAndGridBoxDisplayModelAndRedraw();
visibleViews[i]->createMeasurementDisplayModelAndRedraw();
}
}

View File

@@ -319,7 +319,7 @@ void RiuViewer::slotSetCurrentFrame( int frameIndex )
for ( auto contView : containingViews )
{
contView->updateCurrentTimeStepAndRedraw();
contView->updateDisplayModelForCurrentTimeStepAndRedraw();
}
}
}

View File

@@ -57,8 +57,6 @@ public:
virtual cvf::ref<caf::DisplayCoordTransform> displayCoordTransform() const = 0;
virtual void setCurrentTimeStepAndUpdate( int frameIndex ) = 0;
virtual void updateCurrentTimeStepAndRedraw() = 0;
virtual void updateLegends() = 0;
virtual void endAnimation() = 0;
};

View File

@@ -201,10 +201,17 @@ void PdmUiListEditor::configureAndUpdateUi(const QString& uiConfigName)
{
uiObject->editorAttribute(uiField()->fieldHandle(), uiConfigName, &attributes);
QPalette myPalette(m_listView->palette());
myPalette.setColor(QPalette::Base, attributes.m_baseColor);
QPalette myPalette;
if (attributes.m_baseColor == myPalette.color(QPalette::Active, QPalette::Base))
{
m_listView->setStyleSheet("");
}
else
{
m_listView->setStyleSheet("background-color: " + attributes.m_baseColor.name() + ";");
}
m_listView->setPalette(myPalette);
m_listView->setHeightHint(attributes.m_heightHint);
if (!attributes.m_allowHorizontalScrollBar)
{

View File

@@ -60,6 +60,7 @@
#include "cvfRenderSequence.h"
#include "cvfRenderbufferObject.h"
#include "cvfRendering.h"
#include "cvfRenderingScissor.h"
#include "cvfScene.h"
#include "cvfShaderSourceProvider.h"
#include "cvfSingleQuadRenderingGenerator.h"
@@ -72,11 +73,11 @@
#include "cvfqtPerformanceInfoHud.h"
#include "cvfqtUtils.h"
#include <cmath>
#include <QDebug>
#include <QHBoxLayout>
#include <QInputEvent>
#include "cvfRenderingScissor.h"
#include <cmath>
namespace caf
{
@@ -550,7 +551,7 @@ bool caf::Viewer::calculateNearFarPlanes(const cvf::Rendering* rendering,
}
// Guard against the zero nearplane possibility
if ( nearPlaneDist <= 0 ) (*nearPlaneDist) = m_defaultPerspectiveNearPlaneDistance;
if ( (*nearPlaneDist) <= 0 ) (*nearPlaneDist) = m_defaultPerspectiveNearPlaneDistance;
}
else // Orthographic projection. Set to encapsulate the complete boundingbox, possibly setting a negative nearplane
{
@@ -641,6 +642,20 @@ const caf::NavigationPolicy* caf::Viewer::getNavigationPolicy() const
return m_navigationPolicy.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::RayIntersectSpec> caf::Viewer::rayIntersectSpecFromWindowCoordinates( int winPosX, int winPosY )
{
bool mousePosIsWithinComparisonView = isMousePosWithinComparisonView(winPosX, winPosY);
int translatedMousePosX = winPosX;
int translatedMousePosY = height() - winPosY;
cvf::Rendering* renderingToInvestigate = mousePosIsWithinComparisonView ? m_comparisonMainRendering.p(): m_mainRendering.p();
return renderingToInvestigate->rayIntersectSpecFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
}
//--------------------------------------------------------------------------------------------------
///
@@ -649,14 +664,12 @@ bool caf::Viewer::rayPick(int winPosX, int winPosY, cvf::HitItemCollection* pick
{
CVF_ASSERT(m_mainRendering.notNull());
int translatedMousePosX = winPosX;
int translatedMousePosY = height() - winPosY;
bool mousePosIsWithinComparisonView = isMousePosWithinComparisonView(winPosX, winPosY);
cvf::Rendering* renderingToInvestigate = mousePosIsWithinComparisonView ? m_comparisonMainRendering.p(): m_mainRendering.p();
cvf::ref<cvf::RayIntersectSpec> ris = renderingToInvestigate->rayIntersectSpecFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
cvf::ref<cvf::RayIntersectSpec> ris = rayIntersectSpecFromWindowCoordinates(winPosX, winPosY);
if (ris.notNull())
{
bool retVal = renderingToInvestigate->rayIntersect(*ris, pickedPoints);
@@ -973,7 +986,7 @@ void caf::Viewer::setCurrentComparisonFrame(int frameIndex)
{
if (m_frameScenes.size() == 0) return;
int clampedFrameIndex = clampFrameIndex(frameIndex);
unsigned clampedFrameIndex = static_cast<unsigned>(clampFrameIndex(frameIndex));
if (m_releaseOGLResourcesEachFrame)
{
@@ -1007,9 +1020,7 @@ void caf::Viewer::slotSetCurrentFrame(int frameIndex)
{
if (m_frameScenes.size() == 0) return;
int clampedFrameIndex = clampFrameIndex(frameIndex);
//if (m_frameScenes.at(clampedFrameIndex) == nullptr) return;
unsigned clampedFrameIndex = static_cast<unsigned>(clampFrameIndex(frameIndex));
if (m_releaseOGLResourcesEachFrame)
{

View File

@@ -61,6 +61,7 @@ namespace cvf {
class Scene;
class Texture;
class TextureImage;
class RayIntersectSpec;
}
namespace caf {
@@ -150,6 +151,7 @@ public:
// Test whether it is any point in doing navigation etc.
bool canRender() const;
cvf::ref<cvf::RayIntersectSpec> rayIntersectSpecFromWindowCoordinates(int winPosX, int winPosY);
bool rayPick(int winPosX, int winPosY, cvf::HitItemCollection* pickedPoints, cvf::Vec3d* rayGlobalOrigin = nullptr) ;
bool isMousePosWithinComparisonView(int winPosX, int winPosY);

View File

@@ -0,0 +1,62 @@
@startuml
actor RedrawScheduler
box "Rim3dView" #White
participant createDisplayModelAndRedraw order 10
participant setCurrentTimeStepAndUpdate order 20
end box
box "RimSpecialView" #LightBlue
participant createDisplayModel order 20
participant onUpdateCurrentTimeStep order 30
end box
box "RiuViewer" #LightBlue
participant setCurrentFrame order 40
end box
box "Rim3dView Comparison" #LightGray
participant createDisplayModelAndRedraw_c order 45
end box
box "RimSpecialView Comparison" #LightGray
participant onUpdateCurrentTimeStep_c order 50
participant createDisplayModel_c order 60
end box
RedrawScheduler -> createDisplayModelAndRedraw ++
createDisplayModelAndRedraw -> createDisplayModel ++
createDisplayModel -> setCurrentFrame ++
setCurrentFrame -> setCurrentTimeStepAndUpdate
activate setCurrentTimeStepAndUpdate
setCurrentTimeStepAndUpdate -> onUpdateCurrentTimeStep ++
onUpdateCurrentTimeStep --> setCurrentTimeStepAndUpdate -- : return
setCurrentTimeStepAndUpdate -> onUpdateCurrentTimeStep_c ++
onUpdateCurrentTimeStep_c --> setCurrentTimeStepAndUpdate --
setCurrentTimeStepAndUpdate --> setCurrentFrame --: return
setCurrentFrame --> createDisplayModel --: return
createDisplayModel --> createDisplayModelAndRedraw --: return
createDisplayModelAndRedraw -> createDisplayModelAndRedraw_c ++
createDisplayModelAndRedraw_c -> createDisplayModel_c++
createDisplayModel_c --> createDisplayModelAndRedraw_c-- : return
createDisplayModelAndRedraw_c --> createDisplayModelAndRedraw -- : return
createDisplayModelAndRedraw -> onUpdateCurrentTimeStep_c ++
onUpdateCurrentTimeStep_c --> createDisplayModelAndRedraw --: return
createDisplayModelAndRedraw --> RedrawScheduler -- : return
@enduml