mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Whitespace
This commit is contained in:
@@ -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,20 +60,18 @@
|
||||
#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();
|
||||
m_cellVisibility = new cvf::UByteArray;
|
||||
m_gridIdx = grid->elementPartId();
|
||||
m_cellVisibility = new cvf::UByteArray;
|
||||
m_surfaceFacesTextureCoords = new cvf::Vec2fArray;
|
||||
}
|
||||
|
||||
@@ -122,7 +120,7 @@ void RivFemPartPartMgr::generatePartGeometry(RivFemPartGeometryGenerator& geoBui
|
||||
|
||||
cvf::ref<cvf::Part> part = new cvf::Part;
|
||||
part->setName("FemPart " + cvf::String(m_gridIdx));
|
||||
part->setId(m_gridIdx); // Use grid index as part ID
|
||||
part->setId(m_gridIdx); // Use grid index as part ID
|
||||
part->setDrawable(geo.p());
|
||||
part->setTransform(m_scaleTransform.p());
|
||||
|
||||
@@ -134,7 +132,7 @@ void RivFemPartPartMgr::generatePartGeometry(RivFemPartGeometryGenerator& geoBui
|
||||
|
||||
// Set default effect
|
||||
caf::SurfaceEffectGenerator geometryEffgen(cvf::Color4f(cvf::Color3f::WHITE), caf::PO_1);
|
||||
cvf::ref<cvf::Effect> geometryOnlyEffect = geometryEffgen.generateCachedEffect();
|
||||
cvf::ref<cvf::Effect> geometryOnlyEffect = geometryEffgen.generateCachedEffect();
|
||||
part->setEffect(geometryOnlyEffect.p());
|
||||
part->setEnableMask(surfaceBit);
|
||||
m_surfaceFaces = part;
|
||||
@@ -162,7 +160,7 @@ void RivFemPartPartMgr::generatePartGeometry(RivFemPartGeometryGenerator& geoBui
|
||||
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator effGen(prefs->defaultGridLineColors());
|
||||
eff = effGen.generateCachedEffect();
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -206,7 +204,7 @@ void RivFemPartPartMgr::updateCellColor(cvf::Color4f color)
|
||||
|
||||
// Set default effect
|
||||
caf::SurfaceEffectGenerator geometryEffgen(color, caf::PO_1);
|
||||
cvf::ref<cvf::Effect> geometryOnlyEffect = geometryEffgen.generateCachedEffect();
|
||||
cvf::ref<cvf::Effect> geometryOnlyEffect = geometryEffgen.generateCachedEffect();
|
||||
|
||||
if (m_surfaceFaces.notNull()) m_surfaceFaces->setEffect(geometryOnlyEffect.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,24 +250,27 @@ 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;
|
||||
int vxCount = 0;
|
||||
|
||||
if (resVarAddress.resultPosType == RIG_NODAL)
|
||||
{
|
||||
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,22 +300,21 @@ 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;
|
||||
rawPtr[quadStartIdx + 2][1] = 1.0f;
|
||||
rawPtr[quadStartIdx + 3][1] = 1.0f;
|
||||
rawPtr[quadStartIdx][1] = 1.0f;
|
||||
rawPtr[quadStartIdx + 1][1] = 1.0f;
|
||||
rawPtr[quadStartIdx + 2][1] = 1.0f;
|
||||
rawPtr[quadStartIdx + 3][1] = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
rawPtr[quadStartIdx] = mapper->mapToTextureCoord(resultValue1);
|
||||
rawPtr[quadStartIdx + 1] = mapper->mapToTextureCoord(resultValue2);
|
||||
rawPtr[quadStartIdx + 2] = mapper->mapToTextureCoord(resultValue3);
|
||||
rawPtr[quadStartIdx + 3] = mapper->mapToTextureCoord(resultValue4);
|
||||
rawPtr[quadStartIdx] = mapper->mapToTextureCoord(resultValue1);
|
||||
rawPtr[quadStartIdx + 1] = mapper->mapToTextureCoord(resultValue2);
|
||||
rawPtr[quadStartIdx + 2] = mapper->mapToTextureCoord(resultValue3);
|
||||
rawPtr[quadStartIdx + 3] = mapper->mapToTextureCoord(resultValue4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -333,13 +332,7 @@ void RivFemPartPartMgr::updateCellResultColor(size_t timeStepIndex, RimGeoMechCe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RivFemPartPartMgr::~RivFemPartPartMgr()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
RivFemPartPartMgr::~RivFemPartPartMgr() {}
|
||||
|
||||
@@ -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(),
|
||||
@@ -118,7 +115,7 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
|
||||
{
|
||||
CVF_ASSERT(m_intersectionBoxGenerator.notNull());
|
||||
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
cvf::ref<RigResultAccessor> resultAccessor;
|
||||
|
||||
if (RiaDefines::isPerCellFaceResult(cellResultColors->resultVariable()))
|
||||
@@ -127,17 +124,14 @@ 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(),
|
||||
m_intersectionBoxGenerator->triangleToCellIndex(),
|
||||
resultAccessor.p(),
|
||||
mapper);
|
||||
|
||||
m_intersectionBoxGenerator->triangleToCellIndex(),
|
||||
resultAccessor.p(),
|
||||
mapper);
|
||||
|
||||
RivScalarMapperUtils::applyTextureResultsToPart(m_intersectionBoxFaces.p(),
|
||||
m_intersectionBoxFacesTextureCoords.p(),
|
||||
@@ -145,7 +139,7 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
|
||||
1.0,
|
||||
caf::FC_NONE,
|
||||
eclipseView->isLightingDisabled());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,23 +149,22 @@ void RivIntersectionBoxPartMgr::updateCellResultColor(size_t timeStepIndex)
|
||||
if (geoView)
|
||||
{
|
||||
RimGeoMechCellColors* cellResultColors = geoView->cellResult();
|
||||
RigGeoMechCaseData* caseData = cellResultColors->ownerCaseData();
|
||||
RigGeoMechCaseData* caseData = cellResultColors->ownerCaseData();
|
||||
|
||||
if (!caseData) return;
|
||||
|
||||
RigFemResultAddress resVarAddress = cellResultColors->resultAddress();
|
||||
RigFemResultAddress resVarAddress = cellResultColors->resultAddress();
|
||||
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
|
||||
if (resVarAddress.resultPosType == RIG_ELEMENT)
|
||||
{
|
||||
const std::vector<float>& resultValues = caseData->femPartResults()->resultValues(resVarAddress, 0, (int)timeStepIndex);
|
||||
const std::vector<size_t>& triangleToCellIdx = m_intersectionBoxGenerator->triangleToCellIndex();
|
||||
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);
|
||||
RigFemPart* femPart = caseData->femParts()->part(0);
|
||||
bool isElementNodalResult = !(resVarAddress.resultPosType == RIG_NODAL);
|
||||
const std::vector<RivIntersectionVertexWeights> &vertexWeights = m_intersectionBoxGenerator->triangleVxToCellCornerInterpolationWeights();
|
||||
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();
|
||||
|
||||
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());
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -60,13 +59,13 @@ private:
|
||||
cvf::ref<RivIntersectionHexGridInterface> createHexGridInterface();
|
||||
|
||||
private:
|
||||
RimIntersectionBox* m_rimIntersectionBox;
|
||||
RimIntersectionBox* m_rimIntersectionBox;
|
||||
|
||||
cvf::Color3f m_defaultColor;
|
||||
cvf::Color3f m_defaultColor;
|
||||
|
||||
cvf::ref<cvf::Part> m_intersectionBoxFaces;
|
||||
cvf::ref<cvf::Part> m_intersectionBoxGridLines;
|
||||
cvf::ref<cvf::Vec2fArray> m_intersectionBoxFacesTextureCoords;
|
||||
cvf::ref<cvf::Part> m_intersectionBoxFaces;
|
||||
cvf::ref<cvf::Part> m_intersectionBoxGridLines;
|
||||
cvf::ref<cvf::Vec2fArray> m_intersectionBoxFacesTextureCoords;
|
||||
|
||||
cvf::ref<RivIntersectionBoxGeometryGenerator> m_intersectionBoxGenerator;
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
cvf::Vec3d direction = m_rimCrossSection->extrusionDirection();
|
||||
cvf::ref<RivIntersectionHexGridInterface> hexGrid = createHexGridInterface();
|
||||
m_crossSectionGenerator = new RivIntersectionGeometryGenerator(
|
||||
m_rimCrossSection, polyLines, direction, hexGrid.p(), m_isFlattened, flattenedPolylineStartPoint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,7 +124,7 @@ void RivIntersectionPartMgr::applySingleColorEffect()
|
||||
|
||||
if (m_crossSectionGridLines.notNull())
|
||||
{
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator CrossSectionEffGen(prefs->defaultGridLineColors());
|
||||
eff = CrossSectionEffGen.generateCachedEffect();
|
||||
|
||||
@@ -138,7 +133,7 @@ void RivIntersectionPartMgr::applySingleColorEffect()
|
||||
|
||||
if (m_crossSectionFaultGridLines.notNull())
|
||||
{
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator CrossSectionEffGen(prefs->defaultFaultGridLineColors());
|
||||
eff = CrossSectionEffGen.generateCachedEffect();
|
||||
|
||||
@@ -149,8 +144,8 @@ void RivIntersectionPartMgr::applySingleColorEffect()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper)
|
||||
{
|
||||
CVF_ASSERT(scalarColorMapper);
|
||||
@@ -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,17 +192,14 @@ 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(),
|
||||
m_crossSectionGenerator->triangleToCellIndex(),
|
||||
resultAccessor.p(),
|
||||
scalarColorMapper);
|
||||
|
||||
m_crossSectionGenerator->triangleToCellIndex(),
|
||||
resultAccessor.p(),
|
||||
scalarColorMapper);
|
||||
|
||||
RivScalarMapperUtils::applyTextureResultsToPart(m_crossSectionFaces.p(),
|
||||
m_crossSectionFacesTextureCoords.p(),
|
||||
@@ -214,7 +207,7 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
|
||||
1.0,
|
||||
caf::FC_NONE,
|
||||
eclipseView->isLightingDisabled());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,38 +217,35 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
|
||||
if (geoView)
|
||||
{
|
||||
RimGeoMechCellColors* cellResultColors = geoView->cellResult();
|
||||
RigGeoMechCaseData* caseData = cellResultColors->ownerCaseData();
|
||||
RigGeoMechCaseData* caseData = cellResultColors->ownerCaseData();
|
||||
|
||||
if (!caseData) return;
|
||||
|
||||
RigFemResultAddress resVarAddress = cellResultColors->resultAddress();
|
||||
RigFemResultAddress resVarAddress = cellResultColors->resultAddress();
|
||||
|
||||
if (resVarAddress.resultPosType == RIG_ELEMENT)
|
||||
{
|
||||
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);
|
||||
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);
|
||||
}
|
||||
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);
|
||||
RigFemPart* femPart = caseData->femParts()->part(0);
|
||||
bool isElementNodalResult = !(resVarAddress.resultPosType == RIG_NODAL);
|
||||
const std::vector<RivIntersectionVertexWeights> &vertexWeights = m_crossSectionGenerator->triangleVxToCellCornerInterpolationWeights();
|
||||
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();
|
||||
|
||||
RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords(m_crossSectionFacesTextureCoords.p(),
|
||||
vertexWeights,
|
||||
@@ -293,16 +286,16 @@ void RivIntersectionPartMgr::updateCellResultColor(size_t timeStepIndex,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
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)
|
||||
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)
|
||||
{
|
||||
textureCoords->resize(vertexWeights.size());
|
||||
|
||||
@@ -319,8 +312,8 @@ void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords
|
||||
#pragma omp parallel for schedule(dynamic)
|
||||
for (int triangleVxIdx = 0; triangleVxIdx < vxCount; ++triangleVxIdx)
|
||||
{
|
||||
float resValue = 0;
|
||||
int weightCount = vertexWeights[triangleVxIdx].size();
|
||||
float resValue = 0;
|
||||
int weightCount = vertexWeights[triangleVxIdx].size();
|
||||
for (int wIdx = 0; wIdx < weightCount; ++wIdx)
|
||||
{
|
||||
size_t resIdx;
|
||||
@@ -338,7 +331,7 @@ void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords
|
||||
|
||||
if (resValue == HUGE_VAL || resValue != resValue) // a != a is true for NAN's
|
||||
{
|
||||
rawPtr[triangleVxIdx][1] = 1.0f;
|
||||
rawPtr[triangleVxIdx][1] = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -351,12 +344,12 @@ void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float> &resultValues,
|
||||
void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float>& resultValues,
|
||||
const std::vector<size_t>& triangleToCellIdx,
|
||||
const cvf::ScalarMapper* mapper)
|
||||
const cvf::ScalarMapper* mapper)
|
||||
{
|
||||
textureCoords->resize(triangleToCellIdx.size()*3);
|
||||
textureCoords->resize(triangleToCellIdx.size() * 3);
|
||||
|
||||
if (resultValues.size() == 0)
|
||||
{
|
||||
@@ -368,20 +361,20 @@ void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(cvf::Vec2
|
||||
|
||||
for (size_t triangleIdx = 0; triangleIdx < triangleToCellIdx.size(); triangleIdx++)
|
||||
{
|
||||
size_t resIdx = triangleToCellIdx[triangleIdx];
|
||||
float resValue = resultValues[resIdx];
|
||||
size_t resIdx = triangleToCellIdx[triangleIdx];
|
||||
float resValue = resultValues[resIdx];
|
||||
|
||||
size_t triangleVxIdx = triangleIdx * 3;
|
||||
|
||||
if (resValue == HUGE_VAL || resValue != resValue) // a != a is true for NAN's
|
||||
{
|
||||
rawPtr[triangleVxIdx][1] = 1.0f;
|
||||
rawPtr[triangleVxIdx][1] = 1.0f;
|
||||
rawPtr[triangleVxIdx + 1][1] = 1.0f;
|
||||
rawPtr[triangleVxIdx + 2][1] = 1.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
rawPtr[triangleVxIdx] = mapper->mapToTextureCoord(resValue);
|
||||
rawPtr[triangleVxIdx] = mapper->mapToTextureCoord(resValue);
|
||||
rawPtr[triangleVxIdx + 1] = mapper->mapToTextureCoord(resValue);
|
||||
rawPtr[triangleVxIdx + 2] = mapper->mapToTextureCoord(resValue);
|
||||
}
|
||||
@@ -392,94 +385,95 @@ void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords(cvf::Vec2
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
void RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const std::vector<RivIntersectionVertexWeights> &vertexWeights,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
int timeStepIdx,
|
||||
const cvf::ScalarMapper* mapper)
|
||||
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;
|
||||
cvf::Vec2f* rawPtr = textureCoords->ptr();
|
||||
int vxCount = static_cast<int>(vertexWeights.size());
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculatePlaneAngleTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
const cvf::ScalarMapper* mapper)
|
||||
void RivIntersectionPartMgr::calculatePlaneAngleTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
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;
|
||||
cvf::Vec2f* rawPtr = textureCoords->ptr();
|
||||
int vxCount = static_cast<int>(triangelVertices->size());
|
||||
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
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculateEclipseTextureCoordinates(cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper)
|
||||
void RivIntersectionPartMgr::calculateEclipseTextureCoordinates(cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper)
|
||||
{
|
||||
if (!resultAccessor) return;
|
||||
|
||||
size_t numVertices = triangleToCellIdxMap.size()*3;
|
||||
size_t numVertices = triangleToCellIdxMap.size() * 3;
|
||||
|
||||
textureCoords->resize(numVertices);
|
||||
cvf::Vec2f* rawPtr = textureCoords->ptr();
|
||||
@@ -489,8 +483,8 @@ void RivIntersectionPartMgr::calculateEclipseTextureCoordinates(cvf::Vec2fArray*
|
||||
#pragma omp parallel for
|
||||
for (int tIdx = 0; tIdx < triangleCount; tIdx++)
|
||||
{
|
||||
double cellScalarValue = resultAccessor->cellScalarGlobIdx(triangleToCellIdxMap[tIdx]);
|
||||
cvf::Vec2f texCoord = mapper->mapToTextureCoord(cellScalarValue);
|
||||
double cellScalarValue = resultAccessor->cellScalarGlobIdx(triangleToCellIdxMap[tIdx]);
|
||||
cvf::Vec2f texCoord = mapper->mapToTextureCoord(cellScalarValue);
|
||||
if (cellScalarValue == HUGE_VAL || cellScalarValue != cellScalarValue) // a != a is true for NAN's
|
||||
{
|
||||
texCoord[1] = 1.0f;
|
||||
@@ -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,9 +593,9 @@ 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_faultMeshLabels = nullptr;
|
||||
m_faultMeshLabelLines = nullptr;
|
||||
|
||||
if (!labelAndAnchors.size()) return;
|
||||
@@ -613,7 +607,7 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
|
||||
if (!(eclipseView && faultInViewColl->showFaultLabel())) return;
|
||||
|
||||
cvf::Color3f defWellLabelColor = faultInViewColl->faultLabelColor();
|
||||
cvf::Font* font = RiaApplication::instance()->customFont();
|
||||
cvf::Font* font = RiaApplication::instance()->customFont();
|
||||
|
||||
std::vector<cvf::Vec3f> lineVertices;
|
||||
|
||||
@@ -627,9 +621,9 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
|
||||
drawableText->setTextColor(defWellLabelColor);
|
||||
}
|
||||
|
||||
cvf::BoundingBox bb = m_crossSectionFaces->boundingBox();
|
||||
double labelZOffset = bb.extent().z() / 10;
|
||||
int visibleFaultNameCount = 0;
|
||||
cvf::BoundingBox bb = m_crossSectionFaces->boundingBox();
|
||||
double labelZOffset = bb.extent().z() / 10;
|
||||
int visibleFaultNameCount = 0;
|
||||
|
||||
for (const auto& labelAndAnchorPair : labelAndAnchors)
|
||||
{
|
||||
@@ -638,7 +632,7 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
|
||||
if (!(fault && fault->showFault())) continue;
|
||||
|
||||
cvf::String cvfString = cvfqt::Utils::toString(labelAndAnchorPair.first);
|
||||
cvf::Vec3f textCoord(labelAndAnchorPair.second);
|
||||
cvf::Vec3f textCoord(labelAndAnchorPair.second);
|
||||
|
||||
textCoord.z() += labelZOffset;
|
||||
drawableText->addText(cvfString, textCoord);
|
||||
@@ -684,12 +678,11 @@ void RivIntersectionPartMgr::createFaultLabelParts(const std::vector<std::pair<Q
|
||||
part->updateBoundingBox();
|
||||
|
||||
caf::MeshEffectGenerator gen(RiaApplication::instance()->preferences()->defaultFaultGridLineColors());
|
||||
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
|
||||
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
m_faultMeshLabelLines = part;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -721,9 +714,9 @@ 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;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
|
||||
eff = lineEffGen.generateUnCachedEffect();
|
||||
|
||||
@@ -753,9 +746,9 @@ 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;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
|
||||
eff = lineEffGen.generateUnCachedEffect();
|
||||
|
||||
@@ -763,7 +756,7 @@ void RivIntersectionPartMgr::createPolyLineParts(bool useBufferObjects)
|
||||
depth->enableDepthTest(false);
|
||||
eff->setRenderState(depth.p());
|
||||
|
||||
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint(cvf::RenderStatePoint::FIXED_SIZE);
|
||||
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint(cvf::RenderStatePoint::FIXED_SIZE);
|
||||
pointRendState->setSize(5.0f);
|
||||
eff->setRenderState(pointRendState.p());
|
||||
|
||||
@@ -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,9 +795,9 @@ 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;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
|
||||
eff = lineEffGen.generateUnCachedEffect();
|
||||
|
||||
@@ -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,9 +828,9 @@ 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;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator lineEffGen(cvf::Color3::MAGENTA);
|
||||
eff = lineEffGen.generateUnCachedEffect();
|
||||
|
||||
@@ -843,7 +838,7 @@ void RivIntersectionPartMgr::createExtrusionDirParts(bool useBufferObjects)
|
||||
depth->enableDepthTest(false);
|
||||
eff->setRenderState(depth.p());
|
||||
|
||||
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint(cvf::RenderStatePoint::FIXED_SIZE);
|
||||
cvf::ref<cvf::RenderStatePoint> pointRendState = new cvf::RenderStatePoint(cvf::RenderStatePoint::FIXED_SIZE);
|
||||
pointRendState->setSize(5.0f);
|
||||
eff->setRenderState(pointRendState.p());
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -869,7 +862,7 @@ cvf::ref<cvf::Part> createStdSurfacePart(cvf::DrawableGeo* geometry,
|
||||
part->setDrawable(geometry);
|
||||
|
||||
caf::SurfaceEffectGenerator surfaceGen(color, caf::PO_1);
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
cvf::ref<cvf::Effect> eff = surfaceGen.generateCachedEffect();
|
||||
part->setEffect(eff.p());
|
||||
|
||||
part->setSourceInfo(sourceInfo);
|
||||
@@ -881,19 +874,16 @@ 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);
|
||||
part->setDrawable(geometry);
|
||||
|
||||
caf::MeshEffectGenerator gen(color);
|
||||
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
|
||||
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
|
||||
|
||||
part->setEffect(eff.p());
|
||||
part->updateBoundingBox();
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -68,11 +68,10 @@ public:
|
||||
explicit RivIntersectionPartMgr(RimIntersection* rimCrossSection, bool isFlattened = false);
|
||||
|
||||
void applySingleColorEffect();
|
||||
void updateCellResultColor(size_t timeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
void updateCellResultColor(size_t timeStepIndex,
|
||||
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);
|
||||
@@ -82,38 +81,40 @@ public:
|
||||
cvf::Mat4d unflattenTransformMatrix(const cvf::Vec3d& intersectionPointFlat);
|
||||
|
||||
public:
|
||||
static void calculateEclipseTextureCoordinates(cvf::Vec2fArray* textureCoords,
|
||||
static void calculateEclipseTextureCoordinates(cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper);
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper);
|
||||
|
||||
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
|
||||
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,
|
||||
static void calculateElementBasedGeoMechTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float>& resultValues,
|
||||
const std::vector<size_t>& triangleToCellIdx,
|
||||
const cvf::ScalarMapper* mapper);
|
||||
const cvf::ScalarMapper* mapper);
|
||||
|
||||
static void calculateGeoMechTensorXfTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const std::vector<RivIntersectionVertexWeights> &vertexWeights,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
int timeStepIdx,
|
||||
const cvf::ScalarMapper* mapper);
|
||||
static void calculateGeoMechTensorXfTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
int timeStepIdx,
|
||||
const cvf::ScalarMapper* mapper);
|
||||
|
||||
static void calculatePlaneAngleTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
static void calculatePlaneAngleTextureCoords(cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
const cvf::ScalarMapper* mapper);
|
||||
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);
|
||||
|
||||
@@ -122,30 +123,27 @@ private:
|
||||
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<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::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;
|
||||
|
||||
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;
|
||||
cvf::ref<cvf::Part> m_surfacePart;
|
||||
cvf::ref<cvf::Part> m_centerLinePart;
|
||||
cvf::ref<RivPipeGeometryGenerator> m_pipeGeomGenerator;
|
||||
cvf::ref<cvf::Part> m_surfacePart;
|
||||
cvf::ref<cvf::Part> m_centerLinePart;
|
||||
};
|
||||
std::list<RivPipeBranchData> m_wellBranches;
|
||||
|
||||
bool m_isFlattened;
|
||||
bool m_isFlattened;
|
||||
};
|
||||
|
||||
|
||||
@@ -44,36 +44,38 @@
|
||||
#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_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_nativeFaultFacesTextureCoords = new cvf::Vec2fArray;
|
||||
m_oppositeFaultFacesTextureCoords = new cvf::Vec2fArray;
|
||||
m_NNCTextureCoords = new cvf::Vec2fArray;
|
||||
m_NNCTextureCoords = new cvf::Vec2fArray;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -113,22 +115,26 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
|
||||
{
|
||||
if (cellResultColors->isTernarySaturationSelected())
|
||||
{
|
||||
RivTernaryTextureCoordsCreator texturer(cellResultColors, cellResultColors->ternaryLegendConfig(),
|
||||
timeStepIndex,
|
||||
m_grid->gridIndex(),
|
||||
m_nativeFaultGenerator->quadToCellFaceMapper());
|
||||
RivTernaryTextureCoordsCreator texturer(cellResultColors,
|
||||
cellResultColors->ternaryLegendConfig(),
|
||||
timeStepIndex,
|
||||
m_grid->gridIndex(),
|
||||
m_nativeFaultGenerator->quadToCellFaceMapper());
|
||||
|
||||
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,22 +157,26 @@ void RivFaultPartMgr::updateCellResultColor(size_t timeStepIndex, RimEclipseCell
|
||||
{
|
||||
if (cellResultColors->isTernarySaturationSelected())
|
||||
{
|
||||
RivTernaryTextureCoordsCreator texturer(cellResultColors, cellResultColors->ternaryLegendConfig(),
|
||||
timeStepIndex,
|
||||
m_grid->gridIndex(),
|
||||
m_oppositeFaultGenerator->quadToCellFaceMapper());
|
||||
RivTernaryTextureCoordsCreator texturer(cellResultColors,
|
||||
cellResultColors->ternaryLegendConfig(),
|
||||
timeStepIndex,
|
||||
m_grid->gridIndex(),
|
||||
m_oppositeFaultGenerator->quadToCellFaceMapper());
|
||||
|
||||
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(),
|
||||
m_grid->gridIndex(),
|
||||
timeStepIndex, cellResultColors, cellEdgeResultColors, m_opacityLevel, m_defaultColor, this->faceCullingMode(), cellResultColors->reservoirView()->isLightingDisabled());
|
||||
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());
|
||||
|
||||
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
|
||||
{
|
||||
@@ -233,7 +271,7 @@ void RivFaultPartMgr::generatePartGeometry()
|
||||
part->setDrawable(geo.p());
|
||||
|
||||
// Set mapping from triangle face index to cell index
|
||||
cvf::ref<RivSourceInfo> si = new RivSourceInfo(m_rimFault, m_grid->gridIndex());
|
||||
cvf::ref<RivSourceInfo> si = new RivSourceInfo(m_rimFault, m_grid->gridIndex());
|
||||
si->m_cellFaceFromTriangleMapper = m_nativeFaultGenerator->triangleToCellFaceMapper();
|
||||
part->setSourceInfo(si.p());
|
||||
|
||||
@@ -269,7 +307,6 @@ void RivFaultPartMgr::generatePartGeometry()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Surface geometry
|
||||
{
|
||||
cvf::ref<cvf::DrawableGeo> geo = m_oppositeFaultGenerator->generateSurface();
|
||||
@@ -287,7 +324,7 @@ void RivFaultPartMgr::generatePartGeometry()
|
||||
part->setDrawable(geo.p());
|
||||
|
||||
// Set mapping from triangle face index to cell index
|
||||
cvf::ref<RivSourceInfo> si = new RivSourceInfo(m_rimFault, m_grid->gridIndex());
|
||||
cvf::ref<RivSourceInfo> si = new RivSourceInfo(m_rimFault, m_grid->gridIndex());
|
||||
si->m_cellFaceFromTriangleMapper = m_oppositeFaultGenerator->triangleToCellFaceMapper();
|
||||
part->setSourceInfo(si.p());
|
||||
|
||||
@@ -340,7 +377,7 @@ void RivFaultPartMgr::generatePartGeometry()
|
||||
|
||||
// Set mapping from triangle face index to cell index
|
||||
cvf::ref<RivSourceInfo> si = new RivSourceInfo(m_rimFault, m_grid->gridIndex());
|
||||
si->m_NNCIndices = m_NNCGenerator->triangleToNNCIndex().p();
|
||||
si->m_NNCIndices = m_NNCGenerator->triangleToNNCIndex().p();
|
||||
part->setSourceInfo(si.p());
|
||||
|
||||
part->updateBoundingBox();
|
||||
@@ -356,7 +393,6 @@ void RivFaultPartMgr::generatePartGeometry()
|
||||
updatePartEffect();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -383,7 +419,7 @@ void RivFaultPartMgr::updatePartEffect()
|
||||
// Update mesh colors as well, in case of change
|
||||
RiaPreferences* prefs = RiaApplication::instance()->preferences();
|
||||
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
cvf::ref<cvf::Effect> eff;
|
||||
caf::MeshEffectGenerator faultEffGen(prefs->defaultFaultGridLineColors());
|
||||
eff = faultEffGen.generateCachedEffect();
|
||||
|
||||
@@ -402,7 +438,7 @@ void RivFaultPartMgr::updatePartEffect()
|
||||
// Set priority to make sure this transparent geometry are rendered last
|
||||
if (m_nativeFaultFaces.notNull()) m_nativeFaultFaces->setPriority(RivPartPriority::PartType::TransparentFault);
|
||||
if (m_oppositeFaultFaces.notNull()) m_oppositeFaultFaces->setPriority(RivPartPriority::PartType::TransparentFault);
|
||||
if (m_NNCFaces.notNull()) m_NNCFaces->setPriority(RivPartPriority::PartType::TransparentNnc);
|
||||
if (m_NNCFaces.notNull()) m_NNCFaces->setPriority(RivPartPriority::PartType::TransparentNnc);
|
||||
|
||||
if (m_nativeFaultGridLines.notNull())
|
||||
{
|
||||
@@ -421,7 +457,7 @@ void RivFaultPartMgr::updatePartEffect()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part)
|
||||
{
|
||||
m_faultLabelPart = nullptr;
|
||||
m_faultLabelPart = nullptr;
|
||||
m_faultLabelLinePart = nullptr;
|
||||
|
||||
if (!part) return;
|
||||
@@ -429,7 +465,7 @@ void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part)
|
||||
cvf::BoundingBox bb = part->boundingBox();
|
||||
|
||||
cvf::Vec3d bbTopCenter = bb.center();
|
||||
bbTopCenter.z() = bb.max().z();
|
||||
bbTopCenter.z() = bb.max().z();
|
||||
|
||||
const cvf::DrawableGeo* geo = dynamic_cast<const cvf::DrawableGeo*>(part->drawable());
|
||||
|
||||
@@ -460,7 +496,7 @@ void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part)
|
||||
m_rimFault->firstAncestorOrThisOfType(parentObject);
|
||||
if (parentObject)
|
||||
{
|
||||
defWellLabelColor = parentObject->faultLabelColor();;
|
||||
defWellLabelColor = parentObject->faultLabelColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -470,7 +506,7 @@ void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part)
|
||||
cvf::String cvfString = cvfqt::Utils::toString(m_rimFault->name());
|
||||
|
||||
cvf::Vec3f textCoord(labelPosition);
|
||||
double characteristicCellSize = bb.extent().z() / 20;
|
||||
double characteristicCellSize = bb.extent().z() / 20;
|
||||
textCoord.z() += characteristicCellSize;
|
||||
|
||||
drawableText->addText(cvfString, textCoord);
|
||||
@@ -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;
|
||||
@@ -510,7 +545,7 @@ void RivFaultPartMgr::createLabelWithAnchorLine(const cvf::Part* part)
|
||||
m_faultLabelLinePart->updateBoundingBox();
|
||||
|
||||
caf::MeshEffectGenerator gen(m_rimFault->faultColor());
|
||||
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
|
||||
cvf::ref<cvf::Effect> eff = gen.generateCachedEffect();
|
||||
|
||||
m_faultLabelLinePart->setEffect(eff.p());
|
||||
}
|
||||
@@ -535,7 +570,7 @@ cvf::Vec3f RivFaultPartMgr::findClosestVertex(const cvf::Vec3f& point, const cvf
|
||||
|
||||
if (diff < closestDiff)
|
||||
{
|
||||
closestDiff = diff;
|
||||
closestDiff = diff;
|
||||
closestIndex = i;
|
||||
}
|
||||
}
|
||||
@@ -577,8 +612,8 @@ void RivFaultPartMgr::appendOppositeFaultFacesToModel(cvf::ModelBasicList* model
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFaultPartMgr::appendLabelPartsToModel(cvf::ModelBasicList* model)
|
||||
{
|
||||
if (m_faultLabelPart.notNull()) model->addPart(m_faultLabelPart.p());
|
||||
if (m_faultLabelLinePart.notNull()) model->addPart(m_faultLabelLinePart.p());
|
||||
if (m_faultLabelPart.notNull()) model->addPart(m_faultLabelPart.p());
|
||||
if (m_faultLabelLinePart.notNull()) model->addPart(m_faultLabelLinePart.p());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -586,7 +621,7 @@ void RivFaultPartMgr::appendLabelPartsToModel(cvf::ModelBasicList* model)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFaultPartMgr::appendMeshLinePartsToModel(cvf::ModelBasicList* model)
|
||||
{
|
||||
if (m_nativeFaultGridLines.notNull()) model->addPart(m_nativeFaultGridLines.p());
|
||||
if (m_nativeFaultGridLines.notNull()) model->addPart(m_nativeFaultGridLines.p());
|
||||
if (m_oppositeFaultGridLines.notNull()) model->addPart(m_oppositeFaultGridLines.p());
|
||||
}
|
||||
|
||||
@@ -595,7 +630,7 @@ void RivFaultPartMgr::appendMeshLinePartsToModel(cvf::ModelBasicList* model)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivFaultPartMgr::appendNNCFacesToModel(cvf::ModelBasicList* model)
|
||||
{
|
||||
if (m_NNCFaces.notNull()) model->addPart(m_NNCFaces.p());
|
||||
if (m_NNCFaces.notNull()) model->addPart(m_NNCFaces.p());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -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)
|
||||
{
|
||||
@@ -630,7 +665,7 @@ caf::FaceCulling RivFaultPartMgr::faceCullingMode() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return caf::FC_NONE;
|
||||
return caf::FC_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -664,8 +699,8 @@ void RivFaultPartMgr::updateNNCColors(size_t timeStepIndex, RimEclipseCellColors
|
||||
|
||||
if (showNncsWithScalarMappedColor)
|
||||
{
|
||||
size_t scalarSetIndex = cellResultColors->scalarResultIndex();
|
||||
RiaDefines::ResultCatType resultType = cellResultColors->resultType();
|
||||
size_t scalarSetIndex = cellResultColors->scalarResultIndex();
|
||||
RiaDefines::ResultCatType resultType = cellResultColors->resultType();
|
||||
|
||||
const cvf::ScalarMapper* mapper = cellResultColors->legendConfig()->scalarMapper();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,9 +741,9 @@ void RivFaultPartMgr::updateNNCColors(size_t timeStepIndex, RimEclipseCellColors
|
||||
{
|
||||
// NNC faces a bit lighter than the fault for now
|
||||
cvf::Color3f nncColor = m_defaultColor;
|
||||
nncColor.r() += (1.0 - nncColor.r()) * 0.2;
|
||||
nncColor.g() += (1.0 - nncColor.g()) * 0.2;
|
||||
nncColor.b() += (1.0 - nncColor.b()) * 0.2;
|
||||
nncColor.r() += (1.0 - nncColor.r()) * 0.2;
|
||||
nncColor.g() += (1.0 - nncColor.g()) * 0.2;
|
||||
nncColor.b() += (1.0 - nncColor.b()) * 0.2;
|
||||
|
||||
CVF_ASSERT(nncColor.isValid());
|
||||
cvf::ref<cvf::Effect> nncEffect;
|
||||
@@ -728,4 +764,3 @@ void RivFaultPartMgr::updateNNCColors(size_t timeStepIndex, RimEclipseCellColors
|
||||
m_NNCFaces->setEffect(nncEffect.p());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user