diff --git a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake index 13163351b8..d3ab43480f 100644 --- a/ApplicationCode/ModelVisualization/CMakeLists_files.cmake +++ b/ApplicationCode/ModelVisualization/CMakeLists_files.cmake @@ -35,6 +35,7 @@ ${CEE_CURRENT_LIST_DIR}RivScalarMapperUtils.h ${CEE_CURRENT_LIST_DIR}RivCellEdgeGeometryUtils.h ${CEE_CURRENT_LIST_DIR}RivPipeQuadToSegmentMapper.h ${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.h +${CEE_CURRENT_LIST_DIR}RivWellPipeSourceInfo.h ) set (SOURCE_GROUP_SOURCE_FILES @@ -66,7 +67,7 @@ ${CEE_CURRENT_LIST_DIR}RivScalarMapperUtils.cpp ${CEE_CURRENT_LIST_DIR}RivCellEdgeGeometryUtils.cpp ${CEE_CURRENT_LIST_DIR}RivPipeQuadToSegmentMapper.cpp ${CEE_CURRENT_LIST_DIR}RivSingleCellPartGenerator.cpp - +${CEE_CURRENT_LIST_DIR}RivWellPipeSourceInfo.cpp ) list(APPEND CODE_HEADER_FILES diff --git a/ApplicationCode/ModelVisualization/RivWellPipeSourceInfo.cpp b/ApplicationCode/ModelVisualization/RivWellPipeSourceInfo.cpp new file mode 100644 index 0000000000..2e90f699bb --- /dev/null +++ b/ApplicationCode/ModelVisualization/RivWellPipeSourceInfo.cpp @@ -0,0 +1,39 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- Ceetron Solutions AS +// +// 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 "RivWellPipeSourceInfo.h" + +#include "RimEclipseWell.h" + + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RivEclipseWellSourceInfo::RivEclipseWellSourceInfo(RimEclipseWell* eclipseWell) + : m_eclipseWell(eclipseWell) +{ +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +RimEclipseWell* RivEclipseWellSourceInfo::well() const +{ + return m_eclipseWell.p(); +} diff --git a/ApplicationCode/ModelVisualization/RivWellPipeSourceInfo.h b/ApplicationCode/ModelVisualization/RivWellPipeSourceInfo.h new file mode 100644 index 0000000000..41472b6dd1 --- /dev/null +++ b/ApplicationCode/ModelVisualization/RivWellPipeSourceInfo.h @@ -0,0 +1,37 @@ +///////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2015- Statoil ASA +// Copyright (C) 2015- Ceetron Solutions AS +// +// 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 "cvfBase.h" +#include "cvfObject.h" +#include "cafPdmPointer.h" + +class RimEclipseWell; + +class RivEclipseWellSourceInfo : public cvf::Object +{ +public: + RivEclipseWellSourceInfo(RimEclipseWell* eclipseWell); + + RimEclipseWell* well() const; + +private: + caf::PdmPointer m_eclipseWell; +}; diff --git a/ApplicationCode/ModelVisualization/RivWellPipesPartMgr.cpp b/ApplicationCode/ModelVisualization/RivWellPipesPartMgr.cpp index 5372356ff4..b326f2a4a1 100644 --- a/ApplicationCode/ModelVisualization/RivWellPipesPartMgr.cpp +++ b/ApplicationCode/ModelVisualization/RivWellPipesPartMgr.cpp @@ -20,34 +20,35 @@ #include "RivWellPipesPartMgr.h" -#include "cvfLibCore.h" -#include "cvfModelBasicList.h" -#include "cvfTransform.h" -#include "cvfPart.h" -#include "cvfScalarMapperDiscreteLinear.h" -#include "cvfDrawableGeo.h" -#include "cvfRay.h" - -#include "cafEffectGenerator.h" -#include "cafPdmFieldCvfColor.h" -#include "cafPdmFieldCvfMat4d.h" - #include "RigCaseData.h" #include "RigCell.h" -#include "RivPipeGeometryGenerator.h" +#include "Rim3dOverlayInfoConfig.h" +#include "RimCellEdgeColors.h" +#include "RimCellRangeFilterCollection.h" #include "RimEclipseCase.h" +#include "RimEclipseCellColors.h" +#include "RimEclipsePropertyFilterCollection.h" #include "RimEclipseView.h" #include "RimEclipseWell.h" #include "RimEclipseWellCollection.h" #include "RimReservoirCellResultsStorage.h" -#include "RimEclipseCellColors.h" -#include "RimCellEdgeColors.h" -#include "RimCellRangeFilterCollection.h" -#include "RimEclipsePropertyFilterCollection.h" -#include "Rim3dOverlayInfoConfig.h" +#include "RivPipeGeometryGenerator.h" +#include "RivWellPathSourceInfo.h" +#include "RivWellPipeSourceInfo.h" +#include "cafEffectGenerator.h" +#include "cafPdmFieldCvfColor.h" +#include "cafPdmFieldCvfMat4d.h" + +#include "cvfDrawableGeo.h" +#include "cvfLibCore.h" +#include "cvfModelBasicList.h" +#include "cvfPart.h" +#include "cvfRay.h" +#include "cvfScalarMapperDiscreteLinear.h" +#include "cvfTransform.h" //-------------------------------------------------------------------------------------------------- @@ -105,6 +106,8 @@ void RivWellPipesPartMgr::buildWellPipeParts() double characteristicCellSize = m_rimReservoirView->eclipseCase()->reservoirData()->mainGrid()->characteristicIJCellSize(); double pipeRadius = m_rimReservoirView->wellCollection()->pipeRadiusScaleFactor() *m_rimWell->pipeRadiusScaleFactor() * characteristicCellSize; + cvf::ref sourceInfo = new RivEclipseWellSourceInfo(m_rimWell); + for (size_t brIdx = 0; brIdx < pipeBranchesCellIds.size(); ++brIdx) { m_wellBranches.push_back(RivPipeBranchData()); @@ -145,6 +148,8 @@ void RivWellPipesPartMgr::buildWellPipeParts() cvf::ref eff = surfaceGen.generateCachedEffect(); pbd.m_surfacePart->setEffect(eff.p()); + + pbd.m_surfacePart->setSourceInfo(sourceInfo.p()); } if (pbd.m_centerLineDrawable.notNull()) diff --git a/ApplicationCode/UserInterface/RiuViewerCommands.cpp b/ApplicationCode/UserInterface/RiuViewerCommands.cpp index 5dff91acd6..567bf582a4 100644 --- a/ApplicationCode/UserInterface/RiuViewerCommands.cpp +++ b/ApplicationCode/UserInterface/RiuViewerCommands.cpp @@ -23,6 +23,7 @@ #include "RicGeoMechPropertyFilterNewExec.h" #include "RicRangeFilterNewExec.h" +#include "CrossSectionCommands/RicNewSimWellCrossSectionFeature.h" #include "CrossSectionCommands/RicNewWellPathCrossSectionFeature.h" #include "WellLogCommands/RicNewWellLogCurveExtractionFeature.h" #include "WellLogCommands/RicNewWellLogFileCurveFeature.h" @@ -40,6 +41,7 @@ #include "RimEclipsePropertyFilter.h" #include "RimEclipsePropertyFilterCollection.h" #include "RimEclipseView.h" +#include "RimEclipseWell.h" #include "RimFaultCollection.h" #include "RimGeoMechCase.h" #include "RimGeoMechCellColors.h" @@ -63,11 +65,13 @@ #include "RivFemPickSourceInfo.h" #include "RivSourceInfo.h" #include "RivWellPathSourceInfo.h" +#include "RivWellPipeSourceInfo.h" #include "cafCmdExecCommandManager.h" #include "cafCmdFeature.h" #include "cafCmdFeatureManager.h" #include "cafPdmUiTreeView.h" +#include "cafSelectionManager.h" #include "cvfDrawableGeo.h" #include "cvfHitItemCollection.h" @@ -221,13 +225,14 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) // Well log curve creation commands if (firstHitPart && firstHitPart->sourceInfo()) { + caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance(); + const RivWellPathSourceInfo* wellPathSourceInfo = dynamic_cast(firstHitPart->sourceInfo()); if (wellPathSourceInfo) { RimWellPath* wellPath = wellPathSourceInfo->wellPath(); if (wellPath) { - caf::CmdFeatureManager* commandManager = caf::CmdFeatureManager::instance(); RicNewWellLogFileCurveFeature* newWellLogFileCurveFeature = dynamic_cast(commandManager->getCommandFeature("RicNewWellLogFileCurveFeature")); if (newWellLogFileCurveFeature && newWellLogFileCurveFeature->canFeatureBeExecuted()) @@ -250,6 +255,22 @@ void RiuViewerCommands::displayContextMenu(QMouseEvent* event) } } } + + const RivEclipseWellSourceInfo* eclipseWellSourceInfo = dynamic_cast(firstHitPart->sourceInfo()); + if (eclipseWellSourceInfo) + { + RimEclipseWell* well = eclipseWellSourceInfo->well(); + if (well) + { + caf::SelectionManager::instance()->setSelectedItem(well); + + RicNewSimWellCrossSectionFeature* newSimWellCrossSectionFeature = dynamic_cast(commandManager->getCommandFeature("RicNewSimWellCrossSectionFeature")); + if (newSimWellCrossSectionFeature && newSimWellCrossSectionFeature->canFeatureBeExecuted()) + { + menu.addAction(newSimWellCrossSectionFeature->action()); + } + } + } } // View Link commands