mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#973 Linked views : Propagate change of parallell/perspective flag
This commit is contained in:
parent
6367522593
commit
6adc7eab7c
@ -46,8 +46,11 @@ void RicTogglePerspectiveViewFeature::onActionTriggered(bool isChecked)
|
|||||||
{
|
{
|
||||||
bool isPerspective = RiaApplication::instance()->activeReservoirView()->isPerspectiveView();
|
bool isPerspective = RiaApplication::instance()->activeReservoirView()->isPerspectiveView();
|
||||||
RiaApplication::instance()->activeReservoirView()->isPerspectiveView = !isPerspective;
|
RiaApplication::instance()->activeReservoirView()->isPerspectiveView = !isPerspective;
|
||||||
RiaApplication::instance()->activeReservoirView()->viewer()->enableParallelProjection(isPerspective);
|
|
||||||
RiaApplication::instance()->activeReservoirView()->isPerspectiveView.uiCapability()->updateConnectedEditors();
|
RiaApplication::instance()->activeReservoirView()->isPerspectiveView.uiCapability()->updateConnectedEditors();
|
||||||
|
|
||||||
|
RiaApplication::instance()->activeReservoirView()->viewer()->enableParallelProjection(isPerspective);
|
||||||
|
RiaApplication::instance()->activeReservoirView()->viewer()->navigationPolicyUpdate();
|
||||||
|
|
||||||
this->action(); // Retrieve the action to update the looks
|
this->action(); // Retrieve the action to update the looks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -516,19 +516,21 @@ void RimViewLinker::updateCamera(RimView* sourceView)
|
|||||||
sourceSceneBB.transform(trans);
|
sourceSceneBB.transform(trans);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Propagate view matrix to all relevant views
|
for (RimView* destinationView : viewsToUpdate)
|
||||||
|
|
||||||
const cvf::Mat4d mat = sourceView->viewer()->mainCamera()->viewMatrix();
|
|
||||||
for (size_t i = 0; i < viewsToUpdate.size(); i++)
|
|
||||||
{
|
{
|
||||||
if (viewsToUpdate[i] && viewsToUpdate[i]->viewer())
|
if (!destinationView) continue;
|
||||||
|
|
||||||
|
destinationView->isPerspectiveView = sourceView->isPerspectiveView;
|
||||||
|
|
||||||
|
RiuViewer* destinationViewer = destinationView->viewer();
|
||||||
|
if (destinationViewer)
|
||||||
{
|
{
|
||||||
RiuViewer* destinationViewer = viewsToUpdate[i]->viewer();
|
destinationViewer->enableParallelProjection(!sourceView->isPerspectiveView);
|
||||||
|
|
||||||
// Destination bounding box in global coordinates including scaleZ
|
// Destination bounding box in global coordinates including scaleZ
|
||||||
cvf::BoundingBox destSceneBB = destinationViewer->currentScene()->boundingBox();
|
cvf::BoundingBox destSceneBB = destinationViewer->currentScene()->boundingBox();
|
||||||
|
|
||||||
RimEclipseView* destEclipseView = dynamic_cast<RimEclipseView*>(viewsToUpdate[i]);
|
RimEclipseView* destEclipseView = dynamic_cast<RimEclipseView*>(destinationView);
|
||||||
if (destEclipseView
|
if (destEclipseView
|
||||||
&& destEclipseView->eclipseCase()
|
&& destEclipseView->eclipseCase()
|
||||||
&& destEclipseView->eclipseCase()->reservoirData()
|
&& destEclipseView->eclipseCase()->reservoirData()
|
||||||
|
Loading…
Reference in New Issue
Block a user