mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5766 Make it possible to change color of well disks.
This commit is contained in:
parent
0be429e0fe
commit
eff3c91e4b
@ -203,9 +203,9 @@ void RivWellDiskPartMgr::buildWellDiskParts( size_t frameIndex, const caf::Displ
|
||||
if ( diskData.isSingleProperty() )
|
||||
{
|
||||
// Set color for the triangle vertices
|
||||
cvf::Color3ub c = cvf::Color3ub( m_rimWell->wellDiskColor );
|
||||
for ( size_t i = 0; i < numSectors * 3; i++ )
|
||||
{
|
||||
cvf::Color3ub c = cvf::Color3::OLIVE;
|
||||
colorArray->set( i, c );
|
||||
}
|
||||
|
||||
|
@ -86,6 +86,9 @@ RimSimWellInView::RimSimWellInView()
|
||||
CAF_PDM_InitField( &pipeScaleFactor, "WellPipeRadiusScale", 1.0, "Pipe Radius Scale", "", "", "" );
|
||||
CAF_PDM_InitField( &wellPipeColor, "WellPipeColor", cvf::Color3f( 0.588f, 0.588f, 0.804f ), "Pipe Color", "", "", "" );
|
||||
|
||||
cvf::Color3f defaultWellDiskColor = cvf::Color3::OLIVE;
|
||||
CAF_PDM_InitField( &wellDiskColor, "WellDiskColor", defaultWellDiskColor, "Disk Color", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &showWellCells, "ShowWellCells", false, "Well Cells", "", "", "" );
|
||||
CAF_PDM_InitField( &showWellCellFence, "ShowWellCellFence", false, "Well Cell Fence", "", "", "" );
|
||||
|
||||
@ -127,7 +130,8 @@ void RimSimWellInView::fieldChangedByUi( const caf::PdmFieldHandle* changedField
|
||||
if ( reservoirView )
|
||||
{
|
||||
if ( &showWellLabel == changedField || &showWellHead == changedField || &showWellPipe == changedField ||
|
||||
&showWellSpheres == changedField || &showWellDisks == changedField || &wellPipeColor == changedField )
|
||||
&showWellSpheres == changedField || &showWellDisks == changedField || &wellPipeColor == changedField ||
|
||||
&wellDiskColor == changedField )
|
||||
{
|
||||
reservoirView->scheduleCreateDisplayModelAndRedraw();
|
||||
schedule2dIntersectionViewUpdate();
|
||||
@ -428,6 +432,7 @@ void RimSimWellInView::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
|
||||
|
||||
caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup( "Colors" );
|
||||
colorGroup->add( &wellPipeColor );
|
||||
colorGroup->add( &wellDiskColor );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ public:
|
||||
caf::PdmField<double> pipeScaleFactor;
|
||||
|
||||
caf::PdmField<cvf::Color3f> wellPipeColor;
|
||||
caf::PdmField<cvf::Color3f> wellDiskColor;
|
||||
|
||||
caf::PdmField<bool> showWellCells;
|
||||
caf::PdmField<bool> showWellCellFence;
|
||||
|
@ -274,6 +274,8 @@ RimSimWellInViewCollection::RimSimWellInViewCollection()
|
||||
"",
|
||||
"" );
|
||||
CAF_PDM_InitField( &m_wellDiskScaleFactor, "WellDiskScaleFactor", 1.0, "Scale Factor", "", "", "" );
|
||||
cvf::Color3f defaultWellDiskColor = cvf::Color3::OLIVE;
|
||||
CAF_PDM_InitField( &wellDiskColor, "WellDiskColor", defaultWellDiskColor, "Well Disk Color", "", "", "" );
|
||||
|
||||
CAF_PDM_InitField( &obsoleteField_wellPipeVisibility,
|
||||
"GlobalWellPipeVisibility",
|
||||
@ -487,6 +489,15 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
}
|
||||
}
|
||||
|
||||
if ( &wellDiskColor == changedField )
|
||||
{
|
||||
for ( RimSimWellInView* w : wells )
|
||||
{
|
||||
w->wellDiskColor = wellDiskColor;
|
||||
w->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_reservoirView )
|
||||
{
|
||||
if ( !m_wellDiskSummaryCase() )
|
||||
@ -509,7 +520,8 @@ void RimSimWellInViewCollection::fieldChangedByUi( const caf::PdmFieldHandle* ch
|
||||
else if ( &m_wellDiskQuantity == changedField || &m_wellDiskPropertyType == changedField ||
|
||||
&m_wellDiskPropertyConfigType == changedField || &m_wellDiskshowLabelsBackground == changedField ||
|
||||
&m_wellDiskShowQuantityLabels == changedField || &m_wellDiskSummaryCase == changedField ||
|
||||
&m_wellDiskScaleFactor == changedField || &m_showWellDisks == changedField )
|
||||
&m_wellDiskScaleFactor == changedField || &m_showWellDisks == changedField ||
|
||||
&wellDiskColor == changedField )
|
||||
{
|
||||
RimWellDiskConfig wellDiskConfig = getActiveWellDiskConfig();
|
||||
updateWellDisks( wellDiskConfig );
|
||||
@ -783,6 +795,10 @@ void RimSimWellInViewCollection::defineUiOrdering( QString uiConfigName, caf::Pd
|
||||
wellDiskGroup->add( &m_wellDiskShowQuantityLabels );
|
||||
wellDiskGroup->add( &m_wellDiskshowLabelsBackground );
|
||||
wellDiskGroup->add( &m_wellDiskScaleFactor );
|
||||
if ( m_wellDiskPropertyType() == PROPERTY_TYPE_SINGLE )
|
||||
{
|
||||
wellDiskGroup->add( &wellDiskColor );
|
||||
}
|
||||
|
||||
bool isReadOnly = m_showWellDisks().isFalse();
|
||||
|
||||
@ -793,6 +809,7 @@ void RimSimWellInViewCollection::defineUiOrdering( QString uiConfigName, caf::Pd
|
||||
m_wellDiskShowQuantityLabels.uiCapability()->setUiReadOnly( isReadOnly );
|
||||
m_wellDiskshowLabelsBackground.uiCapability()->setUiReadOnly( isReadOnly );
|
||||
m_wellDiskScaleFactor.uiCapability()->setUiReadOnly( isReadOnly );
|
||||
wellDiskColor.uiCapability()->setUiReadOnly( isReadOnly );
|
||||
}
|
||||
|
||||
RimEclipseResultCase* ownerCase = nullptr;
|
||||
|
@ -161,6 +161,8 @@ public:
|
||||
void updateWellDisks();
|
||||
double wellDiskScaleFactor() const;
|
||||
|
||||
caf::PdmField<cvf::Color3f> wellDiskColor;
|
||||
|
||||
protected:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user