mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3420 Result info. Fix cordinate system translations. Renaming to improve readability
This commit is contained in:
parent
a3d8fc1fb3
commit
0c05c93a72
@ -2625,7 +2625,7 @@ RigFemClosestResultIndexCalculator::RigFemClosestResultIndexCalculator(RigFemPar
|
|||||||
RigFemResultPosEnum resultPosition,
|
RigFemResultPosEnum resultPosition,
|
||||||
int elementIndex,
|
int elementIndex,
|
||||||
int m_face,
|
int m_face,
|
||||||
const cvf::Vec3d& m_intersectionPoint)
|
const cvf::Vec3d& intersectionPointInDomain)
|
||||||
{
|
{
|
||||||
m_resultIndexToClosestResult = -1;
|
m_resultIndexToClosestResult = -1;
|
||||||
m_closestNodeId = -1;
|
m_closestNodeId = -1;
|
||||||
@ -2643,8 +2643,8 @@ RigFemClosestResultIndexCalculator::RigFemClosestResultIndexCalculator(RigFemPar
|
|||||||
for ( int lNodeIdx = 0; lNodeIdx < elmNodeCount; ++lNodeIdx )
|
for ( int lNodeIdx = 0; lNodeIdx < elmNodeCount; ++lNodeIdx )
|
||||||
{
|
{
|
||||||
int nodeIdx = elmentConn[lNodeIdx];
|
int nodeIdx = elmentConn[lNodeIdx];
|
||||||
cvf::Vec3f nodePos = femPart->nodes().coordinates[nodeIdx];
|
cvf::Vec3f nodePosInDomain = femPart->nodes().coordinates[nodeIdx];
|
||||||
float dist = (nodePos - cvf::Vec3f(m_intersectionPoint)).lengthSquared();
|
float dist = (nodePosInDomain - cvf::Vec3f(intersectionPointInDomain)).lengthSquared();
|
||||||
if ( dist < minDist )
|
if ( dist < minDist )
|
||||||
{
|
{
|
||||||
closestLocalNode = lNodeIdx;
|
closestLocalNode = lNodeIdx;
|
||||||
@ -2694,8 +2694,8 @@ RigFemClosestResultIndexCalculator::RigFemClosestResultIndexCalculator(RigFemPar
|
|||||||
for ( int faceNodIdx = 0; faceNodIdx < faceNodeCount; ++faceNodIdx )
|
for ( int faceNodIdx = 0; faceNodIdx < faceNodeCount; ++faceNodIdx )
|
||||||
{
|
{
|
||||||
int nodeIdx = elmNodeIndices[localElmNodeIndicesForFace[faceNodIdx]];
|
int nodeIdx = elmNodeIndices[localElmNodeIndicesForFace[faceNodIdx]];
|
||||||
cvf::Vec3f nodePos = femPart->nodes().coordinates[nodeIdx];
|
cvf::Vec3f nodePosInDomain = femPart->nodes().coordinates[nodeIdx];
|
||||||
float dist = (nodePos - cvf::Vec3f(m_intersectionPoint)).lengthSquared();
|
float dist = (nodePosInDomain - cvf::Vec3f(intersectionPointInDomain)).lengthSquared();
|
||||||
if ( dist < minDist )
|
if ( dist < minDist )
|
||||||
{
|
{
|
||||||
closestLocFaceNode = faceNodIdx;
|
closestLocFaceNode = faceNodIdx;
|
||||||
|
@ -159,7 +159,7 @@ public:
|
|||||||
RigFemResultPosEnum resultPosition,
|
RigFemResultPosEnum resultPosition,
|
||||||
int elementIndex,
|
int elementIndex,
|
||||||
int m_face,
|
int m_face,
|
||||||
const cvf::Vec3d& m_intersectionPoint);
|
const cvf::Vec3d& intersectionPointInDomain);
|
||||||
|
|
||||||
int resultIndexToClosestResult() { return m_resultIndexToClosestResult; }
|
int resultIndexToClosestResult() { return m_resultIndexToClosestResult; }
|
||||||
int closestNodeId() { return m_closestNodeId; }
|
int closestNodeId() { return m_closestNodeId; }
|
||||||
|
@ -69,7 +69,7 @@ void RimGeoMechGeometrySelectionItem::setFromSelectionItem(const RiuGeoMechSelec
|
|||||||
m_intersectionTriangle_1 = cvf::Vec3d(selectionItem->m_intersectionTriangle[1]);
|
m_intersectionTriangle_1 = cvf::Vec3d(selectionItem->m_intersectionTriangle[1]);
|
||||||
m_intersectionTriangle_2 = cvf::Vec3d(selectionItem->m_intersectionTriangle[2]);
|
m_intersectionTriangle_2 = cvf::Vec3d(selectionItem->m_intersectionTriangle[2]);
|
||||||
|
|
||||||
m_localIntersectionPoint = selectionItem->m_localIntersectionPoint;
|
m_localIntersectionPoint = selectionItem->m_localIntersectionPointInDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -39,7 +39,7 @@ RimEclipseGeometrySelectionItem::RimEclipseGeometrySelectionItem()
|
|||||||
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "EclipseCase", "Eclipse Case", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_eclipseCase, "EclipseCase", "Eclipse Case", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_gridIndex, "GridIndex", "Grid Index", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_gridIndex, "GridIndex", "Grid Index", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_cellIndex, "CellIndex", "Cell Index", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_cellIndex, "CellIndex", "Cell Index", "", "", "");
|
||||||
CAF_PDM_InitFieldNoDefault(&m_localIntersectionPoint, "LocalIntersectionPoint", "local Intersection Point", "", "", "");
|
CAF_PDM_InitFieldNoDefault(&m_localIntersectionPointInDisplay, "LocalIntersectionPoint", "local Intersection Point", "", "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -56,7 +56,7 @@ void RimEclipseGeometrySelectionItem::setFromSelectionItem(const RiuEclipseSelec
|
|||||||
{
|
{
|
||||||
m_gridIndex = selectionItem->m_gridIndex;
|
m_gridIndex = selectionItem->m_gridIndex;
|
||||||
m_cellIndex = selectionItem->m_gridLocalCellIndex;
|
m_cellIndex = selectionItem->m_gridLocalCellIndex;
|
||||||
m_localIntersectionPoint = selectionItem->m_localIntersectionPoint;
|
m_localIntersectionPointInDisplay = selectionItem->m_localIntersectionPointInDisplay;
|
||||||
|
|
||||||
m_eclipseCase = selectionItem->m_view->eclipseCase();
|
m_eclipseCase = selectionItem->m_view->eclipseCase();
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,6 @@ private:
|
|||||||
|
|
||||||
caf::PdmField<size_t> m_gridIndex;
|
caf::PdmField<size_t> m_gridIndex;
|
||||||
caf::PdmField<size_t> m_cellIndex;
|
caf::PdmField<size_t> m_cellIndex;
|
||||||
caf::PdmField<cvf::Vec3d> m_localIntersectionPoint;
|
caf::PdmField<cvf::Vec3d> m_localIntersectionPointInDisplay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,16 +56,16 @@ RiuFemResultTextBuilder::RiuFemResultTextBuilder(RimGeoMechView* reservoirView,
|
|||||||
m_cellIndex = cellIndex;
|
m_cellIndex = cellIndex;
|
||||||
m_timeStepIndex = timeStepIndex;
|
m_timeStepIndex = timeStepIndex;
|
||||||
|
|
||||||
m_intersectionPoint = cvf::Vec3d::UNDEFINED;
|
m_intersectionPointInDisplay = cvf::Vec3d::UNDEFINED;
|
||||||
m_face = cvf::StructGridInterface::NO_FACE;
|
m_face = cvf::StructGridInterface::NO_FACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuFemResultTextBuilder::setIntersectionPoint(cvf::Vec3d intersectionPoint)
|
void RiuFemResultTextBuilder::setIntersectionPointInDisplay(cvf::Vec3d intersectionPointInDisplay)
|
||||||
{
|
{
|
||||||
m_intersectionPoint = intersectionPoint;
|
m_intersectionPointInDisplay = intersectionPointInDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -153,13 +153,13 @@ QString RiuFemResultTextBuilder::geometrySelectionText(QString itemSeparator)
|
|||||||
QString formattedText;
|
QString formattedText;
|
||||||
if (m_2dIntersectionView)
|
if (m_2dIntersectionView)
|
||||||
{
|
{
|
||||||
formattedText.sprintf("Horizontal length from well start: %.2f", m_intersectionPoint.x());
|
formattedText.sprintf("Horizontal length from well start: %.2f", m_intersectionPointInDisplay.x());
|
||||||
text += formattedText + itemSeparator;
|
text += formattedText + itemSeparator;
|
||||||
|
|
||||||
cvf::Mat4d t = m_2dIntersectionView->flatIntersectionPartMgr()->unflattenTransformMatrix(m_intersectionPoint);
|
cvf::Mat4d t = m_2dIntersectionView->flatIntersectionPartMgr()->unflattenTransformMatrix(m_intersectionPointInDisplay);
|
||||||
if (!t.isZero())
|
if (!t.isZero())
|
||||||
{
|
{
|
||||||
cvf::Vec3d intPt = m_intersectionPoint.getTransformedPoint(t);
|
cvf::Vec3d intPt = m_intersectionPointInDisplay.getTransformedPoint(t);
|
||||||
formattedText.sprintf("Intersection point : [E: %.2f, N: %.2f, Depth: %.2f]", intPt.x(), intPt.y(), -intPt.z());
|
formattedText.sprintf("Intersection point : [E: %.2f, N: %.2f, Depth: %.2f]", intPt.x(), intPt.y(), -intPt.z());
|
||||||
text += formattedText;
|
text += formattedText;
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ QString RiuFemResultTextBuilder::geometrySelectionText(QString itemSeparator)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
cvf::ref<caf::DisplayCoordTransform> transForm = m_reservoirView->displayCoordTransform();
|
cvf::ref<caf::DisplayCoordTransform> transForm = m_reservoirView->displayCoordTransform();
|
||||||
cvf::Vec3d domainCoord = transForm->translateToDomainCoord(m_intersectionPoint);
|
cvf::Vec3d domainCoord = transForm->translateToDomainCoord(m_intersectionPointInDisplay);
|
||||||
|
|
||||||
formattedText.sprintf("Intersection point : [E: %.2f, N: %.2f, Depth: %.2f]", domainCoord.x(), domainCoord.y(), -domainCoord.z());
|
formattedText.sprintf("Intersection point : [E: %.2f, N: %.2f, Depth: %.2f]", domainCoord.x(), domainCoord.y(), -domainCoord.z());
|
||||||
text += formattedText;
|
text += formattedText;
|
||||||
@ -386,11 +386,12 @@ QString RiuFemResultTextBuilder::closestNodeResultText(RimGeoMechResultDefinitio
|
|||||||
RigFemPart* femPart = geomData->femParts()->part(m_gridIndex);
|
RigFemPart* femPart = geomData->femParts()->part(m_gridIndex);
|
||||||
RigFemResultPosEnum activeResultPosition = resultColors->resultPositionType();
|
RigFemResultPosEnum activeResultPosition = resultColors->resultPositionType();
|
||||||
|
|
||||||
|
cvf::Vec3d intersectionPointInDomain = m_reservoirView->displayCoordTransform()->translateToDomainCoord(m_intersectionPointInDisplay);
|
||||||
RigFemClosestResultIndexCalculator closestIndexCalc(femPart,
|
RigFemClosestResultIndexCalculator closestIndexCalc(femPart,
|
||||||
activeResultPosition,
|
activeResultPosition,
|
||||||
m_cellIndex,
|
m_cellIndex,
|
||||||
m_face,
|
m_face,
|
||||||
m_intersectionPoint);
|
intersectionPointInDomain);
|
||||||
int resultIndex = closestIndexCalc.resultIndexToClosestResult();
|
int resultIndex = closestIndexCalc.resultIndexToClosestResult();
|
||||||
int closestNodeId = closestIndexCalc.closestNodeId();
|
int closestNodeId = closestIndexCalc.closestNodeId();
|
||||||
int closestElmNodResIdx = closestIndexCalc.closestElementNodeResIdx();
|
int closestElmNodResIdx = closestIndexCalc.closestElementNodeResIdx();
|
||||||
|
@ -45,7 +45,7 @@ class RiuFemResultTextBuilder
|
|||||||
public:
|
public:
|
||||||
RiuFemResultTextBuilder(RimGeoMechView* reservoirView, int gridIndex, int cellIndex, int timeStepIndex);
|
RiuFemResultTextBuilder(RimGeoMechView* reservoirView, int gridIndex, int cellIndex, int timeStepIndex);
|
||||||
void setFace(int face);
|
void setFace(int face);
|
||||||
void setIntersectionPoint(cvf::Vec3d intersectionPoint);
|
void setIntersectionPointInDisplay(cvf::Vec3d intersectionPointInDisplay);
|
||||||
void setIntersectionTriangle(const std::array<cvf::Vec3f, 3>& triangle);
|
void setIntersectionTriangle(const std::array<cvf::Vec3f, 3>& triangle);
|
||||||
void set2dIntersectionView(Rim2dIntersectionView* intersectionView);
|
void set2dIntersectionView(Rim2dIntersectionView* intersectionView);
|
||||||
|
|
||||||
@ -75,5 +75,5 @@ private:
|
|||||||
bool m_isIntersectionTriangleSet;
|
bool m_isIntersectionTriangleSet;
|
||||||
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
||||||
|
|
||||||
cvf::Vec3d m_intersectionPoint;
|
cvf::Vec3d m_intersectionPointInDisplay;
|
||||||
};
|
};
|
||||||
|
@ -37,13 +37,13 @@ RiuFemTimeHistoryResultAccessor::RiuFemTimeHistoryResultAccessor(RigGeoMechCaseD
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
int elementIndex,
|
int elementIndex,
|
||||||
int face,
|
int face,
|
||||||
const cvf::Vec3d& intersectionPoint)
|
const cvf::Vec3d& intersectionPointInDomain)
|
||||||
: m_geoMechCaseData(geomData),
|
: m_geoMechCaseData(geomData),
|
||||||
m_femResultAddress(femResultAddress),
|
m_femResultAddress(femResultAddress),
|
||||||
m_gridIndex(gridIndex),
|
m_gridIndex(gridIndex),
|
||||||
m_elementIndex(elementIndex),
|
m_elementIndex(elementIndex),
|
||||||
m_face(face),
|
m_face(face),
|
||||||
m_intersectionPoint(intersectionPoint),
|
m_intersectionPointInDomain(intersectionPointInDomain),
|
||||||
m_hasIntersectionTriangle(false)
|
m_hasIntersectionTriangle(false)
|
||||||
{
|
{
|
||||||
computeTimeHistoryData();
|
computeTimeHistoryData();
|
||||||
@ -57,14 +57,14 @@ RiuFemTimeHistoryResultAccessor::RiuFemTimeHistoryResultAccessor(RigGeoMechCaseD
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
int elementIndex,
|
int elementIndex,
|
||||||
int face,
|
int face,
|
||||||
const cvf::Vec3d& intersectionPoint,
|
const cvf::Vec3d& intersectionPointInDomain,
|
||||||
const std::array<cvf::Vec3f, 3>& intersectionTriangle)
|
const std::array<cvf::Vec3f, 3>& intersectionTriangle)
|
||||||
: m_geoMechCaseData(geomData),
|
: m_geoMechCaseData(geomData),
|
||||||
m_femResultAddress(femResultAddress),
|
m_femResultAddress(femResultAddress),
|
||||||
m_gridIndex(gridIndex),
|
m_gridIndex(gridIndex),
|
||||||
m_elementIndex(elementIndex),
|
m_elementIndex(elementIndex),
|
||||||
m_face(face),
|
m_face(face),
|
||||||
m_intersectionPoint(intersectionPoint),
|
m_intersectionPointInDomain(intersectionPointInDomain),
|
||||||
m_hasIntersectionTriangle(true),
|
m_hasIntersectionTriangle(true),
|
||||||
m_intersectionTriangle(intersectionTriangle)
|
m_intersectionTriangle(intersectionTriangle)
|
||||||
{
|
{
|
||||||
@ -94,7 +94,7 @@ QString RiuFemTimeHistoryResultAccessor::geometrySelectionText() const
|
|||||||
j++;
|
j++;
|
||||||
k++;
|
k++;
|
||||||
|
|
||||||
cvf::Vec3d domainCoord = m_intersectionPoint;
|
cvf::Vec3d domainCoord = m_intersectionPointInDomain;
|
||||||
text += QString(", ijk[%1, %2, %3] ").arg(i).arg(j).arg(k);
|
text += QString(", ijk[%1, %2, %3] ").arg(i).arg(j).arg(k);
|
||||||
|
|
||||||
QString formattedText;
|
QString formattedText;
|
||||||
@ -126,7 +126,7 @@ void RiuFemTimeHistoryResultAccessor::computeTimeHistoryData()
|
|||||||
m_femResultAddress.resultPosType,
|
m_femResultAddress.resultPosType,
|
||||||
m_elementIndex,
|
m_elementIndex,
|
||||||
m_face,
|
m_face,
|
||||||
m_intersectionPoint );
|
m_intersectionPointInDomain );
|
||||||
|
|
||||||
int scalarResultIndex = closestCalc.resultIndexToClosestResult();
|
int scalarResultIndex = closestCalc.resultIndexToClosestResult();
|
||||||
m_closestNodeId = closestCalc.closestNodeId();
|
m_closestNodeId = closestCalc.closestNodeId();
|
||||||
|
@ -36,14 +36,14 @@ public:
|
|||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
int elementIndex,
|
int elementIndex,
|
||||||
int face,
|
int face,
|
||||||
const cvf::Vec3d& intersectionPoint);
|
const cvf::Vec3d& intersectionPointInDomain);
|
||||||
|
|
||||||
RiuFemTimeHistoryResultAccessor(RigGeoMechCaseData* geomData,
|
RiuFemTimeHistoryResultAccessor(RigGeoMechCaseData* geomData,
|
||||||
RigFemResultAddress femResultAddress,
|
RigFemResultAddress femResultAddress,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
int elementIndex,
|
int elementIndex,
|
||||||
int face,
|
int face,
|
||||||
const cvf::Vec3d& intersectionPoint,
|
const cvf::Vec3d& intersectionPointInDomain,
|
||||||
const std::array<cvf::Vec3f, 3>& m_intersectionTriangle);
|
const std::array<cvf::Vec3f, 3>& m_intersectionTriangle);
|
||||||
|
|
||||||
QString geometrySelectionText() const;
|
QString geometrySelectionText() const;
|
||||||
@ -62,7 +62,7 @@ private:
|
|||||||
int m_face;
|
int m_face;
|
||||||
int m_closestNodeId;
|
int m_closestNodeId;
|
||||||
|
|
||||||
cvf::Vec3d m_intersectionPoint;
|
cvf::Vec3d m_intersectionPointInDomain;
|
||||||
|
|
||||||
bool m_hasIntersectionTriangle;
|
bool m_hasIntersectionTriangle;
|
||||||
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
||||||
|
@ -57,7 +57,7 @@ RiuResultTextBuilder::RiuResultTextBuilder(RimEclipseView* reservoirView, size_t
|
|||||||
m_timeStepIndex = timeStepIndex;
|
m_timeStepIndex = timeStepIndex;
|
||||||
|
|
||||||
m_nncIndex = cvf::UNDEFINED_SIZE_T;
|
m_nncIndex = cvf::UNDEFINED_SIZE_T;
|
||||||
m_intersectionPoint = cvf::Vec3d::UNDEFINED;
|
m_intersectionPointInDisplay = cvf::Vec3d::UNDEFINED;
|
||||||
m_face = cvf::StructGridInterface::NO_FACE;
|
m_face = cvf::StructGridInterface::NO_FACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,7 +95,7 @@ RiuResultTextBuilder::RiuResultTextBuilder(RimEclipseView* reservoirView, size_t
|
|||||||
m_timeStepIndex = timeStepIndex;
|
m_timeStepIndex = timeStepIndex;
|
||||||
|
|
||||||
m_nncIndex = cvf::UNDEFINED_SIZE_T;
|
m_nncIndex = cvf::UNDEFINED_SIZE_T;
|
||||||
m_intersectionPoint = cvf::Vec3d::UNDEFINED;
|
m_intersectionPointInDisplay = cvf::Vec3d::UNDEFINED;
|
||||||
m_face = cvf::StructGridInterface::NO_FACE;
|
m_face = cvf::StructGridInterface::NO_FACE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,9 +110,9 @@ void RiuResultTextBuilder::setNncIndex(size_t nncIndex)
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuResultTextBuilder::setIntersectionPoint(cvf::Vec3d intersectionPoint)
|
void RiuResultTextBuilder::setIntersectionPointInDisplay(cvf::Vec3d intersectionPointInDisplay)
|
||||||
{
|
{
|
||||||
m_intersectionPoint = intersectionPoint;
|
m_intersectionPointInDisplay = intersectionPointInDisplay;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@ -226,21 +226,21 @@ QString RiuResultTextBuilder::geometrySelectionText(QString itemSeparator)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_intersectionPoint != cvf::Vec3d::UNDEFINED)
|
if (m_intersectionPointInDisplay != cvf::Vec3d::UNDEFINED)
|
||||||
{
|
{
|
||||||
cvf::ref<caf::DisplayCoordTransform> transForm = m_reservoirView->displayCoordTransform();
|
cvf::ref<caf::DisplayCoordTransform> transForm = m_reservoirView->displayCoordTransform();
|
||||||
cvf::Vec3d domainCoord = transForm->translateToDomainCoord(m_intersectionPoint);
|
cvf::Vec3d domainCoord = transForm->translateToDomainCoord(m_intersectionPointInDisplay);
|
||||||
|
|
||||||
QString formattedText;
|
QString formattedText;
|
||||||
if (m_2dIntersectionView)
|
if (m_2dIntersectionView)
|
||||||
{
|
{
|
||||||
formattedText.sprintf("Horizontal length from well start: %.2f", m_intersectionPoint.x());
|
formattedText.sprintf("Horizontal length from well start: %.2f", m_intersectionPointInDisplay.x());
|
||||||
text += formattedText + itemSeparator;
|
text += formattedText + itemSeparator;
|
||||||
|
|
||||||
cvf::Mat4d t = m_2dIntersectionView->flatIntersectionPartMgr()->unflattenTransformMatrix(m_intersectionPoint);
|
cvf::Mat4d t = m_2dIntersectionView->flatIntersectionPartMgr()->unflattenTransformMatrix(m_intersectionPointInDisplay);
|
||||||
if (!t.isZero())
|
if (!t.isZero())
|
||||||
{
|
{
|
||||||
cvf::Vec3d intPt = m_intersectionPoint.getTransformedPoint(t);
|
cvf::Vec3d intPt = m_intersectionPointInDisplay.getTransformedPoint(t);
|
||||||
formattedText.sprintf("Intersection point : [E: %.2f, N: %.2f, Depth: %.2f]", intPt.x(), intPt.y(), -intPt.z());
|
formattedText.sprintf("Intersection point : [E: %.2f, N: %.2f, Depth: %.2f]", intPt.x(), intPt.y(), -intPt.z());
|
||||||
text += formattedText;
|
text += formattedText;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
|
|
||||||
void setFace(cvf::StructGridInterface::FaceType face);
|
void setFace(cvf::StructGridInterface::FaceType face);
|
||||||
void setNncIndex(size_t nncIndex);
|
void setNncIndex(size_t nncIndex);
|
||||||
void setIntersectionPoint(cvf::Vec3d intersectionPoint);
|
void setIntersectionPointInDisplay(cvf::Vec3d intersectionPointInDisplay);
|
||||||
void set2dIntersectionView(Rim2dIntersectionView* intersectionView);
|
void set2dIntersectionView(Rim2dIntersectionView* intersectionView);
|
||||||
|
|
||||||
QString mainResultText();
|
QString mainResultText();
|
||||||
@ -83,5 +83,5 @@ private:
|
|||||||
|
|
||||||
size_t m_nncIndex;
|
size_t m_nncIndex;
|
||||||
|
|
||||||
cvf::Vec3d m_intersectionPoint;
|
cvf::Vec3d m_intersectionPointInDisplay;
|
||||||
};
|
};
|
||||||
|
@ -52,6 +52,8 @@
|
|||||||
|
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
|
|
||||||
|
#include <cafDisplayCoordTransform.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +162,9 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuEclipseSelec
|
|||||||
curveName += ", ";
|
curveName += ", ";
|
||||||
curveName += QString("Grid index %1").arg(eclipseSelectionItem->m_gridIndex);
|
curveName += QString("Grid index %1").arg(eclipseSelectionItem->m_gridIndex);
|
||||||
curveName += ", ";
|
curveName += ", ";
|
||||||
curveName += RigTimeHistoryResultAccessor::geometrySelectionText(eclipseView->eclipseCase()->eclipseCaseData(), eclipseSelectionItem->m_gridIndex, eclipseSelectionItem->m_gridLocalCellIndex);
|
curveName += RigTimeHistoryResultAccessor::geometrySelectionText(eclipseView->eclipseCase()->eclipseCaseData(),
|
||||||
|
eclipseSelectionItem->m_gridIndex,
|
||||||
|
eclipseSelectionItem->m_gridLocalCellIndex);
|
||||||
|
|
||||||
|
|
||||||
std::vector<double> timeHistoryValues = RigTimeHistoryResultAccessor::timeHistoryValues(eclipseView->eclipseCase()->eclipseCaseData(), eclipseView->cellResult(), eclipseSelectionItem->m_gridIndex, eclipseSelectionItem->m_gridLocalCellIndex, timeStepDates.size());
|
std::vector<double> timeHistoryValues = RigTimeHistoryResultAccessor::timeHistoryValues(eclipseView->eclipseCase()->eclipseCaseData(), eclipseView->cellResult(), eclipseSelectionItem->m_gridIndex, eclipseSelectionItem->m_gridLocalCellIndex, timeStepDates.size());
|
||||||
@ -185,6 +189,8 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuGeoMechSelec
|
|||||||
{
|
{
|
||||||
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor;
|
std::unique_ptr<RiuFemTimeHistoryResultAccessor> timeHistResultAccessor;
|
||||||
|
|
||||||
|
cvf::Vec3d intersectionPointInDomain = geoMechView->displayCoordTransform()->translateToDomainCoord(geomSelectionItem->m_localIntersectionPointInDisplay);
|
||||||
|
|
||||||
if ( geomSelectionItem->m_hasIntersectionTriangle )
|
if ( geomSelectionItem->m_hasIntersectionTriangle )
|
||||||
{
|
{
|
||||||
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
timeHistResultAccessor = std::unique_ptr<RiuFemTimeHistoryResultAccessor>(
|
||||||
@ -193,7 +199,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuGeoMechSelec
|
|||||||
geomSelectionItem->m_gridIndex,
|
geomSelectionItem->m_gridIndex,
|
||||||
static_cast<int>(geomSelectionItem->m_cellIndex),
|
static_cast<int>(geomSelectionItem->m_cellIndex),
|
||||||
geomSelectionItem->m_elementFace,
|
geomSelectionItem->m_elementFace,
|
||||||
geomSelectionItem->m_localIntersectionPoint,
|
intersectionPointInDomain,
|
||||||
geomSelectionItem->m_intersectionTriangle));
|
geomSelectionItem->m_intersectionTriangle));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -204,7 +210,7 @@ void RiuSelectionChangedHandler::addCurveFromSelectionItem(const RiuGeoMechSelec
|
|||||||
geomSelectionItem->m_gridIndex,
|
geomSelectionItem->m_gridIndex,
|
||||||
static_cast<int>(geomSelectionItem->m_cellIndex),
|
static_cast<int>(geomSelectionItem->m_cellIndex),
|
||||||
geomSelectionItem->m_elementFace,
|
geomSelectionItem->m_elementFace,
|
||||||
geomSelectionItem->m_localIntersectionPoint));
|
intersectionPointInDomain));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString curveName;
|
QString curveName;
|
||||||
@ -348,7 +354,7 @@ void RiuSelectionChangedHandler::updateResultInfo(const RiuSelectionItem* itemAd
|
|||||||
RiuResultTextBuilder textBuilder(eclipseView, eclipseSelectionItem->m_gridIndex, eclipseSelectionItem->m_gridLocalCellIndex, eclipseView->currentTimeStep());
|
RiuResultTextBuilder textBuilder(eclipseView, eclipseSelectionItem->m_gridIndex, eclipseSelectionItem->m_gridLocalCellIndex, eclipseView->currentTimeStep());
|
||||||
textBuilder.setFace(eclipseSelectionItem->m_face);
|
textBuilder.setFace(eclipseSelectionItem->m_face);
|
||||||
textBuilder.setNncIndex(eclipseSelectionItem->m_nncIndex);
|
textBuilder.setNncIndex(eclipseSelectionItem->m_nncIndex);
|
||||||
textBuilder.setIntersectionPoint(eclipseSelectionItem->m_localIntersectionPoint);
|
textBuilder.setIntersectionPointInDisplay(eclipseSelectionItem->m_localIntersectionPointInDisplay);
|
||||||
textBuilder.set2dIntersectionView(intersectionView);
|
textBuilder.set2dIntersectionView(intersectionView);
|
||||||
|
|
||||||
resultInfo = textBuilder.mainResultText();
|
resultInfo = textBuilder.mainResultText();
|
||||||
@ -361,7 +367,7 @@ void RiuSelectionChangedHandler::updateResultInfo(const RiuSelectionItem* itemAd
|
|||||||
|
|
||||||
RimGeoMechView* geomView = geomSelectionItem->m_view.p();
|
RimGeoMechView* geomView = geomSelectionItem->m_view.p();
|
||||||
RiuFemResultTextBuilder textBuilder(geomView, (int)geomSelectionItem->m_gridIndex, (int)geomSelectionItem->m_cellIndex, geomView->currentTimeStep());
|
RiuFemResultTextBuilder textBuilder(geomView, (int)geomSelectionItem->m_gridIndex, (int)geomSelectionItem->m_cellIndex, geomView->currentTimeStep());
|
||||||
textBuilder.setIntersectionPoint(geomSelectionItem->m_localIntersectionPoint);
|
textBuilder.setIntersectionPointInDisplay(geomSelectionItem->m_localIntersectionPointInDisplay);
|
||||||
textBuilder.setFace(geomSelectionItem->m_elementFace);
|
textBuilder.setFace(geomSelectionItem->m_elementFace);
|
||||||
textBuilder.set2dIntersectionView(intersectionView);
|
textBuilder.set2dIntersectionView(intersectionView);
|
||||||
if (geomSelectionItem->m_hasIntersectionTriangle) textBuilder.setIntersectionTriangle(geomSelectionItem->m_intersectionTriangle);
|
if (geomSelectionItem->m_hasIntersectionTriangle) textBuilder.setIntersectionTriangle(geomSelectionItem->m_intersectionTriangle);
|
||||||
|
@ -163,14 +163,14 @@ RiuEclipseSelectionItem::RiuEclipseSelectionItem(RimEclipseView* view,
|
|||||||
size_t nncIndex,
|
size_t nncIndex,
|
||||||
cvf::Color3f color,
|
cvf::Color3f color,
|
||||||
cvf::StructGridInterface::FaceType face,
|
cvf::StructGridInterface::FaceType face,
|
||||||
const cvf::Vec3d& localIntersectionPoint)
|
const cvf::Vec3d& localIntersectionPointInDisplay)
|
||||||
: m_view(view),
|
: m_view(view),
|
||||||
m_gridIndex(gridIndex),
|
m_gridIndex(gridIndex),
|
||||||
m_gridLocalCellIndex(cellIndex),
|
m_gridLocalCellIndex(cellIndex),
|
||||||
m_nncIndex(nncIndex),
|
m_nncIndex(nncIndex),
|
||||||
m_color(color),
|
m_color(color),
|
||||||
m_face(face),
|
m_face(face),
|
||||||
m_localIntersectionPoint(localIntersectionPoint)
|
m_localIntersectionPointInDisplay(localIntersectionPointInDisplay)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,14 +182,14 @@ RiuGeoMechSelectionItem::RiuGeoMechSelectionItem(RimGeoMechView* view,
|
|||||||
size_t cellIndex,
|
size_t cellIndex,
|
||||||
cvf::Color3f color,
|
cvf::Color3f color,
|
||||||
int elementFace,
|
int elementFace,
|
||||||
const cvf::Vec3d& localIntersectionPoint)
|
const cvf::Vec3d& localIntersectionPointInDisplay)
|
||||||
: m_view(view)
|
: m_view(view)
|
||||||
, m_gridIndex(gridIndex)
|
, m_gridIndex(gridIndex)
|
||||||
, m_cellIndex(cellIndex)
|
, m_cellIndex(cellIndex)
|
||||||
, m_color(color)
|
, m_color(color)
|
||||||
, m_elementFace(elementFace)
|
, m_elementFace(elementFace)
|
||||||
, m_hasIntersectionTriangle(false)
|
, m_hasIntersectionTriangle(false)
|
||||||
, m_localIntersectionPoint(localIntersectionPoint)
|
, m_localIntersectionPointInDisplay(localIntersectionPointInDisplay)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ RiuGeoMechSelectionItem::RiuGeoMechSelectionItem(RimGeoMechView*
|
|||||||
size_t cellIndex,
|
size_t cellIndex,
|
||||||
cvf::Color3f color,
|
cvf::Color3f color,
|
||||||
int elementFace,
|
int elementFace,
|
||||||
const cvf::Vec3d& localIntersectionPoint,
|
const cvf::Vec3d& localIntersectionPointInDisplay,
|
||||||
const std::array<cvf::Vec3f, 3>& intersectionTriangle)
|
const std::array<cvf::Vec3f, 3>& intersectionTriangle)
|
||||||
: m_view(view)
|
: m_view(view)
|
||||||
, m_gridIndex(gridIndex)
|
, m_gridIndex(gridIndex)
|
||||||
@ -210,7 +210,7 @@ RiuGeoMechSelectionItem::RiuGeoMechSelectionItem(RimGeoMechView*
|
|||||||
, m_elementFace(elementFace)
|
, m_elementFace(elementFace)
|
||||||
, m_hasIntersectionTriangle(true)
|
, m_hasIntersectionTriangle(true)
|
||||||
, m_intersectionTriangle(intersectionTriangle)
|
, m_intersectionTriangle(intersectionTriangle)
|
||||||
, m_localIntersectionPoint(localIntersectionPoint)
|
, m_localIntersectionPointInDisplay(localIntersectionPointInDisplay)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ public:
|
|||||||
size_t nncIndex,
|
size_t nncIndex,
|
||||||
cvf::Color3f color,
|
cvf::Color3f color,
|
||||||
cvf::StructGridInterface::FaceType face,
|
cvf::StructGridInterface::FaceType face,
|
||||||
const cvf::Vec3d& localIntersectionPoint);
|
const cvf::Vec3d& localIntersectionPointInDisplay);
|
||||||
|
|
||||||
virtual ~RiuEclipseSelectionItem() {};
|
virtual ~RiuEclipseSelectionItem() {};
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ public:
|
|||||||
size_t m_nncIndex;
|
size_t m_nncIndex;
|
||||||
cvf::Color3f m_color;
|
cvf::Color3f m_color;
|
||||||
cvf::StructGridInterface::FaceType m_face;
|
cvf::StructGridInterface::FaceType m_face;
|
||||||
cvf::Vec3d m_localIntersectionPoint;
|
cvf::Vec3d m_localIntersectionPointInDisplay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -170,14 +170,14 @@ public:
|
|||||||
size_t cellIndex,
|
size_t cellIndex,
|
||||||
cvf::Color3f color,
|
cvf::Color3f color,
|
||||||
int elementFace,
|
int elementFace,
|
||||||
const cvf::Vec3d& localIntersectionPoint);
|
const cvf::Vec3d& localIntersectionPointInDisplay);
|
||||||
|
|
||||||
explicit RiuGeoMechSelectionItem(RimGeoMechView* view,
|
explicit RiuGeoMechSelectionItem(RimGeoMechView* view,
|
||||||
size_t gridIndex,
|
size_t gridIndex,
|
||||||
size_t cellIndex,
|
size_t cellIndex,
|
||||||
cvf::Color3f color,
|
cvf::Color3f color,
|
||||||
int elementFace,
|
int elementFace,
|
||||||
const cvf::Vec3d& localIntersectionPoint,
|
const cvf::Vec3d& localIntersectionPointInDisplay,
|
||||||
const std::array<cvf::Vec3f, 3>& intersectionTriangle );
|
const std::array<cvf::Vec3f, 3>& intersectionTriangle );
|
||||||
virtual ~RiuGeoMechSelectionItem() {};
|
virtual ~RiuGeoMechSelectionItem() {};
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ public:
|
|||||||
int m_elementFace;
|
int m_elementFace;
|
||||||
bool m_hasIntersectionTriangle;
|
bool m_hasIntersectionTriangle;
|
||||||
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
std::array<cvf::Vec3f, 3> m_intersectionTriangle;
|
||||||
cvf::Vec3d m_localIntersectionPoint;
|
cvf::Vec3d m_localIntersectionPointInDisplay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user