Whitespace

This commit is contained in:
Magne Sjaastad
2018-09-12 14:24:24 +02:00
parent fce3d586ca
commit a1518bd9ec
2 changed files with 93 additions and 74 deletions

View File

@@ -31,12 +31,13 @@
#include "RimEclipseCase.h"
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
#include "RimSimWellInViewCollection.h"
#include "RimRegularLegendConfig.h"
#include "RimReservoirCellResultsStorage.h"
#include "RimSimWellInViewCollection.h"
#include "RimTernaryLegendConfig.h"
#include "RivCellEdgeEffectGenerator.h"
#include "RivCompletionTypeResultToTextureMapper.h"
#include "RivPartPriority.h"
#include "RivResultToTextureMapper.h"
#include "RivScalarMapperUtils.h"
@@ -44,7 +45,6 @@
#include "RivTernaryScalarMapperEffectGenerator.h"
#include "RivTernaryTextureCoordsCreator.h"
#include "RivTextureCoordsCreator.h"
#include "RivCompletionTypeResultToTextureMapper.h"
#include "cafEffectGenerator.h"
#include "cafPdmFieldCvfColor.h"
@@ -55,9 +55,9 @@
#include "cvfMath.h"
#include "cvfModelBasicList.h"
#include "cvfPart.h"
#include "cvfRenderState_FF.h"
#include "cvfRenderStateBlending.h"
#include "cvfRenderStatePolygonOffset.h"
#include "cvfRenderState_FF.h"
#include "cvfShaderProgram.h"
#include "cvfShaderProgramGenerator.h"
#include "cvfShaderSourceProvider.h"
@@ -66,18 +66,16 @@
#include "cvfTransform.h"
#include "cvfUniform.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivGridPartMgr::RivGridPartMgr(const RigGridBase* grid, size_t gridIdx)
: m_surfaceGenerator(grid),
m_gridIdx(gridIdx),
m_grid(grid),
m_surfaceFaceFilter(grid),
m_opacityLevel(1.0f),
m_defaultColor(cvf::Color3::WHITE)
: m_surfaceGenerator(grid)
, m_gridIdx(gridIdx)
, m_grid(grid)
, m_surfaceFaceFilter(grid)
, m_opacityLevel(1.0f)
, m_defaultColor(cvf::Color3::WHITE)
{
CVF_ASSERT(grid);
m_cellVisibility = new cvf::UByteArray;
@@ -108,6 +106,9 @@ void RivGridPartMgr::setCellVisibility(cvf::UByteArray* cellVisibilities)
generatePartGeometry(m_surfaceGenerator);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGridPartMgr::generatePartGeometry(cvf::StructGridGeometryGenerator& geoBuilder)
{
bool useBufferObjects = true;
@@ -191,8 +192,8 @@ void RivGridPartMgr::appendPartsToModel(cvf::ModelBasicList* model)
{
CVF_ASSERT(model != nullptr);
if(m_surfaceFaces.notNull() ) model->addPart(m_surfaceFaces.p() );
if(m_surfaceGridLines.notNull()) model->addPart(m_surfaceGridLines.p());
if (m_surfaceFaces.notNull()) model->addPart(m_surfaceFaces.p());
if (m_surfaceGridLines.notNull()) model->addPart(m_surfaceGridLines.p());
}
//--------------------------------------------------------------------------------------------------
@@ -210,8 +211,10 @@ void RivGridPartMgr::updateCellColor(cvf::Color4f color)
cvf::ref<cvf::Effect> geometryOnlyEffect = geometryEffgen.generateCachedEffect();
m_surfaceFaces->setEffect(geometryOnlyEffect.p());
if (m_opacityLevel < 1.0f) m_surfaceFaces->setPriority(RivPartPriority::PartType::Transparent);
else m_surfaceFaces->setPriority(RivPartPriority::PartType::BaseLevel);
if (m_opacityLevel < 1.0f)
m_surfaceFaces->setPriority(RivPartPriority::PartType::Transparent);
else
m_surfaceFaces->setPriority(RivPartPriority::PartType::BaseLevel);
// Update mesh colors as well, in case of change
if (m_surfaceGridLines.notNull())
@@ -237,7 +240,8 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCellC
if (cellResultColors->isTernarySaturationSelected())
{
RivTernaryTextureCoordsCreator texturer(cellResultColors, cellResultColors->ternaryLegendConfig(),
RivTernaryTextureCoordsCreator texturer(cellResultColors,
cellResultColors->ternaryLegendConfig(),
timeStepIndex,
m_grid->gridIndex(),
m_surfaceGenerator.quadToCellFaceMapper());
@@ -254,10 +258,8 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCellC
}
else
{
RivTextureCoordsCreator texturer(cellResultColors,
timeStepIndex,
m_grid->gridIndex(),
m_surfaceGenerator.quadToCellFaceMapper());
RivTextureCoordsCreator texturer(
cellResultColors, timeStepIndex, m_grid->gridIndex(), m_surfaceGenerator.quadToCellFaceMapper());
if (!texturer.isValid())
{
return;
@@ -265,7 +267,8 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCellC
if (cellResultColors->isCompletionTypeSelected())
{
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval = RivTextureCoordsCreator::createPipeInCellEvaluator(cellResultColors, timeStepIndex, m_grid->gridIndex());
cvf::ref<RigPipeInCellEvaluator> pipeInCellEval =
RivTextureCoordsCreator::createPipeInCellEvaluator(cellResultColors, timeStepIndex, m_grid->gridIndex());
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
texturer.setResultToTextureMapper(new RivCompletionTypeResultToTextureMapper(mapper, pipeInCellEval.p()));
@@ -283,28 +286,43 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCellC
cellResultColors->reservoirView()->isLightingDisabled());
}
if (effectiveOpacityLevel < 1.0f) m_surfaceFaces->setPriority(RivPartPriority::PartType::Transparent);
else m_surfaceFaces->setPriority(RivPartPriority::PartType::BaseLevel);
if (effectiveOpacityLevel < 1.0f)
m_surfaceFaces->setPriority(RivPartPriority::PartType::Transparent);
else
m_surfaceFaces->setPriority(RivPartPriority::PartType::BaseLevel);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimEclipseCellColors* cellResultColors, RimCellEdgeColors* cellEdgeResultColors)
void RivGridPartMgr::updateCellEdgeResultColor(size_t timeStepIndex,
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors)
{
if (m_surfaceFaces.notNull())
{
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_surfaceFaces->drawable());
if (dg)
{
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_surfaceGenerator.quadToCellFaceMapper(), m_grid->gridIndex(),
timeStepIndex, cellResultColors, cellEdgeResultColors, m_opacityLevel, m_defaultColor, caf::FC_NONE, cellResultColors->reservoirView()->isLightingDisabled());
cvf::ref<cvf::Effect> eff =
RivScalarMapperUtils::createCellEdgeEffect(dg,
m_surfaceGenerator.quadToCellFaceMapper(),
m_grid->gridIndex(),
timeStepIndex,
cellResultColors,
cellEdgeResultColors,
m_opacityLevel,
m_defaultColor,
caf::FC_NONE,
cellResultColors->reservoirView()->isLightingDisabled());
m_surfaceFaces->setEffect(eff.p());
if (m_opacityLevel < 1.0f) m_surfaceFaces->setPriority(RivPartPriority::PartType::Transparent);
else m_surfaceFaces->setPriority(RivPartPriority::PartType::BaseLevel);
if (m_opacityLevel < 1.0f)
m_surfaceFaces->setPriority(RivPartPriority::PartType::Transparent);
else
m_surfaceFaces->setPriority(RivPartPriority::PartType::BaseLevel);
}
}
}
@@ -321,5 +339,3 @@ RivGridPartMgr::~RivGridPartMgr()
if (m_surfaceFaces.notNull()) m_surfaceFaces->deleteOrReleaseOpenGLResources();
#endif
}

View File

@@ -19,11 +19,13 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RigGridBase.h"
#include "cvfBase.h"
#include "cvfObject.h"
#include "cvfStructGridGeometryGenerator.h"
#include "RigGridBase.h"
namespace cvf
{
@@ -59,7 +61,8 @@ public:
void updateCellColor(cvf::Color4f color);
void updateCellResultColor(size_t timeStepIndex, RimEclipseCellColors* cellResultColors);
void updateCellEdgeResultColor(size_t timeStepIndex, RimEclipseCellColors* cellResultColors,
void updateCellEdgeResultColor(size_t timeStepIndex,
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors);
void appendPartsToModel(cvf::ModelBasicList* model);