(#266) Refactoring

Limit usage of RivGridBoxGenerator to only RiuViewer
Update colors of grid box based on background color
Use dark gray instead of pure black
This commit is contained in:
Magne Sjaastad
2015-11-16 14:08:17 +01:00
parent a7656e2367
commit 401cfe81a1
9 changed files with 108 additions and 77 deletions

View File

@@ -23,6 +23,7 @@
#include "RiaApplication.h"
#include "RiaBaseDefs.h"
#include "RimCase.h"
#include "RimProject.h"
#include "RimView.h"
#include "RimViewController.h"
@@ -526,14 +527,6 @@ RimView* RiuViewer::ownerReservoirView()
return m_rimView;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGridBoxGenerator* RiuViewer::gridBoxGenerator() const
{
return m_gridBoxGenerator;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -598,3 +591,38 @@ void RiuViewer::resizeGL(int width, int height)
m_overlayRendering->camera()->viewport()->set(0, 0, width, height);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuViewer::updateGridBoxData()
{
if (ownerReservoirView() && ownerReservoirView()->ownerCase())
{
RimView* rimView = ownerReservoirView();
RimCase* rimCase = rimView->ownerCase();
m_gridBoxGenerator->setScaleZ(rimView->scaleZ);
m_gridBoxGenerator->setDisplayModelOffset(rimCase->displayModelOffset());
m_gridBoxGenerator->updateFromBackgroundColor(rimView->backgroundColor);
if (rimView->showActiveCellsOnly())
{
m_gridBoxGenerator->setGridBoxDomainCoordBoundingBox(rimCase->activeCellsBoundingBox());
}
else
{
m_gridBoxGenerator->setGridBoxDomainCoordBoundingBox(rimCase->allCellsBoundingBox());
}
m_gridBoxGenerator->createGridBoxParts();
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::Model* RiuViewer::gridBoxModel() const
{
return m_gridBoxGenerator->model();
}