(#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();
}

View File

@@ -39,8 +39,9 @@ class QProgressBar;
namespace cvf
{
class Part;
class Model;
class OverlayItem;
class Part;
}
//==================================================================================================
@@ -71,7 +72,8 @@ public:
void setHistogram(double min, double max, const std::vector<size_t>& histogram);
void setHistogramPercentiles(double pmin, double pmax, double mean);
RivGridBoxGenerator* gridBoxGenerator() const;
void updateGridBoxData();
cvf::Model* gridBoxModel() const;
void showAnimationProgress(bool enable);
@@ -100,7 +102,6 @@ private:
void setupRenderingSequence();
static void copyCameraView(cvf::Camera* srcCamera, cvf::Camera* dstCamera);
private:
QLabel* m_InfoLabel;
QLabel* m_versionInfoLabel;