mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2428 Fracture: Reorganize Fracture Colors tree item
This commit is contained in:
parent
d7fa97f052
commit
e50f7bf66f
@ -96,7 +96,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* mod
|
||||
|
||||
if (stimPlanFracTemplate)
|
||||
{
|
||||
if (m_rimFracture->stimPlanResultColorType() == RimFracture::SINGLE_ELEMENT_COLOR)
|
||||
if (eclView.stimPlanColors->stimPlanResultColorType() == RimStimPlanColors::SINGLE_ELEMENT_COLOR)
|
||||
{
|
||||
auto part = createStimPlanElementColorSurfacePart(eclView);
|
||||
if (part.notNull()) parts.push_back(part.p());
|
||||
@ -107,7 +107,7 @@ void RivWellFracturePartMgr::appendGeometryPartsToModel(cvf::ModelBasicList* mod
|
||||
if (part.notNull()) parts.push_back(part.p());
|
||||
}
|
||||
|
||||
if (stimPlanFracTemplate->showStimPlanMesh())
|
||||
if (eclView.stimPlanColors->showStimPlanMesh())
|
||||
{
|
||||
auto part = createStimPlanMeshPart(eclView);
|
||||
if (part.notNull()) parts.push_back(part.p());
|
||||
|
@ -70,19 +70,6 @@
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT(RimFracture, "Fracture");
|
||||
|
||||
namespace caf {
|
||||
|
||||
template<>
|
||||
void caf::AppEnum< RimFracture::StimPlanResultColorType >::setUp()
|
||||
{
|
||||
addItem(RimFracture::COLOR_INTERPOLATION, "COLOR_INTERPOLATION", "On");
|
||||
addItem(RimFracture::SINGLE_ELEMENT_COLOR, "SINGLE_ELEMENT_COLOR", "Off");
|
||||
|
||||
setDefault(RimFracture::COLOR_INTERPOLATION);
|
||||
}
|
||||
|
||||
} // End namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -154,8 +141,6 @@ RimFracture::RimFracture(void)
|
||||
m_wellFractureAzimuthAngleWarning.uiCapability()->setUiReadOnly(true);
|
||||
m_wellFractureAzimuthAngleWarning.xmlCapability()->disableIO();
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_stimPlanCellVizMode, "StimPlanCellVizMode", "StimPlan Color Interpolation", "", "", "");
|
||||
|
||||
m_fracturePartMgr = new RivWellFracturePartMgr(this);
|
||||
}
|
||||
|
||||
@ -190,14 +175,6 @@ void RimFracture::setStimPlanTimeIndexToPlot(int timeIndex)
|
||||
m_stimPlanTimeIndexToPlot = timeIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFracture::StimPlanResultColorType RimFracture::stimPlanResultColorType() const
|
||||
{
|
||||
return m_stimPlanCellVizMode();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -227,7 +204,6 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
||||
if (changedField == &m_azimuth ||
|
||||
changedField == &m_fractureTemplate ||
|
||||
changedField == &m_stimPlanTimeIndexToPlot ||
|
||||
changedField == &m_stimPlanCellVizMode ||
|
||||
changedField == this->objectToggleField() ||
|
||||
changedField == &m_dip ||
|
||||
changedField == &m_tilt ||
|
||||
@ -520,14 +496,12 @@ void RimFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiO
|
||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(fracTemplate))
|
||||
{
|
||||
m_stimPlanTimeIndexToPlot.uiCapability()->setUiHidden(false);
|
||||
m_stimPlanCellVizMode.uiCapability()->setUiHidden(false);
|
||||
|
||||
m_stimPlanTimeIndexToPlot.uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_stimPlanTimeIndexToPlot.uiCapability()->setUiHidden(true);
|
||||
m_stimPlanCellVizMode.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -52,13 +52,6 @@ class RimFracture : public RimCheckableNamedObject, public Rim3dPropertiesInterf
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum StimPlanResultColorType
|
||||
{
|
||||
COLOR_INTERPOLATION,
|
||||
SINGLE_ELEMENT_COLOR
|
||||
};
|
||||
|
||||
public:
|
||||
RimFracture(void);
|
||||
virtual ~RimFracture(void);
|
||||
@ -67,7 +60,6 @@ public:
|
||||
double perforationEfficiency() const;
|
||||
|
||||
void setStimPlanTimeIndexToPlot(int timeIndex);
|
||||
StimPlanResultColorType stimPlanResultColorType() const;
|
||||
|
||||
double wellRadius(RiaEclipseUnitTools::UnitSystem unitSystem) const;
|
||||
cvf::Vec3d anchorPosition() const ;
|
||||
@ -133,8 +125,6 @@ protected:
|
||||
caf::PdmField<double> m_wellDiameter;
|
||||
caf::PdmField<int> m_stimPlanTimeIndexToPlot;
|
||||
|
||||
caf::PdmField<caf::AppEnum<StimPlanResultColorType>> m_stimPlanCellVizMode;
|
||||
|
||||
private:
|
||||
caf::PdmField<cvf::Vec3d> m_anchorPosition;
|
||||
|
||||
|
@ -221,6 +221,7 @@ void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi
|
||||
RimFracture::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
uiOrdering.add(nameField());
|
||||
uiOrdering.add(&m_fractureTemplate);
|
||||
|
||||
caf::PdmUiGroup* locationGroup = uiOrdering.addNewGroup("Location / Orientation");
|
||||
locationGroup->add(&m_location);
|
||||
@ -234,9 +235,7 @@ void RimSimWellFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrderi
|
||||
|
||||
caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties");
|
||||
propertyGroup->add(&m_fractureUnit);
|
||||
propertyGroup->add(&m_fractureTemplate);
|
||||
propertyGroup->add(&m_stimPlanTimeIndexToPlot);
|
||||
propertyGroup->add(&m_stimPlanCellVizMode);
|
||||
propertyGroup->add(&m_perforationLength);
|
||||
propertyGroup->add(&m_perforationEfficiency);
|
||||
propertyGroup->add(&m_wellDiameter);
|
||||
|
@ -72,7 +72,6 @@ RimStimPlanFractureTemplate::RimStimPlanFractureTemplate()
|
||||
m_borderPolygonResultName.uiCapability()->setUiHidden(true);
|
||||
|
||||
CAF_PDM_InitField(&m_activeTimeStepIndex, "ActiveTimeStepIndex", 0, "Active TimeStep Index", "", "", "");
|
||||
CAF_PDM_InitField(&m_showStimPlanMesh, "ShowStimPlanMesh", true, "Show StimPlan Mesh", "", "", "");
|
||||
CAF_PDM_InitField(&m_conductivityScalingFactor, "ConductivityFactor", 1.0, "Conductivity Scaling Factor", "", "The conductivity values read from file will be scaled with this parameters", "");
|
||||
CAF_PDM_InitField(&m_conductivityResultNameOnFile, "ConductivityResultName", QString(""), "Active Conductivity Result Name", "", "", "");
|
||||
|
||||
@ -95,14 +94,6 @@ int RimStimPlanFractureTemplate::activeTimeStepIndex()
|
||||
return m_activeTimeStepIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimStimPlanFractureTemplate::showStimPlanMesh()
|
||||
{
|
||||
return m_showStimPlanMesh;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -148,7 +139,6 @@ void RimStimPlanFractureTemplate::fieldChangedByUi(const caf::PdmFieldHandle* ch
|
||||
if (&m_wellPathDepthAtFracture == changedField
|
||||
|| &m_borderPolygonResultName == changedField
|
||||
|| &m_activeTimeStepIndex == changedField
|
||||
|| &m_showStimPlanMesh == changedField
|
||||
|| &m_conductivityScalingFactor == changedField
|
||||
|| &m_stimPlanFileName == changedField
|
||||
|| &m_conductivityResultNameOnFile == changedField)
|
||||
@ -615,7 +605,6 @@ void RimStimPlanFractureTemplate::defineUiOrdering(QString uiConfigName, caf::Pd
|
||||
RimFractureTemplate::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
uiOrdering.add(&name);
|
||||
uiOrdering.add(&m_showStimPlanMesh);
|
||||
|
||||
caf::PdmUiGroup* fileGroup = uiOrdering.addNewGroup("Input");
|
||||
fileGroup->add(&m_stimPlanFileName);
|
||||
|
@ -53,7 +53,6 @@ public:
|
||||
virtual ~RimStimPlanFractureTemplate();
|
||||
|
||||
int activeTimeStepIndex();
|
||||
bool showStimPlanMesh();
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void setDefaultsBasedOnXMLfile();
|
||||
@ -105,7 +104,6 @@ private:
|
||||
private:
|
||||
caf::PdmField<int> m_activeTimeStepIndex;
|
||||
caf::PdmField<QString> m_conductivityResultNameOnFile;
|
||||
caf::PdmField<bool> m_showStimPlanMesh;
|
||||
|
||||
caf::PdmField<double> m_wellPathDepthAtFracture;
|
||||
caf::PdmField<QString> m_borderPolygonResultName;
|
||||
|
@ -185,6 +185,7 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
RimFracture::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
uiOrdering.add(nameField());
|
||||
uiOrdering.add(&m_fractureTemplate);
|
||||
|
||||
caf::PdmUiGroup* locationGroup = uiOrdering.addNewGroup("Location / Orientation");
|
||||
locationGroup->add(&m_measuredDepth);
|
||||
@ -197,9 +198,7 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
|
||||
caf::PdmUiGroup* propertyGroup = uiOrdering.addNewGroup("Properties");
|
||||
propertyGroup->add(&m_fractureUnit);
|
||||
propertyGroup->add(&m_fractureTemplate);
|
||||
propertyGroup->add(&m_stimPlanTimeIndexToPlot);
|
||||
propertyGroup->add(&m_stimPlanCellVizMode);
|
||||
propertyGroup->add(&m_perforationLength);
|
||||
propertyGroup->add(&m_perforationEfficiency);
|
||||
propertyGroup->add(&m_wellDiameter);
|
||||
|
@ -123,7 +123,7 @@ RimEclipseView::RimEclipseView()
|
||||
faultResultSettings.uiCapability()->setUiHidden(true);
|
||||
|
||||
#ifdef USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
CAF_PDM_InitFieldNoDefault(&stimPlanColors, "StimPlanColors", "Fracture Colors", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&stimPlanColors, "StimPlanColors", "Fracture", "", "", "");
|
||||
stimPlanColors = new RimStimPlanColors();
|
||||
stimPlanColors.uiCapability()->setUiHidden(true);
|
||||
#endif // USE_PROTOTYPE_FEATURE_FRACTURES
|
||||
|
@ -40,6 +40,19 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimStimPlanColors, "RimStimPlanColors");
|
||||
|
||||
namespace caf {
|
||||
|
||||
template<>
|
||||
void caf::AppEnum< RimStimPlanColors::StimPlanResultColorType >::setUp()
|
||||
{
|
||||
addItem(RimStimPlanColors::COLOR_INTERPOLATION, "COLOR_INTERPOLATION", "On");
|
||||
addItem(RimStimPlanColors::SINGLE_ELEMENT_COLOR, "SINGLE_ELEMENT_COLOR", "Off");
|
||||
|
||||
setDefault(RimStimPlanColors::COLOR_INTERPOLATION);
|
||||
}
|
||||
|
||||
} // End namespace caf
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Internal methods
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -60,7 +73,11 @@ RimStimPlanColors::RimStimPlanColors()
|
||||
CAF_PDM_InitFieldNoDefault(&m_legendConfigurations, "LegendConfigurations", "", "", "", "");
|
||||
m_legendConfigurations.uiCapability()->setUiTreeHidden(true);
|
||||
|
||||
setName("Fracture Colors");
|
||||
CAF_PDM_InitField(&m_showStimPlanMesh, "ShowStimPlanMesh", true, "Show Mesh", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_stimPlanCellVizMode, "StimPlanCellVizMode", "Color Interpolation", "", "", "");
|
||||
|
||||
setName("Fracture");
|
||||
nameField()->uiCapability()->setUiReadOnly(true);
|
||||
}
|
||||
|
||||
@ -179,6 +196,26 @@ void RimStimPlanColors::fieldChangedByUi(const caf::PdmFieldHandle* changedField
|
||||
{
|
||||
updateStimPlanTemplates();
|
||||
}
|
||||
|
||||
if (changedField == &m_showStimPlanMesh)
|
||||
{
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj)
|
||||
{
|
||||
proj->createDisplayModelAndRedrawAllViews();
|
||||
}
|
||||
}
|
||||
|
||||
if(changedField == &m_stimPlanCellVizMode)
|
||||
{
|
||||
Rim3dView* rimView = nullptr;
|
||||
this->firstAncestorOrThisOfType(rimView);
|
||||
if (rimView)
|
||||
{
|
||||
rimView->createDisplayModelAndRedraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -336,8 +373,30 @@ void RimStimPlanColors::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimStimPlanColors::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_resultNameAndUnit);
|
||||
uiOrdering.add(&m_defaultColor);
|
||||
caf::PdmUiGroup* colorGroup = uiOrdering.addNewGroup("Colors");
|
||||
colorGroup->add(&m_resultNameAndUnit);
|
||||
colorGroup->add(&m_defaultColor);
|
||||
|
||||
bool stimPlanExists = false;
|
||||
RimProject* proj;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
std::vector<RimFractureTemplate*> fracTemplates = proj->allFractureTemplates();
|
||||
|
||||
for (auto fractemplate : fracTemplates)
|
||||
{
|
||||
if (dynamic_cast<RimStimPlanFractureTemplate*>(fractemplate))
|
||||
{
|
||||
stimPlanExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (stimPlanExists)
|
||||
{
|
||||
caf::PdmUiGroup* stimPlanGroup = uiOrdering.addNewGroup("StimPlan");
|
||||
stimPlanGroup->add(&m_showStimPlanMesh);
|
||||
stimPlanGroup->add(&m_stimPlanCellVizMode);
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
@ -44,6 +44,12 @@ class RimStimPlanColors : public RimCheckableNamedObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
enum StimPlanResultColorType
|
||||
{
|
||||
COLOR_INTERPOLATION,
|
||||
SINGLE_ELEMENT_COLOR
|
||||
};
|
||||
public:
|
||||
RimStimPlanColors();
|
||||
virtual ~RimStimPlanColors();
|
||||
@ -53,11 +59,13 @@ public:
|
||||
void setDefaultResultNameForStimPlan();
|
||||
QString unit() const;
|
||||
cvf::Color3f defaultColor() const;
|
||||
bool showStimPlanMesh() const { return m_showStimPlanMesh; }
|
||||
|
||||
void loadDataAndUpdate();
|
||||
void updateLegendData();
|
||||
|
||||
void updateStimPlanTemplates() const;
|
||||
StimPlanResultColorType stimPlanResultColorType() const { return m_stimPlanCellVizMode(); };
|
||||
|
||||
protected:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
|
||||
@ -75,5 +83,8 @@ private:
|
||||
caf::PdmField<cvf::Color3f> m_defaultColor;
|
||||
caf::PdmField<QString> m_resultNameAndUnit;
|
||||
caf::PdmChildArrayField<RimLegendConfig*> m_legendConfigurations;
|
||||
caf::PdmField<bool> m_showStimPlanMesh;
|
||||
caf::PdmField<caf::AppEnum<StimPlanResultColorType>> m_stimPlanCellVizMode;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user