#1230 Removed obsolete legend structures

This commit is contained in:
Magne Sjaastad 2017-02-20 10:05:11 +01:00
parent a29f325125
commit 6c5410f41a
6 changed files with 1 additions and 120 deletions

View File

@ -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,7 +85,6 @@ 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(&m_i, "I", 1, "Fracture location cell I", "", "", "");
@ -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<caf::PdmOptionItemInfo> RimFracture::calculateValueOptions(const caf::PdmF
}
}
else if (fieldNeedingOptions == &stimPlanParameterToPlot)
{
RimFractureTemplate* fracTemplate = attachedFractureDefinition();
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate))
{
RimStimPlanFractureTemplate* fracTemplateStimPlan = dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate);
std::vector<std::pair<QString, QString>> properties = fracTemplateStimPlan->getStimPlanPropertyNamesUnits();
for (std::pair<QString, QString> 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<RimStimPlanFractureTemplate*>(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;
}
//--------------------------------------------------------------------------------------------------
///

View File

@ -40,7 +40,6 @@ class RigFracture;
class RimEclipseCase;
class RimEllipseFractureTemplate;
class RivWellFracturePartMgr;
class RimLegendConfig;
//==================================================================================================
///
@ -59,8 +58,6 @@ public:
caf::PdmField<double> perforationLength;
caf::PdmField<int> stimPlanTimeIndexToPlot;
caf::PdmField<QString> 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<int> m_k; // Zero based indexing
cvf::ref<RivWellFracturePartMgr> m_rivFracture;
caf::PdmChildField<RimLegendConfig*> m_legendConfigPermeability;
caf::PdmChildField<RimLegendConfig*> m_legendConfigConductivity;
caf::PdmChildField<RimLegendConfig*> m_legendConfigWidth;
};

View File

@ -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);

View File

@ -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<QString> resultNames = m_stimPlanFractureDefinitionData->resultNames();
// Delete legends referencing results not present on file
{
std::vector<RimStimPlanLegendConfig*> 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();
}

View File

@ -91,8 +91,6 @@ private:
caf::PdmField<QString> m_stimPlanFileName;
cvf::ref<RigStimPlanFractureDefinition> m_stimPlanFractureDefinitionData;
caf::PdmChildArrayField<RimStimPlanLegendConfig*> m_legendConfigurations;
bool numberOfParameterValuesOK(std::vector<std::vector<double>> propertyValuesAtTimestep);
void setDepthOfWellPathAtFracture();
};

View File

@ -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);