mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-03 20:20:48 -06:00
Added background color setting to a view.
Requested by Statoil at 19.02.2013 p4#: 20611
This commit is contained in:
parent
7f01481393
commit
459f2a033b
@ -137,6 +137,9 @@ RimReservoirView::RimReservoirView()
|
||||
CAF_PDM_InitField(&showInactiveCells, "ShowInactiveCells", false, "Show Inactive Cells", "", "", "");
|
||||
CAF_PDM_InitField(&showInvalidCells, "ShowInvalidCells", false, "Show Invalid Cells", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&backgroundColor, "ViewBackgroundColor", cvf::Color3f(0.69f, 0.77f, 0.87f), "Viewer Background", "", "", "");
|
||||
|
||||
|
||||
CAF_PDM_InitField(&cameraPosition, "CameraPosition", cvf::Mat4d::IDENTITY, "", "", "", "");
|
||||
|
||||
|
||||
@ -220,6 +223,8 @@ void RimReservoirView::updateViewerWidget()
|
||||
RIMainWindow::instance()->setActiveViewer(m_viewer);
|
||||
|
||||
if (isViewerCreated) m_viewer->mainCamera()->setViewMatrix(cameraPosition);
|
||||
m_viewer->mainCamera()->viewport()->setClearColor(cvf::Color4f(backgroundColor()));
|
||||
|
||||
m_viewer->update();
|
||||
}
|
||||
else
|
||||
@ -358,6 +363,13 @@ void RimReservoirView::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
createDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
else if (changedField == &backgroundColor )
|
||||
{
|
||||
if (viewer() != NULL)
|
||||
{
|
||||
updateViewerWidget();
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_currentTimeStep)
|
||||
{
|
||||
if (m_viewer)
|
||||
|
@ -110,6 +110,8 @@ public:
|
||||
caf::PdmField< caf::AppEnum< MeshModeType > > meshMode;
|
||||
caf::PdmField< caf::AppEnum< SurfaceModeType > > surfaceMode;
|
||||
|
||||
caf::PdmField< cvf::Color3f > backgroundColor;
|
||||
|
||||
caf::PdmField<cvf::Mat4d> cameraPosition;
|
||||
|
||||
caf::PdmField<int> maximumFrameRate;
|
||||
|
Loading…
Reference in New Issue
Block a user