#4665 Implement a Well Bore Stability Plot class

* Trigger updates when Ui fields are changed
  * Show only WBS parameter options that have available data
  * Clang-format WBS stuff
This commit is contained in:
Gaute Lindkvist
2019-09-05 12:24:45 +02:00
parent e550b435e4
commit 129df990ae
12 changed files with 1529 additions and 937 deletions

View File

@@ -1,42 +1,42 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewWellBoreStabilityPlotFeature.h"
#include "RicNewWellLogPlotFeatureImpl.h"
#include "RicNewWellLogFileCurveFeature.h"
#include "RicNewWellLogCurveExtractionFeature.h"
#include "RicNewWellLogFileCurveFeature.h"
#include "RicNewWellLogPlotFeatureImpl.h"
#include "RicWellLogTools.h"
#include "RigFemResultAddress.h"
#include "RigFemPartResultsCollection.h"
#include "RigFemResultAddress.h"
#include "RigGeoMechCaseData.h"
#include "RigWellPath.h"
#include "RimGeoMechCase.h"
#include "RimGeoMechView.h"
#include "RimProject.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellBoreStabilityPlot.h"
#include "RimWellLogExtractionCurve.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileCurve.h"
#include "RimWellLogFileChannel.h"
#include "RimWellLogFileCurve.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellPath.h"
#include "RicWellLogTools.h"
@@ -44,10 +44,10 @@
#include "RiaApplication.h"
#include "cvfAssert.h"
#include "cvfMath.h"
#include "cafProgressInfo.h"
#include "cafSelectionManager.h"
#include "cvfAssert.h"
#include "cvfMath.h"
#include <QAction>
#include <QDateTime>
@@ -55,168 +55,187 @@
#include <algorithm>
CAF_CMD_SOURCE_INIT(RicNewWellBoreStabilityPlotFeature, "RicNewWellBoreStabilityPlotFeature");
CAF_CMD_SOURCE_INIT( RicNewWellBoreStabilityPlotFeature, "RicNewWellBoreStabilityPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellBoreStabilityPlotFeature::isCommandEnabled()
{
{
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if (!view) return false;
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(view);
return geoMechView != nullptr;
if ( !view ) return false;
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( view );
return geoMechView != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::onActionTriggered(bool isChecked)
void RicNewWellBoreStabilityPlotFeature::onActionTriggered( bool isChecked )
{
RimWellPath* wellPath = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPath>();
RimWellLogPlotCollection* plotCollection = caf::SelectionManager::instance()->selectedItemOfType<RimWellLogPlotCollection>();
if (!wellPath)
RimWellPath* wellPath = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPath>();
RimWellLogPlotCollection* plotCollection = caf::SelectionManager::instance()
->selectedItemOfType<RimWellLogPlotCollection>();
if ( !wellPath )
{
if (plotCollection)
if ( plotCollection )
{
RimProject* project = nullptr;
plotCollection->firstAncestorOrThisOfTypeAsserted(project);
plotCollection->firstAncestorOrThisOfTypeAsserted( project );
std::vector<RimWellPath*> allWellPaths;
project->descendantsIncludingThisOfType(allWellPaths);
if (!allWellPaths.empty())
project->descendantsIncludingThisOfType( allWellPaths );
if ( !allWellPaths.empty() )
{
wellPath = allWellPaths.front();
}
}
}
if (!wellPath)
if ( !wellPath )
{
return;
}
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if (!view) return;
if ( !view ) return;
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>(view);
if (!geoMechView) return;
RimGeoMechView* geoMechView = dynamic_cast<RimGeoMechView*>( view );
if ( !geoMechView ) return;
caf::ProgressInfo progInfo(100, "Creating Well Bore Stability Plot");
caf::ProgressInfo progInfo( 100, "Creating Well Bore Stability Plot" );
RimGeoMechCase* geoMechCase = geoMechView->geoMechCase();
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot(false, "Well Bore Stability");
RimGeoMechCase* geoMechCase = geoMechView->geoMechCase();
RimWellBoreStabilityPlot* plot = RicNewWellLogPlotFeatureImpl::createWellBoreStabilityPlot( false,
"Well Bore Stability" );
{
auto task = progInfo.task("Creating formation track", 2);
createFormationTrack(plot, wellPath, geoMechCase);
}
{
auto task = progInfo.task("Creating well design track", 3);
createCasingShoeTrack(plot, wellPath, geoMechCase);
auto task = progInfo.task( "Creating formation track", 2 );
createFormationTrack( plot, wellPath, geoMechCase );
}
{
auto task = progInfo.task("Creating stability curves track", 75);
createStabilityCurvesTrack(plot, wellPath, geoMechView);
auto task = progInfo.task( "Creating well design track", 3 );
createCasingShoeTrack( plot, wellPath, geoMechCase );
}
{
auto task = progInfo.task("Creating angles track", 15);
createAnglesTrack(plot, wellPath, geoMechView);
auto task = progInfo.task( "Creating stability curves track", 75 );
createStabilityCurvesTrack( plot, wellPath, geoMechView );
}
{
auto task = progInfo.task("Updating all tracks", 5);
plot->enableAllAutoNameTags(true);
plot->setPlotTitleVisible(true);
plot->setTrackLegendsVisible(true);
plot->setTrackLegendsHorizontal(true);
plot->setDepthType(RimWellLogPlot::TRUE_VERTICAL_DEPTH);
plot->setDepthAutoZoom(true);
RicNewWellLogPlotFeatureImpl::updateAfterCreation(plot);
auto task = progInfo.task( "Creating angles track", 15 );
createAnglesTrack( plot, wellPath, geoMechView );
}
RiuPlotMainWindowTools::selectAsCurrentItem(plot);
{
auto task = progInfo.task( "Updating all tracks", 5 );
plot->enableAllAutoNameTags( true );
plot->setPlotTitleVisible( true );
plot->setTrackLegendsVisible( true );
plot->setTrackLegendsHorizontal( true );
plot->setDepthType( RimWellLogPlot::TRUE_VERTICAL_DEPTH );
plot->setDepthAutoZoom( true );
RicNewWellLogPlotFeatureImpl::updateAfterCreation( plot );
}
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
// Make sure the summary plot window is visible
RiuPlotMainWindowTools::showPlotMainWindow();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::setupActionLook(QAction* actionToSetup)
void RicNewWellBoreStabilityPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("New Well Bore Stability Plot");
actionToSetup->setIcon(QIcon(":/WellLogPlot16x16.png"));
actionToSetup->setText( "New Well Bore Stability Plot" );
actionToSetup->setIcon( QIcon( ":/WellLogPlot16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::createFormationTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase)
void RicNewWellBoreStabilityPlotFeature::createFormationTrack( RimWellBoreStabilityPlot* plot,
RimWellPath* wellPath,
RimGeoMechCase* geoMechCase )
{
RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(false, "Formations", plot);
formationTrack->setFormationWellPath(wellPath);
formationTrack->setFormationCase(geoMechCase);
formationTrack->setShowFormations(true);
formationTrack->setVisibleXRange(0.0, 0.0);
formationTrack->setWidthScaleFactor(RimWellLogTrack::NARROW_TRACK);
RimWellLogTrack* formationTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Formations", plot );
formationTrack->setFormationWellPath( wellPath );
formationTrack->setFormationCase( geoMechCase );
formationTrack->setShowFormations( true );
formationTrack->setVisibleXRange( 0.0, 0.0 );
formationTrack->setWidthScaleFactor( RimWellLogTrack::NARROW_TRACK );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase)
void RicNewWellBoreStabilityPlotFeature::createCasingShoeTrack( RimWellBoreStabilityPlot* plot,
RimWellPath* wellPath,
RimGeoMechCase* geoMechCase )
{
RimWellLogTrack* casingShoeTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(false, "Well Design", plot);
casingShoeTrack->setWidthScaleFactor(RimWellLogTrack::NARROW_TRACK);
casingShoeTrack->setFormationWellPath(wellPath);
casingShoeTrack->setFormationCase(geoMechCase);
casingShoeTrack->setShowFormations(true);
casingShoeTrack->setShowFormationLabels(false);
casingShoeTrack->setShowWellPathAttributes(true);
casingShoeTrack->setWellPathAttributesSource(wellPath);
casingShoeTrack->setVisibleXRange(0.0, 0.0);
casingShoeTrack->setAutoScaleXEnabled(true);
casingShoeTrack->loadDataAndUpdate();
RimWellLogTrack* casingShoeTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false, "Well Design", plot );
casingShoeTrack->setWidthScaleFactor( RimWellLogTrack::NARROW_TRACK );
casingShoeTrack->setFormationWellPath( wellPath );
casingShoeTrack->setFormationCase( geoMechCase );
casingShoeTrack->setShowFormations( true );
casingShoeTrack->setShowFormationLabels( false );
casingShoeTrack->setShowWellPathAttributes( true );
casingShoeTrack->setWellPathAttributesSource( wellPath );
casingShoeTrack->setVisibleXRange( 0.0, 0.0 );
casingShoeTrack->setAutoScaleXEnabled( true );
casingShoeTrack->loadDataAndUpdate();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechView* geoMechView)
void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack( RimWellBoreStabilityPlot* plot,
RimWellPath* wellPath,
RimGeoMechView* geoMechView )
{
RimWellLogTrack* stabilityCurvesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(false, "Stability Curves", plot);
stabilityCurvesTrack->setWidthScaleFactor(RimWellLogTrack::EXTRA_WIDE_TRACK);
stabilityCurvesTrack->setAutoScaleXEnabled(true);
stabilityCurvesTrack->setTickIntervals(0.5, 0.05);
stabilityCurvesTrack->setXAxisGridVisibility(RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR);
stabilityCurvesTrack->setFormationWellPath(wellPath);
stabilityCurvesTrack->setFormationCase(geoMechView->geoMechCase());
stabilityCurvesTrack->setShowFormations(true);
stabilityCurvesTrack->setShowFormationLabels(false);
RimWellLogTrack* stabilityCurvesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false,
"Stability Curves",
plot );
stabilityCurvesTrack->setWidthScaleFactor( RimWellLogTrack::EXTRA_WIDE_TRACK );
stabilityCurvesTrack->setAutoScaleXEnabled( true );
stabilityCurvesTrack->setTickIntervals( 0.5, 0.05 );
stabilityCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
stabilityCurvesTrack->setFormationWellPath( wellPath );
stabilityCurvesTrack->setFormationCase( geoMechView->geoMechCase() );
stabilityCurvesTrack->setShowFormations( true );
stabilityCurvesTrack->setShowFormationLabels( false );
std::vector<QString> resultNames = RiaDefines::wellPathStabilityResultNames();
std::vector<cvf::Color3f> colors = { cvf::Color3f::RED, cvf::Color3f::PURPLE, cvf::Color3f::GREEN, cvf::Color3f::BLUE, cvf::Color3f::ORANGE };
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = { RiuQwtPlotCurve::STYLE_SOLID, RiuQwtPlotCurve::STYLE_DASH, RiuQwtPlotCurve::STYLE_DASH_DOT, RiuQwtPlotCurve::STYLE_SOLID, RiuQwtPlotCurve::STYLE_DASH};
for (size_t i = 0; i < resultNames.size(); ++i)
std::vector<cvf::Color3f> colors = {cvf::Color3f::RED,
cvf::Color3f::PURPLE,
cvf::Color3f::GREEN,
cvf::Color3f::BLUE,
cvf::Color3f::ORANGE};
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = {RiuQwtPlotCurve::STYLE_SOLID,
RiuQwtPlotCurve::STYLE_DASH,
RiuQwtPlotCurve::STYLE_DASH_DOT,
RiuQwtPlotCurve::STYLE_SOLID,
RiuQwtPlotCurve::STYLE_DASH};
for ( size_t i = 0; i < resultNames.size(); ++i )
{
const QString& resultName = resultNames[i];
RigFemResultAddress resAddr(RIG_WELLPATH_DERIVED, resultName.toStdString(), "");
RimWellLogExtractionCurve* curve = RicWellLogTools::addExtractionCurve(stabilityCurvesTrack, geoMechView, wellPath, nullptr, 0, false, false);
curve->setGeoMechResultAddress(resAddr);
curve->setCurrentTimeStep(geoMechView->currentTimeStep());
curve->setCustomName(resultName);
curve->setColor(colors[i % colors.size()]);
curve->setLineStyle(lineStyles[i % lineStyles.size()]);
curve->setLineThickness(2);
curve->loadDataAndUpdate(false);
const QString& resultName = resultNames[i];
RigFemResultAddress resAddr( RIG_WELLPATH_DERIVED, resultName.toStdString(), "" );
RimWellLogExtractionCurve* curve =
RicWellLogTools::addExtractionCurve( stabilityCurvesTrack, geoMechView, wellPath, nullptr, 0, false, false );
curve->setGeoMechResultAddress( resAddr );
curve->setCurrentTimeStep( geoMechView->currentTimeStep() );
curve->setCustomName( resultName );
curve->setColor( colors[i % colors.size()] );
curve->setLineStyle( lineStyles[i % lineStyles.size()] );
curve->setLineThickness( 2 );
curve->loadDataAndUpdate( false );
}
stabilityCurvesTrack->calculateXZoomRangeAndUpdateQwt();
}
@@ -224,51 +243,56 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack(RimWellLogPl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::createAnglesTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechView* geoMechView)
void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellBoreStabilityPlot* plot,
RimWellPath* wellPath,
RimGeoMechView* geoMechView )
{
RimWellLogTrack* wellPathAnglesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(false, "Well Path Angles", plot);
double minValue = 360.0, maxValue = 0.0;
const double angleIncrement = 90.0;
std::vector<QString> resultNames = RiaDefines::wellPathAngleResultNames();
std::vector<cvf::Color3f> colors = { cvf::Color3f::DARK_RED, cvf::Color3f::BLUE };
RimWellLogTrack* wellPathAnglesTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( false,
"Well Path Angles",
plot );
double minValue = 360.0, maxValue = 0.0;
const double angleIncrement = 90.0;
std::vector<QString> resultNames = RiaDefines::wellPathAngleResultNames();
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = { RiuQwtPlotCurve::STYLE_SOLID, RiuQwtPlotCurve::STYLE_DASH };
std::vector<cvf::Color3f> colors = {cvf::Color3f::DARK_RED, cvf::Color3f::BLUE};
for (size_t i = 0; i < resultNames.size(); ++i)
std::vector<RiuQwtPlotCurve::LineStyleEnum> lineStyles = {RiuQwtPlotCurve::STYLE_SOLID, RiuQwtPlotCurve::STYLE_DASH};
for ( size_t i = 0; i < resultNames.size(); ++i )
{
const QString& resultName = resultNames[i];
RigFemResultAddress resAddr(RIG_WELLPATH_DERIVED, resultName.toStdString(), "");
RimWellLogExtractionCurve* curve = RicWellLogTools::addExtractionCurve(wellPathAnglesTrack, geoMechView, wellPath, nullptr, 0, false, false);
curve->setGeoMechResultAddress(resAddr);
curve->setCurrentTimeStep(geoMechView->currentTimeStep());
curve->setCustomName(resultName);
const QString& resultName = resultNames[i];
RigFemResultAddress resAddr( RIG_WELLPATH_DERIVED, resultName.toStdString(), "" );
RimWellLogExtractionCurve* curve =
RicWellLogTools::addExtractionCurve( wellPathAnglesTrack, geoMechView, wellPath, nullptr, 0, false, false );
curve->setGeoMechResultAddress( resAddr );
curve->setCurrentTimeStep( geoMechView->currentTimeStep() );
curve->setCustomName( resultName );
curve->setColor(colors[i % colors.size()]);
curve->setLineStyle(lineStyles[i % lineStyles.size()]);
curve->setLineThickness(2);
curve->setColor( colors[i % colors.size()] );
curve->setLineStyle( lineStyles[i % lineStyles.size()] );
curve->setLineThickness( 2 );
curve->loadDataAndUpdate( false );
curve->loadDataAndUpdate(false);
double actualMinValue = minValue, actualMaxValue = maxValue;
curve->valueRange(&actualMinValue, &actualMaxValue);
while (maxValue < actualMaxValue)
curve->valueRange( &actualMinValue, &actualMaxValue );
while ( maxValue < actualMaxValue )
{
maxValue += angleIncrement;
}
while (minValue > actualMinValue)
while ( minValue > actualMinValue )
{
minValue -= angleIncrement;
}
maxValue = cvf::Math::clamp(maxValue, angleIncrement, 360.0);
minValue = cvf::Math::clamp(minValue, 0.0, maxValue - 90.0);
maxValue = cvf::Math::clamp( maxValue, angleIncrement, 360.0 );
minValue = cvf::Math::clamp( minValue, 0.0, maxValue - 90.0 );
}
wellPathAnglesTrack->setWidthScaleFactor(RimWellLogTrack::NORMAL_TRACK);
wellPathAnglesTrack->setVisibleXRange(minValue, maxValue);
wellPathAnglesTrack->setTickIntervals(90.0, 30.0);
wellPathAnglesTrack->setXAxisGridVisibility(RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR);
wellPathAnglesTrack->setFormationWellPath(wellPath);
wellPathAnglesTrack->setFormationCase(geoMechView->geoMechCase());
wellPathAnglesTrack->setShowFormations(true);
wellPathAnglesTrack->setShowFormationLabels(false);
wellPathAnglesTrack->setWidthScaleFactor( RimWellLogTrack::NORMAL_TRACK );
wellPathAnglesTrack->setVisibleXRange( minValue, maxValue );
wellPathAnglesTrack->setTickIntervals( 90.0, 30.0 );
wellPathAnglesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
wellPathAnglesTrack->setFormationWellPath( wellPath );
wellPathAnglesTrack->setFormationCase( geoMechView->geoMechCase() );
wellPathAnglesTrack->setShowFormations( true );
wellPathAnglesTrack->setShowFormationLabels( false );
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,11 +22,11 @@
class RimGeoMechCase;
class RimGeoMechView;
class RimWellLogPlot;
class RimWellBoreStabilityPlot;
class RimWellPath;
//==================================================================================================
///
///
//==================================================================================================
class RicNewWellBoreStabilityPlotFeature : public caf::CmdFeature
{
@@ -39,8 +39,8 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
void createFormationTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase);
void createCasingShoeTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase);
void createStabilityCurvesTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechView* geoMechCase);
void createAnglesTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechView* geoMechView);
void createFormationTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase );
void createCasingShoeTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechCase* geoMechCase );
void createStabilityCurvesTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechView* geoMechCase );
void createAnglesTrack( RimWellBoreStabilityPlot* plot, RimWellPath* wellPath, RimGeoMechView* geoMechView );
};

