Merge pull request #4978 from OPM/improve-history-curve-symbol-colors

Improve history curve symbol colors
This commit is contained in:
Magne Sjaastad
2019-11-04 11:03:05 +01:00
committed by GitHub
4 changed files with 19 additions and 50 deletions

View File

@@ -439,16 +439,6 @@ void RimViewController::updateOptionSensitivity()
this->m_syncPropertyFilters = false;
}
if ( isRangeFilterControlPossible() )
{
this->m_syncRangeFilters.uiCapability()->setUiReadOnly( false );
}
else
{
this->m_syncRangeFilters.uiCapability()->setUiReadOnly( true );
this->m_syncRangeFilters = false;
}
if ( m_syncCamera )
{
this->m_showCursor.uiCapability()->setUiReadOnly( false );
@@ -861,40 +851,6 @@ bool RimViewController::isVisibleCellsOveridden() const
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimViewController::isRangeFilterControlPossible() const
{
return true;
#if 0
if (!isMasterAndDepViewDifferentType()) return true;
// Make sure the cases are in the same domain
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>(masterView());
RimGeoMechView* geomView = dynamic_cast<RimGeoMechView*>(masterView());
if (!geomView) geomView = managedGeoView();
if (!eclipseView) eclipseView = managedEclipseView();
if (eclipseView && geomView)
{
if (eclipseView->eclipseCase()->reservoirData() && geomView->geoMechCase()->geoMechData())
{
RigMainGrid* eclGrid = eclipseView->eclipseCase()->reservoirData()->mainGrid();
RigFemPart* femPart = geomView->femParts()->part(0);
if (eclGrid && femPart)
{
cvf::BoundingBox fembb = femPart->boundingBox();
cvf::BoundingBox eclbb = eclGrid->boundingBox();
return fembb.contains(eclbb.min()) && fembb.contains(eclbb.max());
}
}
}
return false;
#endif
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -945,7 +901,7 @@ bool RimViewController::isRangeFilterControlAdvisable() const
{
bool contourMapMasterView = dynamic_cast<RimEclipseContourMapView*>( masterView() ) != nullptr;
bool contourMapManagedView = dynamic_cast<RimEclipseContourMapView*>( managedEclipseView() ) != nullptr;
return isRangeFilterControlPossible() && contourMapMasterView != contourMapManagedView;
return contourMapMasterView != contourMapManagedView;
}
//--------------------------------------------------------------------------------------------------
@@ -963,8 +919,6 @@ bool RimViewController::isPropertyFilterControlAdvisable() const
//--------------------------------------------------------------------------------------------------
bool RimViewController::isRangeFiltersControlled() const
{
if ( !isRangeFilterControlPossible() ) return false;
if ( ownerViewLinker() && ownerViewLinker()->isActive() && this->m_isActive() )
{
return m_syncRangeFilters;

View File

@@ -108,7 +108,6 @@ private:
bool isCameraControlPossible() const;
bool isMasterAndDepViewDifferentType() const;
bool isRangeFilterControlPossible() const;
bool isPropertyFilterControlPossible() const;
bool isRangeFilterMappingApplicable() const;
bool isCellResultControlAdvisable() const;

View File

@@ -819,11 +819,15 @@ void RimSummaryCurve::setCurveAppearanceFromCaseType()
if ( prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::SYMBOLS )
{
m_symbolEdgeColor = m_curveColor;
setSymbol( RiuQwtSymbol::SYMBOL_XCROSS );
setLineStyle( RiuQwtPlotCurve::STYLE_NONE );
}
else if ( prefs->defaultSummaryHistoryCurveStyle() == RiaPreferences::SYMBOLS_AND_LINES )
{
m_symbolEdgeColor = m_curveColor;
setSymbol( RiuQwtSymbol::SYMBOL_XCROSS );
setLineStyle( RiuQwtPlotCurve::STYLE_SOLID );
}

View File

@@ -84,7 +84,13 @@ RimSummaryCurveAppearanceCalculator::RimSummaryCurveAppearanceCalculator(
if ( !curveDef.summaryAddress().quantityName().empty() )
{
std::string varname = curveDef.summaryAddress().quantityName();
std::string varname = curveDef.summaryAddress().quantityName();
if ( curveDef.summaryAddress().isHistoryQuantity() )
{
varname = varname.substr( 0, varname.size() - 1 );
}
m_varToAppearanceIdxMap[varname] = -1;
// Indexes for sub color ranges
@@ -363,6 +369,12 @@ void RimSummaryCurveAppearanceCalculator::setupCurveLook( RimSummaryCurve* curve
int subColorIndex = -1;
char secondChar = 0;
std::string varname = curve->summaryAddressY().quantityName();
if ( curve->summaryAddressY().isHistoryQuantity() )
{
varname = varname.substr( 0, varname.size() - 1 );
}
if ( varname.size() > 1 )
{
secondChar = varname[1];
@@ -527,7 +539,7 @@ RiuQwtSymbol::PointSymbolEnum RimSummaryCurveAppearanceCalculator::cycledSymbol(
int RimSummaryCurveAppearanceCalculator::cycledLineThickness( int index )
{
static const int thicknessCount = 3;
static const int thicknesses[] = {1, 3, 5};
static const int thicknesses[] = { 1, 3, 5 };
if ( index < 0 ) return 1;
return ( thicknesses[( index ) % thicknessCount] );