mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
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:
43 files changed
+489
-382
No files matched your search
+1
-1
@@ -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();
|
||||
|
||||
+1
-1
@@ -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 );
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -171,7 +171,7 @@ void RicShowContributingWellsFeatureImpl::modifyViewToShowContributingWells( Rim
|
||||
viewToModify->faultCollection()->showFaultCollection = false;
|
||||
viewToModify->faultCollection()->updateConnectedEditors();
|
||||
|
||||
viewToModify->updateCurrentTimeStepAndRedraw();
|
||||
viewToModify->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
viewToModify->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
+1
-1
@@ -94,7 +94,7 @@ void RicPasteIntersectionsFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
if ( i == intersectionObjects.size() - 1 )
|
||||
{
|
||||
intersectionCollection->appendIntersectionAndUpdate( intersection );
|
||||
intersectionCollection->appendIntersectionAndUpdate( intersection, false );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -90,7 +90,7 @@ bool RicContourMapPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
return true;
|
||||
}
|
||||
contourMap->setPickPoint( cvf::Vec2d::UNDEFINED );
|
||||
view->updateCurrentTimeStepAndRedraw();
|
||||
view->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void RicFlyToObjectFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
destinationViewer->setPointOfInterest( cameraViewRefPoint );
|
||||
|
||||
activeView->updateCurrentTimeStepAndRedraw();
|
||||
activeView->updateDisplayModelForCurrentTimeStepAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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() )
|
||||
|
||||
Reference in new issue
Block a user