mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5019 Use the static methods to color intersections as well
Move all the color/texture generation methods into a separate tools class. (Only scope wise)
This commit is contained in:
@@ -223,3 +223,12 @@ private:
|
||||
std::array<float, 8> m_weights;
|
||||
int m_count;
|
||||
};
|
||||
|
||||
class RivIntersectionGeometryGeneratorIF
|
||||
{
|
||||
public:
|
||||
virtual bool isAnyGeometryPresent() const = 0;
|
||||
virtual const std::vector<size_t>& triangleToCellIndex() const = 0;
|
||||
virtual const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const = 0;
|
||||
virtual const cvf::Vec3fArray* triangleVxes() const = 0;
|
||||
};
|
||||
|
||||
@@ -37,14 +37,6 @@ class ScalarMapper;
|
||||
class DrawableGeo;
|
||||
} // namespace cvf
|
||||
|
||||
class RivIntersectionGeometryGeneratorIF
|
||||
{
|
||||
public:
|
||||
virtual bool isAnyGeometryPresent() const = 0;
|
||||
virtual const std::vector<size_t>& triangleToCellIndex() const = 0;
|
||||
virtual const std::vector<RivIntersectionVertexWeights>& triangleVxToCellCornerInterpolationWeights() const = 0;
|
||||
virtual const cvf::Vec3fArray* triangleVxes() const = 0;
|
||||
};
|
||||
|
||||
class RivIntersectionBoxGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorIF
|
||||
{
|
||||
|
||||
@@ -83,17 +83,17 @@ void RivIntersectionBoxPartMgr::applySingleColorEffect()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionBoxPartMgr::updateCellResultColor( size_t timeStepIndex )
|
||||
{
|
||||
RivIntersectionBoxPartMgr::updateCellResultColorStatic( timeStepIndex,
|
||||
m_rimIntersectionBox,
|
||||
m_intersectionBoxGenerator.p(),
|
||||
m_intersectionBoxFaces.p(),
|
||||
m_intersectionBoxFacesTextureCoords.p() );
|
||||
RivIntersectionResultsColoringTools::updateCellResultColorStatic( timeStepIndex,
|
||||
m_rimIntersectionBox,
|
||||
m_intersectionBoxGenerator.p(),
|
||||
m_intersectionBoxFaces.p(),
|
||||
m_intersectionBoxFacesTextureCoords.p() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionBoxPartMgr::updateCellResultColorStatic(
|
||||
void RivIntersectionResultsColoringTools::updateCellResultColorStatic(
|
||||
size_t timeStepIndex,
|
||||
RimIntersectionHandle* rimIntersectionHandle,
|
||||
const RivIntersectionGeometryGeneratorIF* intersectionGeomGenIF,
|
||||
@@ -163,34 +163,35 @@ void RivIntersectionBoxPartMgr::updateCellResultColorStatic(
|
||||
{
|
||||
if ( eclipseResDef->isTernarySaturationSelected() )
|
||||
{
|
||||
updateEclipseTernaryCellResultColors( eclipseResDef,
|
||||
ternaryColorMapper,
|
||||
timeStepIndex,
|
||||
isLightingDisabled,
|
||||
intersectionGeomGenIF->triangleToCellIndex(),
|
||||
intersectionFacesPart,
|
||||
intersectionFacesTextureCoords );
|
||||
RivIntersectionResultsColoringTools::updateEclipseTernaryCellResultColors( eclipseResDef,
|
||||
ternaryColorMapper,
|
||||
timeStepIndex,
|
||||
isLightingDisabled,
|
||||
intersectionGeomGenIF
|
||||
->triangleToCellIndex(),
|
||||
intersectionFacesPart,
|
||||
intersectionFacesTextureCoords );
|
||||
}
|
||||
else
|
||||
{
|
||||
updateEclipseCellResultColors( eclipseResDef,
|
||||
scalarColorMapper,
|
||||
timeStepIndex,
|
||||
isLightingDisabled,
|
||||
intersectionGeomGenIF->triangleToCellIndex(),
|
||||
intersectionFacesPart,
|
||||
intersectionFacesTextureCoords );
|
||||
RivIntersectionResultsColoringTools::updateEclipseCellResultColors( eclipseResDef,
|
||||
scalarColorMapper,
|
||||
timeStepIndex,
|
||||
isLightingDisabled,
|
||||
intersectionGeomGenIF->triangleToCellIndex(),
|
||||
intersectionFacesPart,
|
||||
intersectionFacesTextureCoords );
|
||||
}
|
||||
}
|
||||
else if ( geomResultDef )
|
||||
{
|
||||
updateGeoMechCellResultColors( geomResultDef,
|
||||
timeStepIndex,
|
||||
scalarColorMapper,
|
||||
isLightingDisabled,
|
||||
intersectionGeomGenIF,
|
||||
intersectionFacesPart,
|
||||
intersectionFacesTextureCoords );
|
||||
RivIntersectionResultsColoringTools::updateGeoMechCellResultColors( geomResultDef,
|
||||
timeStepIndex,
|
||||
scalarColorMapper,
|
||||
isLightingDisabled,
|
||||
intersectionGeomGenIF,
|
||||
intersectionFacesPart,
|
||||
intersectionFacesTextureCoords );
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -198,13 +199,14 @@ void RivIntersectionBoxPartMgr::updateCellResultColorStatic(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionBoxPartMgr::updateEclipseCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
void RivIntersectionResultsColoringTools::updateEclipseCellResultColors(
|
||||
const RimEclipseResultDefinition* eclipseResDef,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseResDef->eclipseCase()->eclipseCaseData();
|
||||
|
||||
@@ -222,10 +224,10 @@ void RivIntersectionBoxPartMgr::updateEclipseCellResultColors( const RimEclipseR
|
||||
eclipseResDef );
|
||||
}
|
||||
|
||||
RivIntersectionPartMgr::calculateEclipseTextureCoordinates( intersectionFacesTextureCoords,
|
||||
triangleToCellIndexMapping,
|
||||
resultAccessor.p(),
|
||||
scalarColorMapper );
|
||||
RivIntersectionResultsColoringTools::calculateEclipseTextureCoordinates( intersectionFacesTextureCoords,
|
||||
triangleToCellIndexMapping,
|
||||
resultAccessor.p(),
|
||||
scalarColorMapper );
|
||||
|
||||
RivScalarMapperUtils::applyTextureResultsToPart( intersectionFacesPart,
|
||||
intersectionFacesTextureCoords,
|
||||
@@ -238,13 +240,14 @@ void RivIntersectionBoxPartMgr::updateEclipseCellResultColors( const RimEclipseR
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionBoxPartMgr::updateEclipseTernaryCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
void RivIntersectionResultsColoringTools::updateEclipseTernaryCellResultColors(
|
||||
const RimEclipseResultDefinition* eclipseResDef,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
RivTernaryTextureCoordsCreator texturer( eclipseResDef, ternaryColorMapper, timeStepIndex );
|
||||
|
||||
@@ -261,13 +264,14 @@ void RivIntersectionBoxPartMgr::updateEclipseTernaryCellResultColors( const RimE
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionBoxPartMgr::updateGeoMechCellResultColors( const RimGeoMechResultDefinition* geomResultDef,
|
||||
size_t timeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
bool isLightingDisabled,
|
||||
const RivIntersectionGeometryGeneratorIF* geomGenerator,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
|
||||
const RimGeoMechResultDefinition* geomResultDef,
|
||||
size_t timeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
bool isLightingDisabled,
|
||||
const RivIntersectionGeometryGeneratorIF* geomGenerator,
|
||||
cvf::Part* intersectionFacesPart,
|
||||
cvf::Vec2fArray* intersectionFacesTextureCoords )
|
||||
{
|
||||
RigGeoMechCaseData* caseData = nullptr;
|
||||
RigFemResultAddress resVarAddress;
|
||||
@@ -289,10 +293,10 @@ void RivIntersectionBoxPartMgr::updateGeoMechCellResultColors( const RimGeoMechR
|
||||
0,
|
||||
(int)timeStepIndex );
|
||||
|
||||
RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
|
||||
resultValues,
|
||||
triangleToCellIdx,
|
||||
scalarColorMapper );
|
||||
RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
|
||||
resultValues,
|
||||
triangleToCellIdx,
|
||||
scalarColorMapper );
|
||||
}
|
||||
else if ( resVarAddress.resultPosType == RIG_ELEMENT_NODAL_FACE )
|
||||
{
|
||||
@@ -300,20 +304,20 @@ void RivIntersectionBoxPartMgr::updateGeoMechCellResultColors( const RimGeoMechR
|
||||
|
||||
if ( resVarAddress.componentName == "Pazi" || resVarAddress.componentName == "Pinc" )
|
||||
{
|
||||
RivIntersectionPartMgr::calculatePlaneAngleTextureCoords( intersectionFacesTextureCoords,
|
||||
triangelVxes,
|
||||
resVarAddress,
|
||||
scalarColorMapper );
|
||||
RivIntersectionResultsColoringTools::calculatePlaneAngleTextureCoords( intersectionFacesTextureCoords,
|
||||
triangelVxes,
|
||||
resVarAddress,
|
||||
scalarColorMapper );
|
||||
}
|
||||
else
|
||||
{
|
||||
RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords( intersectionFacesTextureCoords,
|
||||
triangelVxes,
|
||||
vertexWeights,
|
||||
caseData,
|
||||
resVarAddress,
|
||||
(int)timeStepIndex,
|
||||
scalarColorMapper );
|
||||
RivIntersectionResultsColoringTools::calculateGeoMechTensorXfTextureCoords( intersectionFacesTextureCoords,
|
||||
triangelVxes,
|
||||
vertexWeights,
|
||||
caseData,
|
||||
resVarAddress,
|
||||
(int)timeStepIndex,
|
||||
scalarColorMapper );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -332,12 +336,12 @@ void RivIntersectionBoxPartMgr::updateGeoMechCellResultColors( const RimGeoMechR
|
||||
RigFemPart* femPart = caseData->femParts()->part( 0 );
|
||||
bool isElementNodalResult = !( resVarAddress.resultPosType == RIG_NODAL );
|
||||
|
||||
RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
|
||||
vertexWeights,
|
||||
resultValues,
|
||||
isElementNodalResult,
|
||||
femPart,
|
||||
scalarColorMapper );
|
||||
RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
|
||||
vertexWeights,
|
||||
resultValues,
|
||||
isElementNodalResult,
|
||||
femPart,
|
||||
scalarColorMapper );
|
||||
}
|
||||
|
||||
RivScalarMapperUtils::applyTextureResultsToPart( intersectionFacesPart,
|
||||
|
||||
@@ -44,7 +44,6 @@ class RimGeoMechView;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimGeoMechResultDefinition;
|
||||
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
@@ -55,8 +54,8 @@ class RivIntersectionBoxPartMgr : public cvf::Object
|
||||
public:
|
||||
explicit RivIntersectionBoxPartMgr( RimIntersectionBox* intersectionBox );
|
||||
|
||||
void applySingleColorEffect();
|
||||
void updateCellResultColor( size_t timeStepIndex );
|
||||
void applySingleColorEffect();
|
||||
void updateCellResultColor( size_t timeStepIndex );
|
||||
|
||||
void appendNativeCrossSectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
|
||||
void appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
|
||||
@@ -65,35 +64,6 @@ private:
|
||||
void updatePartEffect();
|
||||
void generatePartGeometry();
|
||||
|
||||
static void updateCellResultColorStatic( size_t timeStepIndex,
|
||||
RimIntersectionHandle* m_rimIntersectionBox,
|
||||
const RivIntersectionGeometryGeneratorIF* m_intersectionBoxGenerator,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
static void updateEclipseCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
static void updateEclipseTernaryCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
static void updateGeoMechCellResultColors( const RimGeoMechResultDefinition* geomResultDef,
|
||||
size_t timeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
bool isLightingDisabled,
|
||||
const RivIntersectionGeometryGeneratorIF* geomGenerator,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
private:
|
||||
RimIntersectionBox* m_rimIntersectionBox;
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "cafPdmPointer.h"
|
||||
|
||||
#include "RivHexGridIntersectionTools.h"
|
||||
|
||||
#include "cvfArray.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
@@ -44,7 +46,7 @@ class ScalarMapper;
|
||||
class DrawableGeo;
|
||||
} // namespace cvf
|
||||
|
||||
class RivIntersectionGeometryGenerator : public cvf::Object
|
||||
class RivIntersectionGeometryGenerator : public cvf::Object, public RivIntersectionGeometryGeneratorIF
|
||||
{
|
||||
public:
|
||||
RivIntersectionGeometryGenerator( RimIntersection* crossSection,
|
||||
|
||||
@@ -152,164 +152,17 @@ void RivIntersectionPartMgr::updateCellResultColor( size_t
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper )
|
||||
{
|
||||
if ( !m_crossSectionGenerator->isAnyGeometryPresent() ) return;
|
||||
|
||||
CVF_ASSERT( scalarColorMapper );
|
||||
|
||||
RimEclipseView* eclipseView = nullptr;
|
||||
m_rimCrossSection->firstAncestorOrThisOfType( eclipseView );
|
||||
|
||||
if ( eclipseView )
|
||||
{
|
||||
bool isLightingDisabled = eclipseView->isLightingDisabled();
|
||||
|
||||
RimEclipseResultDefinition* eclipseResDef = eclipseView->cellResult();
|
||||
bool isTernaryResult = eclipseResDef->isTernarySaturationSelected();
|
||||
RigEclipseCaseData* eclipseCaseData = eclipseResDef->eclipseCase()->eclipseCaseData();
|
||||
|
||||
CVF_ASSERT( eclipseResDef );
|
||||
|
||||
// CrossSections
|
||||
if ( m_crossSectionFaces.notNull() )
|
||||
{
|
||||
if ( isTernaryResult )
|
||||
{
|
||||
RivTernaryTextureCoordsCreator texturer( eclipseResDef, ternaryColorMapper, timeStepIndex );
|
||||
|
||||
texturer.createTextureCoords( m_crossSectionFacesTextureCoords.p(),
|
||||
m_crossSectionGenerator->triangleToCellIndex() );
|
||||
|
||||
RivScalarMapperUtils::applyTernaryTextureResultsToPart( m_crossSectionFaces.p(),
|
||||
m_crossSectionFacesTextureCoords.p(),
|
||||
ternaryColorMapper,
|
||||
1.0,
|
||||
caf::FC_NONE,
|
||||
isLightingDisabled );
|
||||
}
|
||||
else
|
||||
{
|
||||
CVF_ASSERT( m_crossSectionGenerator.notNull() );
|
||||
|
||||
cvf::ref<RigResultAccessor> resultAccessor;
|
||||
|
||||
if ( RiaDefines::isPerCellFaceResult( eclipseResDef->resultVariable() ) )
|
||||
{
|
||||
resultAccessor = new RigHugeValResultAccessor;
|
||||
}
|
||||
else
|
||||
{
|
||||
resultAccessor = RigResultAccessorFactory::createFromResultDefinition( eclipseCaseData,
|
||||
0,
|
||||
timeStepIndex,
|
||||
eclipseResDef );
|
||||
}
|
||||
|
||||
RivIntersectionPartMgr::calculateEclipseTextureCoordinates( m_crossSectionFacesTextureCoords.p(),
|
||||
m_crossSectionGenerator->triangleToCellIndex(),
|
||||
resultAccessor.p(),
|
||||
scalarColorMapper );
|
||||
|
||||
RivScalarMapperUtils::applyTextureResultsToPart( m_crossSectionFaces.p(),
|
||||
m_crossSectionFacesTextureCoords.p(),
|
||||
scalarColorMapper,
|
||||
1.0,
|
||||
caf::FC_NONE,
|
||||
isLightingDisabled );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RimGeoMechView* geoView;
|
||||
m_rimCrossSection->firstAncestorOrThisOfType( geoView );
|
||||
|
||||
if ( geoView )
|
||||
{
|
||||
bool isLightingDisabled = geoView->isLightingDisabled();
|
||||
|
||||
RigGeoMechCaseData* caseData = nullptr;
|
||||
RigFemResultAddress resVarAddress;
|
||||
{
|
||||
RimGeoMechResultDefinition* geomResultDef = geoView->cellResult();
|
||||
caseData = geomResultDef->ownerCaseData();
|
||||
resVarAddress = geomResultDef->resultAddress();
|
||||
}
|
||||
|
||||
if ( !caseData ) return;
|
||||
|
||||
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 );
|
||||
}
|
||||
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 );
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights =
|
||||
m_crossSectionGenerator->triangleVxToCellCornerInterpolationWeights();
|
||||
|
||||
RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords( m_crossSectionFacesTextureCoords.p(),
|
||||
triangelVxes,
|
||||
vertexWeights,
|
||||
caseData,
|
||||
resVarAddress,
|
||||
(int)timeStepIndex,
|
||||
scalarColorMapper );
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
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,
|
||||
resultValues,
|
||||
isElementNodalResult,
|
||||
femPart,
|
||||
scalarColorMapper );
|
||||
}
|
||||
|
||||
RivScalarMapperUtils::applyTextureResultsToPart( m_crossSectionFaces.p(),
|
||||
m_crossSectionFacesTextureCoords.p(),
|
||||
scalarColorMapper,
|
||||
1.0,
|
||||
caf::FC_NONE,
|
||||
isLightingDisabled );
|
||||
}
|
||||
RivIntersectionResultsColoringTools::updateCellResultColorStatic( timeStepIndex,
|
||||
m_rimCrossSection,
|
||||
m_crossSectionGenerator.p(),
|
||||
m_crossSectionFaces.p(),
|
||||
m_crossSectionFacesTextureCoords.p() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords(
|
||||
void RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMechTextureCoords(
|
||||
cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
const std::vector<float>& resultValues,
|
||||
@@ -364,10 +217,11 @@ void RivIntersectionPartMgr::calculateNodeOrElementNodeBasedGeoMechTextureCoords
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float>& resultValues,
|
||||
const std::vector<size_t>& triangleToCellIdx,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
void RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords(
|
||||
cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<float>& resultValues,
|
||||
const std::vector<size_t>& triangleToCellIdx,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
textureCoords->resize( triangleToCellIdx.size() * 3 );
|
||||
|
||||
@@ -405,7 +259,7 @@ void RivIntersectionPartMgr::calculateElementBasedGeoMechTextureCoords( cvf::Vec
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords(
|
||||
void RivIntersectionResultsColoringTools::calculateGeoMechTensorXfTextureCoords(
|
||||
cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
|
||||
@@ -446,10 +300,10 @@ void RivIntersectionPartMgr::calculateGeoMechTensorXfTextureCoords(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RivIntersectionPartMgr::calculatePlaneAngleTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
void RivIntersectionResultsColoringTools::calculatePlaneAngleTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
textureCoords->resize( triangelVertices->size() );
|
||||
cvf::Vec2f* rawPtr = textureCoords->ptr();
|
||||
@@ -493,10 +347,10 @@ void RivIntersectionPartMgr::calculatePlaneAngleTextureCoords( cvf::Vec2fArray*
|
||||
/// 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 RivIntersectionResultsColoringTools::calculateEclipseTextureCoordinates( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
const RigResultAccessor* resultAccessor,
|
||||
const cvf::ScalarMapper* mapper )
|
||||
{
|
||||
if ( !resultAccessor ) return;
|
||||
|
||||
|
||||
@@ -80,37 +80,6 @@ public:
|
||||
cvf::Mat4d unflattenTransformMatrix( const cvf::Vec3d& intersectionPointFlat );
|
||||
|
||||
public:
|
||||
static void calculateEclipseTextureCoordinates( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
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 calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
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,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
int timeStepIdx,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
|
||||
static void calculatePlaneAngleTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
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 );
|
||||
@@ -144,3 +113,74 @@ private:
|
||||
|
||||
bool m_isFlattened;
|
||||
};
|
||||
|
||||
class RimIntersectionHandle;
|
||||
class RivIntersectionGeometryGeneratorIF;
|
||||
class RimEclipseResultDefinition;
|
||||
class RimGeoMechResultDefinition;
|
||||
|
||||
class RivIntersectionResultsColoringTools
|
||||
{
|
||||
public:
|
||||
static void updateCellResultColorStatic( size_t timeStepIndex,
|
||||
RimIntersectionHandle* m_rimIntersectionBox,
|
||||
const RivIntersectionGeometryGeneratorIF* m_intersectionBoxGenerator,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
private:
|
||||
static void updateEclipseCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
static void updateEclipseTernaryCellResultColors( const RimEclipseResultDefinition* eclipseResDef,
|
||||
const RivTernaryScalarMapper* ternaryColorMapper,
|
||||
size_t timeStepIndex,
|
||||
bool isLightingDisabled,
|
||||
const std::vector<size_t>& triangleToCellIndexMapping,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
static void updateGeoMechCellResultColors( const RimGeoMechResultDefinition* geomResultDef,
|
||||
size_t timeStepIndex,
|
||||
const cvf::ScalarMapper* scalarColorMapper,
|
||||
bool isLightingDisabled,
|
||||
const RivIntersectionGeometryGeneratorIF* geomGenerator,
|
||||
cvf::Part* m_intersectionBoxFaces,
|
||||
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
|
||||
|
||||
static void calculateEclipseTextureCoordinates( cvf::Vec2fArray* textureCoords,
|
||||
const std::vector<size_t>& triangleToCellIdxMap,
|
||||
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 calculateElementBasedGeoMechTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
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,
|
||||
RigGeoMechCaseData* caseData,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
int timeStepIdx,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
|
||||
static void calculatePlaneAngleTextureCoords( cvf::Vec2fArray* textureCoords,
|
||||
const cvf::Vec3fArray* triangelVertices,
|
||||
const RigFemResultAddress& resVarAddress,
|
||||
const cvf::ScalarMapper* mapper );
|
||||
};
|
||||
Reference in New Issue
Block a user