mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3297 Make casing shoe a right-angled triangle and refactor symbols
* Put plot symbol enum inside the symbol class. * Put line style enums inside the line class. * Add custom capability.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryTimeAxisProperties.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
class RifReaderEclipseSummary;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryFilter;
|
||||
class RiuLineSegmentQwtPlotCurve;
|
||||
class RiuQwtPlotCurve;
|
||||
class RimAsciiDataCurveAutoName;
|
||||
|
||||
//==================================================================================================
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "RimSummaryFilter.h"
|
||||
#include "RimSummaryPlot.h"
|
||||
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
#include "RiuSummaryCurveDefSelectionDialog.h"
|
||||
@@ -71,8 +72,8 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Internal functions
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotCurve::PointSymbolEnum statisticsCurveSymbolFromAddress(const RifEclipseSummaryAddress& address);
|
||||
int statisticsCurveSymbolSize(RimPlotCurve::PointSymbolEnum symbol);
|
||||
RiuQwtSymbol::PointSymbolEnum statisticsCurveSymbolFromAddress(const RifEclipseSummaryAddress& address);
|
||||
int statisticsCurveSymbolSize(RiuQwtSymbol::PointSymbolEnum symbol);
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@@ -1027,7 +1028,7 @@ void RimEnsembleCurveSet::updateStatisticsCurves(const std::vector<RimSummaryCas
|
||||
curve->setSymbolLabel(RiaStatisticsTools::replacePercentileByPValueText(
|
||||
QString::fromStdString(address.ensembleStatisticsQuantityName())));
|
||||
}
|
||||
curve->setLineStyle(RimPlotCurve::STYLE_SOLID);
|
||||
curve->setLineStyle(RiuQwtPlotCurve::STYLE_SOLID);
|
||||
curve->setSummaryCaseY(m_ensembleStatCase.get());
|
||||
curve->setSummaryAddressY(address);
|
||||
curve->setZOrder(1000);
|
||||
@@ -1274,23 +1275,23 @@ void RimEnsembleCurveSet::updateLegendMappingMode()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotCurve::PointSymbolEnum statisticsCurveSymbolFromAddress(const RifEclipseSummaryAddress& address)
|
||||
RiuQwtSymbol::PointSymbolEnum statisticsCurveSymbolFromAddress(const RifEclipseSummaryAddress& address)
|
||||
{
|
||||
auto qName = QString::fromStdString(address.quantityName());
|
||||
|
||||
if (qName.contains(ENSEMBLE_STAT_P10_QUANTITY_NAME)) return RimPlotCurve::SYMBOL_TRIANGLE;
|
||||
if (qName.contains(ENSEMBLE_STAT_P90_QUANTITY_NAME)) return RimPlotCurve::SYMBOL_DOWN_TRIANGLE;
|
||||
if (qName.contains(ENSEMBLE_STAT_P50_QUANTITY_NAME)) return RimPlotCurve::SYMBOL_DIAMOND;
|
||||
return RimPlotCurve::SYMBOL_ELLIPSE;
|
||||
if (qName.contains(ENSEMBLE_STAT_P10_QUANTITY_NAME)) return RiuQwtSymbol::SYMBOL_TRIANGLE;
|
||||
if (qName.contains(ENSEMBLE_STAT_P90_QUANTITY_NAME)) return RiuQwtSymbol::SYMBOL_DOWN_TRIANGLE;
|
||||
if (qName.contains(ENSEMBLE_STAT_P50_QUANTITY_NAME)) return RiuQwtSymbol::SYMBOL_DIAMOND;
|
||||
return RiuQwtSymbol::SYMBOL_ELLIPSE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int statisticsCurveSymbolSize(RimPlotCurve::PointSymbolEnum symbol)
|
||||
int statisticsCurveSymbolSize(RiuQwtSymbol::PointSymbolEnum symbol)
|
||||
{
|
||||
if (symbol == RimPlotCurve::SYMBOL_DIAMOND) return 8;
|
||||
if (symbol == RimPlotCurve::SYMBOL_TRIANGLE) return 7;
|
||||
if (symbol == RimPlotCurve::SYMBOL_DOWN_TRIANGLE) return 7;
|
||||
if (symbol == RiuQwtSymbol::SYMBOL_DIAMOND) return 8;
|
||||
if (symbol == RiuQwtSymbol::SYMBOL_TRIANGLE) return 7;
|
||||
if (symbol == RiuQwtSymbol::SYMBOL_DOWN_TRIANGLE) return 7;
|
||||
return 6;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotSourceStepping.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEnsembleCurveSetCollection, "RimEnsembleCurveSetCollection");
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
class RifSummaryReaderInterface;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryFilter;
|
||||
class RiuLineSegmentQwtPlotCurve;
|
||||
class RiuQwtPlotCurve;
|
||||
class RimSummaryCurveAutoName;
|
||||
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "RimSummaryTimeAxisProperties.h"
|
||||
#include "RimTools.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuPlotMainWindow.h"
|
||||
#include "RiuSummaryCurveDefSelectionDialog.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
@@ -713,17 +713,17 @@ void RimSummaryCurve::forceUpdateCurveAppearanceFromCaseType()
|
||||
{
|
||||
if (m_yValuesSummaryCase->isObservedData())
|
||||
{
|
||||
setLineStyle(RimPlotCurve::STYLE_NONE);
|
||||
setLineStyle(RiuQwtPlotCurve::STYLE_NONE);
|
||||
|
||||
if (symbol() == RimPlotCurve::SYMBOL_NONE)
|
||||
if (symbol() == RiuQwtSymbol::SYMBOL_NONE)
|
||||
{
|
||||
setSymbol(RimPlotCurve::SYMBOL_XCROSS);
|
||||
setSymbol(RiuQwtSymbol::SYMBOL_XCROSS);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
setLineStyle(RimPlotCurve::STYLE_SOLID);
|
||||
setSymbol(RimPlotCurve::SYMBOL_NONE);
|
||||
setLineStyle(RiuQwtPlotCurve::STYLE_SOLID);
|
||||
setSymbol(RiuQwtSymbol::SYMBOL_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -779,8 +779,8 @@ void RimSummaryCurve::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
if (oldVal == nullptr && m_yValuesSummaryCase->isObservedData())
|
||||
{
|
||||
// If no previous case selected and observed data, use symbols to indicate observed data curve
|
||||
setLineStyle(RimPlotCurve::STYLE_NONE);
|
||||
setSymbol(RimPlotCurve::SYMBOL_XCROSS);
|
||||
setLineStyle(RiuQwtPlotCurve::STYLE_NONE);
|
||||
setSymbol(RiuQwtSymbol::SYMBOL_XCROSS);
|
||||
}
|
||||
plot->updateCaseNameHasChanged();
|
||||
this->onLoadDataAndUpdate(true);
|
||||
@@ -986,11 +986,11 @@ void RimSummaryCurve::calculateCurveInterpolationFromAddress()
|
||||
auto address = m_yValuesCurveVariable()->address();
|
||||
if (address.hasAccumulatedData())
|
||||
{
|
||||
m_curveInterpolation = INTERPOLATION_POINT_TO_POINT;
|
||||
m_curveInterpolation = RiuQwtPlotCurve::INTERPOLATION_POINT_TO_POINT;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_curveInterpolation = INTERPOLATION_STEP_LEFT;
|
||||
m_curveInterpolation = RiuQwtPlotCurve::INTERPOLATION_STEP_LEFT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
class RifSummaryReaderInterface;
|
||||
class RimSummaryCase;
|
||||
class RimSummaryFilter;
|
||||
class RiuLineSegmentQwtPlotCurve;
|
||||
class RiuQwtPlotCurve;
|
||||
class RimSummaryCurveAutoName;
|
||||
class RimSummaryAddress;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "RiaColorTables.h"
|
||||
#include "RiaSummaryCurveDefinition.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
|
||||
#include "RimSummaryCurve.h"
|
||||
#include "RimSummaryCase.h"
|
||||
@@ -191,11 +192,11 @@ std::map<std::string, size_t> RimSummaryCurveAppearanceCalculator::mapNameToAppe
|
||||
}
|
||||
else if (appearance == CurveAppearanceType::SYMBOL)
|
||||
{
|
||||
numOptions = caf::AppEnum<RimPlotCurve::PointSymbolEnum>::size() - 1; // -1 since the No symbol option is not counted see cycledSymbol()
|
||||
numOptions = caf::AppEnum<RiuQwtSymbol::PointSymbolEnum>::size() - 1; // -1 since the No symbol option is not counted see cycledSymbol()
|
||||
}
|
||||
else if (appearance == CurveAppearanceType::LINE_STYLE)
|
||||
{
|
||||
numOptions = caf::AppEnum<RimPlotCurve::LineStyleEnum>::size() - 1; // -1 since the No symbol option is not counted see cycledLineStyle()
|
||||
numOptions = caf::AppEnum<RiuQwtPlotCurve::LineStyleEnum>::size() - 1; // -1 since the No symbol option is not counted see cycledLineStyle()
|
||||
}
|
||||
else {
|
||||
// If none of these styles are used, fall back to a simply incrementing index
|
||||
@@ -452,21 +453,21 @@ cvf::Color3f RimSummaryCurveAppearanceCalculator::cycledBrownColor(int colorInde
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotCurve::LineStyleEnum RimSummaryCurveAppearanceCalculator::cycledLineStyle(int index)
|
||||
RiuQwtPlotCurve::LineStyleEnum RimSummaryCurveAppearanceCalculator::cycledLineStyle(int index)
|
||||
{
|
||||
if (index < 0) return RimPlotCurve::STYLE_SOLID;
|
||||
if (index < 0) return RiuQwtPlotCurve::STYLE_SOLID;
|
||||
|
||||
return caf::AppEnum<RimPlotCurve::LineStyleEnum>::fromIndex(1 + (index % (caf::AppEnum<RimPlotCurve::LineStyleEnum>::size() - 1)));
|
||||
return caf::AppEnum<RiuQwtPlotCurve::LineStyleEnum>::fromIndex(1 + (index % (caf::AppEnum<RiuQwtPlotCurve::LineStyleEnum>::size() - 1)));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimPlotCurve::PointSymbolEnum RimSummaryCurveAppearanceCalculator::cycledSymbol(int index)
|
||||
RiuQwtSymbol::PointSymbolEnum RimSummaryCurveAppearanceCalculator::cycledSymbol(int index)
|
||||
{
|
||||
if (index < 0) return RimPlotCurve::SYMBOL_NONE;
|
||||
if (index < 0) return RiuQwtSymbol::SYMBOL_NONE;
|
||||
|
||||
return caf::AppEnum<RimPlotCurve::PointSymbolEnum>::fromIndex(1 + (index % (caf::AppEnum<RimPlotCurve::PointSymbolEnum>::size() - 1)));
|
||||
return caf::AppEnum<RiuQwtSymbol::PointSymbolEnum>::fromIndex(1 + (index % (caf::AppEnum<RiuQwtSymbol::PointSymbolEnum>::size() - 1)));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
static cvf::Color3f cycledBlueColor(int colorIndex);
|
||||
static cvf::Color3f cycledRedColor(int colorIndex);
|
||||
static cvf::Color3f cycledBrownColor(int colorIndex);
|
||||
static RimPlotCurve::PointSymbolEnum cycledSymbol(int index);
|
||||
static RiuQwtSymbol::PointSymbolEnum cycledSymbol(int index);
|
||||
|
||||
private:
|
||||
template<typename S>
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
std::map<std::string, size_t> mapNameToAppearanceIndex(CurveAppearanceType & appearance, const std::set<std::string>& names);
|
||||
|
||||
|
||||
RimPlotCurve::LineStyleEnum cycledLineStyle(int index);
|
||||
RiuQwtPlotCurve::LineStyleEnum cycledLineStyle(int index);
|
||||
int cycledLineThickness(int index);
|
||||
float gradient(size_t totalCount, int index);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "RimSummaryPlot.h"
|
||||
#include "RimSummaryPlotSourceStepping.h"
|
||||
|
||||
#include "RiuLineSegmentQwtPlotCurve.h"
|
||||
#include "RiuQwtPlotCurve.h"
|
||||
#include "RiuSummaryQwtPlot.h"
|
||||
|
||||
#include "cafPdmUiTreeViewEditor.h"
|
||||
|
||||
Reference in New Issue
Block a user