mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#260) Fixed problem with picking faults in some rare cases
Made sure that we handle the case when an item has been hit which is not a non-NNC item.
This commit is contained in:
parent
c527545e4f
commit
04d70a9204
@ -433,6 +433,8 @@ void RiuViewerCommands::extractIntersectionData(const cvf::HitItemCollection& hi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (firstNonNncHitItem)
|
||||||
|
{
|
||||||
const cvf::Part* pickedPart = firstNonNncHitItem->part();
|
const cvf::Part* pickedPart = firstNonNncHitItem->part();
|
||||||
CVF_ASSERT(pickedPart);
|
CVF_ASSERT(pickedPart);
|
||||||
*firstPart = const_cast<cvf::Part*>(pickedPart);
|
*firstPart = const_cast<cvf::Part*>(pickedPart);
|
||||||
@ -461,6 +463,24 @@ void RiuViewerCommands::extractIntersectionData(const cvf::HitItemCollection& hi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (localIntersectionPoint && nncPart && *nncPart)
|
||||||
|
{
|
||||||
|
cvf::Vec3d globalPickedPoint = firstItemIntersectionPoint;
|
||||||
|
|
||||||
|
const cvf::Transform* xf = (*nncPart)->transform();
|
||||||
|
if (xf)
|
||||||
|
{
|
||||||
|
*localIntersectionPoint = globalPickedPoint.getTransformedPoint(xf->worldTransform().getInverted());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*localIntersectionPoint = globalPickedPoint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user