Whitespace

This commit is contained in:
Magne Sjaastad
2018-09-21 11:43:03 +02:00
parent 32237b6c7c
commit 163193dc6c
6 changed files with 501 additions and 503 deletions

View File

@@ -49,9 +49,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"
@@ -60,16 +60,14 @@
#include "cvfTransform.h"
#include "cvfUniform.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivFemPartPartMgr::RivFemPartPartMgr(const RigFemPart* grid)
: m_surfaceGenerator(grid),
m_grid(grid),
m_opacityLevel(1.0f),
m_defaultColor(cvf::Color3::WHITE)
: m_surfaceGenerator(grid)
, m_grid(grid)
, m_opacityLevel(1.0f)
, m_defaultColor(cvf::Color3::WHITE)
{
CVF_ASSERT(grid);
m_gridIdx = grid->elementPartId();
@@ -185,8 +183,8 @@ void RivFemPartPartMgr::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());
}
//--------------------------------------------------------------------------------------------------
@@ -243,7 +241,6 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
// Outer surface
if (m_surfaceFaces.notNull())
{
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
RigGeoMechCaseData* caseData = cellResultColors->ownerCaseData();
@@ -253,9 +250,13 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
RigFemResultAddress resVarAddress = cellResultColors->resultAddress();
// Do a "Hack" to show elm nodal and not nodal POR results
if (resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar") resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
if (resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar")
{
resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
}
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues(resVarAddress, m_gridIdx, (int)timeStepIndex);
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues(resVarAddress, m_gridIdx, (int)timeStepIndex);
const std::vector<size_t>* vxToResultMapping = nullptr;
int vxCount = 0;
@@ -264,13 +265,12 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
{
vxToResultMapping = &(m_surfaceGenerator.quadVerticesToNodeIdxMapping());
}
else if ( resVarAddress.resultPosType == RIG_ELEMENT_NODAL
|| resVarAddress.resultPosType == RIG_INTEGRATION_POINT
|| resVarAddress.resultPosType == RIG_FORMATION_NAMES)
else if (resVarAddress.resultPosType == RIG_ELEMENT_NODAL || resVarAddress.resultPosType == RIG_INTEGRATION_POINT ||
resVarAddress.resultPosType == RIG_FORMATION_NAMES)
{
vxToResultMapping = &(m_surfaceGenerator.quadVerticesToGlobalElmNodeIdx());
}
else if(resVarAddress.resultPosType == RIG_ELEMENT_NODAL_FACE)
else if (resVarAddress.resultPosType == RIG_ELEMENT_NODAL_FACE)
{
vxToResultMapping = &(m_surfaceGenerator.quadVerticesToGlobalElmFaceNodeIdx());
}
@@ -292,7 +292,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
{
cvf::Vec2f* rawPtr = m_surfaceFacesTextureCoords->ptr();
#pragma omp parallel for schedule(dynamic)
#pragma omp parallel for schedule(dynamic)
for (int quadStartIdx = 0; quadStartIdx < vxCount; quadStartIdx += 4)
{
float resultValue1 = resultValues[(*vxToResultMapping)[quadStartIdx + 0]];
@@ -300,10 +300,9 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
float resultValue3 = resultValues[(*vxToResultMapping)[quadStartIdx + 2]];
float resultValue4 = resultValues[(*vxToResultMapping)[quadStartIdx + 3]];
if ( resultValue1 == HUGE_VAL || resultValue1 != resultValue1 // a != a is true for NAN's
|| resultValue2 == HUGE_VAL || resultValue2 != resultValue2
|| resultValue3 == HUGE_VAL || resultValue3 != resultValue3
|| resultValue4 == HUGE_VAL || resultValue4 != resultValue4)
if (resultValue1 == HUGE_VAL || resultValue1 != resultValue1 // a != a is true for NAN's
|| resultValue2 == HUGE_VAL || resultValue2 != resultValue2 || resultValue3 == HUGE_VAL ||
resultValue3 != resultValue3 || resultValue4 == HUGE_VAL || resultValue4 != resultValue4)
{
rawPtr[quadStartIdx][1] = 1.0f;
rawPtr[quadStartIdx + 1][1] = 1.0f;
@@ -333,13 +332,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivFemPartPartMgr::~RivFemPartPartMgr()
{
}
RivFemPartPartMgr::~RivFemPartPartMgr() {}

View File

@@ -48,19 +48,17 @@
#include "cvfModelBasicList.h"
#include "cvfPart.h"
#include "cvfPrimitiveSetDirect.h"
#include "cvfRenderState_FF.h"
#include "cvfRenderStateDepth.h"
#include "cvfRenderStatePoint.h"
#include "cvfRenderState_FF.h"
#include "cvfStructGridGeometryGenerator.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivIntersectionBoxPartMgr::RivIntersectionBoxPartMgr(RimIntersectionBox* intersectionBox)
: m_rimIntersectionBox(intersectionBox),
m_defaultColor(cvf::Color3::WHITE)
: m_rimIntersectionBox(intersectionBox)
, m_defaultColor(cvf::Color3::WHITE)
{
CVF_ASSERT(m_rimIntersectionBox);
@@ -75,7 +73,7 @@ RivIntersectionBoxPartMgr::RivIntersectionBoxPartMgr(RimIntersectionBox* interse
//--------------------------------------------------------------------------------------------------
void RivIntersectionBoxPartMgr::applySingleColorEffect()
{
m_defaultColor = cvf::Color3f::OLIVE;//m_rimCrossSection->CrossSectionColor();
m_defaultColor = cvf::Color3f::OLIVE; // m_rimCrossSection->CrossSectionColor();
this->updatePartEffect();
}
@@ -84,7 +82,6 @@ void RivIntersectionBoxPartMgr::applySingleColorEffect()
//--------------------------------------------------------------------------------------------------
void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
{
if (!m_intersectionBoxGenerator->isAnyGeometryPresent()) return;
RimEclipseView* eclipseView;
@@ -100,11 +97,11 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
{
if (cellResultColors->isTernarySaturationSelected())
{
RivTernaryTextureCoordsCreator texturer(cellResultColors,
cellResultColors->ternaryLegendConfig()->scalarMapper(),
timeStepIndex);
RivTernaryTextureCoordsCreator texturer(
cellResultColors, cellResultColors->ternaryLegendConfig()->scalarMapper(), timeStepIndex);
texturer.createTextureCoords(m_intersectionBoxFacesTextureCoords.p(), m_intersectionBoxGenerator->triangleToCellIndex());
texturer.createTextureCoords(m_intersectionBoxFacesTextureCoords.p(),
m_intersectionBoxGenerator->triangleToCellIndex());
const RivTernaryScalarMapper* mapper = cellResultColors->ternaryLegendConfig()->scalarMapper();
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_intersectionBoxFaces.p(),
@@ -127,10 +124,8 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
}
else
{
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(cellResultColors->reservoirView()->eclipseCase()->eclipseCaseData(),
0,
timeStepIndex,
cellResultColors);
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(
cellResultColors->reservoirView()->eclipseCase()->eclipseCaseData(), 0, timeStepIndex, cellResultColors);
}
RivIntersectionPartMgr::calculateEclipseTextureCoordinates(m_intersectionBoxFacesTextureCoords.p(),
@@ -138,7 +133,6 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
resultAccessor.p(),
mapper);
RivScalarMapperUtils::applyTextureResultsToPart(m_intersectionBoxFaces.p(),
m_intersectionBoxFacesTextureCoords.p(),
mapper,
@@ -165,13 +159,12 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
if (resVarAddress.resultPosType == RIG_ELEMENT)
{
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
const std::vector<size_t>& triangleToCellIdx = m_intersectionBoxGenerator->triangleToCellIndex();
RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(m_intersectionBoxFacesTextureCoords.p(),
resultValues,
triangleToCellIdx,
mapper);
RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(
m_intersectionBoxFacesTextureCoords.p(), resultValues, triangleToCellIdx, mapper);
}
else if (resVarAddress.resultPosType == RIG_ELEMENT_NODAL_FACE)
{
@@ -180,14 +173,13 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
if (resVarAddress.componentName == "Pazi" || resVarAddress.componentName == "Pinc")
{
RivIntersectionPartMgr::calculatePlaneAngleTextureCoords(m_intersectionBoxFacesTextureCoords.p(),
triangelVxes,
resVarAddress,
mapper);
RivIntersectionPartMgr::calculatePlaneAngleTextureCoords(
m_intersectionBoxFacesTextureCoords.p(), triangelVxes, resVarAddress, mapper);
}
else
{
const std::vector<RivIntersectionVertexWeights> &vertexWeights = m_intersectionBoxGenerator->triangleVxToCellCornerInterpolationWeights();
const std::vector<RivIntersectionVertexWeights>& vertexWeights =
m_intersectionBoxGenerator->triangleVxToCellCornerInterpolationWeights();
RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords(m_intersectionBoxFacesTextureCoords.p(),
triangelVxes,
@@ -201,19 +193,18 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
else
{
// Do a "Hack" to show elm nodal and not nodal POR results
if (resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar") resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
if (resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar")
resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
RigFemPart* femPart = caseData->femParts()->part(0);
bool isElementNodalResult = !(resVarAddress.resultPosType == RIG_NODAL);
const std::vector<RivIntersectionVertexWeights> &vertexWeights = m_intersectionBoxGenerator->triangleVxToCellCornerInterpolationWeights();
const std::vector<RivIntersectionVertexWeights>& vertexWeights =
m_intersectionBoxGenerator->triangleVxToCellCornerInterpolationWeights();
RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords(m_intersectionBoxFacesTextureCoords.p(),
vertexWeights,
resultValues,
isElementNodalResult,
femPart,
mapper);
RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords(
m_intersectionBoxFacesTextureCoords.p(), vertexWeights, resultValues, isElementNodalResult, femPart, mapper);
}
RivScalarMapperUtils::applyTextureResultsToPart(m_intersectionBoxFaces.p(),
@@ -225,13 +216,11 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionBoxPartMgr::generatePartGeometry()
{
bool useBufferObjects = true;
// Surface geometry
{
@@ -288,7 +277,6 @@ void RivIntersectionBoxPartMgr::generatePartGeometry()
updatePartEffect();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -305,17 +293,16 @@ void RivIntersectionBoxPartMgr::updatePartEffect()
}
// Update mesh colors as well, in case of change
//RiaPreferences* prefs = RiaApplication::instance()->preferences();
// RiaPreferences* prefs = RiaApplication::instance()->preferences();
cvf::ref<cvf::Effect> eff;
caf::MeshEffectGenerator CrossSectionEffGen(cvf::Color3::WHITE);//prefs->defaultCrossSectionGridLineColors());
caf::MeshEffectGenerator CrossSectionEffGen(cvf::Color3::WHITE); // prefs->defaultCrossSectionGridLineColors());
eff = CrossSectionEffGen.generateCachedEffect();
if (m_intersectionBoxGridLines.notNull())
{
m_intersectionBoxGridLines->setEffect(eff.p());
}
}
//--------------------------------------------------------------------------------------------------
@@ -352,20 +339,19 @@ void RivIntersectionBoxPartMgr::appendMeshLinePartsToModel(cvf::ModelBasicList*
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<RivIntersectionHexGridInterface> RivIntersectionBoxPartMgr::createHexGridInterface()
{
RimEclipseView* eclipseView;
m_rimIntersectionBox->firstAncestorOrThisOfType(eclipseView);
if (eclipseView)
{
RigMainGrid* grid = eclipseView->mainGrid();
return new RivEclipseIntersectionGrid(grid, eclipseView->currentActiveCellInfo(), m_rimIntersectionBox->showInactiveCells());
return new RivEclipseIntersectionGrid(
grid, eclipseView->currentActiveCellInfo(), m_rimIntersectionBox->showInactiveCells());
}
RimGeoMechView* geoView;
@@ -378,4 +364,3 @@ cvf::ref<RivIntersectionHexGridInterface> RivIntersectionBoxPartMgr::createHexGr
return nullptr;
}

View File

@@ -23,13 +23,12 @@
#include "cvfBase.h"
#include "cvfObject.h"
namespace cvf
{
class ModelBasicList;
class Transform;
class Part;
}
class ModelBasicList;
class Transform;
class Part;
} // namespace cvf
class RigMainGrid;
class RigResultAccessor;

View File

@@ -70,23 +70,22 @@
#include "cvfGeometryTools.h"
#include "cvfModelBasicList.h"
#include "cvfPart.h"
#include "cvfqtUtils.h"
#include "cvfPrimitiveSetDirect.h"
#include "cvfRenderState_FF.h"
#include "cvfRenderStateDepth.h"
#include "cvfRenderStatePoint.h"
#include "cvfRenderState_FF.h"
#include "cvfStructGridGeometryGenerator.h"
#include "cvfTransform.h"
#include "cvfqtUtils.h"
#include <functional>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivIntersectionPartMgr::RivIntersectionPartMgr(RimIntersection* rimCrossSection, bool isFlattened)
: m_rimCrossSection(rimCrossSection),
m_isFlattened(isFlattened)
: m_rimCrossSection(rimCrossSection)
, m_isFlattened(isFlattened)
{
CVF_ASSERT(m_rimCrossSection);
@@ -94,17 +93,13 @@ RivIntersectionPartMgr::RivIntersectionPartMgr(RimIntersection* rimCrossSection,
cvf::Vec3d flattenedPolylineStartPoint;
std::vector< std::vector <cvf::Vec3d> > polyLines = m_rimCrossSection->polyLines(&flattenedPolylineStartPoint);
std::vector<std::vector<cvf::Vec3d>> polyLines = m_rimCrossSection->polyLines(&flattenedPolylineStartPoint);
if (polyLines.size() > 0)
{
cvf::Vec3d direction = m_rimCrossSection->extrusionDirection();
cvf::ref<RivIntersectionHexGridInterface> hexGrid = createHexGridInterface();
m_crossSectionGenerator = new RivIntersectionGeometryGenerator(m_rimCrossSection,
polyLines,
direction,
hexGrid.p(),
m_isFlattened,
flattenedPolylineStartPoint);
m_crossSectionGenerator = new RivIntersectionGeometryGenerator(
m_rimCrossSection, polyLines, direction, hexGrid.p(), m_isFlattened, flattenedPolylineStartPoint);
}
}
@@ -175,7 +170,8 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
{
RivTernaryTextureCoordsCreator texturer(cellResultColors, ternaryColorMapper, timeStepIndex);
texturer.createTextureCoords(m_crossSectionFacesTextureCoords.p(), m_crossSectionGenerator->triangleToCellIndex());
texturer.createTextureCoords(m_crossSectionFacesTextureCoords.p(),
m_crossSectionGenerator->triangleToCellIndex());
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_crossSectionFaces.p(),
m_crossSectionFacesTextureCoords.p(),
@@ -196,10 +192,8 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
}
else
{
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(cellResultColors->reservoirView()->eclipseCase()->eclipseCaseData(),
0,
timeStepIndex,
cellResultColors);
resultAccessor = RigResultAccessorFactory::createFromResultDefinition(
cellResultColors->reservoirView()->eclipseCase()->eclipseCaseData(), 0, timeStepIndex, cellResultColors);
}
RivIntersectionPartMgr::calculateEclipseTextureCoordinates(m_crossSectionFacesTextureCoords.p(),
@@ -207,7 +201,6 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
resultAccessor.p(),
scalarColorMapper);
RivScalarMapperUtils::applyTextureResultsToPart(m_crossSectionFaces.p(),
m_crossSectionFacesTextureCoords.p(),
scalarColorMapper,
@@ -232,30 +225,27 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
if (resVarAddress.resultPosType == RIG_ELEMENT)
{
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
const std::vector<size_t>& triangleToCellIdx = m_crossSectionGenerator->triangleToCellIndex();
RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(m_crossSectionFacesTextureCoords.p(),
resultValues,
triangleToCellIdx,
scalarColorMapper);
RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(
m_crossSectionFacesTextureCoords.p(), resultValues, triangleToCellIdx, scalarColorMapper);
}
else if(resVarAddress.resultPosType == RIG_ELEMENT_NODAL_FACE)
else if (resVarAddress.resultPosType == RIG_ELEMENT_NODAL_FACE)
{
// Special direction sensitive result calculation
const cvf::Vec3fArray* triangelVxes = m_crossSectionGenerator->triangleVxes();
if (resVarAddress.componentName == "Pazi" || resVarAddress.componentName == "Pinc")
{
RivIntersectionPartMgr::calculatePlaneAngleTextureCoords(m_crossSectionFacesTextureCoords.p(),
triangelVxes,
resVarAddress,
scalarColorMapper);
RivIntersectionPartMgr::calculatePlaneAngleTextureCoords(
m_crossSectionFacesTextureCoords.p(), triangelVxes, resVarAddress, scalarColorMapper);
}
else
{
const std::vector<RivIntersectionVertexWeights> &vertexWeights = m_crossSectionGenerator->triangleVxToCellCornerInterpolationWeights();
const std::vector<RivIntersectionVertexWeights>& vertexWeights =
m_crossSectionGenerator->triangleVxToCellCornerInterpolationWeights();
RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords(m_crossSectionFacesTextureCoords.p(),
triangelVxes,
@@ -269,12 +259,15 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
else
{
// Do a "Hack" to show elm nodal and not nodal POR results
if (resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar") resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
if (resVarAddress.resultPosType == RIG_NODAL && resVarAddress.fieldName == "POR-Bar")
resVarAddress.resultPosType = RIG_ELEMENT_NODAL;
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
RigFemPart* femPart = caseData->femParts()->part(0);
bool isElementNodalResult = !(resVarAddress.resultPosType == RIG_NODAL);
const std::vector<RivIntersectionVertexWeights> &vertexWeights = m_crossSectionGenerator->triangleVxToCellCornerInterpolationWeights();
const std::vector<RivIntersectionVertexWeights>& vertexWeights =
m_crossSectionGenerator->triangleVxToCellCornerInterpolationWeights();
RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords(m_crossSectionFacesTextureCoords.p(),
vertexWeights,
@@ -293,13 +286,13 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
const std::vector<RivIntersectionVertexWeights> &vertexWeights,
const std::vector<float> &resultValues,
void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords(
cvf::Vec2fArray* textureCoords,
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
const std::vector<float>& resultValues,
bool isElementNodalResult,
const RigFemPart* femPart,
const cvf::ScalarMapper* mapper)
@@ -352,11 +345,11 @@ void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
const std::vector<float> &resultValues,
const std::vector<float>& resultValues,
const std::vector<size_t>& triangleToCellIdx,
const cvf::ScalarMapper* mapper)
{
textureCoords->resize(triangleToCellIdx.size()*3);
textureCoords->resize(triangleToCellIdx.size() * 3);
if (resultValues.size() == 0)
{
@@ -394,36 +387,37 @@ void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(cvf::Vec2
//--------------------------------------------------------------------------------------------------
void RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords(cvf::Vec2fArray* textureCoords,
const cvf::Vec3fArray* triangelVertices,
const std::vector<RivIntersectionVertexWeights> &vertexWeights,
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
RigGeoMechCaseData* caseData,
const RigFemResultAddress& resVarAddress,
int timeStepIdx,
const cvf::ScalarMapper* mapper)
{
RiuGeoMechXfTensorResultAccessor accessor(caseData->femPartResults(), resVarAddress, timeStepIdx);
textureCoords->resize(vertexWeights.size());
cvf::Vec2f* rawPtr = textureCoords->ptr();
int vxCount = static_cast<int>(vertexWeights.size());
int triCount = vxCount/3;
int triCount = vxCount / 3;
#pragma omp parallel for schedule(dynamic)
for ( int triangleIdx = 0; triangleIdx < triCount; ++triangleIdx )
#pragma omp parallel for schedule(dynamic)
for (int triangleIdx = 0; triangleIdx < triCount; ++triangleIdx)
{
int triangleVxStartIdx = triangleIdx*3;
int triangleVxStartIdx = triangleIdx * 3;
float values[3];
accessor.calculateInterpolatedValue(&((*triangelVertices)[triangleVxStartIdx]), &(vertexWeights[triangleVxStartIdx]), values );
accessor.calculateInterpolatedValue(
&((*triangelVertices)[triangleVxStartIdx]), &(vertexWeights[triangleVxStartIdx]), values);
rawPtr[triangleVxStartIdx + 0] = (values[0] != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(values[0]) : cvf::Vec2f(0.0f, 1.0f);
rawPtr[triangleVxStartIdx + 1] = (values[1] != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(values[1]) : cvf::Vec2f(0.0f, 1.0f);
rawPtr[triangleVxStartIdx + 2] = (values[2] != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(values[2]) : cvf::Vec2f(0.0f, 1.0f);
rawPtr[triangleVxStartIdx + 0] =
(values[0] != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(values[0]) : cvf::Vec2f(0.0f, 1.0f);
rawPtr[triangleVxStartIdx + 1] =
(values[1] != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(values[1]) : cvf::Vec2f(0.0f, 1.0f);
rawPtr[triangleVxStartIdx + 2] =
(values[2] != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(values[2]) : cvf::Vec2f(0.0f, 1.0f);
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -432,42 +426,42 @@ void RivIntersectionPartMgr::calculatePlaneAngleTextureCoords(cvf::Vec2fArray* t
const RigFemResultAddress& resVarAddress,
const cvf::ScalarMapper* mapper)
{
textureCoords->resize(triangelVertices->size());
cvf::Vec2f* rawPtr = textureCoords->ptr();
int vxCount = static_cast<int>(triangelVertices->size());
int triCount = vxCount/3;
int triCount = vxCount / 3;
std::function<float (const RiaOffshoreSphericalCoords& )> operation;
std::function<float(const RiaOffshoreSphericalCoords&)> operation;
if (resVarAddress.componentName == "Pazi")
{
operation = [](const RiaOffshoreSphericalCoords& sphCoord) { return (float)sphCoord.azi();};
operation = [](const RiaOffshoreSphericalCoords& sphCoord) { return (float)sphCoord.azi(); };
}
else if ( resVarAddress.componentName == "Pinc" )
else if (resVarAddress.componentName == "Pinc")
{
operation = [](const RiaOffshoreSphericalCoords& sphCoord) { return (float)sphCoord.inc();};
operation = [](const RiaOffshoreSphericalCoords& sphCoord) { return (float)sphCoord.inc(); };
}
#pragma omp parallel for schedule(dynamic)
for ( int triangleIdx = 0; triangleIdx < triCount; ++triangleIdx )
#pragma omp parallel for schedule(dynamic)
for (int triangleIdx = 0; triangleIdx < triCount; ++triangleIdx)
{
int triangleVxStartIdx = triangleIdx*3;
int triangleVxStartIdx = triangleIdx * 3;
const cvf::Vec3f* triangle = &((*triangelVertices)[triangleVxStartIdx]);
cvf::Mat3f rotMx = cvf::GeometryTools::computePlaneHorizontalRotationMx(triangle[1] - triangle[0], triangle[2] - triangle[0]);
cvf::Mat3f rotMx =
cvf::GeometryTools::computePlaneHorizontalRotationMx(triangle[1] - triangle[0], triangle[2] - triangle[0]);
RiaOffshoreSphericalCoords sphCoord(cvf::Vec3f(rotMx.rowCol(0, 2), rotMx.rowCol(1, 2), rotMx.rowCol(2, 2))); // Use Ez from the matrix as plane normal
RiaOffshoreSphericalCoords sphCoord(
cvf::Vec3f(rotMx.rowCol(0, 2), rotMx.rowCol(1, 2), rotMx.rowCol(2, 2))); // Use Ez from the matrix as plane normal
float angle = cvf::Math::toDegrees( operation(sphCoord));
cvf::Vec2f texCoord = (angle != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(angle) : cvf::Vec2f(0.0f, 1.0f);
float angle = cvf::Math::toDegrees(operation(sphCoord));
cvf::Vec2f texCoord =
(angle != std::numeric_limits<float>::infinity()) ? mapper->mapToTextureCoord(angle) : cvf::Vec2f(0.0f, 1.0f);
rawPtr[triangleVxStartIdx + 0] = texCoord;
rawPtr[triangleVxStartIdx + 1] = texCoord;
rawPtr[triangleVxStartIdx + 2] = texCoord;
}
}
//--------------------------------------------------------------------------------------------------
/// Calculates the texture coordinates in a "nearly" one dimensional texture.
/// Undefined values are coded with a y-texturecoordinate value of 1.0 instead of the normal 0.5
@@ -479,7 +473,7 @@ void RivIntersectionPartMgr::calculateEclipseTextureCoordinates(cvf::Vec2fArray*
{
if (!resultAccessor) return;
size_t numVertices = triangleToCellIdxMap.size()*3;
size_t numVertices = triangleToCellIdxMap.size() * 3;
textureCoords->resize(numVertices);
cvf::Vec2f* rawPtr = textureCoords->ptr();
@@ -499,7 +493,7 @@ void RivIntersectionPartMgr::calculateEclipseTextureCoordinates(cvf::Vec2fArray*
size_t j;
for (j = 0; j < 3; j++)
{
rawPtr[tIdx*3 + j] = texCoord;
rawPtr[tIdx * 3 + j] = texCoord;
}
}
}
@@ -599,7 +593,7 @@ void RivIntersectionPartMgr::generatePartGeometry()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<QString, cvf::Vec3d> >& labelAndAnchors)
void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors)
{
m_faultMeshLabels = nullptr;
m_faultMeshLabelLines = nullptr;
@@ -689,7 +683,6 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
part->setEffect(eff.p());
m_faultMeshLabelLines = part;
}
}
//--------------------------------------------------------------------------------------------------
@@ -721,7 +714,7 @@ void RivIntersectionPartMgr::createPolyLineParts(bool useBufferObjects)
part->setPriority(RivPartPriority::PartType::Highlight);
// Always show this part, also when mesh is turned off
//part->setEnableMask(meshFaultBit);
// part->setEnableMask(meshFaultBit);
cvf::ref<cvf::Effect> eff;
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
@@ -753,7 +746,7 @@ void RivIntersectionPartMgr::createPolyLineParts(bool useBufferObjects)
part->setPriority(RivPartPriority::PartType::Highlight);
// Always show this part, also when mesh is turned off
//part->setEnableMask(meshFaultBit);
// part->setEnableMask(meshFaultBit);
cvf::ref<cvf::Effect> eff;
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
@@ -785,7 +778,8 @@ void RivIntersectionPartMgr::createExtrusionDirParts(bool useBufferObjects)
if (m_rimCrossSection->direction() == RimIntersection::CS_TWO_POINTS)
{
{
cvf::ref<cvf::DrawableGeo> polylineGeo = m_crossSectionGenerator->createLineAlongExtrusionLineDrawable(m_rimCrossSection->polyLinesForExtrusionDirection());
cvf::ref<cvf::DrawableGeo> polylineGeo = m_crossSectionGenerator->createLineAlongExtrusionLineDrawable(
m_rimCrossSection->polyLinesForExtrusionDirection());
if (polylineGeo.notNull())
{
if (useBufferObjects)
@@ -801,7 +795,7 @@ void RivIntersectionPartMgr::createExtrusionDirParts(bool useBufferObjects)
part->setPriority(RivPartPriority::PartType::Highlight);
// Always show this part, also when mesh is turned off
//part->setEnableMask(meshFaultBit);
// part->setEnableMask(meshFaultBit);
cvf::ref<cvf::Effect> eff;
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
@@ -817,7 +811,8 @@ void RivIntersectionPartMgr::createExtrusionDirParts(bool useBufferObjects)
}
}
cvf::ref<cvf::DrawableGeo> polylinePointsGeo = m_crossSectionGenerator->createPointsFromExtrusionLineDrawable(m_rimCrossSection->polyLinesForExtrusionDirection());
cvf::ref<cvf::DrawableGeo> polylinePointsGeo =
m_crossSectionGenerator->createPointsFromExtrusionLineDrawable(m_rimCrossSection->polyLinesForExtrusionDirection());
if (polylinePointsGeo.notNull())
{
if (useBufferObjects)
@@ -833,7 +828,7 @@ void RivIntersectionPartMgr::createExtrusionDirParts(bool useBufferObjects)
part->setPriority(RivPartPriority::PartType::Highlight);
// Always show this part, also when mesh is turned off
//part->setEnableMask(meshFaultBit);
// part->setEnableMask(meshFaultBit);
cvf::ref<cvf::Effect> eff;
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
@@ -857,10 +852,8 @@ void RivIntersectionPartMgr::createExtrusionDirParts(bool useBufferObjects)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::Part> createStdSurfacePart(cvf::DrawableGeo* geometry,
const cvf::Color3f& color,
cvf::String name,
cvf::Object* sourceInfo)
cvf::ref<cvf::Part>
createStdSurfacePart(cvf::DrawableGeo* geometry, const cvf::Color3f& color, cvf::String name, cvf::Object* sourceInfo)
{
if (!geometry) return nullptr;
@@ -881,12 +874,9 @@ cvf::ref<cvf::Part> createStdSurfacePart(cvf::DrawableGeo* geometry,
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
cvf::ref<cvf::Part> createStdLinePart(cvf::DrawableGeo* geometry,
const cvf::Color3f& color,
cvf::String name)
cvf::ref<cvf::Part> createStdLinePart(cvf::DrawableGeo* geometry, const cvf::Color3f& color, cvf::String name)
{
if ( !geometry ) return nullptr;
if (!geometry) return nullptr;
cvf::ref<cvf::Part> part = new cvf::Part;
part->setName(name);
@@ -918,7 +908,6 @@ void RivIntersectionPartMgr::appendNativeCrossSectionFacesToModel(cvf::ModelBasi
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -952,14 +941,14 @@ void RivIntersectionPartMgr::appendMeshLinePartsToModel(cvf::ModelBasicList* mod
m_faultMeshLabels->setTransform(scaleTransform);
model->addPart(m_faultMeshLabels.p());
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionPartMgr::appendPolylinePartsToModel(Rim3dView &view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform)
void RivIntersectionPartMgr::appendPolylinePartsToModel(Rim3dView& view,
cvf::ModelBasicList* model,
cvf::Transform* scaleTransform)
{
Rim2dIntersectionView* curr2dView = dynamic_cast<Rim2dIntersectionView*>(&view);
@@ -1049,4 +1038,3 @@ cvf::ref<RivIntersectionHexGridInterface> RivIntersectionPartMgr::createHexGridI
return nullptr;
}

View File

@@ -19,12 +19,12 @@
#pragma once
#include "cvfBase.h"
#include "cvfObject.h"
#include "cvfColor4.h"
#include "cvfVector3.h"
#include "cvfArray.h"
#include "cvfBase.h"
#include "cvfColor4.h"
#include "cvfMatrix4.h"
#include "cvfObject.h"
#include "cvfVector3.h"
#include "cafPdmPointer.h"
@@ -35,12 +35,12 @@
namespace cvf
{
class ModelBasicList;
class Transform;
class Part;
class ScalarMapper;
class DrawableGeo;
}
class ModelBasicList;
class Transform;
class Part;
class ScalarMapper;
class DrawableGeo;
} // namespace cvf
class RigFemPart;
class RigFemResultAddress;
@@ -72,7 +72,6 @@ public:
const cvf::ScalarMapper* scalarColorMapper,
const RivTernaryScalarMapper* ternaryColorMapper);
void appendNativeCrossSectionFacesToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
void appendMeshLinePartsToModel(cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
void appendPolylinePartsToModel(Rim3dView& view, cvf::ModelBasicList* model, cvf::Transform* scaleTransform);
@@ -87,21 +86,22 @@ public:
const RigResultAccessor* resultAccessor,
const cvf::ScalarMapper* mapper);
static void calculateNodeOrElementNodeBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
const std::vector<RivIntersectionVertexWeights> &vertexWeights,
const std::vector<float> &resultValues,
static void
calculateNodeOrElementNodeBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
const std::vector<float>& resultValues,
bool isElementNodalResult,
const RigFemPart* femPart,
const cvf::ScalarMapper* mapper);
static void calculateElementBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
const std::vector<float> &resultValues,
const std::vector<float>& resultValues,
const std::vector<size_t>& triangleToCellIdx,
const cvf::ScalarMapper* mapper);
static void calculateGeoMechTensorXfTextureCoords(cvf::Vec2fArray* textureCoords,
const cvf::Vec3fArray* triangelVertices,
const std::vector<RivIntersectionVertexWeights> &vertexWeights,
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
RigGeoMechCaseData* caseData,
const RigFemResultAddress& resVarAddress,
int timeStepIdx,
@@ -111,9 +111,10 @@ public:
const cvf::Vec3fArray* triangelVertices,
const RigFemResultAddress& resVarAddress,
const cvf::ScalarMapper* mapper);
private:
void generatePartGeometry();
void createFaultLabelParts(const std::vector<std::pair<QString, cvf::Vec3d> >& labelAndAnchors);
void createFaultLabelParts(const std::vector<std::pair<QString, cvf::Vec3d>>& labelAndAnchors);
void createPolyLineParts(bool useBufferObjects);
void createExtrusionDirParts(bool useBufferObjects);
@@ -123,21 +124,19 @@ private:
caf::PdmPointer<RimIntersection> m_rimCrossSection;
cvf::ref<RivIntersectionGeometryGenerator> m_crossSectionGenerator;
cvf::ref<cvf::Part> m_crossSectionFaces;
cvf::ref<cvf::Part> m_crossSectionGridLines;
cvf::ref<cvf::Part> m_crossSectionFaultGridLines;
cvf::ref<cvf::Part> m_faultMeshLabels;
cvf::ref<cvf::Part> m_faultMeshLabelLines;
cvf::ref<cvf::Vec2fArray> m_crossSectionFacesTextureCoords;
cvf::ref<cvf::Part> m_highlightLineAlongPolyline;
cvf::ref<cvf::Part> m_highlightPointsForPolyline;
cvf::ref<cvf::Part> m_highlightLineAlongExtrusionDir;
cvf::ref<cvf::Part> m_highlightPointsForExtrusionDir;
cvf::ref<cvf::Vec2fArray> m_crossSectionFacesTextureCoords;
struct RivPipeBranchData
{
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
@@ -148,4 +147,3 @@ private:
bool m_isFlattened;
};

View File

@@ -44,32 +44,34 @@
#include "RivTernaryTextureCoordsCreator.h"
#include "RivTextureCoordsCreator.h"
#include "RivMeshLinesSourceInfo.h"
#include "cvfDrawableGeo.h"
#include "cvfDrawableText.h"
#include "cvfModelBasicList.h"
#include "cvfPart.h"
#include "cvfPrimitiveSetDirect.h"
#include "cvfqtUtils.h"
#include "RivMeshLinesSourceInfo.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RivFaultPartMgr::RivFaultPartMgr(const RigGridBase* grid, const RimFaultInViewCollection* rimFaultCollection, RimFaultInView* rimFault)
: m_grid(grid),
m_rimFaultCollection(rimFaultCollection),
m_rimFault(rimFault),
m_opacityLevel(1.0f),
m_defaultColor(cvf::Color3::WHITE)
RivFaultPartMgr::RivFaultPartMgr(const RigGridBase* grid,
const RimFaultInViewCollection* rimFaultCollection,
RimFaultInView* rimFault)
: m_grid(grid)
, m_rimFaultCollection(rimFaultCollection)
, m_rimFault(rimFault)
, m_opacityLevel(1.0f)
, m_defaultColor(cvf::Color3::WHITE)
{
cvf::ref< cvf::Array<size_t> > connIdxes = new cvf::Array<size_t>;
cvf::ref<cvf::Array<size_t>> connIdxes = new cvf::Array<size_t>;
connIdxes->assign(rimFault->faultGeometry()->connectionIndices());
m_nativeFaultGenerator = new RivFaultGeometryGenerator(grid, rimFault->faultGeometry(), true);
m_oppositeFaultGenerator = new RivFaultGeometryGenerator(grid, rimFault->faultGeometry(), false);
m_NNCGenerator = new RivNNCGeometryGenerator(grid->mainGrid()->nncData(), grid->mainGrid()->displayModelOffset(), connIdxes.p());
m_NNCGenerator =
new RivNNCGeometryGenerator(grid->mainGrid()->nncData(), grid->mainGrid()->displayModelOffset(), connIdxes.p());
m_nativeFaultFacesTextureCoords = new cvf::Vec2fArray;
m_oppositeFaultFacesTextureCoords = new cvf::Vec2fArray;
@@ -113,7 +115,8 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
{
if (cellResultColors->isTernarySaturationSelected())
{
RivTernaryTextureCoordsCreator texturer(cellResultColors, cellResultColors->ternaryLegendConfig(),
RivTernaryTextureCoordsCreator texturer(cellResultColors,
cellResultColors->ternaryLegendConfig(),
timeStepIndex,
m_grid->gridIndex(),
m_nativeFaultGenerator->quadToCellFaceMapper());
@@ -121,14 +124,17 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
texturer.createTextureCoords(m_nativeFaultFacesTextureCoords.p());
const RivTernaryScalarMapper* mapper = cellResultColors->ternaryLegendConfig()->scalarMapper();
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_nativeFaultFaces.p(), m_nativeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_nativeFaultFaces.p(),
m_nativeFaultFacesTextureCoords.p(),
mapper,
m_opacityLevel,
this->faceCullingMode(),
eclipseView->isLightingDisabled());
}
else
{
RivTextureCoordsCreator texturer(cellResultColors,
timeStepIndex,
m_grid->gridIndex(),
m_nativeFaultGenerator->quadToCellFaceMapper());
RivTextureCoordsCreator texturer(
cellResultColors, timeStepIndex, m_grid->gridIndex(), m_nativeFaultGenerator->quadToCellFaceMapper());
if (!texturer.isValid())
{
@@ -138,7 +144,12 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
texturer.createTextureCoords(m_nativeFaultFacesTextureCoords.p());
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
RivScalarMapperUtils::applyTextureResultsToPart(m_nativeFaultFaces.p(), m_nativeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
RivScalarMapperUtils::applyTextureResultsToPart(m_nativeFaultFaces.p(),
m_nativeFaultFacesTextureCoords.p(),
mapper,
m_opacityLevel,
this->faceCullingMode(),
eclipseView->isLightingDisabled());
}
}
@@ -146,7 +157,8 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
{
if (cellResultColors->isTernarySaturationSelected())
{
RivTernaryTextureCoordsCreator texturer(cellResultColors, cellResultColors->ternaryLegendConfig(),
RivTernaryTextureCoordsCreator texturer(cellResultColors,
cellResultColors->ternaryLegendConfig(),
timeStepIndex,
m_grid->gridIndex(),
m_oppositeFaultGenerator->quadToCellFaceMapper());
@@ -154,14 +166,17 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
texturer.createTextureCoords(m_oppositeFaultFacesTextureCoords.p());
const RivTernaryScalarMapper* mapper = cellResultColors->ternaryLegendConfig()->scalarMapper();
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_oppositeFaultFaces.p(), m_oppositeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
RivScalarMapperUtils::applyTernaryTextureResultsToPart(m_oppositeFaultFaces.p(),
m_oppositeFaultFacesTextureCoords.p(),
mapper,
m_opacityLevel,
this->faceCullingMode(),
eclipseView->isLightingDisabled());
}
else
{
RivTextureCoordsCreator texturer(cellResultColors,
timeStepIndex,
m_grid->gridIndex(),
m_oppositeFaultGenerator->quadToCellFaceMapper());
RivTextureCoordsCreator texturer(
cellResultColors, timeStepIndex, m_grid->gridIndex(), m_oppositeFaultGenerator->quadToCellFaceMapper());
if (!texturer.isValid())
{
@@ -171,7 +186,12 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
texturer.createTextureCoords(m_oppositeFaultFacesTextureCoords.p());
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
RivScalarMapperUtils::applyTextureResultsToPart(m_oppositeFaultFaces.p(), m_oppositeFaultFacesTextureCoords.p(), mapper, m_opacityLevel, this->faceCullingMode(), eclipseView->isLightingDisabled());
RivScalarMapperUtils::applyTextureResultsToPart(m_oppositeFaultFaces.p(),
m_oppositeFaultFacesTextureCoords.p(),
mapper,
m_opacityLevel,
this->faceCullingMode(),
eclipseView->isLightingDisabled());
}
}
}
@@ -179,7 +199,9 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimEclipseCellColors* cellResultColors, RimCellEdgeColors* cellEdgeResultColors)
void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex,
RimEclipseCellColors* cellResultColors,
RimCellEdgeColors* cellEdgeResultColors)
{
updateNNCColors(timeStepIndex, cellResultColors);
@@ -188,9 +210,17 @@ void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimEclipse
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_nativeFaultFaces->drawable());
if (dg)
{
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_nativeFaultGenerator->quadToCellFaceMapper(),
cvf::ref<cvf::Effect> eff =
RivScalarMapperUtils::createCellEdgeEffect(dg,
m_nativeFaultGenerator->quadToCellFaceMapper(),
m_grid->gridIndex(),
timeStepIndex, cellResultColors, cellEdgeResultColors, m_opacityLevel, m_defaultColor, this->faceCullingMode(), cellResultColors->reservoirView()->isLightingDisabled());
timeStepIndex,
cellResultColors,
cellEdgeResultColors,
m_opacityLevel,
m_defaultColor,
this->faceCullingMode(),
cellResultColors->reservoirView()->isLightingDisabled());
m_nativeFaultFaces->setEffect(eff.p());
}
@@ -201,8 +231,17 @@ void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimEclipse
cvf::DrawableGeo* dg = dynamic_cast<cvf::DrawableGeo*>(m_oppositeFaultFaces->drawable());
if (dg)
{
cvf::ref<cvf::Effect> eff = RivScalarMapperUtils::createCellEdgeEffect(dg, m_oppositeFaultGenerator->quadToCellFaceMapper(), m_grid->gridIndex(),
timeStepIndex, cellResultColors, cellEdgeResultColors, m_opacityLevel, m_defaultColor, this->faceCullingMode(), cellResultColors->reservoirView()->isLightingDisabled());
cvf::ref<cvf::Effect> eff =
RivScalarMapperUtils::createCellEdgeEffect(dg,
m_oppositeFaultGenerator->quadToCellFaceMapper(),
m_grid->gridIndex(),
timeStepIndex,
cellResultColors,
cellEdgeResultColors,
m_opacityLevel,
m_defaultColor,
this->faceCullingMode(),
cellResultColors->reservoirView()->isLightingDisabled());
m_oppositeFaultFaces->setEffect(eff.p());
}
@@ -214,7 +253,6 @@ void RivFaultPartMgr::updateCellEdgeResultColor(size_t timeStepIndex, RimEclipse
//--------------------------------------------------------------------------------------------------
void RivFaultPartMgr::generatePartGeometry()
{
bool useBufferObjects = true;
// Surface geometry
{
@@ -269,7 +307,6 @@ void RivFaultPartMgr::generatePartGeometry()
}
}
// Surface geometry
{
cvf::ref<cvf::DrawableGeo> geo = m_oppositeFaultGenerator->generateSurface();
@@ -356,7 +393,6 @@ void RivFaultPartMgr::generatePartGeometry()
updatePartEffect();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -460,7 +496,7 @@ void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part)
m_rimFault->firstAncestorOrThisOfType(parentObject);
if (parentObject)
{
defWellLabelColor = parentObject->faultLabelColor();;
defWellLabelColor = parentObject->faultLabelColor();
}
}
}
@@ -487,7 +523,6 @@ void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part)
m_faultLabelPart = part;
}
// Line from fault geometry to label
{
cvf::ref<cvf::Vec3fArray> vertices = new cvf::Vec3fArray;
@@ -604,7 +639,7 @@ void RivFaultPartMgr::appendNNCFacesToModel(cvf::ModelBasicList* model)
caf::FaceCulling RivFaultPartMgr::faceCullingMode() const
{
bool isShowingGrid = m_rimFaultCollection->isGridVisualizationMode();
if (!isShowingGrid )
if (!isShowingGrid)
{
if (m_rimFaultCollection->faultResult() == RimFaultInViewCollection::FAULT_BACK_FACE_CULLING)
{
@@ -675,7 +710,8 @@ void RivFaultPartMgr::updateNNCColors(size_t timeStepIndex, RimEclipseCellColors
if (eclipseCase)
{
size_t nativeTimeStepIndex = eclipseCase->uiToNativeTimeStepIndex(timeStepIndex);
m_NNCGenerator->textureCoordinates(m_NNCTextureCoords.p(), mapper, resultType, scalarSetIndex, nativeTimeStepIndex);
m_NNCGenerator->textureCoordinates(
m_NNCTextureCoords.p(), mapper, resultType, scalarSetIndex, nativeTimeStepIndex);
}
}
@@ -728,4 +764,3 @@ void RivFaultPartMgr::updateNNCColors(size_t timeStepIndex, RimEclipseCellColors
m_NNCFaces->setEffect(nncEffect.p());
}
}