mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5418 Add picking on reservoir surfaces.
Added sorting of pick items based on tolerance and polygon offset unit.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "RimGeoMechCellColors.h"
|
||||
#include "RimGeoMechView.h"
|
||||
#include "RimIntersectionResultDefinition.h"
|
||||
#include "RimSurfaceInView.h"
|
||||
|
||||
#include "Riu3dSelectionManager.h"
|
||||
#include "RiuViewerCommands.h"
|
||||
@@ -37,6 +38,7 @@
|
||||
#include "RivExtrudedCurveIntersectionSourceInfo.h"
|
||||
#include "RivFemPartGeometryGenerator.h"
|
||||
#include "RivFemPickSourceInfo.h"
|
||||
#include "RivReservoirSurfaceIntersectionSourceInfo.h"
|
||||
#include "RivSourceInfo.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
@@ -124,9 +126,10 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
int gmFace = -1;
|
||||
bool intersectionHit = false;
|
||||
std::array<cvf::Vec3f, 3> intersectionTriangleHit;
|
||||
RimGeoMechResultDefinition* geomResDef = nullptr;
|
||||
RimEclipseResultDefinition* eclResDef = nullptr;
|
||||
size_t timestepIndex = cvf::UNDEFINED_SIZE_T;
|
||||
RimGeoMechResultDefinition* geomResDef = nullptr;
|
||||
RimEclipseResultDefinition* eclResDef = nullptr;
|
||||
size_t timestepIndex = cvf::UNDEFINED_SIZE_T;
|
||||
RimIntersectionResultDefinition* sepInterResDef = nullptr;
|
||||
|
||||
// clang-format off
|
||||
if ( const RivSourceInfo* rivSourceInfo = dynamic_cast<const RivSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||
@@ -146,6 +149,19 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
gridIndex = femSourceInfo->femPartIndex();
|
||||
gridLocalCellIndex = femSourceInfo->triangleToElmMapper()->elementIndex( firstPartTriangleIndex );
|
||||
gmFace = femSourceInfo->triangleToElmMapper()->elementFace( firstPartTriangleIndex );
|
||||
}
|
||||
else if ( const RivReservoirSurfaceIntersectionSourceInfo* surfeIntersectSourceInfo =
|
||||
dynamic_cast<const RivReservoirSurfaceIntersectionSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||
{
|
||||
RiuViewerCommands::findCellAndGridIndex( mainOrComparisonView,
|
||||
surfeIntersectSourceInfo,
|
||||
firstPartTriangleIndex,
|
||||
&gridLocalCellIndex,
|
||||
&gridIndex );
|
||||
|
||||
intersectionHit = true;
|
||||
intersectionTriangleHit = surfeIntersectSourceInfo->triangle( firstPartTriangleIndex );
|
||||
sepInterResDef = surfeIntersectSourceInfo->intersection()->activeSeparateResultDefinition();
|
||||
}
|
||||
else if ( const RivExtrudedCurveIntersectionSourceInfo* intersectionSourceInfo =
|
||||
dynamic_cast<const RivExtrudedCurveIntersectionSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||
@@ -158,20 +174,7 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
|
||||
intersectionHit = true;
|
||||
intersectionTriangleHit = intersectionSourceInfo->triangle( firstPartTriangleIndex );
|
||||
|
||||
if ( RimIntersectionResultDefinition* sepInterResDef = intersectionSourceInfo->intersection()->activeSeparateResultDefinition() )
|
||||
{
|
||||
if ( sepInterResDef->isEclipseResultDefinition() )
|
||||
{
|
||||
eclResDef = sepInterResDef->eclipseResultDefinition();
|
||||
}
|
||||
else
|
||||
{
|
||||
geomResDef = sepInterResDef->geoMechResultDefinition();
|
||||
}
|
||||
|
||||
timestepIndex = sepInterResDef->timeStep();
|
||||
}
|
||||
sepInterResDef = intersectionSourceInfo->intersection()->activeSeparateResultDefinition();
|
||||
}
|
||||
else if ( const RivBoxIntersectionSourceInfo* intersectionBoxSourceInfo =
|
||||
dynamic_cast<const RivBoxIntersectionSourceInfo*>( firstHitPart->sourceInfo() ) )
|
||||
@@ -184,23 +187,24 @@ bool RiuCellAndNncPickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eve
|
||||
|
||||
intersectionHit = true;
|
||||
intersectionTriangleHit = intersectionBoxSourceInfo->triangle( firstPartTriangleIndex );
|
||||
|
||||
if ( RimIntersectionResultDefinition* sepInterResDef = intersectionBoxSourceInfo->intersectionBox()->activeSeparateResultDefinition() )
|
||||
{
|
||||
if ( sepInterResDef->isEclipseResultDefinition() )
|
||||
{
|
||||
eclResDef = sepInterResDef->eclipseResultDefinition();
|
||||
}
|
||||
else
|
||||
{
|
||||
geomResDef = sepInterResDef->geoMechResultDefinition();
|
||||
}
|
||||
|
||||
timestepIndex = sepInterResDef->timeStep();
|
||||
}
|
||||
sepInterResDef = intersectionBoxSourceInfo->intersectionBox()->activeSeparateResultDefinition();
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
if ( sepInterResDef )
|
||||
{
|
||||
if ( sepInterResDef->isEclipseResultDefinition() )
|
||||
{
|
||||
eclResDef = sepInterResDef->eclipseResultDefinition();
|
||||
}
|
||||
else
|
||||
{
|
||||
geomResDef = sepInterResDef->geoMechResultDefinition();
|
||||
}
|
||||
|
||||
timestepIndex = sepInterResDef->timeStep();
|
||||
}
|
||||
|
||||
if ( gridLocalCellIndex == cvf::UNDEFINED_SIZE_T )
|
||||
{
|
||||
Riu3dSelectionManager::instance()->deleteAllItems();
|
||||
|
||||
Reference in New Issue
Block a user