Geomech frames support (#9678)

Support for showing frames in geomech data.
This commit is contained in:
jonjenssen
2023-01-18 14:42:33 +01:00
committed by GitHub
parent 95202ad36a
commit 85f1b004cb
106 changed files with 2468 additions and 1948 deletions

View File

@@ -81,7 +81,7 @@ void RivBoxIntersectionPartMgr::applySingleColorEffect()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivBoxIntersectionPartMgr::updateCellResultColor( size_t timeStepIndex )
void RivBoxIntersectionPartMgr::updateCellResultColor( int timeStepIndex )
{
RivIntersectionResultsColoringTools::calculateIntersectionResultColors( timeStepIndex,
true,

View File

@@ -56,7 +56,7 @@ public:
explicit RivBoxIntersectionPartMgr( RimBoxIntersection* intersectionBox );
void applySingleColorEffect();
void updateCellResultColor( size_t timeStepIndex );
void updateCellResultColor( int timeStepIndex );
void appendNativeIntersectionFacesToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
void appendMeshLinePartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );

View File

@@ -154,7 +154,7 @@ void RivExtrudedCurveIntersectionPartMgr::applySingleColorEffect()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivExtrudedCurveIntersectionPartMgr::updateCellResultColor( size_t timeStepIndex,
void RivExtrudedCurveIntersectionPartMgr::updateCellResultColor( int timeStepIndex,
const cvf::ScalarMapper* explicitScalarColorMapper,
const RivTernaryScalarMapper* explicitTernaryColorMapper )
{

View File

@@ -69,7 +69,7 @@ public:
explicit RivExtrudedCurveIntersectionPartMgr( RimExtrudedCurveIntersection* rimIntersection, bool isFlattened = false );
void applySingleColorEffect();
void updateCellResultColor( size_t timeStepIndex,
void updateCellResultColor( int timeStepIndex,
const cvf::ScalarMapper* explicitScalarColorMapper,
const RivTernaryScalarMapper* explicitTernaryColorMapper );

View File

@@ -51,7 +51,7 @@
///
//--------------------------------------------------------------------------------------------------
void RivIntersectionResultsColoringTools::calculateIntersectionResultColors(
size_t timeStepIndex,
int timeStepIndex,
bool useSeparateIntersectionResDefTimeStep,
RimIntersection* rimIntersectionHandle,
const RivIntersectionGeometryGeneratorInterface* intersectionGeomGenIF,
@@ -227,7 +227,7 @@ void RivIntersectionResultsColoringTools::updateEclipseTernaryCellResultColors(
//--------------------------------------------------------------------------------------------------
void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
const RimGeoMechResultDefinition* geomResultDef,
size_t timeStepIndex,
int viewerTimeStepIndex,
const cvf::ScalarMapper* scalarColorMapper,
bool isLightingDisabled,
const RivIntersectionGeometryGeneratorInterface* geomGenerator,
@@ -243,6 +243,8 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
if ( !caseData ) return;
auto [stepIdx, frameIdx] = caseData->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( viewerTimeStepIndex );
const std::vector<size_t>& triangleToCellIdx = geomGenerator->triangleToCellIndex();
const cvf::Vec3fArray* triangelVxes = geomGenerator->triangleVxes();
const std::vector<RivIntersectionVertexWeights>& vertexWeights =
@@ -253,7 +255,7 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
if ( caseData->femPartResults()->partCount() == 1 )
{
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues( resVarAddress, 0, (int)timeStepIndex );
caseData->femPartResults()->resultValues( resVarAddress, 0, stepIdx, frameIdx );
RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
resultValues,
@@ -263,7 +265,7 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
else
{
std::vector<float> resultValues;
caseData->femPartResults()->globalResultValues( resVarAddress, (int)timeStepIndex, resultValues );
caseData->femPartResults()->globalResultValues( resVarAddress, stepIdx, frameIdx, resultValues );
RivIntersectionResultsColoringTools::calculateElementBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
resultValues,
@@ -291,7 +293,9 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
vertexWeights,
caseData,
resVarAddress,
(int)timeStepIndex,
0,
stepIdx,
frameIdx,
scalarColorMapper );
}
}
@@ -311,7 +315,7 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
if ( caseData->femPartResults()->partCount() == 1 )
{
const std::vector<float>& resultValues =
caseData->femPartResults()->resultValues( resVarAddress, 0, (int)timeStepIndex );
caseData->femPartResults()->resultValues( resVarAddress, 0, stepIdx, frameIdx );
RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
vertexWeights,
resultValues,
@@ -322,7 +326,7 @@ void RivIntersectionResultsColoringTools::updateGeoMechCellResultColors(
else
{
std::vector<float> resultValues;
caseData->femPartResults()->globalResultValues( resVarAddress, (int)timeStepIndex, resultValues );
caseData->femPartResults()->globalResultValues( resVarAddress, stepIdx, frameIdx, resultValues );
RivIntersectionResultsColoringTools::calculateNodeOrElementNodeBasedGeoMechTextureCoords( intersectionFacesTextureCoords,
vertexWeights,
@@ -427,10 +431,12 @@ void RivIntersectionResultsColoringTools::calculateGeoMechTensorXfTextureCoords(
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
RigGeoMechCaseData* caseData,
const RigFemResultAddress& resVarAddress,
int partIdx,
int timeStepIdx,
int frameIdx,
const cvf::ScalarMapper* mapper )
{
RiuGeoMechXfTensorResultAccessor accessor( caseData->femPartResults(), resVarAddress, timeStepIdx );
RiuGeoMechXfTensorResultAccessor accessor( caseData->femPartResults(), resVarAddress, partIdx, timeStepIdx, frameIdx );
textureCoords->resize( vertexWeights.size() );
cvf::Vec2f* rawPtr = textureCoords->ptr();

View File

@@ -42,7 +42,7 @@ class ScalarMapper;
class RivIntersectionResultsColoringTools
{
public:
static void calculateIntersectionResultColors( size_t timeStepIndex,
static void calculateIntersectionResultColors( int timeStepIndex,
bool useSeparateIntersectionResDefTimeStep,
RimIntersection* rimIntersectionHandle,
const RivIntersectionGeometryGeneratorInterface* intersectionGeomGenIF,
@@ -69,7 +69,7 @@ private:
cvf::Vec2fArray* m_intersectionBoxFacesTextureCoords );
static void updateGeoMechCellResultColors( const RimGeoMechResultDefinition* geomResultDef,
size_t timeStepIndex,
int timeStepIndex,
const cvf::ScalarMapper* scalarColorMapper,
bool isLightingDisabled,
const RivIntersectionGeometryGeneratorInterface* geomGenerator,
@@ -99,7 +99,9 @@ private:
const std::vector<RivIntersectionVertexWeights>& vertexWeights,
RigGeoMechCaseData* caseData,
const RigFemResultAddress& resVarAddress,
int partIdx,
int timeStepIdx,
int frameIdx,
const cvf::ScalarMapper* mapper );
static void calculatePlaneAngleTextureCoords( cvf::Vec2fArray* textureCoords,

View File

@@ -70,7 +70,10 @@ RivTensorResultPartMgr::~RivTensorResultPartMgr()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex ) const
void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
int viewerStepIndex,
int localTimeStepIndex,
int frameIndex ) const
{
CVF_ASSERT( model );
@@ -93,7 +96,8 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicL
for ( int partIdx = 0; partIdx < femParts->partCount(); partIdx++ )
{
std::vector<caf::Ten3f> vertexTensors = resultCollection->tensors( address, partIdx, (int)frameIndex );
std::vector<caf::Ten3f> vertexTensors =
resultCollection->tensors( address, partIdx, localTimeStepIndex, frameIndex );
if ( vertexTensors.empty() ) continue;
const RigFemPart* part = femParts->part( partIdx );
@@ -108,7 +112,7 @@ void RivTensorResultPartMgr::appendDynamicGeometryPartsToModel( cvf::ModelBasicL
calculatePrincipalsAndDirections( elmTensors, &elmPrincipals, &elmPrincipalDirections );
std::vector<RivGeoMechPartMgrCache::Key> partKeys =
m_rimReservoirView->vizLogic()->keysToVisiblePartMgrs( (int)frameIndex );
m_rimReservoirView->vizLogic()->keysToVisiblePartMgrs( viewerStepIndex );
RigFemPartNodes nodes = part->nodes();

View File

@@ -50,7 +50,10 @@ public:
RivTensorResultPartMgr( RimGeoMechView* reservoirView );
~RivTensorResultPartMgr() override;
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model, size_t frameIndex ) const;
void appendDynamicGeometryPartsToModel( cvf::ModelBasicList* model,
int viewerStepIndex,
int localTimeStepIndex,
int frameIndex ) const;
private:
struct TensorVisualization

View File

@@ -89,7 +89,7 @@ void RivSurfacePartMgr::appendNativeGeometryPartsToModel( cvf::ModelBasicList* m
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RivSurfacePartMgr::updateCellResultColor( size_t timeStepIndex )
void RivSurfacePartMgr::updateCellResultColor( int timeStepIndex )
{
if ( m_intersectionFaces.notNull() )
{

View File

@@ -44,7 +44,7 @@ public:
explicit RivSurfacePartMgr( RimSurfaceInView* surface );
void updateNativeSurfaceColors();
void updateCellResultColor( size_t timeStepIndex );
void updateCellResultColor( int timeStepIndex );
void appendIntersectionGeometryPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );
void appendNativeGeometryPartsToModel( cvf::ModelBasicList* model, cvf::Transform* scaleTransform );