mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Geomech case info (#291)
Displaying result info and the number of cells in the 3D view's info box for geomech cases.
This commit is contained in:
parent
0bdc8916d7
commit
f88343a122
@ -69,5 +69,17 @@ int RigFemPartCollection::partCount() const
|
|||||||
return static_cast<int>(m_femParts.size());
|
return static_cast<int>(m_femParts.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
size_t RigFemPartCollection::totalElementCount() const
|
||||||
|
{
|
||||||
|
size_t elementCount = 0;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < partCount(); i++)
|
||||||
|
{
|
||||||
|
elementCount += part(i)->elementCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
return elementCount;
|
||||||
|
}
|
||||||
|
@ -35,6 +35,9 @@ public:
|
|||||||
|
|
||||||
int partCount() const;
|
int partCount() const;
|
||||||
|
|
||||||
|
size_t totalElementCount() const;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
cvf::Collection<RigFemPart> m_femParts;
|
cvf::Collection<RigFemPart> m_femParts;
|
||||||
|
|
||||||
|
@ -34,6 +34,11 @@
|
|||||||
#include "RiuViewer.h"
|
#include "RiuViewer.h"
|
||||||
#include "RimGeoMechView.h"
|
#include "RimGeoMechView.h"
|
||||||
#include "RimView.h"
|
#include "RimView.h"
|
||||||
|
#include "RimGeoMechCase.h"
|
||||||
|
#include "RigGeoMechCaseData.h"
|
||||||
|
#include "RigFemPartCollection.h"
|
||||||
|
#include "RimGeoMechResultSlot.h"
|
||||||
|
#include "RigStatisticsDataCache.h"
|
||||||
|
|
||||||
CAF_PDM_SOURCE_INIT(Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig");
|
CAF_PDM_SOURCE_INIT(Rim3dOverlayInfoConfig, "View3dOverlayInfoConfig");
|
||||||
|
|
||||||
@ -274,12 +279,59 @@ void Rim3dOverlayInfoConfig::updateGeoMech3DInfo(RimGeoMechView * geoMechView)
|
|||||||
{
|
{
|
||||||
if (showInfoText())
|
if (showInfoText())
|
||||||
{
|
{
|
||||||
QString infoText = QString(
|
QString infoText;
|
||||||
"<p><b><center>-- %1 --</center></b><p> ").arg("ToDo: Describe Geo Mech Case");
|
|
||||||
|
const RimGeoMechCase* geoMechCase = geoMechView->geoMechCase();
|
||||||
|
const RigGeoMechCaseData* caseData = geoMechCase ? geoMechCase->geoMechData() : NULL;
|
||||||
|
const RigFemPartCollection* femParts = caseData ? caseData->femParts() : NULL;
|
||||||
|
|
||||||
|
if (femParts)
|
||||||
|
{
|
||||||
|
QString caseName = geoMechCase->caseUserDescription();
|
||||||
|
QString cellCount = QString("%1").arg(femParts->totalElementCount());
|
||||||
|
|
||||||
|
infoText = QString(
|
||||||
|
"<p><b><center>-- %1 --</center></b><p>"
|
||||||
|
"<b>Cell count:</b> %2<br>").arg(caseName, cellCount);
|
||||||
|
|
||||||
|
if (geoMechView->cellResult().notNull())
|
||||||
|
{
|
||||||
|
QString resultPos;
|
||||||
|
QString fieldName = geoMechView->cellResult()->resultFieldName();
|
||||||
|
QString compName = geoMechView->cellResult()->resultComponentName();
|
||||||
|
QString resultName = compName.isEmpty() ? fieldName : compName;
|
||||||
|
|
||||||
|
if (!resultName.isEmpty())
|
||||||
|
{
|
||||||
|
switch (geoMechView->cellResult()->resultPositionType())
|
||||||
|
{
|
||||||
|
case RIG_NODAL:
|
||||||
|
resultPos = "Nodal";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RIG_ELEMENT_NODAL:
|
||||||
|
resultPos = "Element nodal";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case RIG_INTEGRATION_POINT:
|
||||||
|
resultPos = "Integration point";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
infoText += QString(
|
||||||
|
"<b>Cell result:</b> %1 %2").arg(resultPos, resultName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
geoMechView->viewer()->setInfoText(infoText);
|
geoMechView->viewer()->setInfoText(infoText);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (showHistogram())
|
if (showHistogram())
|
||||||
{
|
{
|
||||||
|
// ToDo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user