(#408) Save and restore MDI window size and position

This commit is contained in:
Magne Sjaastad
2015-09-01 22:11:39 +02:00
parent 107d3ff65a
commit b29ad69673
4 changed files with 58 additions and 9 deletions

View File

@@ -99,6 +99,9 @@ RimView::RimView(void)
CAF_PDM_InitField(&m_disableLighting, "DisableLighting", false, "Disable Results Lighting", "", "Disable light model for scalar result colors", "");
CAF_PDM_InitFieldNoDefault(&windowGeometry, "WindowGeometry", "", "", "", "");
windowGeometry.uiCapability()->setUiHidden(true);
m_previousGridModeMeshLinesWasFaults = false;
}
@@ -141,7 +144,7 @@ void RimView::updateViewerWidget()
m_viewer = new RiuViewer(glFormat, NULL);
m_viewer->setOwnerReservoirView(this);
RiuMainWindow::instance()->addViewer(m_viewer);
RiuMainWindow::instance()->addViewer(m_viewer, windowGeometry());
m_viewer->setMinNearPlaneDistance(10);
this->resetLegendsInViewer();
@@ -255,7 +258,9 @@ void RimView::setupBeforeSave()
{
hasUserRequestedAnimation = m_viewer->isAnimationActive(); // JJS: This is not conceptually correct. The variable is updated as we go, and store the user intentions. But I guess that in practice...
cameraPosition = m_viewer->mainCamera()->viewMatrix();
}
windowGeometry = RiuMainWindow::instance()->windowGeometryForViewer(m_viewer);
}
}
//--------------------------------------------------------------------------------------------------
@@ -588,3 +593,4 @@ void RimView::notifyCameraHasChanged()
}
}
}

View File

@@ -74,6 +74,9 @@ public:
void notifyCameraHasChanged();
caf::PdmField< std::vector<int> > windowGeometry;
// Draw style
enum MeshModeType