mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1039 - pre-proto - Added command feature for generating new fracture
This commit is contained in:
parent
6e25fe2569
commit
cd3b6da47f
@ -37,6 +37,8 @@ ${CEE_CURRENT_LIST_DIR}RicImportSummaryCaseFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.h
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureFeature.h
|
||||
|
||||
|
||||
# General delete of any object in a child array field
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemExec.h
|
||||
@ -76,6 +78,9 @@ ${CEE_CURRENT_LIST_DIR}RicImportSummaryCaseFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.cpp
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureFeature.cpp
|
||||
|
||||
|
||||
# General delete of any object in a child array field
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemExec.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemExecData.cpp
|
||||
|
118
ApplicationCode/Commands/RicNewSimWellFractureFeature.cpp
Normal file
118
ApplicationCode/Commands/RicNewSimWellFractureFeature.cpp
Normal file
@ -0,0 +1,118 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicNewSimWellFractureFeature.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
//
|
||||
// #include "RimMainPlotCollection.h"
|
||||
// #include "RimOilField.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimFractureCollection.h"
|
||||
// #include "RimSummaryCaseCollection.h"
|
||||
// #include "RimSummaryCurve.h"
|
||||
// #include "RimSummaryPlot.h"
|
||||
// #include "RimSummaryPlotCollection.h"
|
||||
//
|
||||
// #include "RiuMainPlotWindow.h"
|
||||
//
|
||||
// #include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
//
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
#include <QAction>
|
||||
#include "RimOilField.h"
|
||||
#include "RimFracture.h"
|
||||
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewSimWellFractureFeature, "RicNewSimWellFractureFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
CVF_ASSERT(project);
|
||||
|
||||
RimOilField* oilfield = project->activeOilField();
|
||||
if (oilfield == nullptr) return;
|
||||
|
||||
RimFractureCollection* fracColl = oilfield->fractureCollection();
|
||||
|
||||
|
||||
if (fracColl)
|
||||
{
|
||||
RimFracture* fracture = new RimFracture();
|
||||
fracColl->fractures.push_back(fracture);
|
||||
|
||||
fracture->name = "New Fracture";
|
||||
|
||||
|
||||
fracColl->updateConnectedEditors();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// RimSummaryPlot* plot = selectedSummaryPlot();
|
||||
// if (plot)
|
||||
// {
|
||||
// RimSummaryCurve* newCurve = new RimSummaryCurve();
|
||||
// plot->addCurve(newCurve);
|
||||
//
|
||||
// cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable();
|
||||
// newCurve->setColor(curveColor);
|
||||
//
|
||||
// RimSummaryCase* defaultCase = nullptr;
|
||||
// if (project->activeOilField()->summaryCaseCollection()->summaryCaseCount() > 0)
|
||||
// {
|
||||
// defaultCase = project->activeOilField()->summaryCaseCollection()->summaryCase(0);
|
||||
// newCurve->setSummaryCase(defaultCase);
|
||||
// newCurve->setVariable("FOPT");
|
||||
// newCurve->loadDataAndUpdate();
|
||||
// }
|
||||
//
|
||||
// plot->updateConnectedEditors();
|
||||
//
|
||||
// RiaApplication::instance()->getOrCreateAndShowMainPlotWindow()->selectAsCurrentItem(newCurve);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewSimWellFractureFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
// actionToSetup->setIcon(QIcon(":/CrossSection16x16.png"));
|
||||
actionToSetup->setText("New Fracture");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewSimWellFractureFeature::isCommandEnabled()
|
||||
{
|
||||
return true;
|
||||
}
|
44
ApplicationCode/Commands/RicNewSimWellFractureFeature.h
Normal file
44
ApplicationCode/Commands/RicNewSimWellFractureFeature.h
Normal file
@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2016- Statoil 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
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cafCmdFeature.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
// class RimSummaryPlot;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewSimWellFractureFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
virtual void onActionTriggered(bool isChecked) override;
|
||||
virtual void setupActionLook(QAction* actionToSetup) override;
|
||||
virtual bool isCommandEnabled() override;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// RimSummaryPlot* selectedSummaryPlot() const;
|
||||
};
|
@ -59,6 +59,8 @@
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
|
||||
#include "RimFractureCollection.h"
|
||||
|
||||
#include "ToggleCommands/RicToggleItemsFeatureImpl.h"
|
||||
|
||||
#include "cafPdmUiItem.h"
|
||||
@ -351,6 +353,11 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
|
||||
{
|
||||
commandIds << "RicExportFaultsFeature";
|
||||
}
|
||||
else if (dynamic_cast<RimFractureCollection*>(uiItem))
|
||||
{
|
||||
commandIds << "RicNewSimWellFractureFeature";
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (dynamic_cast<RimView*>(uiItem))
|
||||
|
@ -53,8 +53,8 @@ RimFracture::RimFracture(void)
|
||||
CAF_PDM_InitFieldNoDefault(&wellpath, "WellPath", "Well path for measured deph", "", "", "");
|
||||
|
||||
CAF_PDM_InitField(&i, "I", 1, "Fracture location cell I", "", "", "");
|
||||
CAF_PDM_InitField(&i, "J", 1, "Fracture location cell J", "", "", "");
|
||||
CAF_PDM_InitField(&i, "K", 1, "Fracture location cell K", "", "", "");
|
||||
CAF_PDM_InitField(&j, "J", 1, "Fracture location cell J", "", "", "");
|
||||
CAF_PDM_InitField(&k, "K", 1, "Fracture location cell K", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&fractureDefinition, "FractureDef", "FractureDef", "", "", "");
|
||||
|
||||
|
@ -36,7 +36,7 @@ RimFractureCollection::RimFractureCollection(void)
|
||||
CAF_PDM_InitField(&isActive, "Active", true, "Active", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&fractures, "Fractures", "", "", "", "");
|
||||
|
||||
fractures.uiCapability()->setUiHidden(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -76,9 +76,6 @@ public:
|
||||
|
||||
caf::PdmChildArrayField<RimMultiSnapshotDefinition*> multiSnapshotDefinitions;
|
||||
|
||||
caf::PdmChildArrayField<RimFractureDefinition*> fractureDefinition;
|
||||
caf::PdmChildArrayField<RimFractureCollection*> fractureCollection;
|
||||
|
||||
caf::PdmField<QString> mainWindowTreeViewState;
|
||||
caf::PdmField<QString> mainWindowCurrentModelIndexPath;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user