mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3699 Show global east west position when picking on Contour Maps.
This commit is contained in:
parent
a1e094625a
commit
e2cc7fb423
@ -61,13 +61,13 @@ bool RicContourMapPickEventHandler::handlePickEvent(const Ric3DPickEvent& eventO
|
||||
RimContourMapView* view = nullptr;
|
||||
contourMap->firstAncestorOrThisOfTypeAsserted(view);
|
||||
|
||||
cvf::Vec2ui pickedPoint;
|
||||
cvf::Vec2d pickedPoint;
|
||||
double valueAtPoint = 0.0;
|
||||
if (contourMap->checkForMapIntersection(firstPickedItem.globalPickedPoint(), &pickedPoint, &valueAtPoint))
|
||||
{
|
||||
QString curveText;
|
||||
curveText += QString("%1\n").arg(view->createAutoName());
|
||||
curveText += QString("Sample, I, J: [%1, %2]\n").arg(pickedPoint.x()).arg(pickedPoint.y());
|
||||
curveText += QString("Picked Point X, Y: %1, %2\n").arg(pickedPoint.x(), 5, 'f', 0).arg(pickedPoint.y(), 5, 'f', 0);
|
||||
curveText += QString("Result Type: %1\n").arg(contourMap->resultDescriptionText());
|
||||
curveText += QString("Aggregated Value: %1\n").arg(valueAtPoint);
|
||||
|
||||
|
@ -1008,13 +1008,18 @@ void RimContourMapProjection::updatedWeightingResult()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimContourMapProjection::checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2ui* contourMapIJ, double* valueAtPoint) const
|
||||
bool RimContourMapProjection::checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2d* contourMapPoint, double* valueAtPoint) const
|
||||
{
|
||||
CVF_TIGHT_ASSERT(contourMapIJ);
|
||||
CVF_TIGHT_ASSERT(contourMapPoint);
|
||||
CVF_TIGHT_ASSERT(valueAtPoint);
|
||||
cvf::Vec2d localPos2d(localPoint3d.x(), localPoint3d.y());
|
||||
*contourMapIJ = ijFromLocalPos(localPos2d);
|
||||
*valueAtPoint = value(contourMapIJ->x(), contourMapIJ->y());
|
||||
cvf::Vec2ui pickedCellIJ = ijFromLocalPos(localPos2d);
|
||||
*valueAtPoint = value(pickedCellIJ.x(), pickedCellIJ.y());
|
||||
|
||||
cvf::BoundingBox boundingBox = expandedBoundingBox();
|
||||
cvf::Vec2d origin(boundingBox.min().x(), boundingBox.min().y());
|
||||
*contourMapPoint = localPos2d + origin;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ public:
|
||||
QString resultDescriptionText() const;
|
||||
void updatedWeightingResult();
|
||||
|
||||
bool checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2ui* contourMapIJ, double* valueAtPoint) const;
|
||||
bool checkForMapIntersection(const cvf::Vec3d& localPoint3d, cvf::Vec2d* contourMapPoint, double* valueAtPoint) const;
|
||||
|
||||
protected:
|
||||
double calculateValue(uint i, uint j) const;
|
||||
|
Loading…
Reference in New Issue
Block a user