#3700 Add visual picking marker and improve map results

* Fix "off by half a cell" errors and improve smoothness using averaging and interpolation
This commit is contained in:
Gaute Lindkvist
2018-11-15 21:40:10 +01:00
parent 71f90b1337
commit 42d3e65416
8 changed files with 497 additions and 204 deletions

View File

@@ -62,19 +62,26 @@ bool RicContourMapPickEventHandler::handlePickEvent(const Ric3DPickEvent& eventO
contourMap->firstAncestorOrThisOfTypeAsserted(view);
cvf::Vec2d pickedPoint;
cvf::Vec2ui pickedCell;
double valueAtPoint = 0.0;
if (contourMap->checkForMapIntersection(firstPickedItem.globalPickedPoint(), &pickedPoint, &valueAtPoint))
if (contourMap->checkForMapIntersection(firstPickedItem.globalPickedPoint(), &pickedPoint, &pickedCell, &valueAtPoint))
{
QString curveText;
curveText += QString("%1\n").arg(view->createAutoName());
curveText += QString("Picked Point X, Y: %1, %2\n").arg(pickedPoint.x(), 5, 'f', 0).arg(pickedPoint.y(), 5, 'f', 0);
curveText += QString("Picked Cell I, J: %1, %2\n").arg(pickedCell.x()).arg(pickedCell.y());
curveText += QString("Result Type: %1\n").arg(contourMap->resultDescriptionText());
curveText += QString("Aggregated Value: %1\n").arg(valueAtPoint);
RiuMainWindow::instance()->setResultInfo(curveText);
contourMap->setPickPoint(pickedPoint);
view->updateCurrentTimeStepAndRedraw();
return true;
}
contourMap->setPickPoint(cvf::Vec2d::UNDEFINED);
view->updateCurrentTimeStepAndRedraw();
return true;
}
}
return false;