#3180 Add multiple fraction create command (CommandFile)

This commit is contained in:
Bjørn Erik Jensen
2018-08-22 11:10:10 +02:00
parent 3a716fe0f7
commit 6f421e0990
8 changed files with 319 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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