diff --git a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp index b6b19d2884..47ddf15d52 100644 --- a/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellFracturePartMgr.cpp @@ -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()); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp index 9a63c139dc..c1019aa681 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimFracture.cpp @@ -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(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 diff --git a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h index 8ce6f74901..66d8d04827 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimFracture.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimFracture.h @@ -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 m_wellDiameter; caf::PdmField m_stimPlanTimeIndexToPlot; - caf::PdmField> m_stimPlanCellVizMode; - private: caf::PdmField m_anchorPosition; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp index 2c42b1028e..afcd5615d8 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimSimWellFracture.cpp @@ -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); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp index ae141a16ec..25df77ce51 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.cpp @@ -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); diff --git a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h index 11b15c9af5..ff81f7e5cd 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h +++ b/ApplicationCode/ProjectDataModel/Completions/RimStimPlanFractureTemplate.h @@ -53,7 +53,6 @@ public: virtual ~RimStimPlanFractureTemplate(); int activeTimeStepIndex(); - bool showStimPlanMesh(); void loadDataAndUpdate(); void setDefaultsBasedOnXMLfile(); @@ -105,7 +104,6 @@ private: private: caf::PdmField m_activeTimeStepIndex; caf::PdmField m_conductivityResultNameOnFile; - caf::PdmField m_showStimPlanMesh; caf::PdmField m_wellPathDepthAtFracture; caf::PdmField m_borderPolygonResultName; diff --git a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp index 33d5d1f11b..c01bcbe6e9 100644 --- a/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp +++ b/ApplicationCode/ProjectDataModel/Completions/RimWellPathFracture.cpp @@ -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); diff --git a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp index a04119f33f..d07bf58900 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseView.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseView.cpp @@ -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 diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp b/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp index 851fa14fc6..481e41156b 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp +++ b/ApplicationCode/ProjectDataModel/RimStimPlanColors.cpp @@ -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 fracTemplates = proj->allFractureTemplates(); + + for (auto fractemplate : fracTemplates) + { + if (dynamic_cast(fractemplate)) + { + stimPlanExists = true; + break; + } + } + + if (stimPlanExists) + { + caf::PdmUiGroup* stimPlanGroup = uiOrdering.addNewGroup("StimPlan"); + stimPlanGroup->add(&m_showStimPlanMesh); + stimPlanGroup->add(&m_stimPlanCellVizMode); + } uiOrdering.skipRemainingFields(true); } diff --git a/ApplicationCode/ProjectDataModel/RimStimPlanColors.h b/ApplicationCode/ProjectDataModel/RimStimPlanColors.h index 4b74f9d038..944fe88aee 100644 --- a/ApplicationCode/ProjectDataModel/RimStimPlanColors.h +++ b/ApplicationCode/ProjectDataModel/RimStimPlanColors.h @@ -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 calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override; @@ -75,5 +83,8 @@ private: caf::PdmField m_defaultColor; caf::PdmField m_resultNameAndUnit; caf::PdmChildArrayField m_legendConfigurations; + caf::PdmField m_showStimPlanMesh; + caf::PdmField> m_stimPlanCellVizMode; + };