Replaced dataAccessObject with resultAccessor

This commit is contained in:
Jacob Støren
2014-08-07 14:55:33 +02:00
parent 584a93d9eb
commit 53426b9103
16 changed files with 64 additions and 64 deletions

View File

@@ -121,7 +121,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
}
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
cellCenterDataAccessObject = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, cellResultSlot->gridScalarIndex());
cellCenterDataAccessObject = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, cellResultSlot->gridScalarIndex());
}
CVF_ASSERT(cellEdgeResultSlot->hasResult());
@@ -140,7 +140,7 @@ void RivCellEdgeGeometryGenerator::addCellEdgeResultsToDrawableGeo(
{
// Assuming static values to be mapped onto cell edge, always using time step zero
// TODO: Now hardcoded matrix results, should it be possible to use fracture results?
daObj = eclipseCase->dataAccessObject(grid, RifReaderInterface::MATRIX_RESULTS, 0, resultIndices[cubeFaceIdx]);
daObj = eclipseCase->resultAccessor(grid, RifReaderInterface::MATRIX_RESULTS, 0, resultIndices[cubeFaceIdx]);
}
cellEdgeDataAccessObjects.push_back(daObj.p());

View File

@@ -90,7 +90,7 @@ public:
texCoords.resize(m_quadsToGridCells.size()*4);
for (i = 0; i < m_quadsToGridCells.size(); ++i)
{
cvf::Vec2f texCoord = scalarMapper->mapToTextureCoord(dataAccessObject->cellScalar(m_quadsToGridCells[i]));
cvf::Vec2f texCoord = scalarMapper->mapToTextureCoord(resultAccessor->cellScalar(m_quadsToGridCells[i]));
ResValue ResPoint To ResValue
texCoords[i*4 + 0] = texCoord;
texCoords[i*4 + 1] = texCoord;

View File

@@ -203,9 +203,9 @@ void RivFaultGeometryGenerator::computeArrays()
/// Calculates the texture coordinates in a "nearly" one dimensional texture.
/// Undefined values are coded with a y-texture coordinate value of 1.0 instead of the normal 0.5
//--------------------------------------------------------------------------------------------------
void RivFaultGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords, const cvf::StructGridScalarDataAccess* dataAccessObject, const cvf::ScalarMapper* mapper) const
void RivFaultGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoords, const cvf::StructGridScalarDataAccess* resultAccessor, const cvf::ScalarMapper* mapper) const
{
if (!dataAccessObject) return;
if (!resultAccessor) return;
size_t numVertices = m_quadMapper->quadCount()*4;
@@ -218,7 +218,7 @@ void RivFaultGeometryGenerator::textureCoordinates(cvf::Vec2fArray* textureCoord
#pragma omp parallel for private(texCoord, cellScalarValue)
for (int i = 0; i < static_cast<int>(m_quadMapper->quadCount()); i++)
{
cellScalarValue = dataAccessObject->cellScalar(m_quadMapper->cellIndex(i));
cellScalarValue = resultAccessor->cellScalar(m_quadMapper->cellIndex(i));
texCoord = mapper->mapToTextureCoord(cellScalarValue);
if (cellScalarValue == HUGE_VAL || cellScalarValue != cellScalarValue) // a != a is true for NAN's
{

View File

@@ -48,7 +48,7 @@ public:
void setCellVisibility(const cvf::UByteArray* cellVisibilities );
void textureCoordinates(cvf::Vec2fArray* textureCoords,
const cvf::StructGridScalarDataAccess* dataAccessObject,
const cvf::StructGridScalarDataAccess* resultAccessor,
const cvf::ScalarMapper* mapper) const;
// Mapping between cells and geometry

View File

@@ -117,7 +117,7 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
RigCaseData* eclipseCase = cellResultSlot->reservoirView()->eclipseCase()->reservoirData();
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
// Faults
if (m_nativeFaultFaces.notNull())
@@ -139,11 +139,11 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
}
else
{
if (dataAccessObject.isNull())
if (resultAccessor.isNull())
{
return;
}
m_nativeFaultGenerator->textureCoordinates(m_nativeFaultFacesTextureCoords.p(), dataAccessObject.p(), mapper);
m_nativeFaultGenerator->textureCoordinates(m_nativeFaultFacesTextureCoords.p(), resultAccessor.p(), mapper);
}
@@ -212,12 +212,12 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
}
else
{
if (dataAccessObject.isNull())
if (resultAccessor.isNull())
{
return;
}
m_oppositeFaultGenerator->textureCoordinates(m_oppositeFaultFacesTextureCoords.p(), dataAccessObject.p(), mapper);
m_oppositeFaultGenerator->textureCoordinates(m_oppositeFaultFacesTextureCoords.p(), resultAccessor.p(), mapper);
}
if (m_opacityLevel < 1.0f )

View File

@@ -243,10 +243,10 @@ void RivGridPartMgr::updateCellResultColor(size_t timeStepIndex, RimResultSlot*
if (cellResultSlot->hasStaticResult()) resTimeStepIdx = 0;
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
if (dataAccessObject.isNull()) return;
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(m_grid.p(), porosityModel, resTimeStepIdx, scalarSetIndex);
if (resultAccessor.isNull()) return;
m_surfaceGenerator.textureCoordinates(m_surfaceFacesTextureCoords.p(), dataAccessObject.p(), mapper);
m_surfaceGenerator.textureCoordinates(m_surfaceFacesTextureCoords.p(), resultAccessor.p(), mapper);
}
@@ -460,9 +460,9 @@ void RivTransmissibilityColorMapper::updateCombinedTransmissibilityTextureCoordi
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(cellResultSlot->porosityModel());
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranX = eclipseCase->dataAccessObject(grid, porosityModel, resTimeStepIdx, tranPosXScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranY = eclipseCase->dataAccessObject(grid, porosityModel, resTimeStepIdx, tranPosYScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranZ = eclipseCase->dataAccessObject(grid, porosityModel, resTimeStepIdx, tranPosZScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranX = eclipseCase->resultAccessor(grid, porosityModel, resTimeStepIdx, tranPosXScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranY = eclipseCase->resultAccessor(grid, porosityModel, resTimeStepIdx, tranPosYScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectTranZ = eclipseCase->resultAccessor(grid, porosityModel, resTimeStepIdx, tranPosZScalarSetIndex);
int quadCount = static_cast<int>(quadToCellFaceMapper->quadCount());
@@ -601,19 +601,19 @@ void RivTransmissibilityColorMapper::updateTernarySaturationColorArray(size_t ti
cellResultSlot->ternaryLegendConfig()->ternaryRanges(soilMin, soilMax, sgasMin, sgasMax, swatMin, swatMax);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSoil = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, soilScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSoil = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, soilScalarSetIndex);
if (dataAccessObjectSoil.isNull())
{
dataAccessObjectSoil = new ScalarDataAccessZeroForAllCells;
}
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSgas = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, sgasScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSgas = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, sgasScalarSetIndex);
if (dataAccessObjectSgas.isNull())
{
dataAccessObjectSgas = new ScalarDataAccessZeroForAllCells;
}
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSwat = eclipseCase->dataAccessObject(grid, porosityModel, timeStepIndex, swatScalarSetIndex);
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObjectSwat = eclipseCase->resultAccessor(grid, porosityModel, timeStepIndex, swatScalarSetIndex);
if (dataAccessObjectSwat.isNull())
{
dataAccessObjectSwat = new ScalarDataAccessZeroForAllCells;

View File

@@ -728,8 +728,8 @@ void RivReservoirViewPartMgr::computePropertyVisibility(cvf::UByteArray* cellVis
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel((*pfIt)->resultDefinition()->porosityModel());
RigCaseData* eclipseCase = propFilterColl->reservoirView()->eclipseCase()->reservoirData();
cvf::ref<cvf::StructGridScalarDataAccess> dataAccessObject = eclipseCase->dataAccessObject(grid, porosityModel, adjustedTimeStepIndex, scalarResultIndex);
CVF_ASSERT(dataAccessObject.notNull());
cvf::ref<cvf::StructGridScalarDataAccess> resultAccessor = eclipseCase->resultAccessor(grid, porosityModel, adjustedTimeStepIndex, scalarResultIndex);
CVF_ASSERT(resultAccessor.notNull());
//#pragma omp parallel for schedule(dynamic)
for (int cellIndex = 0; cellIndex < static_cast<int>(grid->cellCount()); cellIndex++)
@@ -738,7 +738,7 @@ void RivReservoirViewPartMgr::computePropertyVisibility(cvf::UByteArray* cellVis
{
size_t resultValueIndex = cellIndex;
double scalarValue = dataAccessObject->cellScalar(resultValueIndex);
double scalarValue = resultAccessor->cellScalar(resultValueIndex);
if (lowerBound <= scalarValue && scalarValue <= upperBound)
{
if (filterType == RimCellFilter::EXCLUDE)