Skip to content

Commit

Permalink
#11689 Well Target Candidates: generate on well target clusters for s…
Browse files Browse the repository at this point in the history
…ingle case.
  • Loading branch information
kriben committed Sep 30, 2024
1 parent 13cf450 commit b760fce
Show file tree
Hide file tree
Showing 14 changed files with 1,265 additions and 8 deletions.
2 changes: 2 additions & 0 deletions ApplicationLibCode/Commands/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogCsvFileFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.h
${CMAKE_CURRENT_LIST_DIR}/RicNewWellTargetCandidatesGeneratorFeature.h
)

set(SOURCE_GROUP_SOURCE_FILES
Expand Down Expand Up @@ -196,6 +197,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RicImportWellLogOsduFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewViewForGridEnsembleFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewCustomVfpPlotFeature.cpp
${CMAKE_CURRENT_LIST_DIR}/RicNewWellTargetCandidatesGeneratorFeature.cpp
)

if(RESINSIGHT_USE_QT_CHARTS)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024 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 "RicNewWellTargetCandidatesGeneratorFeature.h"

#include "RimEclipseCaseEnsemble.h"
#include "RimWellTargetCandidatesGenerator.h"

#include "cafSelectionManagerTools.h"

#include <QAction>

CAF_CMD_SOURCE_INIT( RicNewWellTargetCandidatesGeneratorFeature, "RicNewWellTargetCandidatesGeneratorFeature" );

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellTargetCandidatesGeneratorFeature::onActionTriggered( bool isChecked )
{
auto ensembles = caf::selectedObjectsByTypeStrict<RimEclipseCaseEnsemble*>();
if ( ensembles.empty() ) return;

auto ensemble = ensembles.front();
ensemble->addWellTargetsGenerator( new RimWellTargetCandidatesGenerator() );
ensemble->updateConnectedEditors();
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellTargetCandidatesGeneratorFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Create Well Target Candidates Generator" );
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2024 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 RicNewWellTargetCandidatesGeneratorFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;

private:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};
2 changes: 2 additions & 0 deletions ApplicationLibCode/ProjectDataModel/CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimEclipseViewCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseEnsemble.h
${CMAKE_CURRENT_LIST_DIR}/RimCameraPosition.h
${CMAKE_CURRENT_LIST_DIR}/RimWellTargetCandidatesGenerator.h
)

set(SOURCE_GROUP_SOURCE_FILES
Expand Down Expand Up @@ -268,6 +269,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimEclipseViewCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimEclipseCaseEnsemble.cpp
${CMAKE_CURRENT_LIST_DIR}/RimCameraPosition.cpp
${CMAKE_CURRENT_LIST_DIR}/RimWellTargetCandidatesGenerator.cpp
)

if(RESINSIGHT_USE_QT_CHARTS)
Expand Down
12 changes: 12 additions & 0 deletions ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "RimEclipseCase.h"
#include "RimEclipseView.h"
#include "RimEclipseViewCollection.h"
#include "RimWellTargetCandidatesGenerator.h"

#include "cafCmdFeatureMenuBuilder.h"
#include "cafPdmFieldScriptingCapability.h"
Expand Down Expand Up @@ -50,6 +51,8 @@ RimEclipseCaseEnsemble::RimEclipseCaseEnsemble()
CAF_PDM_InitFieldNoDefault( &m_viewCollection, "ViewCollection", "Views" );
m_viewCollection = new RimEclipseViewCollection;

CAF_PDM_InitFieldNoDefault( &m_wellTargetGenerators, "WellTargetGenerators", "Well Target Candidates Generators" );

setDeletable( true );
}

Expand Down Expand Up @@ -169,6 +172,7 @@ void RimEclipseCaseEnsemble::fieldChangedByUi( const caf::PdmFieldHandle* change
void RimEclipseCaseEnsemble::appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const
{
menuBuilder << "RicNewViewForGridEnsembleFeature";
menuBuilder << "RicNewWellTargetCandidatesGeneratorFeature";
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -178,3 +182,11 @@ RimEclipseViewCollection* RimEclipseCaseEnsemble::viewCollection() const
{
return m_viewCollection;
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimEclipseCaseEnsemble::addWellTargetsGenerator( RimWellTargetCandidatesGenerator* generator )
{
m_wellTargetGenerators.push_back( generator );
}
12 changes: 8 additions & 4 deletions ApplicationLibCode/ProjectDataModel/RimEclipseCaseEnsemble.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class RimCaseCollection;
class RimEclipseCase;
class RimEclipseView;
class RimEclipseViewCollection;
class RimWellTargetCandidatesGenerator;

//==================================================================================================
//
Expand All @@ -54,14 +55,17 @@ class RimEclipseCaseEnsemble : public RimNamedObject

RimEclipseViewCollection* viewCollection() const;

void addWellTargetsGenerator( RimWellTargetCandidatesGenerator* generator );

protected:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
void appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const override;

private:
caf::PdmField<int> m_groupId;
caf::PdmChildField<RimCaseCollection*> m_caseCollection;
caf::PdmChildField<RimEclipseViewCollection*> m_viewCollection;
caf::PdmPtrField<RimEclipseCase*> m_selectedCase;
caf::PdmField<int> m_groupId;
caf::PdmChildField<RimCaseCollection*> m_caseCollection;
caf::PdmChildField<RimEclipseViewCollection*> m_viewCollection;
caf::PdmChildArrayField<RimWellTargetCandidatesGenerator*> m_wellTargetGenerators;
caf::PdmPtrField<RimEclipseCase*> m_selectedCase;
};
Loading

0 comments on commit b760fce

Please sign in to comment.