diff --git a/ApplicationCode/Commands/CMakeLists_files.cmake b/ApplicationCode/Commands/CMakeLists_files.cmake index 4ca7189620..025ff74bce 100644 --- a/ApplicationCode/Commands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/CMakeLists_files.cmake @@ -31,6 +31,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionBoxFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicImportElementPropertyFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicSelectColorResult.h +${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogCurveFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicWellLogsImportFileFeature.h @@ -99,6 +100,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicHideIntersectionBoxFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportElementPropertyFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicSelectColorResult.cpp +${CMAKE_CURRENT_LIST_DIR}/RicAdd3dWellLogCurveFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicTogglePerspectiveViewFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicImportGeoMechCaseFeature.cpp diff --git a/ApplicationCode/Commands/RicAdd3dWellLogCurveFeature.cpp b/ApplicationCode/Commands/RicAdd3dWellLogCurveFeature.cpp new file mode 100644 index 0000000000..5adcb2190b --- /dev/null +++ b/ApplicationCode/Commands/RicAdd3dWellLogCurveFeature.cpp @@ -0,0 +1,63 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2018- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#include "RicAdd3dWellLogCurveFeature.h" + +#include "RiaApplication.h" + +#include "RicWellLogTools.h" + +#include "Rim3dWellLogCurve.h" +#include "RimCase.h" +#include "RimProject.h" +#include "RimWellPath.h" + +#include + +CAF_CMD_SOURCE_INIT(RicAdd3dWellLogCurveFeature, "RicAdd3dWellLogCurveFeature"); + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RicAdd3dWellLogCurveFeature::isCommandEnabled() +{ + std::vector cases; + RiaApplication::instance()->project()->allCases(cases); + if (cases.empty()) return false; + + return (RicWellLogTools::selectedWellPath() != nullptr); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicAdd3dWellLogCurveFeature::onActionTriggered(bool isChecked) +{ + Rim3dWellLogCurve* rim3dWellLogCurve = new Rim3dWellLogCurve; + + RicWellLogTools::selectedWellPath()->add3dWellLogCurve(rim3dWellLogCurve); +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicAdd3dWellLogCurveFeature::setupActionLook(QAction* actionToSetup) +{ + actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png")); + actionToSetup->setText("Add 3D Well Log Curve"); +} diff --git a/ApplicationCode/Commands/RicAdd3dWellLogCurveFeature.h b/ApplicationCode/Commands/RicAdd3dWellLogCurveFeature.h new file mode 100644 index 0000000000..ddc5cc4f4b --- /dev/null +++ b/ApplicationCode/Commands/RicAdd3dWellLogCurveFeature.h @@ -0,0 +1,34 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2018- 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 +// for more details. +// +///////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "cafCmdFeature.h" + +//================================================================================================== +/// +//================================================================================================== +class RicAdd3dWellLogCurveFeature : public caf::CmdFeature +{ + CAF_CMD_HEADER_INIT; + +protected: + virtual bool isCommandEnabled() override; + virtual void onActionTriggered( bool isChecked ) override; + virtual void setupActionLook( QAction* actionToSetup ) override; +}; diff --git a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp index aea3b55d4e..8a167f71e3 100644 --- a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -263,6 +263,10 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder.addSeparator(); + menuBuilder << "RicAdd3dWellLogCurveFeature"; + + menuBuilder.addSeparator(); + menuBuilder.subMenuStart("Completions", QIcon(":/FishBoneGroup16x16.png")); menuBuilder << "RicNewWellPathFractureFeature"; menuBuilder << "RicNewFishbonesSubsFeature"; diff --git a/ApplicationCode/ProjectDataModel/RimWellPath.cpp b/ApplicationCode/ProjectDataModel/RimWellPath.cpp index 3a39485916..de019a7298 100644 --- a/ApplicationCode/ProjectDataModel/RimWellPath.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellPath.cpp @@ -809,6 +809,7 @@ const RigWellPathFormations* RimWellPath::formationsGeometry() const void RimWellPath::add3dWellLogCurve(Rim3dWellLogCurve* rim3dWellLogCurve) { m_3dWellLogCurves.push_back(rim3dWellLogCurve); + updateConnectedEditors(); } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/UserInterface/RiuViewerCommands.cpp b/ApplicationCode/UserInterface/RiuViewerCommands.cpp index 61da1cef03..4b3af5efdc 100644 --- a/ApplicationCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationCode/UserInterface/RiuViewerCommands.cpp @@ -355,6 +355,10 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) menuBuilder.addSeparator(); + menuBuilder << "RicAdd3dWellLogCurveFeature"; + + menuBuilder.addSeparator(); + menuBuilder.subMenuStart("Completions", QIcon(":/FishBoneGroup16x16.png")); menuBuilder << "RicNewWellPathFractureAtPosFeature";