From 6c5410f41a119daca3ca44d77721b9c8860c1df5 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 20 Feb 2017 10:05:11 +0100 Subject: [PATCH] #1230 Removed obsolete legend structures --- .../ProjectDataModel/RimFracture.cpp | 62 +------------------ .../ProjectDataModel/RimFracture.h | 8 --- .../ProjectDataModel/RimSimWellFracture.cpp | 1 - .../RimStimPlanFractureTemplate.cpp | 47 -------------- .../RimStimPlanFractureTemplate.h | 2 - .../ProjectDataModel/RimWellPathFracture.cpp | 1 - 6 files changed, 1 insertion(+), 120 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimFracture.cpp b/ApplicationCode/ProjectDataModel/RimFracture.cpp index c7aa651ae5..cc047126ab 100644 --- a/ApplicationCode/ProjectDataModel/RimFracture.cpp +++ b/ApplicationCode/ProjectDataModel/RimFracture.cpp @@ -38,7 +38,6 @@ #include "RimEclipseView.h" #include "RimEllipseFractureTemplate.h" #include "RimFractureTemplateCollection.h" -#include "RimLegendConfig.h" #include "RimOilField.h" #include "RimProject.h" #include "RimReservoirCellResultsStorage.h" @@ -86,8 +85,7 @@ RimFracture::RimFracture(void) azimuth.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName()); CAF_PDM_InitField(&perforationLength, "PerforationLength", 0.0, "PerforationLength", "", "", ""); - CAF_PDM_InitField(&stimPlanParameterToPlot, "parameterToPlot", QString(""), "Parameter from StimPlan file to plot", "", "", ""); - CAF_PDM_InitField(&stimPlanTimeIndexToPlot, "timeIndexToPlot", 0, "Timestep from StimPlan file to plot", "", "", ""); + CAF_PDM_InitField(&stimPlanTimeIndexToPlot, "timeIndexToPlot", 0, "Timestep from StimPlan file to plot", "", "", ""); CAF_PDM_InitField(&m_i, "I", 1, "Fracture location cell I", "", "", ""); m_i.uiCapability()->setUiHidden(true); @@ -102,15 +100,6 @@ RimFracture::RimFracture(void) m_displayIJK.registerGetMethod(this, &RimFracture::createOneBasedIJK); m_displayIJK.uiCapability()->setUiReadOnly(true); - CAF_PDM_InitFieldNoDefault(&m_legendConfigPermeability, "LegendConfigPerm", "LegendConfigPerm", "", "", ""); - m_legendConfigPermeability = new RimLegendConfig; - - CAF_PDM_InitFieldNoDefault(&m_legendConfigConductivity, "LegendConfigCond", "LegendConfigCond", "", "", ""); - m_legendConfigConductivity = new RimLegendConfig; - - CAF_PDM_InitFieldNoDefault(&m_legendConfigWidth, "LegendConfigWidth", "LegendConfigWidth", "", "", ""); - m_legendConfigWidth = new RimLegendConfig; - m_rigFracture = new RigFracture; m_recomputeGeometry = true; @@ -122,13 +111,6 @@ RimFracture::RimFracture(void) //-------------------------------------------------------------------------------------------------- RimFracture::~RimFracture() { - delete m_legendConfigConductivity; - delete m_legendConfigPermeability; - delete m_legendConfigWidth; - - m_legendConfigConductivity = nullptr; - m_legendConfigPermeability = nullptr; - m_legendConfigWidth = nullptr; } //-------------------------------------------------------------------------------------------------- @@ -191,7 +173,6 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons if (changedField == &azimuth || changedField == &m_fractureTemplate || - changedField == &stimPlanParameterToPlot || changedField == &stimPlanTimeIndexToPlot) { @@ -623,22 +604,6 @@ QList RimFracture::calculateValueOptions(const caf::PdmF } } - else if (fieldNeedingOptions == &stimPlanParameterToPlot) - { - RimFractureTemplate* fracTemplate = attachedFractureDefinition(); - if (dynamic_cast(fracTemplate)) - { - RimStimPlanFractureTemplate* fracTemplateStimPlan = dynamic_cast(fracTemplate); - std::vector> properties = fracTemplateStimPlan->getStimPlanPropertyNamesUnits(); - - for (std::pair propNameUnit : properties) - { - QString nameAndUnit = propNameUnit.first + " [" + propNameUnit.second + "]"; - QString name = propNameUnit.first; - options.push_back(caf::PdmOptionItemInfo(nameAndUnit, name)); - } - } - } return options; } @@ -666,23 +631,16 @@ void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO if (dynamic_cast(fracTemplate)) { stimPlanTimeIndexToPlot.uiCapability()->setUiHidden(false); - stimPlanParameterToPlot.uiCapability()->setUiHidden(false); } else { stimPlanTimeIndexToPlot.uiCapability()->setUiHidden(true); - stimPlanParameterToPlot.uiCapability()->setUiHidden(true); } } else { stimPlanTimeIndexToPlot.uiCapability()->setUiHidden(true); - stimPlanParameterToPlot.uiCapability()->setUiHidden(true); } - - - - } //-------------------------------------------------------------------------------------------------- @@ -706,12 +664,6 @@ void RimFracture::defineEditorAttribute(const caf::PdmFieldHandle* field, QStrin //-------------------------------------------------------------------------------------------------- void RimFracture::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/) { - //TODO - uiTreeOrdering.add(m_legendConfigConductivity); -// uiTreeOrdering.add(m_legendConfigPermeability); -// uiTreeOrdering.add(m_legendConfigWidth); - - uiTreeOrdering.setForgetRemainingFields(true); } //-------------------------------------------------------------------------------------------------- @@ -795,18 +747,6 @@ RivWellFracturePartMgr* RimFracture::fracturePartManager() return m_rivFracture.p(); } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RimLegendConfig* RimFracture::activeLegend() -{ -// if (stimPlanParameterToPlot == RimFracture::CONDUCTIVITY) return m_legendConfigConductivity; -// else if (stimPlanParameterToPlot == RimFracture::PERMEABILITY) return m_legendConfigPermeability; -// else if (stimPlanParameterToPlot == RimFracture::WIDTH) return m_legendConfigWidth; -// return nullptr; - - return m_legendConfigConductivity; -} //-------------------------------------------------------------------------------------------------- /// diff --git a/ApplicationCode/ProjectDataModel/RimFracture.h b/ApplicationCode/ProjectDataModel/RimFracture.h index 422dd786a8..513aef56a5 100644 --- a/ApplicationCode/ProjectDataModel/RimFracture.h +++ b/ApplicationCode/ProjectDataModel/RimFracture.h @@ -40,7 +40,6 @@ class RigFracture; class RimEclipseCase; class RimEllipseFractureTemplate; class RivWellFracturePartMgr; -class RimLegendConfig; //================================================================================================== /// @@ -59,8 +58,6 @@ public: caf::PdmField perforationLength; caf::PdmField stimPlanTimeIndexToPlot; - caf::PdmField stimPlanParameterToPlot; - cvf::Vec3d anchorPosition(); void setAnchorPosition(const cvf::Vec3d& pos); @@ -74,7 +71,6 @@ public: RimFractureTemplate* attachedFractureDefinition() const; RivWellFracturePartMgr* fracturePartManager(); - RimLegendConfig* activeLegend(); bool hasValidGeometry() const; void computeGeometry(); @@ -122,8 +118,4 @@ private: caf::PdmField m_k; // Zero based indexing cvf::ref m_rivFracture; - - caf::PdmChildField m_legendConfigPermeability; - caf::PdmChildField m_legendConfigConductivity; - caf::PdmChildField m_legendConfigWidth; }; diff --git a/ApplicationCode/ProjectDataModel/RimSimWellFracture.cpp b/ApplicationCode/ProjectDataModel/RimSimWellFracture.cpp index 043b52690f..4ce7d57c62 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellFracture.cpp +++ b/ApplicationCode/ProjectDataModel/RimSimWellFracture.cpp @@ -165,7 +165,6 @@ void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties"); propertyGroup->add(&m_fractureTemplate); - propertyGroup->add(&stimPlanParameterToPlot); propertyGroup->add(&stimPlanTimeIndexToPlot); propertyGroup->add(&perforationLength); diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp index 4de5fbde04..6dec575b19 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.cpp @@ -52,9 +52,6 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate(void) CAF_PDM_InitField(&wellPathDepthAtFracture, "WellPathDepthAtFracture", 0.0, "Depth of Well Path at Fracture", "", "", ""); wellPathDepthAtFracture.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName()); - - CAF_PDM_InitFieldNoDefault(&m_legendConfigurations, "LegendConfigurations", "", "", "", ""); - m_legendConfigurations.uiCapability()->setUiTreeHidden(true); } //-------------------------------------------------------------------------------------------------- @@ -255,50 +252,6 @@ void RimStimPlanFractureTemplate::loadDataAndUpdate() readStimPlanXMLFile(&errorMessage); qDebug() << errorMessage; - std::vector resultNames = m_stimPlanFractureDefinitionData->resultNames(); - - // Delete legends referencing results not present on file - { - std::vector toBeDeleted; - for (RimStimPlanLegendConfig* legend : m_legendConfigurations) - { - QString legendName = legend->name(); - if (std::find(resultNames.begin(), resultNames.end(), legendName) == resultNames.end()) - { - toBeDeleted.push_back(legend); - } - } - - for (auto legend : toBeDeleted) - { - m_legendConfigurations.removeChildObject(legend); - - delete legend; - } - } - - // Create legend for result if not already present - for (auto resultName : resultNames) - { - bool foundResult = false; - - for (RimStimPlanLegendConfig* legend : m_legendConfigurations) - { - if (legend->name().compare(resultName) == 0) - { - foundResult = true; - } - } - - if (!foundResult) - { - RimStimPlanLegendConfig* legendConfig = new RimStimPlanLegendConfig(); - legendConfig->setName(resultName); - - m_legendConfigurations.push_back(legendConfig); - } - } - updateConnectedEditors(); } diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h index fb6b7cb8f4..e9e4a669f6 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h +++ b/ApplicationCode/ProjectDataModel/RimStimPlanFractureTemplate.h @@ -91,8 +91,6 @@ private: caf::PdmField m_stimPlanFileName; cvf::ref m_stimPlanFractureDefinitionData; - caf::PdmChildArrayField m_legendConfigurations; - bool numberOfParameterValuesOK(std::vector> propertyValuesAtTimestep); void setDepthOfWellPathAtFracture(); }; diff --git a/ApplicationCode/ProjectDataModel/RimWellPathFracture.cpp b/ApplicationCode/ProjectDataModel/RimWellPathFracture.cpp index bcb626dbc3..99c0216412 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPathFracture.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPathFracture.cpp @@ -158,7 +158,6 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties"); propertyGroup->add(&m_fractureTemplate); - propertyGroup->add(&stimPlanParameterToPlot); propertyGroup->add(&stimPlanTimeIndexToPlot); propertyGroup->add(&perforationLength);