mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-26 23:20:29 -05:00
Introduce RimMswSegment and RimMswSegmentCollection classes to manage and visualize Multi-Segment Well (MSW) segments from Eclipse WELSEGS data. Update WelsegsRow to include source well name for correct segment grouping. Integrate new classes into the build system and UI, enabling accurate 3D well path representation and improved segment management in ResInsight.
176 lines
6.4 KiB
C++
176 lines
6.4 KiB
C++
/////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2026 Equinor ASA
|
|
//
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
//
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
//
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
// for more details.
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "RimMswSegment.h"
|
|
|
|
#include "cafPdmUiDoubleValueEditor.h"
|
|
|
|
CAF_PDM_SOURCE_INIT( RimMswSegment, "RimMswSegment" );
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimMswSegment::RimMswSegment()
|
|
{
|
|
CAF_PDM_InitObject( "MSW Segment" );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_segmentNumber, "SegmentNumber", "Segment Number" );
|
|
m_segmentNumber.uiCapability()->setUiReadOnly( true );
|
|
|
|
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_endMD, "EndMD", "End MD" );
|
|
m_endMD.uiCapability()->setUiReadOnly( true );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_diameter, "Diameter", "Diameter" );
|
|
m_diameter.uiCapability()->setUiReadOnly( true );
|
|
|
|
setDeletable( false );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RimMswSegment::~RimMswSegment()
|
|
{
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimMswSegment::setSegmentData( int segmentNumber, int branchNumber, double startMD, double endMD, double diameter )
|
|
{
|
|
m_segmentNumber = segmentNumber;
|
|
m_branchNumber = branchNumber;
|
|
m_startMD = startMD;
|
|
m_endMD = endMD;
|
|
m_diameter = diameter;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
int RimMswSegment::segmentNumber() const
|
|
{
|
|
return m_segmentNumber;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
int RimMswSegment::branchNumber() const
|
|
{
|
|
return m_branchNumber;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
double RimMswSegment::diameter() const
|
|
{
|
|
return m_diameter;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
bool RimMswSegment::isEnabled() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
RiaDefines::WellPathComponentType RimMswSegment::componentType() const
|
|
{
|
|
return RiaDefines::WellPathComponentType::MSW_SEGMENT;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
QString RimMswSegment::componentLabel() const
|
|
{
|
|
return QString( "Seg %1\n%2 - %3" ).arg( segmentNumber() ).arg( startMD(), 0, 'f', 1 ).arg( endMD(), 0, 'f', 1 );
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
QString RimMswSegment::componentTypeLabel() const
|
|
{
|
|
return "MSW Segment";
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
cvf::Color3f RimMswSegment::defaultComponentColor() const
|
|
{
|
|
// Alternating colors based on segment number
|
|
if ( segmentNumber() % 2 == 0 )
|
|
{
|
|
return cvf::Color3f( 0.3f, 0.5f, 0.8f ); // Blue
|
|
}
|
|
return cvf::Color3f( 0.3f, 0.7f, 0.9f ); // Cyan
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
double RimMswSegment::startMD() const
|
|
{
|
|
return m_startMD;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
double RimMswSegment::endMD() const
|
|
{
|
|
return m_endMD;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimMswSegment::applyOffset( double offsetMD )
|
|
{
|
|
m_startMD = m_startMD + offsetMD;
|
|
m_endMD = m_endMD + offsetMD;
|
|
}
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
///
|
|
//--------------------------------------------------------------------------------------------------
|
|
void RimMswSegment::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
|
{
|
|
uiOrdering.add( &m_segmentNumber );
|
|
uiOrdering.add( &m_branchNumber );
|
|
uiOrdering.add( &m_startMD );
|
|
uiOrdering.add( &m_endMD );
|
|
uiOrdering.add( &m_diameter );
|
|
|
|
uiOrdering.skipRemainingFields( true );
|
|
}
|