Minor seismic surface lines fixes

* Support continuous lines along the seismic surface
* Make sure watertight surface include all cells
* Remove unused function and mark with static
* Invert surface intersection line visibility control
This commit is contained in:
Magne Sjaastad
2023-09-11 07:56:08 +02:00
committed by GitHub
parent 7632064105
commit f931021385
6 changed files with 32 additions and 18 deletions

View File

@@ -179,7 +179,9 @@ std::vector<std::vector<cvf::Vec3d>>
{
domainCurvePoints.emplace_back( intersectionPoint );
}
else
// Create a line segment if we did not find an intersection point or if we are at the end of the polyline
if ( !foundMatch || ( point == resampledPolyline.back() ) )
{
if ( domainCurvePoints.size() > 1 )
{

View File

@@ -66,9 +66,6 @@ public:
double lineThickness,
const std::vector<RimSurface*>& surfaces );
private:
cvf::ref<cvf::DrawableGeo> createXYPlaneQuadGeoWithTexCoords( const cvf::Vec3dArray& cornerPoints );
protected:
cvf::TextureImage* createImageFromData( ZGYAccess::SeismicSliceData* data );

View File

@@ -54,7 +54,7 @@ public:
const cvf::BoundingBox& boundingBox ) = 0;
protected:
cvf::ref<cvf::DrawableGeo> createXYPlaneQuadGeoWithTexCoords( const cvf::Vec3dArray& cornerPoints );
static cvf::ref<cvf::DrawableGeo> createXYPlaneQuadGeoWithTexCoords( const cvf::Vec3dArray& cornerPoints );
cvf::ref<cvf::Part> createSingleTexturedQuadPart( const cvf::Vec3dArray& cornerPoints, cvf::ref<cvf::TextureImage> image, bool transparent );
cvf::ref<cvf::ShaderProgram> m_textureShaderProg;

View File

@@ -55,8 +55,8 @@ RimSeismicSectionCollection::RimSeismicSectionCollection()
CAF_PDM_InitField( &m_surfaceIntersectionLinesScaleFactor, "SurfaceIntersectionLinesScaleFactor", 5.0, "Line Scale Factor ( >= 1.0 )" );
CAF_PDM_InitFieldNoDefault( &m_visibleSurfaceLines, "VisibleSurfaceLines", "Visible Surface Lines" );
m_visibleSurfaceLines.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_hiddenSurfaceLines, "HiddenSurfaceLines", "Hidden Surface Lines" );
m_hiddenSurfaceLines.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
setName( "Seismic Sections" );
}
@@ -147,7 +147,7 @@ caf::PdmFieldHandle* RimSeismicSectionCollection::userDescriptionField()
void RimSeismicSectionCollection::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_surfaceIntersectionLinesScaleFactor );
uiOrdering.add( &m_visibleSurfaceLines );
uiOrdering.add( &m_hiddenSurfaceLines );
uiOrdering.skipRemainingFields( true );
}
@@ -170,6 +170,24 @@ 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();
for ( auto& section : m_seismicSections )
{
if ( section->isChecked() )
@@ -178,13 +196,7 @@ void RimSeismicSectionCollection::appendPartsToModel( Rim3dView*
{
section->partMgr()->appendGeometryPartsToModel( model, transform, boundingBox );
std::vector<RimSurface*> surfaces;
for ( const auto& surf : m_visibleSurfaceLines.value() )
{
surfaces.push_back( surf );
}
section->partMgr()->appendSurfaceIntersectionLines( model, transform, m_surfaceIntersectionLinesScaleFactor(), surfaces );
section->partMgr()->appendSurfaceIntersectionLines( model, transform, m_surfaceIntersectionLinesScaleFactor(), visibleSurfaces );
}
section->partMgr()->appendPolylinePartsToModel( view, model, transform, boundingBox );
}
@@ -269,7 +281,7 @@ QList<caf::PdmOptionItemInfo> RimSeismicSectionCollection::calculateValueOptions
{
QList<caf::PdmOptionItemInfo> options;
if ( fieldNeedingOptions == &m_visibleSurfaceLines )
if ( fieldNeedingOptions == &m_hiddenSurfaceLines )
{
auto surfaceCollection = RimTools::surfaceCollection();
for ( auto surface : surfaceCollection->surfaces() )

View File

@@ -88,5 +88,5 @@ private:
caf::PdmChildArrayField<RimSeismicSection*> m_seismicSections;
caf::PdmField<double> m_surfaceIntersectionLinesScaleFactor;
caf::PdmPtrArrayField<RimSurface*> m_visibleSurfaceLines;
caf::PdmPtrArrayField<RimSurface*> m_hiddenSurfaceLines;
};

View File

@@ -312,7 +312,10 @@ void RimGridCaseSurface::extractGridDataUsingFourVerticesPerCell()
const auto& cell = grid->cell( currentCellIndex );
if ( cell.isInvalid() ) continue;
if ( !m_includeInactiveCells() && activeCells && !activeCells->isActive( currentCellIndex ) ) continue;
bool skipInactiveCells = !m_includeInactiveCells();
if ( m_watertight ) skipInactiveCells = false;
if ( skipInactiveCells && activeCells && !activeCells->isActive( currentCellIndex ) ) continue;
cvf::Vec3d currentCornerVerts[8];