#3586 Remove separate legend for 2d Grid Projection

This commit is contained in:
Gaute Lindkvist 2018-10-31 10:02:55 +01:00
parent 7975d0a1e4
commit 68eef3f9d8
4 changed files with 8 additions and 10 deletions

View File

@ -57,9 +57,6 @@ Rim2dGridProjection::Rim2dGridProjection()
CAF_PDM_InitFieldNoDefault(&m_resultAggregation, "ResultAggregation", "Result Aggregation", "", "", ""); CAF_PDM_InitFieldNoDefault(&m_resultAggregation, "ResultAggregation", "Result Aggregation", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_legendConfig, "LegendDefinition", "Legend Definition", ":/Legend.png", "", "");
m_legendConfig = new RimRegularLegendConfig();
setName("2d Grid Projection"); setName("2d Grid Projection");
nameField()->uiCapability()->setUiReadOnly(true); nameField()->uiCapability()->setUiReadOnly(true);
} }
@ -141,7 +138,7 @@ Rim2dGridProjection::ContourPolygons Rim2dGridProjection::generateContourPolygon
cvf::BoundingBox boundingBox = eclipseCase()->activeCellsBoundingBox(); cvf::BoundingBox boundingBox = eclipseCase()->activeCellsBoundingBox();
std::vector<double> contourLevels; std::vector<double> contourLevels;
m_legendConfig->scalarMapper()->majorTickValues(&contourLevels); legendConfig()->scalarMapper()->majorTickValues(&contourLevels);
int nContourLevels = static_cast<int>(contourLevels.size()); int nContourLevels = static_cast<int>(contourLevels.size());
if (nContourLevels > 2) if (nContourLevels > 2)
{ {
@ -357,7 +354,9 @@ uint Rim2dGridProjection::vertexCount() const
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RimRegularLegendConfig* Rim2dGridProjection::legendConfig() const RimRegularLegendConfig* Rim2dGridProjection::legendConfig() const
{ {
return m_legendConfig; RimEclipseView* view = nullptr;
this->firstAncestorOrThisOfTypeAsserted(view);
return view->cellResult()->legendConfig();
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -531,8 +530,8 @@ void Rim2dGridProjection::updateLegend()
RimEclipseCellColors* cellColors = view->cellResult(); RimEclipseCellColors* cellColors = view->cellResult();
generateResults(); generateResults();
m_legendConfig->setAutomaticRanges(minValue(), maxValue(), minValue(), maxValue()); legendConfig()->setAutomaticRanges(minValue(), maxValue(), minValue(), maxValue());
m_legendConfig->setTitle(QString("2d Projection:\n%1").arg(cellColors->resultVariableUiShortName())); legendConfig()->setTitle(QString("2d Projection:\n%1").arg(cellColors->resultVariableUiShortName()));
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -621,6 +620,5 @@ void Rim2dGridProjection::defineEditorAttribute(const caf::PdmFieldHandle* field
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void Rim2dGridProjection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/) void Rim2dGridProjection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
{ {
uiTreeOrdering.add(legendConfig());
uiTreeOrdering.skipRemainingChildren(true); uiTreeOrdering.skipRemainingChildren(true);
} }

View File

@ -96,7 +96,6 @@ protected:
protected: protected:
caf::PdmField<double> m_sampleSpacing; caf::PdmField<double> m_sampleSpacing;
caf::PdmField<ResultAggregation> m_resultAggregation; caf::PdmField<ResultAggregation> m_resultAggregation;
caf::PdmChildField<RimRegularLegendConfig*> m_legendConfig;
cvf::ref<cvf::UByteArray> m_cellVisibility; cvf::ref<cvf::UByteArray> m_cellVisibility;
std::vector<double> m_aggregatedResults; std::vector<double> m_aggregatedResults;

View File

@ -360,6 +360,7 @@ Rim2dEclipseView* RimEclipseCase::create2dContourMap()
contourMap->cellEdgeResult()->setActive(false); contourMap->cellEdgeResult()->setActive(false);
contourMap->fractureColors()->setDefaultResultName(); contourMap->fractureColors()->setDefaultResultName();
contourMap->setBackgroundColor(cvf::Color3f(1.0f, 1.0f, 0.98f)); contourMap->setBackgroundColor(cvf::Color3f(1.0f, 1.0f, 0.98f));
contourMap->initAfterReadRecursively();
} }
caf::PdmDocument::updateUiIconStateRecursively(contourMap); caf::PdmDocument::updateUiIconStateRecursively(contourMap);

View File

@ -72,7 +72,7 @@ private:
caf::PdmPtrField<RimRegularLegendConfig*> m_legendConfigPtrField; caf::PdmPtrField<RimRegularLegendConfig*> m_legendConfigPtrField;
caf::PdmChildField<RimTernaryLegendConfig*> m_ternaryLegendConfig; caf::PdmChildField<RimTernaryLegendConfig*> m_ternaryLegendConfig;
caf::PdmPointer<RimEclipseView> m_reservoirView; caf::PdmPointer<RimEclipseView> m_reservoirView;
// Obsolete // Obsolete
caf::PdmChildField<RimRegularLegendConfig*> obsoleteField_legendConfig; caf::PdmChildField<RimRegularLegendConfig*> obsoleteField_legendConfig;