mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2609 WIP: Editable Well Path object with targets and New/delete features
This commit is contained in:
parent
ba9f7720e6
commit
8565b166da
@ -3,6 +3,9 @@ set (SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathDeleteFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportFileFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathViewerEventHandler.h
|
||||
@ -14,6 +17,9 @@ set (SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathDeleteFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportFileFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsImportSsihubFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewEditableWellPathFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicNewWellPathListTargetFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicDeleteWellPathTargetFeature.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsImpl.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathsUnitSystemSettingsUi.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RicWellPathViewerEventHandler.cpp
|
||||
|
@ -0,0 +1,75 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
// 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 "RicDeleteWellPathTargetFeature.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicDeleteWellPathTargetFeature, "RicDeleteWellPathTargetFeature");
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
#include "RimModeledWellpath.h"
|
||||
#include <QAction>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicDeleteWellPathTargetFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimWellPathTarget*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects, caf::SelectionManager::CURRENT);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteWellPathTargetFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPathTarget*> targets;
|
||||
caf::SelectionManager::instance()->objectsByType(&targets, caf::SelectionManager::CURRENT);
|
||||
|
||||
if (targets.size() > 0)
|
||||
{
|
||||
|
||||
RimWellPathGeometryDef* wellGeomDef = nullptr;
|
||||
targets[0]->firstAncestorOrThisOfTypeAsserted(wellGeomDef);
|
||||
|
||||
for ( auto target: targets )
|
||||
{
|
||||
wellGeomDef->deleteTarget(target);
|
||||
}
|
||||
|
||||
wellGeomDef->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicDeleteWellPathTargetFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Delete Target");
|
||||
actionToSetup->setIcon(QIcon(":/Erase.png"));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
// 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"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicDeleteWellPathTargetFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -0,0 +1,87 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
// 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 "RicNewEditableWellPathFeature.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewEditableWellPathFeature, "RicNewEditableWellPathFeature");
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RiaApplication.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include <QAction>
|
||||
#include "RimOilField.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewEditableWellPathFeature::isCommandEnabled()
|
||||
{
|
||||
{
|
||||
std::vector<RimWellPath*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
{
|
||||
std::vector<RimWellPathCollection*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewEditableWellPathFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
if ( RiaApplication::instance()->project() && RiaApplication::instance()->project()->activeOilField() )
|
||||
{
|
||||
RimWellPathCollection* wellPathCollection = RiaApplication::instance()->project()->activeOilField()->wellPathCollection();
|
||||
|
||||
if ( wellPathCollection )
|
||||
{
|
||||
std::vector<RimWellPath*> newWellPaths;
|
||||
newWellPaths.push_back(new RimModeledWellpath());
|
||||
wellPathCollection->addWellPaths(newWellPaths);
|
||||
wellPathCollection->uiCapability()->updateConnectedEditors();
|
||||
wellPathCollection->scheduleRedrawAffectedViews();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewEditableWellPathFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Create Editable Well Path");
|
||||
actionToSetup->setIcon(QIcon(":/Well.png"));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
// 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"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewEditableWellPathFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -0,0 +1,91 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
// 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 "RicNewWellPathListTargetFeature.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicNewWellPathListTargetFeature, "RicNewWellPathListTargetFeature");
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
#include "RimModeledWellpath.h"
|
||||
#include <QAction>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicNewWellPathListTargetFeature::isCommandEnabled()
|
||||
{
|
||||
{
|
||||
std::vector<RimWellPathGeometryDef*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
{
|
||||
std::vector<RimWellPathTarget*> objects;
|
||||
caf::SelectionManager::instance()->objectsByType(&objects, caf::SelectionManager::CURRENT);
|
||||
|
||||
if ( objects.size() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathListTargetFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
std::vector<RimWellPathTarget*> targets;
|
||||
caf::SelectionManager::instance()->objectsByType(&targets, caf::SelectionManager::CURRENT);
|
||||
if (targets.size() > 0)
|
||||
{
|
||||
RimWellPathGeometryDef* wellGeomDef = nullptr;
|
||||
targets[0]->firstAncestorOrThisOfTypeAsserted(wellGeomDef);
|
||||
|
||||
wellGeomDef->insertTarget(targets[0], new RimWellPathTarget);
|
||||
wellGeomDef->updateConnectedEditors();
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<RimWellPathGeometryDef*> geomDefs;
|
||||
caf::SelectionManager::instance()->objectsByType(&geomDefs);
|
||||
if (geomDefs.size() > 0)
|
||||
{
|
||||
RimWellPathGeometryDef* wellGeomDef = geomDefs[0];
|
||||
|
||||
wellGeomDef->insertTarget(nullptr, new RimWellPathTarget);
|
||||
wellGeomDef->updateConnectedEditors();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicNewWellPathListTargetFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("New Target");
|
||||
actionToSetup->setIcon(QIcon(":/Well.png"));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
// 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"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicNewWellPathListTargetFeature : public caf::CmdFeature
|
||||
{
|
||||
CAF_CMD_HEADER_INIT;
|
||||
protected:
|
||||
|
||||
// Overrides
|
||||
virtual bool isCommandEnabled() override;
|
||||
virtual void onActionTriggered( bool isChecked ) override;
|
||||
virtual void setupActionLook( QAction* actionToSetup ) override;
|
||||
};
|
@ -25,6 +25,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimModeledWellpath.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.h
|
||||
@ -136,6 +137,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimSimWellInView.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimSimWellInViewCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFileWellPath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimModeledWellpath.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimWellPathTarget.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimScriptCollection.cpp
|
||||
|
@ -243,6 +243,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
}
|
||||
else if (dynamic_cast<RimWellPathCollection*>(uiItem))
|
||||
{
|
||||
menuBuilder << "RicNewEditableWellPathFeature";
|
||||
menuBuilder.subMenuStart("Import");
|
||||
menuBuilder << "RicWellPathsImportFileFeature";
|
||||
menuBuilder << "RicWellPathsImportSsihubFeature";
|
||||
|
163
ApplicationCode/ProjectDataModel/RimModeledWellPath.cpp
Normal file
163
ApplicationCode/ProjectDataModel/RimModeledWellPath.cpp
Normal file
@ -0,0 +1,163 @@
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "cafPdmUiTableViewEditor.h"
|
||||
#include "RimWellPathTarget.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimModeledWellpath, "ModeledWellpath");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimModeledWellpath::RimModeledWellpath()
|
||||
{
|
||||
CAF_PDM_InitObject("Modeled WellPath", ":/Well.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_geometryDefinition, "WellPathGeometryDef", "Trajectory", "", "", "");
|
||||
//m_geometryDefinition.uiCapability()->setUiHidden(true);
|
||||
m_geometryDefinition = new RimWellPathGeometryDef;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimModeledWellpath::~RimModeledWellpath()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimModeledWellpath::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName)
|
||||
{
|
||||
uiTreeOrdering.add(m_geometryDefinition());
|
||||
RimWellPath::defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
|
||||
}
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template<>
|
||||
void caf::AppEnum< RimWellPathGeometryDef::WellStartType >::setUp()
|
||||
{
|
||||
addItem(RimWellPathGeometryDef::START_AT_FIRST_TARGET, "START_AT_FIRST_TARGET", "Start at First Target");
|
||||
addItem(RimWellPathGeometryDef::START_AT_SURFACE, "START_AT_SURFACE", "Start at Surface");
|
||||
addItem(RimWellPathGeometryDef::START_FROM_OTHER_WELL, "START_FROM_OTHER_WELL", "Branch");
|
||||
addItem(RimWellPathGeometryDef::START_AT_AUTO_SURFACE, "START_AT_AUTO_SURFACE", "Auto Surface");
|
||||
|
||||
setDefault(RimWellPathGeometryDef::START_AT_FIRST_TARGET);
|
||||
}
|
||||
}
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellPathGeometryDef, "WellPathGeometryDef");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathGeometryDef::RimWellPathGeometryDef()
|
||||
{
|
||||
CAF_PDM_InitObject("Trajectory", ":/Well.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellStartType, "WellStartType", "Start Type", "", "", "");
|
||||
CAF_PDM_InitField(&m_startPos, "StartPos", cvf::Vec3d(0,0,0), "UTM Start Pos", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_parentWell, "ParentWell", "Parent Well", "", "", "");
|
||||
CAF_PDM_InitField(&m_kickoffDepthOrMD, "KickoffDepthOrMD", 100.0, "Kickoff Depth", "", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_wellTargets, "WellPathTargets", "Well Targets", "", "", "");
|
||||
m_wellTargets.uiCapability()->setUiEditorTypeName(caf::PdmUiTableViewEditor::uiEditorTypeName());
|
||||
//m_wellTargets.uiCapability()->setUiTreeHidden(true);
|
||||
m_wellTargets.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_wellTargets.uiCapability()->setUiLabelPosition(caf::PdmUiItemInfo::TOP);
|
||||
m_wellTargets.uiCapability()->setCustomContextMenuEnabled(true);
|
||||
|
||||
|
||||
m_wellTargets.push_back(new RimWellPathTarget());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimWellPathGeometryDef::~RimWellPathGeometryDef()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::insertTarget(RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert)
|
||||
{
|
||||
size_t index = m_wellTargets.index(targetToInsertBefore);
|
||||
if (index < m_wellTargets.size()) m_wellTargets.insert(index, targetToInsert);
|
||||
else m_wellTargets.push_back(targetToInsert);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::deleteTarget(RimWellPathTarget* targetTodelete)
|
||||
{
|
||||
m_wellTargets.removeChildObject(targetTodelete);
|
||||
delete targetTodelete;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue)
|
||||
{
|
||||
if (&m_startPos == changedField)
|
||||
{
|
||||
std::cout << "fieldChanged" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
{
|
||||
uiOrdering.add(&m_wellStartType);
|
||||
if (m_wellStartType == START_FROM_OTHER_WELL)
|
||||
{
|
||||
uiOrdering.add(&m_parentWell);
|
||||
m_kickoffDepthOrMD.uiCapability()->setUiName("Measured Depth");
|
||||
uiOrdering.add(&m_kickoffDepthOrMD);
|
||||
}
|
||||
|
||||
if (m_wellStartType == START_AT_SURFACE)
|
||||
{
|
||||
uiOrdering.add(&m_startPos);
|
||||
m_kickoffDepthOrMD.uiCapability()->setUiName("Kick Off Depth");
|
||||
uiOrdering.add(&m_kickoffDepthOrMD);
|
||||
}
|
||||
|
||||
uiOrdering.add(&m_wellTargets);
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName)
|
||||
{
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellPathGeometryDef::defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
||||
QMenu* menu,
|
||||
QWidget* fieldEditorWidget)
|
||||
{
|
||||
caf::CmdFeatureMenuBuilder menuBuilder;
|
||||
|
||||
menuBuilder << "RicNewWellPathListTargetFeature";
|
||||
menuBuilder << "Separator";
|
||||
menuBuilder << "RicDeleteWellPathTargetFeature";
|
||||
|
||||
menuBuilder.appendToMenu(menu);
|
||||
}
|
82
ApplicationCode/ProjectDataModel/RimModeledWellPath.h
Normal file
82
ApplicationCode/ProjectDataModel/RimModeledWellPath.h
Normal file
@ -0,0 +1,82 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// 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
|
||||
// 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 "RimWellPath.h"
|
||||
|
||||
#include "cafPdmFieldCvfVec3d.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
class RimWellPathTarget;
|
||||
class RimWellPath;
|
||||
class RimWellPathGeometryDef;
|
||||
|
||||
class RimModeledWellpath: public RimWellPath
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
|
||||
RimModeledWellpath();
|
||||
~RimModeledWellpath();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
caf::PdmChildField<RimWellPathGeometryDef*> m_geometryDefinition;
|
||||
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
class RimWellPathGeometryDef : public caf::PdmObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
public:
|
||||
|
||||
RimWellPathGeometryDef();
|
||||
~RimWellPathGeometryDef();
|
||||
|
||||
enum WellStartType { START_AT_FIRST_TARGET, START_AT_SURFACE, START_FROM_OTHER_WELL, START_AT_AUTO_SURFACE };
|
||||
|
||||
void insertTarget(RimWellPathTarget* targetToInsertBefore, RimWellPathTarget* targetToInsert);
|
||||
void deleteTarget(RimWellPathTarget* targetTodelete);
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
|
||||
private:
|
||||
virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
|
||||
caf::PdmField<caf::AppEnum<WellStartType> > m_wellStartType;
|
||||
caf::PdmField<cvf::Vec3d> m_startPos;
|
||||
|
||||
caf::PdmField<double> m_kickoffDepthOrMD;
|
||||
caf::PdmPtrField<RimWellPath*> m_parentWell;
|
||||
|
||||
caf::PdmChildArrayField<RimWellPathTarget*> m_wellTargets;
|
||||
|
||||
protected:
|
||||
virtual void defineCustomContextMenu(const caf::PdmFieldHandle* fieldNeedingMenu,
|
||||
QMenu* menu,
|
||||
QWidget* fieldEditorWidget) override;
|
||||
|
||||
};
|
@ -128,6 +128,7 @@ protected:
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
virtual void initAfterRead() override;
|
||||
virtual void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
|
||||
void setWellPathGeometry(RigWellPath* wellPathModel);
|
||||
|
||||
@ -158,7 +159,6 @@ private:
|
||||
|
||||
private:
|
||||
|
||||
virtual void defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName) override;
|
||||
static size_t simulationWellBranchCount(const QString& simWellName);
|
||||
|
||||
private:
|
||||
|
@ -22,10 +22,12 @@ RimWellPathTarget::RimWellPathTarget()
|
||||
, m_inclination(0.0)
|
||||
{
|
||||
|
||||
CAF_PDM_InitField(&m_isEnabled, "IsEnabled", true, "", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault(&m_targetType, "TargetType", "Type", "", "", "");
|
||||
m_targetType.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitFieldNoDefault(&m_targetPoint, "TargetPoint", "Point", "", "", "");
|
||||
CAF_PDM_InitField(&m_azimuth, "Azimuth", 0.0, "Azimuth", "", "", "");
|
||||
CAF_PDM_InitField(&m_inclination, "Inclination", 0.0, "Inclination", "", "", "");
|
||||
CAF_PDM_InitField(&m_azimuth, "Azimuth", 0.0, "Azi", "", "", "");
|
||||
CAF_PDM_InitField(&m_inclination, "Inclination", 0.0, "Inc", "", "", "");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -42,6 +42,7 @@ public:
|
||||
double inclination();
|
||||
|
||||
private:
|
||||
caf::PdmField<bool> m_isEnabled;
|
||||
caf::PdmField<caf::AppEnum<TargetTypeEnum> > m_targetType;
|
||||
caf::PdmField<cvf::Vec3d> m_targetPoint;
|
||||
caf::PdmField<double> m_azimuth;
|
||||
|
Loading…
Reference in New Issue
Block a user