diff --git a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp index adc9fb54c6..3a7e142c46 100644 --- a/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp +++ b/ApplicationLibCode/ModelVisualization/RivWellPathPartMgr.cpp @@ -668,8 +668,7 @@ void RivWellPathPartMgr::appendMswSegmentsToModel( cvf::ModelBasicList* cvf::ref objectSourceInfo = new RivObjectSourceInfo( const_cast( segment ) ); for ( auto part : parts ) { - part->setName( - QString( "MSW Segment %1 (Branch %2)" ).arg( segment->segmentNumber() ).arg( segment->branchNumber() ).toStdString() ); + part->setName( m_rimWellPath->name().toStdString() ); part->setSourceInfo( objectSourceInfo.p() ); model->addPart( part.p() ); } diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.cpp index bff0837269..d213eda6ec 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.cpp @@ -35,11 +35,17 @@ RimMswSegment::RimMswSegment() CAF_PDM_InitFieldNoDefault( &m_branchNumber, "BranchNumber", "Branch Number" ); m_branchNumber.uiCapability()->setUiReadOnly( true ); - CAF_PDM_InitFieldNoDefault( &m_startMD, "StartMD", "Start MD" ); - m_startMD.uiCapability()->setUiReadOnly( true ); + CAF_PDM_InitFieldNoDefault( &m_joinSegment, "JoinSegment", "Join Segment" ); + m_joinSegment.uiCapability()->setUiReadOnly( true ); - CAF_PDM_InitFieldNoDefault( &m_endMD, "EndMD", "End MD" ); - m_endMD.uiCapability()->setUiReadOnly( true ); + CAF_PDM_InitFieldNoDefault( &m_length, "Length", "Length" ); + m_length.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitFieldNoDefault( &m_depth, "Depth", "Depth" ); + m_depth.uiCapability()->setUiReadOnly( true ); + + CAF_PDM_InitFieldNoDefault( &m_nextSegmentLength, "NextSegmentLength", "Next Segment Length" ); + m_nextSegmentLength.uiCapability()->setUiReadOnly( true ); CAF_PDM_InitFieldNoDefault( &m_diameter, "Diameter", "Diameter" ); m_diameter.uiCapability()->setUiReadOnly( true ); @@ -57,13 +63,21 @@ RimMswSegment::~RimMswSegment() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RimMswSegment::setSegmentData( int segmentNumber, int branchNumber, double startMD, double endMD, double diameter ) +void RimMswSegment::setSegmentData( int segmentNumber, + int branchNumber, + int joinSegment, + double length, + double depth, + double nextSegmentLength, + double diameter ) { - m_segmentNumber = segmentNumber; - m_branchNumber = branchNumber; - m_startMD = startMD; - m_endMD = endMD; - m_diameter = diameter; + m_segmentNumber = segmentNumber; + m_branchNumber = branchNumber; + m_joinSegment = joinSegment; + m_length = length; + m_depth = depth; + m_nextSegmentLength = nextSegmentLength; + m_diameter = diameter; } //-------------------------------------------------------------------------------------------------- @@ -82,6 +96,38 @@ int RimMswSegment::branchNumber() const return m_branchNumber; } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +int RimMswSegment::joinSegment() const +{ + return m_joinSegment; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMswSegment::length() const +{ + return m_length; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMswSegment::depth() const +{ + return m_depth; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +double RimMswSegment::nextSegmentLength() const +{ + return m_nextSegmentLength; +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -140,7 +186,7 @@ cvf::Color3f RimMswSegment::defaultComponentColor() const //-------------------------------------------------------------------------------------------------- double RimMswSegment::startMD() const { - return m_startMD; + return m_length; } //-------------------------------------------------------------------------------------------------- @@ -148,7 +194,7 @@ double RimMswSegment::startMD() const //-------------------------------------------------------------------------------------------------- double RimMswSegment::endMD() const { - return m_endMD; + return m_nextSegmentLength; } //-------------------------------------------------------------------------------------------------- @@ -156,8 +202,8 @@ double RimMswSegment::endMD() const //-------------------------------------------------------------------------------------------------- void RimMswSegment::applyOffset( double offsetMD ) { - m_startMD = m_startMD + offsetMD; - m_endMD = m_endMD + offsetMD; + // This does not make sense to apply offset to MSW segments, as they are not connected to each other and the start/end MD is only used + // for display purposes. So we do nothing here. } //-------------------------------------------------------------------------------------------------- @@ -167,8 +213,10 @@ void RimMswSegment::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& { uiOrdering.add( &m_segmentNumber ); uiOrdering.add( &m_branchNumber ); - uiOrdering.add( &m_startMD ); - uiOrdering.add( &m_endMD ); + uiOrdering.add( &m_length ); + uiOrdering.add( &m_depth ); + uiOrdering.add( &m_nextSegmentLength ); + uiOrdering.add( &m_joinSegment ); uiOrdering.add( &m_diameter ); uiOrdering.skipRemainingFields( true ); diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.h b/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.h index 529f04655e..09ef22e707 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.h +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegment.h @@ -37,10 +37,14 @@ public: RimMswSegment(); ~RimMswSegment() override; - void setSegmentData( int segmentNumber, int branchNumber, double startMD, double endMD, double diameter ); + void setSegmentData( int segmentNumber, int branchNumber, int joinSegment, double length, double depth, double nextSegmentLength, double diameter ); int segmentNumber() const; int branchNumber() const; + int joinSegment() const; + double length() const; + double depth() const; + double nextSegmentLength() const; double diameter() const; // RimWellPathComponentInterface overrides @@ -59,7 +63,9 @@ protected: private: caf::PdmField m_segmentNumber; caf::PdmField m_branchNumber; - caf::PdmField m_startMD; - caf::PdmField m_endMD; + caf::PdmField m_joinSegment; + caf::PdmField m_length; + caf::PdmField m_depth; + caf::PdmField m_nextSegmentLength; caf::PdmField m_diameter; }; diff --git a/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegmentCollection.cpp b/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegmentCollection.cpp index a183e45020..1b794546c3 100644 --- a/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegmentCollection.cpp +++ b/ApplicationLibCode/ProjectDataModel/Completions/RimMswSegmentCollection.cpp @@ -104,21 +104,17 @@ void RimMswSegmentCollection::populateFromWelsegsData( std::vector w // Sort segments by measured depth (length) std::sort( welsegsData.begin(), welsegsData.end(), []( const WelsegsRow& a, const WelsegsRow& b ) { return a.length < b.length; } ); - // Create segments with computed start/end MD + // Assign segments data. Start/end measured depth is used for visualization in 2D plots by RimWellPathComponentInterface for ( size_t i = 0; i < welsegsData.size(); ++i ) { const auto& row = welsegsData[i]; - double startMD = row.length; - double endMD = ( i + 1 < welsegsData.size() ) ? welsegsData[i + 1].length : wellTotalDepth; - - // Skip if start >= end (invalid interval) - if ( startMD >= endMD ) continue; + double nextSegmentLength = ( i + 1 < welsegsData.size() ) ? welsegsData[i + 1].length : wellTotalDepth; double diameter = row.diameter.value_or( 0.1 ); // Default diameter if not specified auto* segment = new RimMswSegment(); - segment->setSegmentData( row.segment1, row.branch, startMD, endMD, diameter ); + segment->setSegmentData( row.segment1, row.branch, row.joinSegment, row.length, row.depth, nextSegmentLength, diameter ); appendSegment( segment ); } } diff --git a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp index d5c75b281f..151b705185 100644 --- a/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationLibCode/UserInterface/RiuViewerCommands.cpp @@ -836,13 +836,18 @@ void RiuViewerCommands::handlePickAction( int winPosX, int winPosY, Qt::Keyboard resultInfoText += "\n\n"; } - resultInfoText += QString( "Segment: %1\nBranch: %2\nMD: %3 - %4\nDiameter: %5" ) + resultInfoText += QString( "Segment : %1\n" + "Branch : %2\n" + "Join Segment: %3\n" + "Length : %4\n" + "Depth : %5\n" + "Diameter : %6" ) .arg( mswSegment->segmentNumber() ) .arg( mswSegment->branchNumber() ) - .arg( mswSegment->startMD() ) - .arg( mswSegment->endMD() ) + .arg( mswSegment->joinSegment() ) + .arg( mswSegment->length() ) + .arg( mswSegment->depth() ) .arg( mswSegment->diameter() ); - RiuMainWindow::instance()->setResultInfo( resultInfoText ); RiuMainWindow::instance()->selectAsCurrentItem( mswSegment, true ); }