mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
* #3966 Add buttons for creating/editing fracture templates from fractures * Make sure view is updated whenever a new template is created from the fracture
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
// Copyright (C) 2017-2018 Statoil ASA
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -24,6 +25,8 @@
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
#include "Rim3dView.h"
|
||||
@@ -43,9 +46,14 @@
|
||||
|
||||
#include "RivWellFracturePartMgr.h"
|
||||
|
||||
#include "FractureCommands/RicNewEllipseFractureTemplateFeature.h"
|
||||
#include "FractureCommands/RicNewStimPlanFractureTemplateFeature.h"
|
||||
|
||||
#include "cafHexGridIntersectionTools/cafHexGridIntersectionTools.h"
|
||||
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiToolButtonEditor.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
@@ -94,6 +102,17 @@ RimFracture::RimFracture()
|
||||
CAF_PDM_InitObject("Fracture", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_fractureTemplate, "FractureDef", "Fracture Template", "", "", "");
|
||||
CAF_PDM_InitField(&m_editFractureTemplate, "EditTemplate", false, "Edit", "", "", "");
|
||||
m_editFractureTemplate.uiCapability()->setUiEditorTypeName(caf::PdmUiToolButtonEditor::uiEditorTypeName());
|
||||
m_editFractureTemplate.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::HIDDEN);
|
||||
|
||||
CAF_PDM_InitField(&m_createEllipseFractureTemplate, "CreateEllipseTemplate", false, "No Fracture Templates Found.", "", "", "");
|
||||
m_createEllipseFractureTemplate.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||
m_createEllipseFractureTemplate.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
|
||||
CAF_PDM_InitField(&m_createStimPlanFractureTemplate, "CreateStimPlanTemplate", false, "Create New Template?", "", "", "");
|
||||
m_createStimPlanFractureTemplate.uiCapability()->setUiEditorTypeName(caf::PdmUiPushButtonEditor::uiEditorTypeName());
|
||||
m_createStimPlanFractureTemplate.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_anchorPosition, "AnchorPosition", "Anchor Position", "", "", "");
|
||||
m_anchorPosition.uiCapability()->setUiHidden(true);
|
||||
@@ -210,7 +229,23 @@ void RimFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
|
||||
setFractureTemplate(m_fractureTemplate);
|
||||
setDefaultFractureColorResult();
|
||||
}
|
||||
|
||||
else if (changedField == &m_editFractureTemplate)
|
||||
{
|
||||
m_editFractureTemplate = false;
|
||||
if (m_fractureTemplate != nullptr)
|
||||
{
|
||||
Riu3DMainWindowTools::selectAsCurrentItem(m_fractureTemplate());
|
||||
}
|
||||
}
|
||||
else if (changedField == &m_createEllipseFractureTemplate)
|
||||
{
|
||||
m_createEllipseFractureTemplate = false;
|
||||
RicNewEllipseFractureTemplateFeature::createNewTemplateForFractureAndUpdate(this);
|
||||
}
|
||||
else if (changedField == &m_createStimPlanFractureTemplate)
|
||||
{
|
||||
RicNewStimPlanFractureTemplateFeature::createNewTemplateForFractureAndUpdate(this);
|
||||
}
|
||||
if ( changedField == &m_azimuth
|
||||
|| changedField == &m_fractureTemplate
|
||||
|| changedField == &m_stimPlanTimeIndexToPlot
|
||||
@@ -690,6 +725,18 @@ void RimFracture::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
myAttr->m_maximum = 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
if (field == &m_createEllipseFractureTemplate)
|
||||
{
|
||||
auto myAttr = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>(attribute);
|
||||
myAttr->m_buttonText = "Ellipse Template";
|
||||
}
|
||||
|
||||
if (field == &m_createStimPlanFractureTemplate)
|
||||
{
|
||||
auto myAttr = dynamic_cast<caf::PdmUiPushButtonEditorAttribute*>(attribute);
|
||||
myAttr->m_buttonText = "StimPlan Template";
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017 Statoil ASA
|
||||
// Copyright (C) 2017-2018 Statoil ASA
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -154,6 +155,9 @@ private:
|
||||
|
||||
protected:
|
||||
caf::PdmPtrField<RimFractureTemplate*> m_fractureTemplate;
|
||||
caf::PdmField<bool> m_editFractureTemplate;
|
||||
caf::PdmField<bool> m_createEllipseFractureTemplate;
|
||||
caf::PdmField<bool> m_createStimPlanFractureTemplate;
|
||||
caf::PdmProxyValueField<cvf::Vec3d> m_uiAnchorPosition;
|
||||
caf::PdmField< RiaEclipseUnitTools::UnitSystemType > m_fractureUnit;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
// Copyright (C) 2016-2018 Statoil ASA
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -79,7 +80,7 @@ void RimWellPathFracture::fieldChangedByUi(const caf::PdmFieldHandle* changedFie
|
||||
RimProject* proj = nullptr;
|
||||
this->firstAncestorOrThisOfType(proj);
|
||||
if (proj) proj->reloadCompletionTypeResultsInAllViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -215,8 +216,29 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
{
|
||||
RimFracture::defineUiOrdering(uiConfigName, uiOrdering);
|
||||
|
||||
uiOrdering.add(nameField());
|
||||
uiOrdering.add(&m_fractureTemplate);
|
||||
if (m_fractureTemplate())
|
||||
{
|
||||
uiOrdering.add(nameField(), caf::PdmUiOrdering::LayoutOptions(true, 3, 1));
|
||||
uiOrdering.add(&m_fractureTemplate, {true, 2, 1});
|
||||
uiOrdering.add(&m_editFractureTemplate, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
uiOrdering.add(nameField());
|
||||
{
|
||||
RimProject* project = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(project);
|
||||
if (project->allFractureTemplates().empty())
|
||||
{
|
||||
uiOrdering.add(&m_createEllipseFractureTemplate);
|
||||
uiOrdering.add(&m_createStimPlanFractureTemplate, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
uiOrdering.add(&m_fractureTemplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* locationGroup = uiOrdering.addNewGroup("Location / Orientation");
|
||||
locationGroup->add(&m_measuredDepth);
|
||||
@@ -236,6 +258,8 @@ void RimWellPathFracture::defineUiOrdering(QString uiConfigName, caf::PdmUiOrder
|
||||
|
||||
caf::PdmUiGroup* fractureCenterGroup = uiOrdering.addNewGroup("Fracture Center Info");
|
||||
fractureCenterGroup->add(&m_uiAnchorPosition);
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil ASA
|
||||
// Copyright (C) 2016-2018 Statoil ASA
|
||||
// Copyright (C) 2018- Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
@@ -60,4 +61,5 @@ private:
|
||||
|
||||
private:
|
||||
caf::PdmField<float> m_measuredDepth;
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user