#1044 - pre-proto - Started adding feature for making new simulation well fracture in 3D view, but not finished due to missing infrastructure

This commit is contained in:
astridkbjorke 2016-12-20 13:10:03 +01:00
parent ff996e75ea
commit b6a08700a2
8 changed files with 130 additions and 13 deletions

View File

@ -38,6 +38,7 @@ ${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.h
${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.h
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureFeature.h
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureAtPosFeature.h
${CEE_CURRENT_LIST_DIR}RicNewFractureDefinitionFeature.h
${CEE_CURRENT_LIST_DIR}RicNewWellPathCollFractureFeature.h
@ -82,6 +83,7 @@ ${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewSimWellFractureAtPosFeature.cpp
${CEE_CURRENT_LIST_DIR}RicNewFractureDefinitionFeature.cpp
#${CEE_CURRENT_LIST_DIR}RicNewWellPathCollFractureFeature.cpp

View File

@ -0,0 +1,76 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RicNewSimWellFractureAtPosFeature.h"
#include "RiaApplication.h"
#include "RimCase.h"
#include "RimEclipseWell.h"
#include "RimFracture.h"
#include "RimFractureCollection.h"
#include "RimProject.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include "QAction.h"
CAF_CMD_SOURCE_INIT(RicNewSimWellFractureAtPosFeature, "RicNewSimWellFractureAtPosFeature");
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSimWellFractureAtPosFeature::onActionTriggered(bool isChecked)
{
// Not yet implemented
// Infrastructure is missing for being able to obtain i j and k when right-clicking
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewSimWellFractureAtPosFeature::setupActionLook(QAction* actionToSetup)
{
//actionToSetup->setIcon(QIcon(":/CrossSection16x16.png"));
actionToSetup->setText("New Fracture");
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewSimWellFractureAtPosFeature::isCommandEnabled()
{
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
if (!pdmUiItem) return false;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
if (!objHandle) return false;
RimEclipseWell* eclipseWell = nullptr;
objHandle->firstAncestorOrThisOfType(eclipseWell);
if (eclipseWell)
{
return true;
}
return false;
}

View File

@ -0,0 +1,39 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 RicNewSimWellFractureAtPosFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
virtual void onActionTriggered(bool isChecked) override;
virtual void setupActionLook(QAction* actionToSetup) override;
virtual bool isCommandEnabled() override;
};

View File

@ -21,6 +21,7 @@
#include "RiaApplication.h"
#include "RimCase.h"
#include "RimEclipseWell.h"
#include "RimFracture.h"
#include "RimFractureCollection.h"
#include "RimProject.h"
@ -30,7 +31,6 @@
#include "cvfAssert.h"
#include "QAction.h"
#include "RimEclipseWell.h"
CAF_CMD_SOURCE_INIT(RicNewSimWellFractureFeature, "RicNewSimWellFractureFeature");
@ -57,7 +57,6 @@ void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
fractureCollection->fractures.push_back(fracture);
fracture->name = "New Simulation Well Fracture";
//TODO set all relevant defaults...
fractureCollection->updateConnectedEditors();
@ -68,7 +67,7 @@ void RicNewSimWellFractureFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
void RicNewSimWellFractureFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setIcon(QIcon(":/CrossSection16x16.png"));
//actionToSetup->setIcon(QIcon(":/CrossSection16x16.png"));
actionToSetup->setText("New Fracture");
}

View File

@ -24,14 +24,13 @@
#include "RimFracture.h"
#include "RimFractureCollection.h"
#include "RimProject.h"
#include "RimWellPathCollection.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include "QAction.h"
#include "RimEclipseWell.h"
#include "RimWellPathCollection.h"
CAF_CMD_SOURCE_INIT(RicNewWellPathCollFractureFeature, "RicNewWellPathCollFractureFeature");
@ -50,9 +49,6 @@ void RicNewWellPathCollFractureFeature::onActionTriggered(bool isChecked)
RimWellPathCollection* wellPathColl = nullptr;
objHandle->firstAncestorOrThisOfType(wellPathColl);
// RimEclipseWell* eclipseWell = nullptr;
// objHandle->firstAncestorOrThisOfType(eclipseWell);
RimFractureCollection* fractureCollection = nullptr;
objHandle->firstAncestorOrThisOfType(fractureCollection);
CVF_ASSERT(fractureCollection);

View File

@ -35,9 +35,12 @@
#include "RimEclipseStatisticsCase.h"
#include "RimEclipseView.h"
#include "RimEclipseWell.h"
#include "RimFault.h"
#include "RimFormationNames.h"
#include "RimFormationNamesCollection.h"
#include "RimFracture.h"
#include "RimFractureCollection.h"
#include "RimFractureDefinition.h"
#include "RimFractureDefinitionCollection.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechPropertyFilter.h"
@ -74,8 +77,6 @@
#include <vector>
#include <QMenu>
#include "RimFault.h"
#include "RimFracture.h"
//--------------------------------------------------------------------------------------------------
///
@ -355,13 +356,14 @@ QStringList RimContextCommandBuilder::commandsFromSelection()
{
commandIds << "RicExportFaultsFeature";
}
else if (dynamic_cast<RimFractureCollection*>(uiItem)
|| dynamic_cast<RimFracture*>(uiItem) )
else if (dynamic_cast<RimFractureCollection*>(uiItem) ||
dynamic_cast<RimFracture*>(uiItem) )
{
commandIds << "RicNewSimWellFractureFeature";
commandIds << "RicNewWellPathCollFractureFeature";
}
else if (dynamic_cast<RimFractureDefinitionCollection*>(uiItem))
else if (dynamic_cast<RimFractureDefinitionCollection*>(uiItem) ||
dynamic_cast<RimFractureDefinition*>(uiItem))
{
commandIds << "RicNewFractureDefinitionFeature";
}

View File

@ -56,6 +56,8 @@ public:
caf::PdmField<int> j;
caf::PdmField<int> k;
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;

View File

@ -310,6 +310,7 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event)
caf::SelectionManager::instance()->setSelectedItem(well);
commandIds << "RicNewSimWellIntersectionFeature";
commandIds << "RicNewSimWellFractureAtPosFeature";
}
}