Show element ID, not element Index in mohrs plot legend

This commit is contained in:
jonjenssen 2023-01-27 17:42:27 +01:00 committed by jonjenssen
parent 919d867930
commit 132fd41bf4
2 changed files with 21 additions and 3 deletions

View File

@ -110,8 +110,11 @@ void RiuMohrsCirclePlot::appendSelection( const RiuSelectionItem* selectionItem
if ( geoMechSelectionItem )
{
const size_t gridIndex = geoMechSelectionItem->m_gridIndex;
const size_t gridIndex = geoMechSelectionItem->m_gridIndex;
RigFemPart* femPart = geoMechSelectionItem->m_resultDefinition->ownerCaseData()->femParts()->part( gridIndex );
const size_t cellIndex = geoMechSelectionItem->m_cellIndex;
const int elmId = femPart->elmId( cellIndex );
const cvf::Color3f color = geoMechSelectionItem->m_color;
addOrUpdateCurves( geoMechSelectionItem->m_resultDefinition,
@ -119,6 +122,7 @@ void RiuMohrsCirclePlot::appendSelection( const RiuSelectionItem* selectionItem
geoMechSelectionItem->m_frameIdx,
gridIndex,
cellIndex,
elmId,
cvf::Color3ub( color ) );
updatePlot();
@ -173,7 +177,13 @@ void RiuMohrsCirclePlot::updateOnTimeStepChanged( Rim3dView* changedView )
for ( const MohrsCirclesInfo& mohrInfo : mohrsCiclesInfosCopy )
{
addOrUpdateCurves( mohrInfo.geomResDef, stepIdx, frameIdx, mohrInfo.gridIndex, mohrInfo.elmIndex, mohrInfo.color );
addOrUpdateCurves( mohrInfo.geomResDef,
stepIdx,
frameIdx,
mohrInfo.gridIndex,
mohrInfo.elmIndex,
mohrInfo.elmId,
mohrInfo.color );
}
updatePlot();
@ -232,7 +242,7 @@ void RiuMohrsCirclePlot::addOrUpdateMohrCircleCurves( const MohrsCirclesInfo& mo
QString( "<b>FOS</b>: %1, " ).arg( QString::number( mohrsCirclesInfo.factorOfSafety, 'f', 2 ) ) );
textBuilder.append( QString( "<b>Element Id</b>: %1, <b>ijk</b>[%2, %3, %4]," )
.arg( mohrsCirclesInfo.elmIndex )
.arg( mohrsCirclesInfo.elmId )
.arg( mohrsCirclesInfo.i )
.arg( mohrsCirclesInfo.j )
.arg( mohrsCirclesInfo.k ) );
@ -363,6 +373,7 @@ bool RiuMohrsCirclePlot::addOrUpdateCurves( const RimGeoMechResultDefinition* ge
int frameIndex,
size_t gridIndex,
size_t elmIndex,
int elmId,
const cvf::Color3ub& color )
{
RigFemPart* femPart = geomResDef->ownerCaseData()->femParts()->part( gridIndex );
@ -405,9 +416,12 @@ bool RiuMohrsCirclePlot::addOrUpdateCurves( const RimGeoMechResultDefinition* ge
CVF_ASSERT( validIndex );
if ( validIndex )
{
int elmId = femPart->elmId( elmIndex );
MohrsCirclesInfo mohrsCircle( principals,
gridIndex,
elmIndex,
elmId,
i,
j,
k,

View File

@ -59,6 +59,7 @@ private:
MohrsCirclesInfo( cvf::Vec3f principals,
size_t gridIndex,
size_t elmIndex,
int elmId,
size_t i,
size_t j,
size_t k,
@ -68,6 +69,7 @@ private:
: principals( principals )
, gridIndex( gridIndex )
, elmIndex( elmIndex )
, elmId( elmId )
, i( i )
, j( j )
, k( k )
@ -80,6 +82,7 @@ private:
cvf::Vec3f principals;
size_t gridIndex;
size_t elmIndex;
int elmId;
size_t i, j, k;
const RimGeoMechResultDefinition* geomResDef;
double factorOfSafety;
@ -104,6 +107,7 @@ private:
int frameIndex,
size_t gridIndex,
size_t elmIndex,
int elmId,
const cvf::Color3ub& color );
void updatePlot();