View File

@@ -2,17 +2,17 @@
//
// 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,6 +21,7 @@
#include "RimMainPlotCollection.h"
#include "RimProject.h"
#include "RimWellBoreStabilityPlot.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
@@ -32,31 +33,34 @@
#include <QString>
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot(bool showAfterCreation, const QString& plotDescription)
RimWellBoreStabilityPlot*
RicNewWellLogPlotFeatureImpl::createWellBoreStabilityPlot( bool showAfterCreation /*= true*/,
const QString& plotDescription /*= QString("")*/ )
{
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
CVF_ASSERT(wellLogPlotColl);
CVF_ASSERT( wellLogPlotColl );
// Make sure the summary plot window is created
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RimWellLogPlot* plot = new RimWellLogPlot();
RimWellBoreStabilityPlot* plot = new RimWellBoreStabilityPlot();
plot->setAsPlotMdiWindow();
wellLogPlotColl->wellLogPlots().push_back(plot);
if (!plotDescription.isEmpty())
wellLogPlotColl->wellLogPlots().push_back( plot );
if ( !plotDescription.isEmpty() )
{
plot->setDescription(plotDescription);
plot->setDescription( plotDescription );
}
else
{
plot->setDescription(QString("Well Log Plot %1").arg(wellLogPlotCollection()->wellLogPlots.size()));
plot->setDescription(
QString( "Well Bore Stability Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
}
if (showAfterCreation)
if ( showAfterCreation )
{
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
}
@@ -65,30 +69,65 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot(bool showAfterCr
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(bool updateAfter, const QString& trackDescription, RimWellLogPlot* existingPlot)
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterCreation, const QString& plotDescription )
{
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
CVF_ASSERT( wellLogPlotColl );
// Make sure the summary plot window is created
RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RimWellLogPlot* plot = new RimWellLogPlot();
plot->setAsPlotMdiWindow();
wellLogPlotColl->wellLogPlots().push_back( plot );
if ( !plotDescription.isEmpty() )
{
plot->setDescription( plotDescription );
}
else
{
plot->setDescription( QString( "Well Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
}
if ( showAfterCreation )
{
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
}
return plot;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack( bool updateAfter,
const QString& trackDescription,
RimWellLogPlot* existingPlot )
{
RimWellLogPlot* plot = existingPlot;
if (plot == nullptr)
if ( plot == nullptr )
{
plot = createWellLogPlot();
}
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plot->addTrack(plotTrack);
if (!trackDescription.isEmpty())
plot->addTrack( plotTrack );
if ( !trackDescription.isEmpty() )
{
plotTrack->setDescription(trackDescription);
plotTrack->setDescription( trackDescription );
}
else
{
plotTrack->setDescription(QString("Track %1").arg(plot->trackCount()));
plotTrack->setDescription( QString( "Track %1" ).arg( plot->trackCount() ) );
}
if (updateAfter)
if ( updateAfter )
{
updateAfterCreation(plot);
updateAfterCreation( plot );
}
return plotTrack;
@@ -97,9 +136,9 @@ RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(bool updat
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotFeatureImpl::updateAfterCreation(RimWellLogPlot* plot)
void RicNewWellLogPlotFeatureImpl::updateAfterCreation( RimWellLogPlot* plot )
{
CVF_ASSERT(plot);
CVF_ASSERT( plot );
plot->loadDataAndUpdate();
plot->updateDepthZoom();
plot->updateConnectedEditors();
@@ -107,18 +146,18 @@ void RicNewWellLogPlotFeatureImpl::updateAfterCreation(RimWellLogPlot* plot)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlotCollection* RicNewWellLogPlotFeatureImpl::wellLogPlotCollection()
{
RimProject* project = RiaApplication::instance()->project();
CVF_ASSERT(project);
CVF_ASSERT( project );
RimMainPlotCollection* mainPlotColl = project->mainPlotCollection();
CVF_ASSERT(mainPlotColl);
CVF_ASSERT( mainPlotColl );
RimWellLogPlotCollection* wellLogPlotColl = mainPlotColl->wellLogPlotCollection();
CVF_ASSERT(wellLogPlotColl);
CVF_ASSERT( wellLogPlotColl );
return mainPlotColl->wellLogPlotCollection();
}

View File

@@ -2,17 +2,17 @@
//
// 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,19 +21,26 @@
#include <QString>
class RimWellBoreStabilityPlot;
class RimWellLogPlotCollection;
class RimWellLogPlot;
class RimWellLogTrack;
//==================================================================================================
///
///
//==================================================================================================
class RicNewWellLogPlotFeatureImpl
{
public:
static RimWellLogPlot* createWellLogPlot(bool showAfterCreation = true, const QString& plotDescription = QString(""));
static RimWellLogTrack* createWellLogPlotTrack(bool updateAfterCreation = true, const QString& trackDescription = QString(""), RimWellLogPlot* existingPlot = nullptr);
static void updateAfterCreation(RimWellLogPlot* plot);
static RimWellBoreStabilityPlot* createWellBoreStabilityPlot( bool showAfterCreation = true,
const QString& plotDescription = QString( "" ) );
static RimWellLogPlot* createWellLogPlot( bool showAfterCreation = true,
const QString& plotDescription = QString( "" ) );
static RimWellLogTrack* createWellLogPlotTrack( bool updateAfterCreation = true,
const QString& trackDescription = QString( "" ),
RimWellLogPlot* existingPlot = nullptr );
static void updateAfterCreation( RimWellLogPlot* plot );
private:
static RimWellLogPlotCollection* wellLogPlotCollection();
};