mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3180 Add multiple fraction create command (CommandFile)
This commit is contained in:
@@ -45,6 +45,22 @@
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicCreateMultipleFracturesFeature, "RicCreateMultipleFracturesFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateMultipleFracturesFeature::appendFractures()
|
||||
{
|
||||
slotAppendFractures();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicCreateMultipleFracturesFeature::replaceFractures()
|
||||
{
|
||||
slotDeleteAndAppendFractures();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -169,6 +185,7 @@ void RicCreateMultipleFracturesFeature::onActionTriggered(bool isChecked)
|
||||
int maxFractureCount = 100;
|
||||
multipleFractionsUi->setValues(firstSourceCase, minimumDistanceFromTip, maxFractureCount);
|
||||
|
||||
// Options
|
||||
auto newItem = new RicCreateMultipleFracturesOptionItemUi;
|
||||
|
||||
RimFractureTemplate* firstFractureTemplate = nullptr;
|
||||
@@ -184,6 +201,11 @@ void RicCreateMultipleFracturesFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
// Selected well paths
|
||||
std::vector<RimWellPath*> selWells = caf::selectedObjectsByTypeStrict<RimWellPath*>();
|
||||
multipleFractionsUi->clearWellPaths();
|
||||
for (auto wellPath : selWells) multipleFractionsUi->addWellPath(wellPath);
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(
|
||||
Riu3DMainWindowTools::mainWindowWidget(), multipleFractionsUi, "Create Multiple Fractions", "");
|
||||
|
||||
|
||||
@@ -36,6 +36,12 @@ class RicCreateMultipleFracturesFeature : public caf::CmdFeature
|
||||
Q_OBJECT
|
||||
CAF_CMD_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RicCreateMultipleFracturesFeature() {}
|
||||
|
||||
void appendFractures();
|
||||
void replaceFractures();
|
||||
|
||||
private slots:
|
||||
void slotDeleteAndAppendFractures();
|
||||
void slotAppendFractures();
|
||||
|
||||
@@ -112,6 +112,30 @@ void RiuCreateMultipleFractionsUi::deleteOptionItem(RicCreateMultipleFracturesOp
|
||||
delete optionsItem;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuCreateMultipleFractionsUi::clearOptions()
|
||||
{
|
||||
m_options.deleteAllChildObjects();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuCreateMultipleFractionsUi::addWellPath(RimWellPath* wellPath)
|
||||
{
|
||||
m_wellPaths.push_back(wellPath);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuCreateMultipleFractionsUi::clearWellPaths()
|
||||
{
|
||||
m_wellPaths.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -242,9 +266,9 @@ std::vector<LocationForNewFracture> RiuCreateMultipleFractionsUi::locationsForNe
|
||||
|
||||
if (mainGrid)
|
||||
{
|
||||
std::vector<RimWellPath*> selWells = caf::selectedObjectsByTypeStrict<RimWellPath*>();
|
||||
//std::vector<RimWellPath*> selWells = caf::selectedObjectsByTypeStrict<RimWellPath*>();
|
||||
|
||||
for (auto w : selWells)
|
||||
for (auto w : m_wellPaths)
|
||||
{
|
||||
auto wellPathGeometry = w->wellPathGeometry();
|
||||
if (wellPathGeometry)
|
||||
|
||||
@@ -66,6 +66,12 @@ public:
|
||||
|
||||
void deleteOptionItem(RicCreateMultipleFracturesOptionItemUi* optionsItem);
|
||||
|
||||
void clearOptions();
|
||||
|
||||
void addWellPath(RimWellPath* wellPath);
|
||||
|
||||
void clearWellPaths();
|
||||
|
||||
std::vector<LocationForNewFracture> locationsForNewFractures() const;
|
||||
|
||||
private:
|
||||
@@ -86,4 +92,6 @@ private:
|
||||
caf::PdmChildArrayField<RicCreateMultipleFracturesOptionItemUi*> m_options;
|
||||
|
||||
caf::PdmProxyValueField<QString> m_fractureCreationSummary;
|
||||
|
||||
std::vector<RimWellPath*> m_wellPaths;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user