mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#552 : Linked Views: Cleanup
This commit is contained in:
@@ -490,6 +490,12 @@ void RimViewLinker::findNameAndIconFromView(QString* name, QIcon* icon, RimView*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimViewLinker::updateCursorPosition(const RimView* sourceView, const cvf::Vec3d& domainCoord)
|
||||
{
|
||||
RimViewController* sourceViewLink = sourceView->viewController();
|
||||
if (sourceViewLink && !sourceViewLink->showCursor())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<RimView*> viewsToUpdate;
|
||||
allViewsForCameraSync(sourceView, viewsToUpdate);
|
||||
|
||||
@@ -497,10 +503,13 @@ void RimViewLinker::updateCursorPosition(const RimView* sourceView, const cvf::V
|
||||
{
|
||||
if (destinationView == sourceView) continue;
|
||||
|
||||
RimViewController* viewLink = destinationView->viewController();
|
||||
if (!viewLink) continue;
|
||||
if (destinationView != m_masterView)
|
||||
{
|
||||
RimViewController* viewLink = destinationView->viewController();
|
||||
if (!viewLink) continue;
|
||||
|
||||
if (!viewLink->showCursor()) continue;
|
||||
if (!viewLink->showCursor()) continue;
|
||||
}
|
||||
|
||||
RiuViewer* destinationViewer = destinationView->viewer();
|
||||
if (destinationViewer)
|
||||
|
||||
@@ -685,27 +685,27 @@ void RiuViewer::resizeGL(int width, int height)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuViewer::mouseMoveEvent(QMouseEvent* mouseEvent)
|
||||
{
|
||||
int translatedMousePosX = mouseEvent->pos().x();
|
||||
int translatedMousePosY = height() - mouseEvent->pos().y();
|
||||
|
||||
cvf::Vec3d displayCoord(0, 0, 0);
|
||||
if (mainCamera()->unproject(cvf::Vec3d(static_cast<double>(translatedMousePosX), static_cast<double>(translatedMousePosY), 0), &displayCoord))
|
||||
if (m_rimView)
|
||||
{
|
||||
if (m_rimView)
|
||||
RimViewLinker* viewLinker = m_rimView->assosiatedViewLinker();
|
||||
if (viewLinker)
|
||||
{
|
||||
RimViewLinker* viewLinker = m_rimView->assosiatedViewLinker();
|
||||
if (viewLinker)
|
||||
int translatedMousePosX = mouseEvent->pos().x();
|
||||
int translatedMousePosY = height() - mouseEvent->pos().y();
|
||||
|
||||
cvf::Vec3d displayCoord(0, 0, 0);
|
||||
if (mainCamera()->unproject(cvf::Vec3d(static_cast<double>(translatedMousePosX), static_cast<double>(translatedMousePosY), 0), &displayCoord))
|
||||
{
|
||||
if (m_cursorPositionDomainCoords != cvf::Vec3d::UNDEFINED)
|
||||
{
|
||||
// Set undefined and redraw to make sure the cursor is not visible in the view
|
||||
// Reset the extra cursor if the view currently is receiving mouse cursor events
|
||||
// Set undefined and redraw to remove the previously displayed cursor
|
||||
m_cursorPositionDomainCoords = cvf::Vec3d::UNDEFINED;
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
cvf::ref<caf::DisplayCoordTransform> trans = m_rimView->displayCoordTransform();
|
||||
|
||||
cvf::Vec3d domainCoord = trans->transformToDomainCoord(displayCoord);
|
||||
|
||||
viewLinker->updateCursorPosition(m_rimView, domainCoord);
|
||||
|
||||
Reference in New Issue
Block a user