Merge branch 'dev' into system-refactor-welllogplot

This commit is contained in:
Gaute Lindkvist committed 2019-09-06 13:44:20 +02:00
commit ff42e8b1be
2065 files changed
+114267 -108283

No files matched your search

@@ -29,7 +29,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(Ric3dWellLogCurveDeleteFeature, "Ric3dWellLogCurveDeleteFeature");
CAF_CMD_SOURCE_INIT( Ric3dWellLogCurveDeleteFeature, "Ric3dWellLogCurveDeleteFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -37,9 +37,9 @@ CAF_CMD_SOURCE_INIT(Ric3dWellLogCurveDeleteFeature, "Ric3dWellLogCurveDeleteFeat
bool Ric3dWellLogCurveDeleteFeature::isCommandEnabled()
{
std::vector<Rim3dWellLogCurve*> objects;
caf::SelectionManager::instance()->objectsByType(&objects);
caf::SelectionManager::instance()->objectsByType( &objects );
if (objects.size() > 0)
if ( objects.size() > 0 )
{
return true;
}
@@ -50,22 +50,22 @@ bool Ric3dWellLogCurveDeleteFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Ric3dWellLogCurveDeleteFeature::onActionTriggered(bool isChecked)
void Ric3dWellLogCurveDeleteFeature::onActionTriggered( bool isChecked )
{
std::vector<Rim3dWellLogCurve*> objects;
caf::SelectionManager::instance()->objectsByType(&objects);
caf::SelectionManager::instance()->objectsByType( &objects );
if (objects.size() == 0) return;
if ( objects.size() == 0 ) return;
Rim3dWellLogCurve* firstCurve = objects[0];
Rim3dWellLogCurveCollection* curveCollection = nullptr;
firstCurve->firstAncestorOrThisOfType(curveCollection);
if (!curveCollection) return;
firstCurve->firstAncestorOrThisOfType( curveCollection );
if ( !curveCollection ) return;
for (Rim3dWellLogCurve* curve : objects)
for ( Rim3dWellLogCurve* curve : objects )
{
curveCollection->remove3dWellLogCurve(curve);
curveCollection->remove3dWellLogCurve( curve );
delete curve;
}
curveCollection->redrawAffectedViewsAndEditors();
@@ -74,9 +74,9 @@ void Ric3dWellLogCurveDeleteFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void Ric3dWellLogCurveDeleteFeature::setupActionLook(QAction* actionToSetup)
void Ric3dWellLogCurveDeleteFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Delete 3D Well Log Curve(s)");
actionToSetup->setIcon(QIcon(":/Erase.png"));
applyShortcutWithHintToAction(actionToSetup, QKeySequence::Delete);
actionToSetup->setText( "Delete 3D Well Log Curve(s)" );
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Delete );
}
@@ -31,6 +31,6 @@ class Ric3dWellLogCurveDeleteFeature : public caf::CmdFeature
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};
@@ -39,44 +39,45 @@ Ric3dWellLogCurvePickEventHandler* Ric3dWellLogCurvePickEventHandler::instance()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool Ric3dWellLogCurvePickEventHandler::handle3dPickEvent(const Ric3dPickEvent& eventObject)
bool Ric3dWellLogCurvePickEventHandler::handle3dPickEvent( const Ric3dPickEvent& eventObject )
{
if (eventObject.m_pickItemInfos.empty()) return false;
if ( eventObject.m_pickItemInfos.empty() ) return false;
const auto& firstPickedItem = eventObject.m_pickItemInfos.front();
const cvf::Part* firstPickedPart = firstPickedItem.pickedPart();
const cvf::Part* firstPickedPart = firstPickedItem.pickedPart();
const RivObjectSourceInfo* sourceInfo = dynamic_cast<const RivObjectSourceInfo*>(firstPickedPart->sourceInfo());
if (sourceInfo)
const RivObjectSourceInfo* sourceInfo = dynamic_cast<const RivObjectSourceInfo*>( firstPickedPart->sourceInfo() );
if ( sourceInfo )
{
Rim3dWellLogCurveCollection* curveCollection = dynamic_cast<Rim3dWellLogCurveCollection*>(sourceInfo->object());
if (curveCollection)
Rim3dWellLogCurveCollection* curveCollection = dynamic_cast<Rim3dWellLogCurveCollection*>( sourceInfo->object() );
if ( curveCollection )
{
RimWellPath* wellPath;
curveCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
QString wellPathName = wellPath->name();
cvf::Vec3d closestPoint;
double measuredDepthAtPoint;
double valueAtPoint;
Rim3dWellLogCurve* curve = curveCollection->checkForCurveIntersection( firstPickedItem.globalPickedPoint(),
&closestPoint,
&measuredDepthAtPoint,
&valueAtPoint);
if (curve)
curveCollection->firstAncestorOrThisOfTypeAsserted( wellPath );
QString wellPathName = wellPath->name();
cvf::Vec3d closestPoint;
double measuredDepthAtPoint;
double valueAtPoint;
Rim3dWellLogCurve* curve = curveCollection->checkForCurveIntersection( firstPickedItem.globalPickedPoint(),
&closestPoint,
&measuredDepthAtPoint,
&valueAtPoint );
if ( curve )
{
RiuMainWindow::instance()->selectAsCurrentItem(curve);
RiuMainWindow::instance()->selectAsCurrentItem( curve );
QString curveText;
curveText += QString("Curve name : %1\n").arg(curve->name());;
curveText += QString("Well path name: %1\n").arg(wellPathName);
curveText += QString("Measured depth: %1\n").arg(measuredDepthAtPoint);
curveText += QString("%1 at depth: %2\n").arg(curve->resultPropertyString()).arg(valueAtPoint);
curveText += QString( "Curve name : %1\n" ).arg( curve->name() );
;
curveText += QString( "Well path name: %1\n" ).arg( wellPathName );
curveText += QString( "Measured depth: %1\n" ).arg( measuredDepthAtPoint );
curveText += QString( "%1 at depth: %2\n" ).arg( curve->resultPropertyString() ).arg( valueAtPoint );
RiuMainWindow::instance()->setResultInfo(curveText);
RiuMainWindow::instance()->setResultInfo( curveText );
}
else
{
RiuMainWindow::instance()->selectAsCurrentItem(curveCollection);
RiuMainWindow::instance()->selectAsCurrentItem( curveCollection );
}
return true;
}
@@ -29,5 +29,5 @@ class Ric3dWellLogCurvePickEventHandler : public RicDefaultPickEventHandler
public:
static Ric3dWellLogCurvePickEventHandler* instance();
bool handle3dPickEvent(const Ric3dPickEvent& eventObject) override;
bool handle3dPickEvent( const Ric3dPickEvent& eventObject ) override;
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -33,7 +33,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicAdd3dWellLogCurveFeature, "RicAdd3dWellLogCurveFeature");
CAF_CMD_SOURCE_INIT( RicAdd3dWellLogCurveFeature, "RicAdd3dWellLogCurveFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -41,8 +41,8 @@ CAF_CMD_SOURCE_INIT(RicAdd3dWellLogCurveFeature, "RicAdd3dWellLogCurveFeature");
bool RicAdd3dWellLogCurveFeature::isCommandEnabled()
{
std::vector<RimCase*> cases;
RiaApplication::instance()->project()->allCases(cases);
if (cases.empty()) return false;
RiaApplication::instance()->project()->allCases( cases );
if ( cases.empty() ) return false;
return caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPath>();
}
@@ -50,27 +50,27 @@ bool RicAdd3dWellLogCurveFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAdd3dWellLogCurveFeature::onActionTriggered(bool isChecked)
void RicAdd3dWellLogCurveFeature::onActionTriggered( bool isChecked )
{
RimWellPath* selectedWellPath = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPath>();
if (!selectedWellPath) return;
if ( !selectedWellPath ) return;
Rim3dWellLogExtractionCurve* rim3dWellLogExtractionCurve = new Rim3dWellLogExtractionCurve();
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if (view)
if ( view )
{
rim3dWellLogExtractionCurve->setPropertiesFromView(view);
rim3dWellLogExtractionCurve->setPropertiesFromView( view );
}
selectedWellPath->add3dWellLogCurve(rim3dWellLogExtractionCurve);
selectedWellPath->add3dWellLogCurve( rim3dWellLogExtractionCurve );
RiaApplication::instance()->project()->scheduleCreateDisplayModelAndRedrawAllViews();
RiaApplication::instance()->project()->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem(rim3dWellLogExtractionCurve);
Riu3DMainWindowTools::setExpanded(selectedWellPath);
Riu3DMainWindowTools::selectAsCurrentItem( rim3dWellLogExtractionCurve );
Riu3DMainWindowTools::setExpanded( selectedWellPath );
selectedWellPath->updateConnectedEditors();
}
@@ -78,8 +78,8 @@ void RicAdd3dWellLogCurveFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAdd3dWellLogCurveFeature::setupActionLook(QAction* actionToSetup)
void RicAdd3dWellLogCurveFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
actionToSetup->setText("Create 3D Well Log Curve");
actionToSetup->setIcon( QIcon( ":/WellLogCurve16x16.png" ) );
actionToSetup->setText( "Create 3D Well Log Curve" );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,7 +21,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicAdd3dWellLogCurveFeature : public caf::CmdFeature
{
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -30,7 +30,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicAdd3dWellLogFileCurveFeature, "RicAdd3dWellLogFileCurveFeature");
CAF_CMD_SOURCE_INIT( RicAdd3dWellLogFileCurveFeature, "RicAdd3dWellLogFileCurveFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -38,30 +38,30 @@ CAF_CMD_SOURCE_INIT(RicAdd3dWellLogFileCurveFeature, "RicAdd3dWellLogFileCurveFe
bool RicAdd3dWellLogFileCurveFeature::isCommandEnabled()
{
std::vector<RimCase*> cases;
RiaApplication::instance()->project()->allCases(cases);
if (cases.empty()) return false;
RiaApplication::instance()->project()->allCases( cases );
if ( cases.empty() ) return false;
return (RicWellLogTools::findWellPathWithLogFileFromSelection() != nullptr);
return ( RicWellLogTools::findWellPathWithLogFileFromSelection() != nullptr );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAdd3dWellLogFileCurveFeature::onActionTriggered(bool isChecked)
void RicAdd3dWellLogFileCurveFeature::onActionTriggered( bool isChecked )
{
RimWellPath* selectedWellPath = RicWellLogTools::findWellPathWithLogFileFromSelection();
if (!selectedWellPath) return;
if ( !selectedWellPath ) return;
Rim3dWellLogFileCurve* rim3dWellLogFileCurve = new Rim3dWellLogFileCurve();
selectedWellPath->add3dWellLogCurve(rim3dWellLogFileCurve);
selectedWellPath->add3dWellLogCurve( rim3dWellLogFileCurve );
rim3dWellLogFileCurve->setDefaultFileCurveDataInfo();
RiaApplication::instance()->project()->scheduleCreateDisplayModelAndRedrawAllViews();
RiaApplication::instance()->project()->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem(rim3dWellLogFileCurve);
Riu3DMainWindowTools::setExpanded(selectedWellPath);
Riu3DMainWindowTools::selectAsCurrentItem( rim3dWellLogFileCurve );
Riu3DMainWindowTools::setExpanded( selectedWellPath );
selectedWellPath->updateConnectedEditors();
}
@@ -69,8 +69,8 @@ void RicAdd3dWellLogFileCurveFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAdd3dWellLogFileCurveFeature::setupActionLook(QAction* actionToSetup)
void RicAdd3dWellLogFileCurveFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
actionToSetup->setText("Create 3D Well Log LAS Curve");
actionToSetup->setIcon( QIcon( ":/WellLogCurve16x16.png" ) );
actionToSetup->setText( "Create 3D Well Log LAS Curve" );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,7 +21,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicAdd3dWellLogFileCurveFeature : public caf::CmdFeature
{
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -32,7 +32,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicAdd3dWellLogRftCurveFeature, "RicAdd3dWellLogRftCurveFeature");
CAF_CMD_SOURCE_INIT( RicAdd3dWellLogRftCurveFeature, "RicAdd3dWellLogRftCurveFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -40,13 +40,13 @@ CAF_CMD_SOURCE_INIT(RicAdd3dWellLogRftCurveFeature, "RicAdd3dWellLogRftCurveFeat
bool RicAdd3dWellLogRftCurveFeature::isCommandEnabled()
{
std::vector<RimCase*> cases;
RiaApplication::instance()->project()->allCases(cases);
if (cases.empty()) return false;
RiaApplication::instance()->project()->allCases( cases );
if ( cases.empty() ) return false;
RimWellPath* wellPath = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPath>();
if (wellPath)
if ( wellPath )
{
return RicWellLogTools::wellHasRftData(wellPath->name());
return RicWellLogTools::wellHasRftData( wellPath->name() );
}
return false;
}
@@ -54,19 +54,19 @@ bool RicAdd3dWellLogRftCurveFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAdd3dWellLogRftCurveFeature::onActionTriggered(bool isChecked)
void RicAdd3dWellLogRftCurveFeature::onActionTriggered( bool isChecked )
{
RimWellPath* selectedWellPath = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPath>();
if (!selectedWellPath) return;
if ( !selectedWellPath ) return;
Rim3dWellLogRftCurve* rim3dWellLogRftCurve = new Rim3dWellLogRftCurve();
selectedWellPath->add3dWellLogCurve(rim3dWellLogRftCurve);
selectedWellPath->add3dWellLogCurve( rim3dWellLogRftCurve );
RiaApplication::instance()->project()->scheduleCreateDisplayModelAndRedrawAllViews();
RiaApplication::instance()->project()->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem(rim3dWellLogRftCurve);
Riu3DMainWindowTools::setExpanded(selectedWellPath);
Riu3DMainWindowTools::selectAsCurrentItem( rim3dWellLogRftCurve );
Riu3DMainWindowTools::setExpanded( selectedWellPath );
selectedWellPath->updateConnectedEditors();
}
@@ -74,8 +74,8 @@ void RicAdd3dWellLogRftCurveFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicAdd3dWellLogRftCurveFeature::setupActionLook(QAction* actionToSetup)
void RicAdd3dWellLogRftCurveFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
actionToSetup->setText("Create 3D Well Log RFT Curve");
actionToSetup->setIcon( QIcon( ":/WellLogCurve16x16.png" ) );
actionToSetup->setText( "Create 3D Well Log RFT Curve" );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,7 +21,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicAdd3dWellLogRftCurveFeature : public caf::CmdFeature
{
@@ -2,25 +2,25 @@
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicAddWellLogToPlotFeature.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RicNewWellLogPlotFeatureImpl.h"
#include "RicWellLogPlotCurveFeatureImpl.h"
#include "RimMainPlotCollection.h"
#include "RimProject.h"
@@ -43,11 +43,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicAddWellLogToPlotFeature, "RicAddWellLogToPlotFeature");
CAF_CMD_SOURCE_INIT( RicAddWellLogToPlotFeature, "RicAddWellLogToPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicAddWellLogToPlotFeature::isCommandEnabled()
{
@@ -56,53 +55,53 @@ bool RicAddWellLogToPlotFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
void RicAddWellLogToPlotFeature::onActionTriggered( bool isChecked )
{
std::vector<RimWellLogFileChannel*> selection = selectedWellLogs();
if (selection.size() < 1) return;
if ( selection.size() < 1 ) return;
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot();
RimWellLogTrack* plotTrack = new RimWellLogTrack();
plot->addTrack(plotTrack);
plotTrack->setDescription(QString("Track %1").arg(plot->trackCount()));
plot->addTrack( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( plot->trackCount() ) );
plot->loadDataAndUpdate();
for (size_t wlIdx = 0; wlIdx < selection.size(); wlIdx++)
for ( size_t wlIdx = 0; wlIdx < selection.size(); wlIdx++ )
{
RimWellLogFileChannel* wellLog = selection[wlIdx];
RimWellPath* wellPath = nullptr;
wellLog->firstAncestorOrThisOfType(wellPath);
wellLog->firstAncestorOrThisOfType( wellPath );
RimWellLogFile* wellLogFile = nullptr;
wellLog->firstAncestorOrThisOfType(wellLogFile);
if (wellLogFile)
wellLog->firstAncestorOrThisOfType( wellLogFile );
if ( wellLogFile )
{
RimWellLogFileCurve* curve = new RimWellLogFileCurve;
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable(plotTrack->curveCount());
curve->setColor(curveColor);
cvf::Color3f curveColor = RicWellLogPlotCurveFeatureImpl::curveColorFromTable( plotTrack->curveCount() );
curve->setColor( curveColor );
plotTrack->addCurve(curve);
plotTrack->addCurve( curve );
RigWellLogFile* wellLogDataFile = wellLogFile->wellLogFileData();
CVF_ASSERT(wellLogDataFile);
CVF_ASSERT( wellLogDataFile );
if (wlIdx == 0)
if ( wlIdx == 0 )
{
// Initialize plot with depth unit from the first log file
plot->setDepthUnit(wellLogDataFile->depthUnit());
plot->setDepthUnit( wellLogDataFile->depthUnit() );
}
curve->setWellPath(wellPath);
curve->setWellLogChannelName(wellLog->name());
curve->setWellLogFile(wellLogFile);
curve->setWellPath( wellPath );
curve->setWellLogChannelName( wellLog->name() );
curve->setWellLogFile( wellLogFile );
curve->loadDataAndUpdate(true);
}
curve->loadDataAndUpdate( true );
}
}
plot->calculateAvailableDepthRange();
plot->updateDepthZoom();
@@ -111,24 +110,24 @@ void RicAddWellLogToPlotFeature::onActionTriggered(bool isChecked)
RiaApplication::instance()->project()->updateConnectedEditors();
RiuPlotMainWindowTools::showPlotMainWindow();
RiuPlotMainWindowTools::selectAsCurrentItem(plot);
RiuPlotMainWindowTools::setExpanded(plotTrack);
RiuPlotMainWindowTools::selectAsCurrentItem( plot );
RiuPlotMainWindowTools::setExpanded( plotTrack );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicAddWellLogToPlotFeature::setupActionLook(QAction* actionToSetup)
void RicAddWellLogToPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Add To New Plot");
actionToSetup->setText( "Add To New Plot" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogFileChannel*> RicAddWellLogToPlotFeature::selectedWellLogs()
{
std::vector<RimWellLogFileChannel*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
caf::SelectionManager::instance()->objectsByType( &selection );
return selection;
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -28,15 +28,14 @@ class RimWellLogPlotCollection;
class RimWellLogPlot;
class RimWellLogFileChannel;
//==================================================================================================
///
///
//==================================================================================================
class RicAddWellLogToPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -36,12 +36,10 @@
#include <QFileDialog>
#include <QFileInfo>
CAF_CMD_SOURCE_INIT(RicAsciiExportWellLogPlotFeature, "RicAsciiExportWellLogPlotFeature");
CAF_CMD_SOURCE_INIT( RicAsciiExportWellLogPlotFeature, "RicAsciiExportWellLogPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicAsciiExportWellLogPlotFeature::isCommandEnabled()
{
@@ -49,87 +47,91 @@ bool RicAsciiExportWellLogPlotFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicAsciiExportWellLogPlotFeature::onActionTriggered(bool isChecked)
void RicAsciiExportWellLogPlotFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
std::vector<RimWellLogPlot*> selectedWellLogPlots;
caf::SelectionManager::instance()->objectsByType(&selectedWellLogPlots);
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder("PLOT_ASCIIEXPORT_DIR");
caf::SelectionManager::instance()->objectsByType( &selectedWellLogPlots );
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder(
"PLOT_ASCIIEXPORT_DIR" );
caf::ProgressInfo pi(selectedWellLogPlots.size(), QString("Exporting plot data to ASCII"));
size_t progress = 0;
caf::ProgressInfo pi( selectedWellLogPlots.size(), QString( "Exporting plot data to ASCII" ) );
size_t progress = 0;
if (selectedWellLogPlots.size() == 1)
if ( selectedWellLogPlots.size() == 1 )
{
RimWellLogPlot* wellLogPlot = selectedWellLogPlots.at(0);
QString defaultFileName = defaultDir + "/" + caf::Utils::makeValidFileBasename((wellLogPlot->description())) + ".ascii";
QString fileName = QFileDialog::getSaveFileName(nullptr, "Select File for Plot Data Export", defaultFileName, "Text File(*.ascii);;All files(*.*)");
if (fileName.isEmpty()) return;
RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot(fileName, wellLogPlot);
RimWellLogPlot* wellLogPlot = selectedWellLogPlots.at( 0 );
QString defaultFileName = defaultDir + "/" +
caf::Utils::makeValidFileBasename( ( wellLogPlot->description() ) ) + ".ascii";
QString fileName = QFileDialog::getSaveFileName( nullptr,
"Select File for Plot Data Export",
defaultFileName,
"Text File(*.ascii);;All files(*.*)" );
if ( fileName.isEmpty() ) return;
RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( fileName, wellLogPlot );
progress++;
pi.setProgress(progress);
pi.setProgress( progress );
}
else if (selectedWellLogPlots.size() > 1)
else if ( selectedWellLogPlots.size() > 1 )
{
std::vector<QString> fileNames;
for (RimWellLogPlot* wellLogPlot : selectedWellLogPlots)
for ( RimWellLogPlot* wellLogPlot : selectedWellLogPlots )
{
QString fileName = caf::Utils::makeValidFileBasename(wellLogPlot->description()) + ".ascii";
fileNames.push_back(fileName);
QString fileName = caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii";
fileNames.push_back( fileName );
}
QString saveDir;
bool writeFiles = caf::Utils::getSaveDirectoryAndCheckOverwriteFiles(defaultDir, fileNames, &saveDir);
if (!writeFiles) return;
bool writeFiles = caf::Utils::getSaveDirectoryAndCheckOverwriteFiles( defaultDir, fileNames, &saveDir );
if ( !writeFiles ) return;
RiaLogging::info(QString("Writing to directory %!").arg(saveDir));
for (RimWellLogPlot* wellLogPlot : selectedWellLogPlots)
RiaLogging::info( QString( "Writing to directory %!" ).arg( saveDir ) );
for ( RimWellLogPlot* wellLogPlot : selectedWellLogPlots )
{
QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename(wellLogPlot->description()) + ".ascii";
RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot(fileName, wellLogPlot);
QString fileName = saveDir + "/" + caf::Utils::makeValidFileBasename( wellLogPlot->description() ) + ".ascii";
RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( fileName, wellLogPlot );
progress++;
pi.setProgress(progress);
pi.setProgress( progress );
}
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicAsciiExportWellLogPlotFeature::setupActionLook(QAction* actionToSetup)
void RicAsciiExportWellLogPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Export Plot Data to Text File");
actionToSetup->setIcon(QIcon(":/Save.png"));
actionToSetup->setText( "Export Plot Data to Text File" );
actionToSetup->setIcon( QIcon( ":/Save.png" ) );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot(const QString& fileName, const RimWellLogPlot* wellLogPlot)
bool RicAsciiExportWellLogPlotFeature::exportAsciiForWellLogPlot( const QString& fileName,
const RimWellLogPlot* wellLogPlot )
{
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
QFile file( fileName );
if ( !file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{
return false;
}
RiaLogging::info(QString("Writing values for plot(s) to file: %1").arg(fileName));
QTextStream out(&file);
RiaLogging::info( QString( "Writing values for plot(s) to file: %1" ).arg( fileName ) );
QTextStream out( &file );
out << wellLogPlot->description();
out << "\n";
out << wellLogPlot->asciiDataForPlotExport();
out << "\n\n";
RiaLogging::info(QString("Competed writing values for plot(s) to file %1").arg(fileName));
RiaLogging::info( QString( "Competed writing values for plot(s) to file %1" ).arg( fileName ) );
return true;
}
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017- 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -23,7 +23,7 @@
class RimWellLogPlot;
//==================================================================================================
///
///
//==================================================================================================
class RicAsciiExportWellLogPlotFeature : public caf::CmdFeature
{
@@ -32,8 +32,8 @@ class RicAsciiExportWellLogPlotFeature : public caf::CmdFeature
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook(QAction* actionToSetup) override;
void setupActionLook( QAction* actionToSetup ) override;
private:
static bool exportAsciiForWellLogPlot(const QString& fileName, const RimWellLogPlot* wellLogPlot);
static bool exportAsciiForWellLogPlot( const QString& fileName, const RimWellLogPlot* wellLogPlot );
};
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -36,86 +36,86 @@
#include <set>
CAF_CMD_SOURCE_INIT(RicChangeDataSourceFeature, "RicChangeDataSourceFeature");
CAF_CMD_SOURCE_INIT( RicChangeDataSourceFeature, "RicChangeDataSourceFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicChangeDataSourceFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellRftPlot() ) return false;
std::vector<RimWellLogCurve*> curves;
std::vector<RimWellLogTrack*> tracks;
return selectedTracksAndCurves(&curves, &tracks);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicChangeDataSourceFeature::onActionTriggered(bool isChecked)
{
std::vector<caf::PdmObject*> selectedObjects;
caf::SelectionManager::instance()->objectsByType(&selectedObjects);
std::vector<RimWellLogCurve*> curves;
std::vector<RimWellLogTrack*> tracks;
if (selectedTracksAndCurves(&curves, &tracks))
{
RimWellLogCurveCommonDataSource featureUi;
featureUi.updateDefaultOptions(curves, tracks);
caf::PdmUiPropertyViewDialog propertyDialog(nullptr, &featureUi, "Change Data Source for Multiple Curves", "");
propertyDialog.resize(QSize(500, 200));
if (propertyDialog.exec() == QDialog::Accepted)
{
featureUi.updateCurvesAndTracks(curves, tracks);
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicChangeDataSourceFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Change Data Source");
return selectedTracksAndCurves( &curves, &tracks );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicChangeDataSourceFeature::selectedTracksAndCurves(std::vector<RimWellLogCurve*>* curves, std::vector<RimWellLogTrack*>* tracks)
void RicChangeDataSourceFeature::onActionTriggered( bool isChecked )
{
CVF_ASSERT(curves && tracks);
std::vector<caf::PdmObject*> selectedObjects;
caf::SelectionManager::instance()->objectsByType(&selectedObjects);
caf::SelectionManager::instance()->objectsByType( &selectedObjects );
if (selectedObjects.empty()) return false;
std::vector<RimWellLogCurve*> curves;
std::vector<RimWellLogTrack*> tracks;
for (caf::PdmObject* selectedObject : selectedObjects)
if ( selectedTracksAndCurves( &curves, &tracks ) )
{
RimWellLogTrack* wellLogTrack = dynamic_cast<RimWellLogTrack*>(selectedObject);
RimWellLogExtractionCurve* wellLogExtractionCurve = dynamic_cast<RimWellLogExtractionCurve*>(selectedObject);
RimWellLogFileCurve* wellLogFileCurve = dynamic_cast<RimWellLogFileCurve*>(selectedObject);
if (wellLogTrack)
RimWellLogCurveCommonDataSource featureUi;
featureUi.updateDefaultOptions( curves, tracks );
caf::PdmUiPropertyViewDialog propertyDialog( nullptr, &featureUi, "Change Data Source for Multiple Curves", "" );
propertyDialog.resize( QSize( 500, 200 ) );
if ( propertyDialog.exec() == QDialog::Accepted )
{
tracks->push_back(wellLogTrack);
featureUi.updateCurvesAndTracks( curves, tracks );
}
else if (wellLogExtractionCurve)
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicChangeDataSourceFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText( "Change Data Source" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicChangeDataSourceFeature::selectedTracksAndCurves( std::vector<RimWellLogCurve*>* curves,
std::vector<RimWellLogTrack*>* tracks )
{
CVF_ASSERT( curves && tracks );
std::vector<caf::PdmObject*> selectedObjects;
caf::SelectionManager::instance()->objectsByType( &selectedObjects );
if ( selectedObjects.empty() ) return false;
for ( caf::PdmObject* selectedObject : selectedObjects )
{
RimWellLogTrack* wellLogTrack = dynamic_cast<RimWellLogTrack*>( selectedObject );
RimWellLogExtractionCurve* wellLogExtractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( selectedObject );
RimWellLogFileCurve* wellLogFileCurve = dynamic_cast<RimWellLogFileCurve*>( selectedObject );
if ( wellLogTrack )
{
curves->push_back(wellLogExtractionCurve);
tracks->push_back( wellLogTrack );
}
else if (wellLogFileCurve)
else if ( wellLogExtractionCurve )
{
curves->push_back(wellLogFileCurve);
curves->push_back( wellLogExtractionCurve );
}
else if ( wellLogFileCurve )
{
curves->push_back( wellLogFileCurve );
}
}
return selectedObjects.size() == (curves->size() + tracks->size());
return selectedObjects.size() == ( curves->size() + tracks->size() );
}
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -25,16 +25,17 @@
class RimWellLogCurve;
class RimWellLogTrack;
//==================================================================================================
///
///
//==================================================================================================
class RicChangeDataSourceFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
CAF_CMD_HEADER_INIT;
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook(QAction* actionToSetup) override;
void setupActionLook( QAction* actionToSetup ) override;
private:
static bool selectedTracksAndCurves(std::vector<RimWellLogCurve*>* curves, std::vector<RimWellLogTrack*>* tracks);
static bool selectedTracksAndCurves( std::vector<RimWellLogCurve*>* curves, std::vector<RimWellLogTrack*>* tracks );
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -25,17 +25,17 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDeletePltPlotFeature, "RicDeletePltPlotFeature");
CAF_CMD_SOURCE_INIT( RicDeletePltPlotFeature, "RicDeletePltPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicDeletePltPlotFeature::isCommandEnabled()
{
std::vector<RimWellPltPlot*> objects;
caf::SelectionManager::instance()->objectsByType(&objects);
caf::SelectionManager::instance()->objectsByType( &objects );
if (objects.size() > 0)
if ( objects.size() > 0 )
{
return true;
}
@@ -44,24 +44,24 @@ bool RicDeletePltPlotFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicDeletePltPlotFeature::onActionTriggered(bool isChecked)
void RicDeletePltPlotFeature::onActionTriggered( bool isChecked )
{
std::vector<RimWellPltPlot*> selectedPlots;
caf::SelectionManager::instance()->objectsByType(&selectedPlots);
caf::SelectionManager::instance()->objectsByType( &selectedPlots );
if (selectedPlots.size() == 0) return;
if ( selectedPlots.size() == 0 ) return;
RimWellPltPlot* firstPlot = selectedPlots[0];
RimPltPlotCollection* pltPlotCollection = nullptr;
firstPlot->firstAncestorOrThisOfType(pltPlotCollection);
if (!pltPlotCollection) return;
firstPlot->firstAncestorOrThisOfType( pltPlotCollection );
if ( !pltPlotCollection ) return;
for (RimWellPltPlot* plot : selectedPlots)
for ( RimWellPltPlot* plot : selectedPlots )
{
pltPlotCollection->removePlot(plot);
pltPlotCollection->removePlot( plot );
delete plot;
}
@@ -69,10 +69,10 @@ void RicDeletePltPlotFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicDeletePltPlotFeature::setupActionLook(QAction* actionToSetup)
void RicDeletePltPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Delete PLT Plot");
actionToSetup->setIcon(QIcon(":/Erase.png"));
actionToSetup->setText( "Delete PLT Plot" );
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,13 +22,13 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicDeletePltPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -25,17 +25,17 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDeleteRftPlotFeature, "RicDeleteRftPlotFeature");
CAF_CMD_SOURCE_INIT( RicDeleteRftPlotFeature, "RicDeleteRftPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicDeleteRftPlotFeature::isCommandEnabled()
{
std::vector<RimWellRftPlot*> objects;
caf::SelectionManager::instance()->objectsByType(&objects);
caf::SelectionManager::instance()->objectsByType( &objects );
if (objects.size() > 0)
if ( objects.size() > 0 )
{
return true;
}
@@ -44,37 +44,37 @@ bool RicDeleteRftPlotFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicDeleteRftPlotFeature::onActionTriggered(bool isChecked)
void RicDeleteRftPlotFeature::onActionTriggered( bool isChecked )
{
std::vector<RimWellRftPlot*> selectedPlots;
caf::SelectionManager::instance()->objectsByType(&selectedPlots);
caf::SelectionManager::instance()->objectsByType( &selectedPlots );
if (selectedPlots.size() == 0) return;
if ( selectedPlots.size() == 0 ) return;
RimWellRftPlot* firstPlot = selectedPlots[0];
RimRftPlotCollection* rftPlotCollection = nullptr;
firstPlot->firstAncestorOrThisOfType(rftPlotCollection);
if (!rftPlotCollection) return;
firstPlot->firstAncestorOrThisOfType( rftPlotCollection );
if ( !rftPlotCollection ) return;
for (RimWellRftPlot* plot : selectedPlots)
for ( RimWellRftPlot* plot : selectedPlots )
{
rftPlotCollection->removePlot(plot);
rftPlotCollection->removePlot( plot );
delete plot;
}
rftPlotCollection->uiCapability()->updateConnectedEditors();
//rftPlotCollection->scheduleRedrawAffectedViews();
// rftPlotCollection->scheduleRedrawAffectedViews();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicDeleteRftPlotFeature::setupActionLook(QAction* actionToSetup)
void RicDeleteRftPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Delete RFT Plot");
actionToSetup->setIcon(QIcon(":/Erase.png"));
applyShortcutWithHintToAction(actionToSetup, QKeySequence::Delete);
actionToSetup->setText( "Delete RFT Plot" );
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Delete );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,13 +22,13 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicDeleteRftPlotFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -25,31 +25,30 @@
#include "RiuWellLogPlot.h"
#include "RiuWellLogTrack.h"
#include "RimWellLogTrack.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "cafSelectionManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDeleteWellLogPlotTrackFeature, "RicDeleteWellLogPlotTrackFeature");
CAF_CMD_SOURCE_INIT( RicDeleteWellLogPlotTrackFeature, "RicDeleteWellLogPlotTrackFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return false;
std::vector<RimWellLogTrack*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
caf::SelectionManager::instance()->objectsByType( &selection );
if (selection.size() > 0)
if ( selection.size() > 0 )
{
RimWellLogPlot* wellLogPlot = nullptr;
selection[0]->firstAncestorOrThisOfType(wellLogPlot);
if (wellLogPlot && wellLogPlot->trackCount() > 1)
selection[0]->firstAncestorOrThisOfType( wellLogPlot );
if ( wellLogPlot && wellLogPlot->trackCount() > 1 )
{
return true;
}
@@ -59,38 +58,38 @@ bool RicDeleteWellLogPlotTrackFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicDeleteWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
void RicDeleteWellLogPlotTrackFeature::onActionTriggered( bool isChecked )
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return;
std::vector<RimWellLogTrack*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
caf::SelectionManager::instance()->objectsByType( &selection );
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
std::set<RimWellLogPlot*> alteredWellLogPlots;
for (size_t i = 0; i < selection.size(); i++)
for ( size_t i = 0; i < selection.size(); i++ )
{
RimWellLogTrack* track = selection[i];
RimWellLogPlot* wellLogPlot = nullptr;
track->firstAncestorOrThisOfType(wellLogPlot);
if (wellLogPlot && wellLogPlot->trackCount() > 1)
track->firstAncestorOrThisOfType( wellLogPlot );
if ( wellLogPlot && wellLogPlot->trackCount() > 1 )
{
alteredWellLogPlots.insert(wellLogPlot);
wellLogPlot->removeTrack(track);
caf::SelectionManager::instance()->removeObjectFromAllSelections(track);
alteredWellLogPlots.insert( wellLogPlot );
wellLogPlot->removeTrack( track );
caf::SelectionManager::instance()->removeObjectFromAllSelections( track );
wellLogPlot->updateConnectedEditors();
delete track;
}
}
for (RimWellLogPlot* wellLogPlot : alteredWellLogPlots)
for ( RimWellLogPlot* wellLogPlot : alteredWellLogPlots )
{
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>(wellLogPlot->viewWidget());
plotWindow->setWidthOfMdiWindow(viewWidget, viewWidget->preferredSize().width());
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( wellLogPlot->viewWidget() );
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredSize().width() );
wellLogPlot->calculateAvailableDepthRange();
wellLogPlot->updateDepthZoom();
wellLogPlot->uiCapability()->updateConnectedEditors();
@@ -98,11 +97,11 @@ void RicDeleteWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicDeleteWellLogPlotTrackFeature::setupActionLook(QAction* actionToSetup)
void RicDeleteWellLogPlotTrackFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Delete Track");
actionToSetup->setIcon(QIcon(":/Erase.png"));
applyShortcutWithHintToAction(actionToSetup, QKeySequence::Delete);
actionToSetup->setText( "Delete Track" );
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Delete );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,7 +22,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicDeleteWellLogPlotTrackFeature : public caf::CmdFeature
{
@@ -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,8 +21,8 @@
#include "RiaApplication.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellLogFile.h"
#include "RimWellPath.h"
#include "RiuMainWindow.h"
#include "cafPdmUiObjectEditorHandle.h"
@@ -31,16 +31,16 @@
#include <QAction>
#include <QFileDialog>
CAF_CMD_SOURCE_INIT(RicMoveWellLogFilesFeature, "RicMoveWellLogFilesFeature");
CAF_CMD_SOURCE_INIT( RicMoveWellLogFilesFeature, "RicMoveWellLogFilesFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicMoveWellLogFilesFeature::isCommandEnabled()
{
RimWellLogFile* selectedWellLogFile = caf::firstAncestorOfTypeFromSelectedObject<RimWellLogFile*>();
if (!selectedWellLogFile) return false;
if ( !selectedWellLogFile ) return false;
// If only one well path exists, the move command is not applicable
RimProject* proj = RiaApplication::instance()->project();
@@ -48,23 +48,23 @@ bool RicMoveWellLogFilesFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicMoveWellLogFilesFeature::onActionTriggered(bool isChecked)
void RicMoveWellLogFilesFeature::onActionTriggered( bool isChecked )
{
const QVariant userData = this->userData();
if (!userData.isNull() && userData.type() == QVariant::String)
if ( !userData.isNull() && userData.type() == QVariant::String )
{
RimProject* proj = RiaApplication::instance()->project();
RimWellPath* destWellPath = proj->wellPathByName(userData.toString());
RimWellLogFile* wellLogFile = caf::firstAncestorOfTypeFromSelectedObject<RimWellLogFile*>();
RimWellPath* sourceWellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>();
if (!destWellPath || !wellLogFile || !sourceWellPath) return;
RimWellPath* destWellPath = proj->wellPathByName( userData.toString() );
RimWellLogFile* wellLogFile = caf::firstAncestorOfTypeFromSelectedObject<RimWellLogFile*>();
RimWellPath* sourceWellPath = caf::firstAncestorOfTypeFromSelectedObject<RimWellPath*>();
sourceWellPath->detachWellLogFile(wellLogFile);
destWellPath->addWellLogFile(wellLogFile);
if ( !destWellPath || !wellLogFile || !sourceWellPath ) return;
sourceWellPath->detachWellLogFile( wellLogFile );
destWellPath->addWellLogFile( wellLogFile );
sourceWellPath->updateConnectedEditors();
destWellPath->updateConnectedEditors();
@@ -72,10 +72,10 @@ void RicMoveWellLogFilesFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicMoveWellLogFilesFeature::setupActionLook(QAction* actionToSetup)
void RicMoveWellLogFilesFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Move Well Log File(s)");
actionToSetup->setIcon(QIcon(":/Well.png"));
actionToSetup->setText( "Move Well Log File(s)" );
actionToSetup->setIcon( QIcon( ":/Well.png" ) );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,14 +22,13 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicMoveWellLogFilesFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -29,9 +29,8 @@ class RimWellPath;
class RimPltPlotCollection;
class RimWellPltPlot;
//==================================================================================================
///
///
//==================================================================================================
class RicNewPltPlotFeature : public caf::CmdFeature
{
@@ -44,8 +43,7 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
RimWellPath* selectedWellPath() const;
RimSimWellInView* selectedSimulationWell(int * branchIndex) const;
bool caseAvailable() const;
RimWellPath* selectedWellPath() const;
RimSimWellInView* selectedSimulationWell( int* branchIndex ) const;
bool caseAvailable() const;
};
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 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 <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,7 +21,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicNewRftPlotFeature : public caf::CmdFeature
{
@@ -34,4 +34,3 @@ private:
static QString selectedWellName();
};
@@ -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 "RimWellLogExtractionCurve.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileChannel.h"
#include "RimWellLogFileCurve.h"
#include "RimWellLogPlot.h"
#include "RimWellLogPlotCollection.h"
#include "RimWellLogTrack.h"
#include "RimWellLogExtractionCurve.h"
#include "RimWellLogFile.h"
#include "RimWellLogFileCurve.h"
#include "RimWellLogFileChannel.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,186 @@
#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");
RimWellLogPlot* plot = RicNewWellLogPlotFeatureImpl::createWellLogPlot( 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( RimWellLogPlot* 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( RimWellLogPlot* 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( RimWellLogPlot* 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 +242,56 @@ void RicNewWellBoreStabilityPlotFeature::createStabilityCurvesTrack(RimWellLogPl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewWellBoreStabilityPlotFeature::createAnglesTrack(RimWellLogPlot* plot, RimWellPath* wellPath, RimGeoMechView* geoMechView)
void RicNewWellBoreStabilityPlotFeature::createAnglesTrack( RimWellLogPlot* 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 );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,7 +26,7 @@ class RimWellLogPlot;
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( 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 );
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -37,8 +37,8 @@
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RiuPlotMainWindow.h"
#include "Riu3dSelectionManager.h"
#include "RiuPlotMainWindow.h"
#include "RiuPlotMainWindowTools.h"
#include "cafSelectionManager.h"
@@ -47,61 +47,67 @@
#include <vector>
CAF_CMD_SOURCE_INIT(RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtractionFeature");
CAF_CMD_SOURCE_INIT( RicNewWellLogCurveExtractionFeature, "RicNewWellLogCurveExtractionFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogCurveExtractionFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellRftPlot() ) return false;
int branchIndex;
return (caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>() != nullptr || caf::SelectionManager::instance()->selectedItemOfType<RimWellPath>() != nullptr || RicWellLogTools::selectedSimulationWell(&branchIndex) != nullptr) && caseAvailable();
return ( caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>() != nullptr ||
caf::SelectionManager::instance()->selectedItemOfType<RimWellPath>() != nullptr ||
RicWellLogTools::selectedSimulationWell( &branchIndex ) != nullptr ) &&
caseAvailable();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked)
void RicNewWellLogCurveExtractionFeature::onActionTriggered( bool isChecked )
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return;
RimWellLogTrack* wellLogPlotTrack = caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>();
if (wellLogPlotTrack)
if ( wellLogPlotTrack )
{
RicWellLogTools::addExtractionCurve(wellLogPlotTrack, nullptr, nullptr, nullptr, -1, true);
RicWellLogTools::addExtractionCurve( wellLogPlotTrack, nullptr, nullptr, nullptr, -1, true );
}
else
{
RimWellPath* wellPath = caf::SelectionManager::instance()->selectedItemOfType<RimWellPath>();
int branchIndex = -1;
RimSimWellInView* simWell = RicWellLogTools::selectedSimulationWell(&branchIndex);
RimWellPath* wellPath = caf::SelectionManager::instance()->selectedItemOfType<RimWellPath>();
int branchIndex = -1;
RimSimWellInView* simWell = RicWellLogTools::selectedSimulationWell( &branchIndex );
bool useBranchDetection = true;
RimSimWellInViewCollection* simWellColl = nullptr;
if (simWell)
bool useBranchDetection = true;
RimSimWellInViewCollection* simWellColl = nullptr;
if ( simWell )
{
simWell->firstAncestorOrThisOfTypeAsserted(simWellColl);
simWell->firstAncestorOrThisOfTypeAsserted( simWellColl );
useBranchDetection = simWellColl->isAutoDetectingBranches;
}
if (wellPath || simWell)
if ( wellPath || simWell )
{
RimWellLogTrack* newWellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogExtractionCurve* plotCurve =
RicWellLogTools::addExtractionCurve(newWellLogPlotTrack, RiaApplication::instance()->activeReservoirView(), wellPath,
simWell, branchIndex, useBranchDetection);
RimWellLogExtractionCurve* plotCurve = RicWellLogTools::addExtractionCurve( newWellLogPlotTrack,
RiaApplication::instance()
->activeReservoirView(),
wellPath,
simWell,
branchIndex,
useBranchDetection );
plotCurve->loadDataAndUpdate(true);
plotCurve->loadDataAndUpdate( true );
RimWellLogPlot* plot = nullptr;
newWellLogPlotTrack->firstAncestorOrThisOfType(plot);
if (plot && plotCurve->curveData())
newWellLogPlotTrack->firstAncestorOrThisOfType( plot );
if ( plot && plotCurve->curveData() )
{
plot->setDepthUnit(plotCurve->curveData()->depthUnit());
plot->setDepthUnit( plotCurve->curveData()->depthUnit() );
}
plotCurve->updateConnectedEditors();
@@ -111,21 +117,21 @@ void RicNewWellLogCurveExtractionFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogCurveExtractionFeature::setupActionLook(QAction* actionToSetup)
void RicNewWellLogCurveExtractionFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("New Well Log Extraction Curve");
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
actionToSetup->setText( "New Well Log Extraction Curve" );
actionToSetup->setIcon( QIcon( ":/WellLogCurve16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogCurveExtractionFeature::caseAvailable()
{
std::vector<RimCase*> cases;
RiaApplication::instance()->project()->allCases(cases);
RiaApplication::instance()->project()->allCases( cases );
return !cases.empty();
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,7 +22,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicNewWellLogCurveExtractionFeature : public caf::CmdFeature
{
@@ -33,5 +33,5 @@ private:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
static bool caseAvailable();
static bool caseAvailable();
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -41,40 +41,41 @@
#include <vector>
CAF_CMD_SOURCE_INIT(RicNewWellLogFileCurveFeature, "RicNewWellLogFileCurveFeature");
CAF_CMD_SOURCE_INIT( RicNewWellLogFileCurveFeature, "RicNewWellLogFileCurveFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogFileCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
return (caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellLogTrack>() != nullptr && wellLogFilesAvailable()) || RicWellLogTools::selectedWellPathWithLogFile() != nullptr;
if ( RicWellLogPlotCurveFeatureImpl::parentWellRftPlot() ) return false;
return ( caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellLogTrack>() != nullptr &&
wellLogFilesAvailable() ) ||
RicWellLogTools::selectedWellPathWithLogFile() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogFileCurveFeature::onActionTriggered(bool isChecked)
void RicNewWellLogFileCurveFeature::onActionTriggered( bool isChecked )
{
RimWellLogTrack* wellLogPlotTrack = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellLogTrack>();
if (wellLogPlotTrack)
if ( wellLogPlotTrack )
{
RicWellLogTools::addFileCurve(wellLogPlotTrack);
RicWellLogTools::addFileCurve( wellLogPlotTrack );
}
else
{
RimWellPath* wellPath = RicWellLogTools::selectedWellPathWithLogFile();
if (wellPath)
if ( wellPath )
{
RimWellLogTrack* newWellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogFileCurve* plotCurve = RicWellLogTools::addFileCurve(newWellLogPlotTrack);
plotCurve->setWellPath(wellPath);
RimWellLogTrack* newWellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogFileCurve* plotCurve = RicWellLogTools::addFileCurve( newWellLogPlotTrack );
plotCurve->setWellPath( wellPath );
if (wellPath->wellLogFiles().size() == 1)
if ( wellPath->wellLogFiles().size() == 1 )
{
plotCurve->setWellLogFile(wellPath->wellLogFiles().front());
plotCurve->setWellLogFile( wellPath->wellLogFiles().front() );
}
plotCurve->updateConnectedEditors();
}
@@ -82,27 +83,27 @@ void RicNewWellLogFileCurveFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogFileCurveFeature::setupActionLook(QAction* actionToSetup)
void RicNewWellLogFileCurveFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
actionToSetup->setText("New Well Log LAS Curve");
actionToSetup->setIcon( QIcon( ":/WellLogCurve16x16.png" ) );
actionToSetup->setText( "New Well Log LAS Curve" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogFileCurveFeature::wellLogFilesAvailable()
{
auto wellPathCollection = RimTools::wellPathCollection();
if (wellPathCollection)
if ( wellPathCollection )
{
caf::PdmChildArrayField<RimWellPath*>& wellPaths = wellPathCollection->wellPaths;
for (size_t i = 0; i < wellPaths.size(); i++)
for ( size_t i = 0; i < wellPaths.size(); i++ )
{
if (!wellPaths[i]->wellLogFiles().empty())
if ( !wellPaths[i]->wellLogFiles().empty() )
{
return true;
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,7 +24,7 @@
#include <vector>
//==================================================================================================
///
///
//==================================================================================================
class RicNewWellLogFileCurveFeature : public caf::CmdFeature
{
@@ -36,5 +36,5 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
static bool wellLogFilesAvailable();
static bool wellLogFilesAvailable();
};
@@ -2,31 +2,31 @@
//
// 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.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RicNewWellLogPlotFeature.h"
#include "RicNewWellLogPlotFeatureImpl.h"
#include "RicNewWellLogFileCurveFeature.h"
#include "RicNewWellLogCurveExtractionFeature.h"
#include "RicNewWellLogFileCurveFeature.h"
#include "RicNewWellLogPlotFeatureImpl.h"
#include "RimProject.h"
#include "RimWellLogCurve.h"
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "RimWellLogCurve.h"
#include "RicWellLogTools.h"
@@ -36,11 +36,10 @@
#include "cvfAssert.h"
CAF_CMD_SOURCE_INIT(RicNewWellLogPlotFeature, "RicNewWellLogPlotFeature");
CAF_CMD_SOURCE_INIT( RicNewWellLogPlotFeature, "RicNewWellLogPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogPlotFeature::isCommandEnabled()
{
@@ -48,19 +47,19 @@ bool RicNewWellLogPlotFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotFeature::onActionTriggered(bool isChecked)
void RicNewWellLogPlotFeature::onActionTriggered( bool isChecked )
{
RimWellLogTrack* plotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RicWellLogTools::addExtractionCurve(plotTrack, nullptr, nullptr, nullptr, -1, true);
RicWellLogTools::addExtractionCurve( plotTrack, nullptr, nullptr, nullptr, -1, true );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotFeature::setupActionLook(QAction* actionToSetup)
void RicNewWellLogPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("New Well Log Plot");
actionToSetup->setIcon(QIcon(":/WellLogPlot16x16.png"));
actionToSetup->setText( "New Well Log Plot" );
actionToSetup->setIcon( QIcon( ":/WellLogPlot16x16.png" ) );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,7 +22,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicNewWellLogPlotFeature : public caf::CmdFeature
{
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -32,31 +32,31 @@
#include <QString>
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot(bool showAfterCreation, const QString& plotDescription)
RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot( bool showAfterCreation, const QString& plotDescription )
{
RimWellLogPlotCollection* wellLogPlotColl = wellLogPlotCollection();
CVF_ASSERT(wellLogPlotColl);
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())
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 Log Plot %1" ).arg( wellLogPlotCollection()->wellLogPlots.size() ) );
}
if (showAfterCreation)
if ( showAfterCreation )
{
RiaGuiApplication::instance()->getOrCreateAndShowMainPlotWindow();
}
@@ -65,30 +65,32 @@ RimWellLogPlot* RicNewWellLogPlotFeatureImpl::createWellLogPlot(bool showAfterCr
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellLogTrack* RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack(bool updateAfter, const QString& trackDescription, RimWellLogPlot* existingPlot)
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 +99,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 +109,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();
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,14 +26,18 @@ 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 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();
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -31,65 +31,63 @@
#include "RimWellLogPlot.h"
#include "RimWellLogTrack.h"
#include "cafSelectionManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicNewWellLogPlotTrackFeature, "RicNewWellLogPlotTrackFeature");
CAF_CMD_SOURCE_INIT( RicNewWellLogPlotTrackFeature, "RicNewWellLogPlotTrackFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogPlotTrackFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ||
RicWellLogPlotCurveFeatureImpl::parentWellRftPlot())
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ||
RicWellLogPlotCurveFeatureImpl::parentWellRftPlot() )
{
return false;
}
return selectedWellLogPlot() != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotTrackFeature::onActionTriggered(bool isChecked)
void RicNewWellLogPlotTrackFeature::onActionTriggered( bool isChecked )
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return;
RimWellLogPlot* wellLogPlot = selectedWellLogPlot();
if (wellLogPlot)
if ( wellLogPlot )
{
RimWellLogTrack* plotTrack = new RimWellLogTrack;
wellLogPlot->addTrack(plotTrack);
plotTrack->setDescription(QString("Track %1").arg(wellLogPlot->trackCount()));
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>(wellLogPlot->viewWidget());
RicWellLogTools::addExtractionCurve(plotTrack, nullptr, nullptr, nullptr, -1, true);
plotWindow->setWidthOfMdiWindow(viewWidget, viewWidget->preferredSize().width());
wellLogPlot->updateConnectedEditors();
wellLogPlot->loadDataAndUpdate();
RimWellLogTrack* plotTrack = new RimWellLogTrack;
wellLogPlot->addTrack( plotTrack );
plotTrack->setDescription( QString( "Track %1" ).arg( wellLogPlot->trackCount() ) );
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( wellLogPlot->viewWidget() );
RicWellLogTools::addExtractionCurve( plotTrack, nullptr, nullptr, nullptr, -1, true );
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredSize().width() );
wellLogPlot->updateConnectedEditors();
wellLogPlot->loadDataAndUpdate();
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogPlotTrackFeature::setupActionLook(QAction* actionToSetup)
void RicNewWellLogPlotTrackFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("New Track");
actionToSetup->setText( "New Track" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellLogPlot* RicNewWellLogPlotTrackFeature::selectedWellLogPlot()
{
std::vector<RimWellLogPlot*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
caf::SelectionManager::instance()->objectsByType( &selection );
return selection.size() > 0 ? selection[0] : nullptr;
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,7 +24,7 @@
class RimWellLogPlot;
//==================================================================================================
///
///
//==================================================================================================
class RicNewWellLogPlotTrackFeature : public caf::CmdFeature
{
@@ -37,5 +37,5 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
RimWellLogPlot* selectedWellLogPlot();
RimWellLogPlot* selectedWellLogPlot();
};
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -41,58 +41,57 @@
#include <vector>
CAF_CMD_SOURCE_INIT(RicNewWellLogRftCurveFeature, "RicNewWellLogRftCurveFeature");
CAF_CMD_SOURCE_INIT( RicNewWellLogRftCurveFeature, "RicNewWellLogRftCurveFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewWellLogRftCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
if (caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>() != nullptr)
if ( RicWellLogPlotCurveFeatureImpl::parentWellRftPlot() ) return false;
if ( caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>() != nullptr )
{
return true;
}
int branchIdx;
RimSimWellInView* simulationWell = RicWellLogTools::selectedSimulationWell(&branchIdx);
int branchIdx;
RimSimWellInView* simulationWell = RicWellLogTools::selectedSimulationWell( &branchIdx );
if (simulationWell != nullptr)
if ( simulationWell != nullptr )
{
return RicWellLogTools::wellHasRftData(simulationWell->name());
return RicWellLogTools::wellHasRftData( simulationWell->name() );
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogRftCurveFeature::onActionTriggered(bool isChecked)
void RicNewWellLogRftCurveFeature::onActionTriggered( bool isChecked )
{
RimWellLogTrack* wellLogPlotTrack = caf::SelectionManager::instance()->selectedItemOfType<RimWellLogTrack>();
if (wellLogPlotTrack)
if ( wellLogPlotTrack )
{
int branchIdx;
RicWellLogTools::addRftCurve(wellLogPlotTrack, RicWellLogTools::selectedSimulationWell(&branchIdx));
RicWellLogTools::addRftCurve( wellLogPlotTrack, RicWellLogTools::selectedSimulationWell( &branchIdx ) );
}
else
{
int branchIndex = -1;
RimSimWellInView* simWell = RicWellLogTools::selectedSimulationWell(&branchIndex);
if (simWell)
int branchIndex = -1;
RimSimWellInView* simWell = RicWellLogTools::selectedSimulationWell( &branchIndex );
if ( simWell )
{
RimWellLogTrack* newWellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogRftCurve* plotCurve = RicWellLogTools::addRftCurve(newWellLogPlotTrack, simWell);
RimWellLogTrack* newWellLogPlotTrack = RicNewWellLogPlotFeatureImpl::createWellLogPlotTrack();
RimWellLogRftCurve* plotCurve = RicWellLogTools::addRftCurve( newWellLogPlotTrack, simWell );
plotCurve->loadDataAndUpdate(true);
plotCurve->loadDataAndUpdate( true );
RimWellLogPlot* plot = nullptr;
newWellLogPlotTrack->firstAncestorOrThisOfType(plot);
if (plot && plotCurve->curveData())
newWellLogPlotTrack->firstAncestorOrThisOfType( plot );
if ( plot && plotCurve->curveData() )
{
plot->setDepthUnit(plotCurve->curveData()->depthUnit());
plot->setDepthUnit( plotCurve->curveData()->depthUnit() );
}
plotCurve->updateConnectedEditors();
@@ -101,10 +100,10 @@ void RicNewWellLogRftCurveFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewWellLogRftCurveFeature::setupActionLook(QAction* actionToSetup)
void RicNewWellLogRftCurveFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("New Well Log RFT Curve");
actionToSetup->setIcon(QIcon(":/WellLogCurve16x16.png"));
actionToSetup->setText( "New Well Log RFT Curve" );
actionToSetup->setIcon( QIcon( ":/WellLogCurve16x16.png" ) );
}
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2017 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 <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,7 +21,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicNewWellLogRftCurveFeature : public caf::CmdFeature
{
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -34,22 +34,22 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicPasteWellLogCurveFeature, "RicPasteWellLogCurveFeature");
CAF_CMD_SOURCE_INIT( RicPasteWellLogCurveFeature, "RicPasteWellLogCurveFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicPasteWellLogCurveFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if (RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellRftPlot() ) return false;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
RimWellLogTrack* wellLogTrack = nullptr;
destinationObject->firstAncestorOrThisOfType(wellLogTrack);
if (!wellLogTrack)
destinationObject->firstAncestorOrThisOfType( wellLogTrack );
if ( !wellLogTrack )
{
return false;
}
@@ -58,55 +58,58 @@ bool RicPasteWellLogCurveFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogCurveFeature::onActionTriggered(bool isChecked)
void RicPasteWellLogCurveFeature::onActionTriggered( bool isChecked )
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
RimWellLogTrack* wellLogTrack = nullptr;
destinationObject->firstAncestorOrThisOfType(wellLogTrack);
if (!wellLogTrack)
destinationObject->firstAncestorOrThisOfType( wellLogTrack );
if ( !wellLogTrack )
{
return;
}
std::vector<caf::PdmPointer<RimWellLogCurve> > sourceObjects = RicPasteWellLogCurveFeature::curves();
std::vector<caf::PdmPointer<RimWellLogCurve>> sourceObjects = RicPasteWellLogCurveFeature::curves();
for (size_t i = 0; i < sourceObjects.size(); i++)
for ( size_t i = 0; i < sourceObjects.size(); i++ )
{
RimWellLogFileCurve* fileCurve = dynamic_cast<RimWellLogFileCurve*>(sourceObjects[i].p());
if (fileCurve)
RimWellLogFileCurve* fileCurve = dynamic_cast<RimWellLogFileCurve*>( sourceObjects[i].p() );
if ( fileCurve )
{
RimWellLogFileCurve* newObject = dynamic_cast<RimWellLogFileCurve*>(sourceObjects[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newObject);
RimWellLogFileCurve* newObject = dynamic_cast<RimWellLogFileCurve*>(
sourceObjects[i]->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
CVF_ASSERT( newObject );
wellLogTrack->addCurve(newObject);
wellLogTrack->addCurve( newObject );
// Resolve references after object has been inserted into the project data model
newObject->resolveReferencesRecursively();
newObject->initAfterReadRecursively();
newObject->loadDataAndUpdate(true);
newObject->loadDataAndUpdate( true );
wellLogTrack->updateConnectedEditors();
}
RimWellLogExtractionCurve* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>(sourceObjects[i].p());
if (extractionCurve)
RimWellLogExtractionCurve* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( sourceObjects[i].p() );
if ( extractionCurve )
{
RimWellLogExtractionCurve* newObject = dynamic_cast<RimWellLogExtractionCurve*>(sourceObjects[i]->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newObject);
RimWellLogExtractionCurve* newObject = dynamic_cast<RimWellLogExtractionCurve*>(
sourceObjects[i]->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
CVF_ASSERT( newObject );
wellLogTrack->addCurve(newObject);
wellLogTrack->addCurve( newObject );
// Resolve references after object has been inserted into the project data model
newObject->resolveReferencesRecursively();
newObject->initAfterReadRecursively();
newObject->loadDataAndUpdate(true);
newObject->loadDataAndUpdate( true );
wellLogTrack->updateConnectedEditors();
}
@@ -114,25 +117,25 @@ void RicPasteWellLogCurveFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogCurveFeature::setupActionLook(QAction* actionToSetup)
void RicPasteWellLogCurveFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Paste Well Log Curve");
actionToSetup->setText( "Paste Well Log Curve" );
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
RicPasteFeatureImpl::setIconAndShortcuts( actionToSetup );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::PdmPointer<RimWellLogCurve> > RicPasteWellLogCurveFeature::curves()
std::vector<caf::PdmPointer<RimWellLogCurve>> RicPasteWellLogCurveFeature::curves()
{
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
std::vector<caf::PdmPointer<RimWellLogCurve> > typedObjects;
objectGroup.objectsByType(&typedObjects);
std::vector<caf::PdmPointer<RimWellLogCurve>> typedObjects;
objectGroup.objectsByType( &typedObjects );
return typedObjects;
}
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,7 +26,7 @@
class RimWellLogCurve;
//==================================================================================================
///
///
//==================================================================================================
class RicPasteWellLogCurveFeature : public caf::CmdFeature
{
@@ -39,5 +39,5 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
static std::vector<caf::PdmPointer<RimWellLogCurve> > curves();
static std::vector<caf::PdmPointer<RimWellLogCurve>> curves();
};
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -31,19 +31,19 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicPasteWellLogPlotFeature, "RicPasteWellLogPlotFeature");
CAF_CMD_SOURCE_INIT( RicPasteWellLogPlotFeature, "RicPasteWellLogPlotFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicPasteWellLogPlotFeature::isCommandEnabled()
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
RimWellLogPlotCollection* wellLogPlotCollection = nullptr;
destinationObject->firstAncestorOrThisOfType(wellLogPlotCollection);
if (!wellLogPlotCollection)
destinationObject->firstAncestorOrThisOfType( wellLogPlotCollection );
if ( !wellLogPlotCollection )
{
return false;
}
@@ -52,37 +52,39 @@ bool RicPasteWellLogPlotFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogPlotFeature::onActionTriggered(bool isChecked)
void RicPasteWellLogPlotFeature::onActionTriggered( bool isChecked )
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
RimWellLogPlotCollection* wellLogPlotCollection = nullptr;
destinationObject->firstAncestorOrThisOfType(wellLogPlotCollection);
if (!wellLogPlotCollection)
destinationObject->firstAncestorOrThisOfType( wellLogPlotCollection );
if ( !wellLogPlotCollection )
{
return;
}
std::vector<caf::PdmPointer<RimWellLogPlot> > sourceObjects = RicPasteWellLogPlotFeature::plots();
std::vector<caf::PdmPointer<RimWellLogPlot>> sourceObjects = RicPasteWellLogPlotFeature::plots();
for (size_t i = 0; i < sourceObjects.size(); i++)
for ( size_t i = 0; i < sourceObjects.size(); i++ )
{
RimWellLogPlot* fileCurve = sourceObjects[i];
if (fileCurve)
if ( fileCurve )
{
RimWellLogPlot* newObject = dynamic_cast<RimWellLogPlot*>(fileCurve->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newObject);
RimWellLogPlot* newObject = dynamic_cast<RimWellLogPlot*>(
fileCurve->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
CVF_ASSERT( newObject );
wellLogPlotCollection->wellLogPlots.push_back(newObject);
wellLogPlotCollection->wellLogPlots.push_back( newObject );
// Resolve references after object has been inserted into the project data model
newObject->resolveReferencesRecursively();
newObject->initAfterReadRecursively();
QString description = "Copy of " + newObject->description();
newObject->setDescription(description);
newObject->setDescription( description );
newObject->loadDataAndUpdate();
@@ -92,25 +94,25 @@ void RicPasteWellLogPlotFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogPlotFeature::setupActionLook(QAction* actionToSetup)
void RicPasteWellLogPlotFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Paste Well Log Plot");
actionToSetup->setText( "Paste Well Log Plot" );
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
RicPasteFeatureImpl::setIconAndShortcuts( actionToSetup );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::PdmPointer<RimWellLogPlot> > RicPasteWellLogPlotFeature::plots()
std::vector<caf::PdmPointer<RimWellLogPlot>> RicPasteWellLogPlotFeature::plots()
{
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
std::vector<caf::PdmPointer<RimWellLogPlot> > typedObjects;
objectGroup.objectsByType(&typedObjects);
std::vector<caf::PdmPointer<RimWellLogPlot>> typedObjects;
objectGroup.objectsByType( &typedObjects );
return typedObjects;
}
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,7 +26,7 @@
class RimWellLogPlot;
//==================================================================================================
///
///
//==================================================================================================
class RicPasteWellLogPlotFeature : public caf::CmdFeature
{
@@ -39,5 +39,5 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
static std::vector<caf::PdmPointer<RimWellLogPlot> > plots();
static std::vector<caf::PdmPointer<RimWellLogPlot>> plots();
};
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -33,23 +33,23 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicPasteWellLogTrackFeature, "RicPasteWellLogTrackFeature");
CAF_CMD_SOURCE_INIT( RicPasteWellLogTrackFeature, "RicPasteWellLogTrackFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicPasteWellLogTrackFeature::isCommandEnabled()
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return false;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return false;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
RimWellLogPlot* wellLogPlot = nullptr;
RimWellRftPlot* rftPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(wellLogPlot);
destinationObject->firstAncestorOrThisOfType(rftPlot);
if (!wellLogPlot || rftPlot)
RimWellRftPlot* rftPlot = nullptr;
destinationObject->firstAncestorOrThisOfType( wellLogPlot );
destinationObject->firstAncestorOrThisOfType( rftPlot );
if ( !wellLogPlot || rftPlot )
{
return false;
}
@@ -58,31 +58,32 @@ bool RicPasteWellLogTrackFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogTrackFeature::onActionTriggered(bool isChecked)
void RicPasteWellLogTrackFeature::onActionTriggered( bool isChecked )
{
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
if ( RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot() ) return;
RimWellLogPlot* wellLogPlot = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellLogPlot>();
if (!wellLogPlot)
if ( !wellLogPlot )
{
return;
}
std::vector<caf::PdmPointer<RimWellLogTrack> > sourceObjects = RicPasteWellLogTrackFeature::tracks();
std::vector<caf::PdmPointer<RimWellLogTrack>> sourceObjects = RicPasteWellLogTrackFeature::tracks();
for (size_t i = 0; i < sourceObjects.size(); i++)
for ( size_t i = 0; i < sourceObjects.size(); i++ )
{
RimWellLogTrack* fileCurve = sourceObjects[i];
if (fileCurve)
if ( fileCurve )
{
RimWellLogTrack* newObject = dynamic_cast<RimWellLogTrack*>(fileCurve->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance()));
CVF_ASSERT(newObject);
RimWellLogTrack* newObject = dynamic_cast<RimWellLogTrack*>(
fileCurve->xmlCapability()->copyByXmlSerialization( caf::PdmDefaultObjectFactory::instance() ) );
CVF_ASSERT( newObject );
wellLogPlot->addTrack(newObject);
wellLogPlot->addTrack( newObject );
newObject->setDescription(QString("Track %1").arg(wellLogPlot->trackCount()));
newObject->setDescription( QString( "Track %1" ).arg( wellLogPlot->trackCount() ) );
// Resolve references after object has been inserted into the project data model
newObject->resolveReferencesRecursively();
@@ -96,25 +97,25 @@ void RicPasteWellLogTrackFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicPasteWellLogTrackFeature::setupActionLook(QAction* actionToSetup)
void RicPasteWellLogTrackFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Paste Well Log Track");
actionToSetup->setText( "Paste Well Log Track" );
RicPasteFeatureImpl::setIconAndShortcuts(actionToSetup);
RicPasteFeatureImpl::setIconAndShortcuts( actionToSetup );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<caf::PdmPointer<RimWellLogTrack> > RicPasteWellLogTrackFeature::tracks()
std::vector<caf::PdmPointer<RimWellLogTrack>> RicPasteWellLogTrackFeature::tracks()
{
caf::PdmObjectGroup objectGroup;
RicPasteFeatureImpl::findObjectsFromClipboardRefs(&objectGroup);
RicPasteFeatureImpl::findObjectsFromClipboardRefs( &objectGroup );
std::vector<caf::PdmPointer<RimWellLogTrack> > typedObjects;
objectGroup.objectsByType(&typedObjects);
std::vector<caf::PdmPointer<RimWellLogTrack>> typedObjects;
objectGroup.objectsByType( &typedObjects );
return typedObjects;
}
@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 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 <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,7 +26,7 @@
class RimWellLogTrack;
//==================================================================================================
///
///
//==================================================================================================
class RicPasteWellLogTrackFeature : public caf::CmdFeature
{
@@ -39,5 +39,5 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
private:
static std::vector<caf::PdmPointer<RimWellLogTrack> > tracks();
static std::vector<caf::PdmPointer<RimWellLogTrack>> tracks();
};
@@ -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,24 +21,24 @@
#include "RiaApplication.h"
#include "RimWellPath.h"
#include "RimViewWindow.h"
#include "RimWellAllocationPlot.h"
#include "RimWellLogFile.h"
#include "RimWellLogPlot.h"
#include "RimWellPath.h"
#include "RimWellPltPlot.h"
#include "RimWellRftPlot.h"
#include "RimWellAllocationPlot.h"
#include "RimViewWindow.h"
#include "cafSelectionManagerTools.h"
#include "cafPdmObjectHandle.h"
#include "cafPdmUiObjectEditorHandle.h"
#include "cafSelectionManagerTools.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicWellLogFileCloseFeature, "RicWellLogFileCloseFeature");
CAF_CMD_SOURCE_INIT( RicWellLogFileCloseFeature, "RicWellLogFileCloseFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicWellLogFileCloseFeature::isCommandEnabled()
{
@@ -47,25 +47,25 @@ bool RicWellLogFileCloseFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellLogFileCloseFeature::onActionTriggered(bool isChecked)
void RicWellLogFileCloseFeature::onActionTriggered( bool isChecked )
{
std::vector<RimWellLogFile*> objects = caf::selectedObjectsByType<RimWellLogFile*>();
if (objects.size() == 0) return;
if ( objects.size() == 0 ) return;
for (const auto& wellLogFile : objects)
for ( const auto& wellLogFile : objects )
{
RimWellPath* parentWellPath;
wellLogFile->firstAncestorOrThisOfType(parentWellPath);
wellLogFile->firstAncestorOrThisOfType( parentWellPath );
if (parentWellPath)
if ( parentWellPath )
{
std::set<RimViewWindow*> referringPlots = referringWellLogPlots(wellLogFile);
parentWellPath->deleteWellLogFile(wellLogFile);
std::set<RimViewWindow*> referringPlots = referringWellLogPlots( wellLogFile );
parentWellPath->deleteWellLogFile( wellLogFile );
for (RimViewWindow* plot : referringPlots)
for ( RimViewWindow* plot : referringPlots )
{
plot->loadDataAndUpdate();
}
@@ -78,46 +78,46 @@ void RicWellLogFileCloseFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellLogFileCloseFeature::setupActionLook(QAction* actionToSetup)
void RicWellLogFileCloseFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Close Well Log File(s)");
actionToSetup->setIcon(QIcon(":/Erase.png"));
actionToSetup->setText( "Close Well Log File(s)" );
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::set<RimViewWindow*> RicWellLogFileCloseFeature::referringWellLogPlots(const RimWellLogFile* wellLogFile)
std::set<RimViewWindow*> RicWellLogFileCloseFeature::referringWellLogPlots( const RimWellLogFile* wellLogFile )
{
// Remove all curves displaying data from the specified wellLogFile
std::vector<caf::PdmObjectHandle*> referringObjects;
wellLogFile->objectsWithReferringPtrFields(referringObjects);
wellLogFile->objectsWithReferringPtrFields( referringObjects );
std::set<RimViewWindow*> plots;
for (const auto& obj : referringObjects)
for ( const auto& obj : referringObjects )
{
RimWellAllocationPlot* allocationPlot;
RimWellPltPlot* pltPlot;
RimWellRftPlot* rftPlot;
RimWellLogPlot* wellLogPlot;
RimWellPltPlot* pltPlot;
RimWellRftPlot* rftPlot;
RimWellLogPlot* wellLogPlot;
obj->firstAncestorOrThisOfType(allocationPlot);
obj->firstAncestorOrThisOfType(pltPlot);
obj->firstAncestorOrThisOfType(rftPlot);
obj->firstAncestorOrThisOfType(wellLogPlot);
obj->firstAncestorOrThisOfType( allocationPlot );
obj->firstAncestorOrThisOfType( pltPlot );
obj->firstAncestorOrThisOfType( rftPlot );
obj->firstAncestorOrThisOfType( wellLogPlot );
RimViewWindow* plot =
allocationPlot ? dynamic_cast<RimViewWindow*>(allocationPlot) :
pltPlot ? dynamic_cast<RimViewWindow*>(pltPlot) :
rftPlot ? dynamic_cast<RimViewWindow*>(rftPlot) :
wellLogPlot ? dynamic_cast<RimViewWindow*>(wellLogPlot) :
nullptr;
RimViewWindow* plot = allocationPlot
? dynamic_cast<RimViewWindow*>( allocationPlot )
: pltPlot
? dynamic_cast<RimViewWindow*>( pltPlot )
: rftPlot ? dynamic_cast<RimViewWindow*>( rftPlot )
: wellLogPlot ? dynamic_cast<RimViewWindow*>( wellLogPlot ) : nullptr;
if (plot != nullptr)
if ( plot != nullptr )
{
plots.insert(plot);
plots.insert( plot );
}
}
return plots;
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,17 +26,17 @@ class RimWellLogFile;
class RimViewWindow;
//==================================================================================================
///
///
//==================================================================================================
class RicWellLogFileCloseFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
std::set<RimViewWindow*> referringWellLogPlots(const RimWellLogFile* wellLogFile);
std::set<RimViewWindow*> referringWellLogPlots( const RimWellLogFile* wellLogFile );
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,24 +22,23 @@
#include "RiaColorTables.h"
#include "RimWellAllocationPlot.h"
#include "RimWellRftPlot.h"
#include "RimWellLogCurve.h"
#include "RimWellRftPlot.h"
#include "cafSelectionManager.h"
#include <QColor>
//--------------------------------------------------------------------------------------------------
/// Pick default curve color from an index based palette
//--------------------------------------------------------------------------------------------------
cvf::Color3f RicWellLogPlotCurveFeatureImpl::curveColorFromTable(size_t index)
cvf::Color3f RicWellLogPlotCurveFeatureImpl::curveColorFromTable( size_t index )
{
return RiaColorTables::wellLogPlotPaletteColors().cycledColor3f(index);
return RiaColorTables::wellLogPlotPaletteColors().cycledColor3f( index );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
std::vector<RimWellLogCurve*> RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves()
{
@@ -47,57 +46,59 @@ std::vector<RimWellLogCurve*> RicWellLogPlotCurveFeatureImpl::selectedWellLogCur
{
std::vector<caf::PdmUiItem*> selectedItems;
caf::SelectionManager::instance()->selectedItems(selectedItems);
caf::SelectionManager::instance()->selectedItems( selectedItems );
for (caf::PdmUiItem* selectedItem : selectedItems)
for ( caf::PdmUiItem* selectedItem : selectedItems )
{
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(selectedItem);
if (objHandle)
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( selectedItem );
if ( objHandle )
{
std::vector<RimWellLogCurve*> childCurves;
objHandle->descendantsIncludingThisOfType(childCurves);
objHandle->descendantsIncludingThisOfType( childCurves );
for (RimWellLogCurve* curve : childCurves)
for ( RimWellLogCurve* curve : childCurves )
{
curveSet.insert(curve);
curveSet.insert( curve );
}
}
}
}
std::vector<RimWellLogCurve*> allCurves;
for (RimWellLogCurve* curve : curveSet)
for ( RimWellLogCurve* curve : curveSet )
{
allCurves.push_back(curve);
allCurves.push_back( curve );
}
return allCurves;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellAllocationPlot* RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
if (!destinationObject) return nullptr;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
if ( !destinationObject ) return nullptr;
RimWellAllocationPlot* wellAllocationPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(wellAllocationPlot);
destinationObject->firstAncestorOrThisOfType( wellAllocationPlot );
return wellAllocationPlot;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellRftPlot* RicWellLogPlotCurveFeatureImpl::parentWellRftPlot()
{
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(caf::SelectionManager::instance()->selectedItem());
if (!destinationObject) return nullptr;
caf::PdmObjectHandle* destinationObject = dynamic_cast<caf::PdmObjectHandle*>(
caf::SelectionManager::instance()->selectedItem() );
if ( !destinationObject ) return nullptr;
RimWellRftPlot* wellRftPlot = nullptr;
destinationObject->firstAncestorOrThisOfType(wellRftPlot);
destinationObject->firstAncestorOrThisOfType( wellRftPlot );
return wellRftPlot;
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,13 +26,13 @@ class RimWellAllocationPlot;
class RimWellRftPlot;
//==================================================================================================
///
///
//==================================================================================================
class RicWellLogPlotCurveFeatureImpl
{
public:
static cvf::Color3f curveColorFromTable(size_t index);
static cvf::Color3f curveColorFromTable( size_t index );
static std::vector<RimWellLogCurve*> selectedWellLogCurves();
static RimWellAllocationPlot* parentWellAllocationPlot();
static RimWellRftPlot* parentWellRftPlot();
static RimWellAllocationPlot* parentWellAllocationPlot();
static RimWellRftPlot* parentWellRftPlot();
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -30,53 +30,52 @@
#include "cvfAssert.h"
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogTrack* destTrack,
const std::vector<RimWellLogCurve*>& curves,
RimWellLogCurve* curveToInsertAfter)
void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack( RimWellLogTrack* destTrack,
const std::vector<RimWellLogCurve*>& curves,
RimWellLogCurve* curveToInsertAfter )
{
CVF_ASSERT(destTrack );
CVF_ASSERT( destTrack );
std::set<RimWellLogTrack*> srcTracks;
std::set<RimWellLogPlot*> srcPlots;
std::set<RimWellLogPlot*> srcPlots;
for (size_t cIdx = 0; cIdx < curves.size(); cIdx++)
for ( size_t cIdx = 0; cIdx < curves.size(); cIdx++ )
{
RimWellLogCurve* curve = curves[cIdx];
RimWellLogTrack* wellLogPlotTrack;
curve->firstAncestorOrThisOfType(wellLogPlotTrack);
if (wellLogPlotTrack)
curve->firstAncestorOrThisOfType( wellLogPlotTrack );
if ( wellLogPlotTrack )
{
wellLogPlotTrack->takeOutCurve(curve);
wellLogPlotTrack->takeOutCurve( curve );
wellLogPlotTrack->updateConnectedEditors();
srcTracks.insert(wellLogPlotTrack);
srcTracks.insert( wellLogPlotTrack );
RimWellLogPlot* plot;
wellLogPlotTrack->firstAncestorOrThisOfType(plot);
if (plot) srcPlots.insert(plot);
wellLogPlotTrack->firstAncestorOrThisOfType( plot );
if ( plot ) srcPlots.insert( plot );
}
}
size_t insertionStartIndex = 0;
if (curveToInsertAfter) insertionStartIndex = destTrack->curveIndex(curveToInsertAfter) + 1;
if ( curveToInsertAfter ) insertionStartIndex = destTrack->curveIndex( curveToInsertAfter ) + 1;
for (size_t cIdx = 0; cIdx < curves.size(); cIdx++)
for ( size_t cIdx = 0; cIdx < curves.size(); cIdx++ )
{
destTrack->insertCurve(curves[cIdx], insertionStartIndex + cIdx);
destTrack->insertCurve( curves[cIdx], insertionStartIndex + cIdx );
}
for (std::set<RimWellLogPlot*>::iterator pIt = srcPlots.begin(); pIt != srcPlots.end(); ++pIt)
for ( std::set<RimWellLogPlot*>::iterator pIt = srcPlots.begin(); pIt != srcPlots.end(); ++pIt )
{
(*pIt)->calculateAvailableDepthRange();
( *pIt )->calculateAvailableDepthRange();
}
for (std::set<RimWellLogTrack*>::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt)
for ( std::set<RimWellLogTrack*>::iterator tIt = srcTracks.begin(); tIt != srcTracks.end(); ++tIt )
{
(*tIt)->updateParentPlotZoom();
(*tIt)->calculateXZoomRangeAndUpdateQwt();
( *tIt )->updateParentPlotZoom();
( *tIt )->calculateXZoomRangeAndUpdateQwt();
}
destTrack->loadDataAndUpdate();
@@ -86,54 +85,52 @@ void RicWellLogPlotTrackFeatureImpl::moveCurvesToWellLogPlotTrack(RimWellLogTrac
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellLogPlotTrackFeatureImpl::moveTracksToWellLogPlot(RimWellLogPlot* dstWellLogPlot,
const std::vector<RimWellLogTrack*>& tracksToMove,
RimWellLogTrack* trackToInsertAfter)
void RicWellLogPlotTrackFeatureImpl::moveTracksToWellLogPlot( RimWellLogPlot* dstWellLogPlot,
const std::vector<RimWellLogTrack*>& tracksToMove,
RimWellLogTrack* trackToInsertAfter )
{
CVF_ASSERT(dstWellLogPlot);
CVF_ASSERT( dstWellLogPlot );
RiuPlotMainWindow* plotWindow = RiaGuiApplication::instance()->getOrCreateMainPlotWindow();
std::set<RimWellLogPlot*> srcPlots;
for (size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++)
for ( size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++ )
{
RimWellLogTrack* track = tracksToMove[tIdx];
RimWellLogPlot* srcPlot;
track->firstAncestorOrThisOfType(srcPlot);
if (srcPlot)
track->firstAncestorOrThisOfType( srcPlot );
if ( srcPlot )
{
srcPlot->removeTrack(track);
srcPlot->removeTrack( track );
srcPlots.insert(srcPlot);
srcPlots.insert( srcPlot );
}
}
for (std::set<RimWellLogPlot*>::iterator pIt = srcPlots.begin(); pIt != srcPlots.end(); ++pIt)
for ( std::set<RimWellLogPlot*>::iterator pIt = srcPlots.begin(); pIt != srcPlots.end(); ++pIt )
{
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>((*pIt)->viewWidget());
plotWindow->setWidthOfMdiWindow(viewWidget, viewWidget->preferredSize().width());
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( ( *pIt )->viewWidget() );
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredSize().width() );
(*pIt)->calculateAvailableDepthRange();
(*pIt)->updateTrackNames();
(*pIt)->updateDepthZoom();
(*pIt)->updateConnectedEditors();
( *pIt )->calculateAvailableDepthRange();
( *pIt )->updateTrackNames();
( *pIt )->updateDepthZoom();
( *pIt )->updateConnectedEditors();
}
size_t insertionStartIndex = 0;
if (trackToInsertAfter) insertionStartIndex = dstWellLogPlot->trackIndex(trackToInsertAfter) + 1;
if ( trackToInsertAfter ) insertionStartIndex = dstWellLogPlot->trackIndex( trackToInsertAfter ) + 1;
for (size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++)
for ( size_t tIdx = 0; tIdx < tracksToMove.size(); tIdx++ )
{
dstWellLogPlot->insertTrack(tracksToMove[tIdx], insertionStartIndex + tIdx);
dstWellLogPlot->insertTrack( tracksToMove[tIdx], insertionStartIndex + tIdx );
}
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>(dstWellLogPlot->viewWidget());
plotWindow->setWidthOfMdiWindow(viewWidget, viewWidget->preferredSize().width());
RiuWellLogPlot* viewWidget = dynamic_cast<RiuWellLogPlot*>( dstWellLogPlot->viewWidget() );
plotWindow->setWidthOfMdiWindow( viewWidget, viewWidget->preferredSize().width() );
dstWellLogPlot->updateTrackNames();
dstWellLogPlot->updateTracks();
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,16 +26,15 @@ class RimWellLogTrack;
class RimWellLogCurve;
//==================================================================================================
///
///
//==================================================================================================
class RicWellLogPlotTrackFeatureImpl
{
public:
static void moveCurvesToWellLogPlotTrack(RimWellLogTrack* dstTrack,
const std::vector<RimWellLogCurve*>& curves,
RimWellLogCurve* insertAfterCurve);
static void moveTracksToWellLogPlot(RimWellLogPlot* wellLogPlot,
const std::vector<RimWellLogTrack*>& tracks,
RimWellLogTrack* trackToInsertAfter);
static void moveCurvesToWellLogPlotTrack( RimWellLogTrack* dstTrack,
const std::vector<RimWellLogCurve*>& curves,
RimWellLogCurve* insertAfterCurve );
static void moveTracksToWellLogPlot( RimWellLogPlot* wellLogPlot,
const std::vector<RimWellLogTrack*>& tracks,
RimWellLogTrack* trackToInsertAfter );
};
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -28,10 +28,10 @@
#include <QAction>
#include <QFileDialog>
CAF_CMD_SOURCE_INIT(RicWellLogsImportFileFeature, "RicWellLogsImportFileFeature");
CAF_CMD_SOURCE_INIT( RicWellLogsImportFileFeature, "RicWellLogsImportFileFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicWellLogsImportFileFeature::isCommandEnabled()
{
@@ -39,30 +39,33 @@ bool RicWellLogsImportFileFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellLogsImportFileFeature::onActionTriggered(bool isChecked)
void RicWellLogsImportFileFeature::onActionTriggered( bool isChecked )
{
// Open dialog box to select well path files
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory("WELL_LOGS_DIR");
QStringList wellLogFilePaths = QFileDialog::getOpenFileNames(Riu3DMainWindowTools::mainWindowWidget(), "Import Well Logs", defaultDir, "Well Logs (*.las);;All Files (*.*)");
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory( "WELL_LOGS_DIR" );
QStringList wellLogFilePaths = QFileDialog::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
"Import Well Logs",
defaultDir,
"Well Logs (*.las);;All Files (*.*)" );
if (wellLogFilePaths.size() < 1) return;
if ( wellLogFilePaths.size() < 1 ) return;
// Remember the path to next time
app->setLastUsedDialogDirectory("WELL_LOGS_DIR", QFileInfo(wellLogFilePaths.last()).absolutePath());
app->setLastUsedDialogDirectory( "WELL_LOGS_DIR", QFileInfo( wellLogFilePaths.last() ).absolutePath() );
app->addWellLogsToModel(wellLogFilePaths);
app->addWellLogsToModel( wellLogFilePaths );
caf::PdmUiObjectEditorHandle::updateUiAllObjectEditors();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellLogsImportFileFeature::setupActionLook(QAction* actionToSetup)
void RicWellLogsImportFileFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Import Well &Logs from File");
actionToSetup->setIcon(QIcon(":/LasFile16x16.png"));
actionToSetup->setText( "Import Well &Logs from File" );
actionToSetup->setIcon( QIcon( ":/LasFile16x16.png" ) );
}
@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,14 +22,13 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicWellLogsImportFileFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;