mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fix display of intersection lines in 3D view
* 10675 Fix missing intersection line geometry * Change to list of visible surface intersection lines * Enable surface intersection band for any intersection * Show labels for intersection curves in 3D The polylines are defined in the display coordinate system without Z-scaling. The z-scaling is applied to the visualization parts using Part::setTransform(Transform* transform) The annotation objects are defined by display coordinates, so apply the Z-scaling to the coordinates. * Improve naming of surfaces * Use scaling factor of 1.0 for flat intersection views
This commit is contained in:
@@ -55,8 +55,8 @@ RimSeismicSectionCollection::RimSeismicSectionCollection()
|
||||
|
||||
CAF_PDM_InitField( &m_surfaceIntersectionLinesScaleFactor, "SurfaceIntersectionLinesScaleFactor", 5.0, "Line Scale Factor ( >= 1.0 )" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_hiddenSurfaceLines, "HiddenSurfaceLines", "Hidden Surface Lines" );
|
||||
m_hiddenSurfaceLines.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
CAF_PDM_InitFieldNoDefault( &m_surfacesWithVisibleSurfaceLines, "SurfacesWithVisibleSurfaceLines", "Surface Lines" );
|
||||
m_surfacesWithVisibleSurfaceLines.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
|
||||
setName( "Seismic Sections" );
|
||||
}
|
||||
@@ -148,7 +148,7 @@ void RimSeismicSectionCollection::defineUiOrdering( QString uiConfigName, caf::P
|
||||
{
|
||||
auto grp = uiOrdering.addNewGroup( "Surface Intersection Lines" );
|
||||
grp->add( &m_surfaceIntersectionLinesScaleFactor );
|
||||
grp->add( &m_hiddenSurfaceLines );
|
||||
grp->add( &m_surfacesWithVisibleSurfaceLines );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
@@ -171,23 +171,7 @@ void RimSeismicSectionCollection::appendPartsToModel( Rim3dView*
|
||||
{
|
||||
if ( !isChecked() ) return;
|
||||
|
||||
auto computeVisibleSurface = [&]() -> std::vector<RimSurface*>
|
||||
{
|
||||
std::vector<RimSurface*> visibleSurfaces;
|
||||
auto allSurfaces = RimTools::surfaceCollection()->surfaces();
|
||||
auto hiddenSurfaces = m_hiddenSurfaceLines.value();
|
||||
|
||||
for ( const auto& surf : allSurfaces )
|
||||
{
|
||||
if ( std::find( hiddenSurfaces.begin(), hiddenSurfaces.end(), surf ) != hiddenSurfaces.end() ) continue;
|
||||
|
||||
visibleSurfaces.push_back( surf );
|
||||
}
|
||||
|
||||
return visibleSurfaces;
|
||||
};
|
||||
|
||||
auto visibleSurfaces = computeVisibleSurface();
|
||||
auto visibleSurfaces = m_surfacesWithVisibleSurfaceLines().ptrReferencedObjectsByType();
|
||||
|
||||
for ( auto& section : m_seismicSections )
|
||||
{
|
||||
@@ -275,6 +259,21 @@ void RimSeismicSectionCollection::updateLegendRangesTextAndVisibility( RiuViewer
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimSeismicSectionCollection::setSurfacesVisible( const std::vector<RimSurface*>& surfaces )
|
||||
{
|
||||
for ( auto surface : surfaces )
|
||||
{
|
||||
if ( std::find( m_surfacesWithVisibleSurfaceLines.begin(), m_surfacesWithVisibleSurfaceLines.end(), surface ) ==
|
||||
m_surfacesWithVisibleSurfaceLines.end() )
|
||||
{
|
||||
m_surfacesWithVisibleSurfaceLines.push_back( surface );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -282,8 +281,11 @@ QList<caf::PdmOptionItemInfo> RimSeismicSectionCollection::calculateValueOptions
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( fieldNeedingOptions == &m_hiddenSurfaceLines )
|
||||
if ( fieldNeedingOptions == &m_surfacesWithVisibleSurfaceLines )
|
||||
{
|
||||
// If a surface is deleted, we need to remove it from the list of surfaces with visible surface lines
|
||||
m_surfacesWithVisibleSurfaceLines.removePtr( nullptr );
|
||||
|
||||
auto surfaceCollection = RimTools::surfaceCollection();
|
||||
for ( auto surface : surfaceCollection->surfaces() )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user