#4683 clang-format on all files in ApplicationCode

This commit is contained in:
Magne Sjaastad
2019-09-06 10:40:57 +02:00
parent 3a317504bb
commit fe9e567825
2092 changed files with 117952 additions and 111846 deletions

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,15 +21,15 @@
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RimTextAnnotation.h"
#include "RimReachCircleAnnotation.h"
#include "RimPolylinesAnnotation.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimAnnotationLineAppearance.h"
#include "RimProject.h"
#include "RimOilField.h"
#include "RimPolylinesAnnotation.h"
#include "RimProject.h"
#include "RimReachCircleAnnotation.h"
#include "RimTextAnnotation.h"
#include "RiuMainWindow.h"
@@ -37,47 +37,46 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicCreateReachCircleAnnotationFeature, "RicCreateReachCircleAnnotationFeature");
CAF_CMD_SOURCE_INIT( RicCreateReachCircleAnnotationFeature, "RicCreateReachCircleAnnotationFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicCreateReachCircleAnnotationFeature::isCommandEnabled()
{
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
return selObjs.size() == 1 || (selGroupColl.size() == 1
&& selGroupColl.front()->uiCapability()->uiName() == RimAnnotationGroupCollection::REACH_CIRCLE_ANNOTATION_UI_NAME);
return selObjs.size() == 1 ||
( selGroupColl.size() == 1 && selGroupColl.front()->uiCapability()->uiName() ==
RimAnnotationGroupCollection::REACH_CIRCLE_ANNOTATION_UI_NAME );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateReachCircleAnnotationFeature::onActionTriggered(bool isChecked)
void RicCreateReachCircleAnnotationFeature::onActionTriggered( bool isChecked )
{
auto coll = annotationCollection();
if (coll)
if ( coll )
{
auto newAnnotation = new RimReachCircleAnnotation();
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f(coll->lineBasedAnnotationsCount());
newAnnotation->appearance()->setColor(newColor);
newAnnotation->enablePicking(true);
coll->addAnnotation(newAnnotation);
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f( coll->lineBasedAnnotationsCount() );
newAnnotation->appearance()->setColor( newColor );
newAnnotation->enablePicking( true );
coll->addAnnotation( newAnnotation );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateReachCircleAnnotationFeature::setupActionLook(QAction* actionToSetup)
void RicCreateReachCircleAnnotationFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/ReachCircle16x16.png"));
actionToSetup->setText("Create Reach Circle Annotation");
actionToSetup->setIcon( QIcon( ":/ReachCircle16x16.png" ) );
actionToSetup->setText( "Create Reach Circle Annotation" );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,10 +24,8 @@
#include <QString>
class RimAnnotationCollection;
//==================================================================================================
///
//==================================================================================================
@@ -38,8 +36,8 @@ class RicCreateReachCircleAnnotationFeature : 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;
private:
RimAnnotationCollection* annotationCollection() const;

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,14 +20,14 @@
#include "RiaApplication.h"
#include "RimTextAnnotation.h"
#include "RimReachCircleAnnotation.h"
#include "RimPolylinesAnnotation.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimProject.h"
#include "RimOilField.h"
#include "RimPolylinesAnnotation.h"
#include "RimProject.h"
#include "RimReachCircleAnnotation.h"
#include "RimTextAnnotation.h"
#include "RiuMainWindow.h"
@@ -35,8 +35,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicCreateTextAnnotationFeature, "RicCreateTextAnnotationFeature");
CAF_CMD_SOURCE_INIT( RicCreateTextAnnotationFeature, "RicCreateTextAnnotationFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -45,37 +44,37 @@ bool RicCreateTextAnnotationFeature::isCommandEnabled()
{
auto selObjsGlobal = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selObjs2InView = caf::selectedObjectsByTypeStrict<RimAnnotationInViewCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
return selObjsGlobal.size() == 1 || selObjs2InView.size() == 1 ||
(selGroupColl.size() == 1 &&
selGroupColl.front()->uiCapability()->uiName() == RimAnnotationGroupCollection::TEXT_ANNOTATION_UI_NAME);
( selGroupColl.size() == 1 &&
selGroupColl.front()->uiCapability()->uiName() == RimAnnotationGroupCollection::TEXT_ANNOTATION_UI_NAME );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationFeature::onActionTriggered(bool isChecked)
void RicCreateTextAnnotationFeature::onActionTriggered( bool isChecked )
{
auto coll = annotationCollectionBase();
if (coll)
if ( coll )
{
auto newAnnotation = new RimTextAnnotation();
newAnnotation->enablePicking(true);
coll->addAnnotation(newAnnotation);
newAnnotation->enablePicking( true );
coll->addAnnotation( newAnnotation );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationFeature::setupActionLook(QAction* actionToSetup)
void RicCreateTextAnnotationFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/TextAnnotation16x16.png"));
actionToSetup->setText("Create Text Annotation");
actionToSetup->setIcon( QIcon( ":/TextAnnotation16x16.png" ) );
actionToSetup->setText( "Create Text Annotation" );
}
//--------------------------------------------------------------------------------------------------
@@ -84,13 +83,13 @@ void RicCreateTextAnnotationFeature::setupActionLook(QAction* actionToSetup)
RimAnnotationCollectionBase* RicCreateTextAnnotationFeature::annotationCollectionBase() const
{
auto selColls = caf::selectedObjectsByTypeStrict<RimAnnotationCollectionBase*>();
if (selColls.size() == 1) return selColls.front();
if ( selColls.size() == 1 ) return selColls.front();
RimAnnotationCollectionBase* coll = nullptr;
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
if (selGroupColl.size() == 1)
RimAnnotationCollectionBase* coll = nullptr;
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
if ( selGroupColl.size() == 1 )
{
selGroupColl.front()->firstAncestorOrThisOfType(coll);
selGroupColl.front()->firstAncestorOrThisOfType( coll );
}
return coll;

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,12 +24,10 @@
#include <QString>
class RimAnnotationCollection;
class RimAnnotationCollectionBase;
class RimAnnotationInViewCollection;
//==================================================================================================
///
//==================================================================================================
@@ -40,8 +38,8 @@ class RicCreateTextAnnotationFeature : 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;
RimAnnotationCollectionBase* annotationCollectionBase() const;
RimAnnotationCollectionBase* annotationCollectionBase() const;
};

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,8 +21,8 @@
#include "RiaApplication.h"
#include "RimAnnotationInViewCollection.h"
#include "RimEclipseContourMapView.h"
#include "RimCase.h"
#include "RimEclipseContourMapView.h"
#include "RimGridView.h"
#include "RimTextAnnotation.h"
@@ -36,8 +36,7 @@
#include <cmath>
CAF_CMD_SOURCE_INIT(RicCreateTextAnnotationIn3dViewFeature, "RicCreateTextAnnotationIn3dViewFeature");
CAF_CMD_SOURCE_INIT( RicCreateTextAnnotationIn3dViewFeature, "RicCreateTextAnnotationIn3dViewFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -50,28 +49,28 @@ bool RicCreateTextAnnotationIn3dViewFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered(bool isChecked)
void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered( bool isChecked )
{
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimEclipseContourMapView * contMapView = dynamic_cast<RimEclipseContourMapView*>(activeView);
RimGridView* activeView = RiaApplication::instance()->activeGridView();
RimEclipseContourMapView* contMapView = dynamic_cast<RimEclipseContourMapView*>( activeView );
if ( activeView )
{
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
cvf::BoundingBox bbox = activeView->ownerCase()->activeCellsBoundingBox();
cvf::Vec3d domainCoord = activeView->viewer()->lastPickPositionInDomainCoords();
cvf::BoundingBox bbox = activeView->ownerCase()->activeCellsBoundingBox();
if (contMapView) domainCoord[2] = bbox.max().z() - bbox.extent().z() * 0.2;
if ( contMapView ) domainCoord[2] = bbox.max().z() - bbox.extent().z() * 0.2;
auto coll = activeView->annotationCollection();
auto coll = activeView->annotationCollection();
if ( coll )
{
auto newAnnotation = new RimTextAnnotation();
newAnnotation->setAnchorPoint(domainCoord);
newAnnotation->setAnchorPoint( domainCoord );
cvf::Vec3d labelPos = domainCoord;
if (activeView->viewer()->mainCamera()->direction().z() <= 0)
if ( activeView->viewer()->mainCamera()->direction().z() <= 0 )
{
labelPos.z() = bbox.max().z();
}
@@ -81,18 +80,20 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered(bool isChecked)
}
cvf::Vec3d horizontalRight = activeView->viewer()->mainCamera()->direction() ^ cvf::Vec3d::Z_AXIS;
cvf::Vec3d horizontalUp = activeView->viewer()->mainCamera()->up() - (cvf::Vec3d::Z_AXIS * (activeView->viewer()->mainCamera()->up() * cvf::Vec3d::Z_AXIS) );
cvf::Vec3d horizontalUp = activeView->viewer()->mainCamera()->up() -
( cvf::Vec3d::Z_AXIS *
( activeView->viewer()->mainCamera()->up() * cvf::Vec3d::Z_AXIS ) );
bool isOk = horizontalRight.normalize();
if (!isOk) horizontalRight = {1.0, 0.0, 0.0};
if ( !isOk ) horizontalRight = {1.0, 0.0, 0.0};
double height = fabs(labelPos.z() - domainCoord.z());
newAnnotation->setLabelPoint(labelPos + 2.0*height * (horizontalRight + horizontalUp));
double height = fabs( labelPos.z() - domainCoord.z() );
newAnnotation->setLabelPoint( labelPos + 2.0 * height * ( horizontalRight + horizontalUp ) );
coll->addAnnotation(newAnnotation);
coll->addAnnotation( newAnnotation );
coll->scheduleRedrawOfRelevantViews();
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
}
}
}
@@ -100,9 +101,8 @@ void RicCreateTextAnnotationIn3dViewFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateTextAnnotationIn3dViewFeature::setupActionLook(QAction* actionToSetup)
void RicCreateTextAnnotationIn3dViewFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/TextAnnotation16x16.png"));
actionToSetup->setText("Create Text Annotation");
actionToSetup->setIcon( QIcon( ":/TextAnnotation16x16.png" ) );
actionToSetup->setText( "Create Text Annotation" );
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -30,7 +30,6 @@ class RicCreateTextAnnotationIn3dViewFeature : 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;
};

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,15 +21,15 @@
#include "RiaApplication.h"
#include "RiaColorTables.h"
#include "RimTextAnnotation.h"
#include "RimReachCircleAnnotation.h"
#include "RimUserDefinedPolylinesAnnotation.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimAnnotationLineAppearance.h"
#include "RimProject.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimReachCircleAnnotation.h"
#include "RimTextAnnotation.h"
#include "RimUserDefinedPolylinesAnnotation.h"
#include "RiuMainWindow.h"
@@ -37,9 +37,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicCreateUserDefinedPolylinesAnnotationFeature, "RicCreateUserDefinedPolylinesAnnotationFeature");
CAF_CMD_SOURCE_INIT( RicCreateUserDefinedPolylinesAnnotationFeature, "RicCreateUserDefinedPolylinesAnnotationFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -49,44 +47,45 @@ bool RicCreateUserDefinedPolylinesAnnotationFeature::isCommandEnabled()
auto selObjs = caf::selectedObjectsByTypeStrict<RimAnnotationCollection*>();
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
return selObjs.size() == 1 || (selGroupColl.size() == 1 && selGroupColl.front()->uiCapability()->uiName() ==
RimAnnotationGroupCollection::USED_DEFINED_POLYLINE_ANNOTATION_UI_NAME);
return selObjs.size() == 1 ||
( selGroupColl.size() == 1 && selGroupColl.front()->uiCapability()->uiName() ==
RimAnnotationGroupCollection::USED_DEFINED_POLYLINE_ANNOTATION_UI_NAME );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateUserDefinedPolylinesAnnotationFeature::onActionTriggered(bool isChecked)
void RicCreateUserDefinedPolylinesAnnotationFeature::onActionTriggered( bool isChecked )
{
auto coll = annotationCollection();
if (coll)
if ( coll )
{
auto newAnnotation = new RimUserDefinedPolylinesAnnotation();
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f(coll->lineBasedAnnotationsCount());
newAnnotation->appearance()->setColor(newColor);
newAnnotation->appearance()->setSphereColor(newColor);
newAnnotation->enablePicking(true);
coll->addAnnotation(newAnnotation);
auto newColor = RiaColorTables::categoryPaletteColors().cycledColor3f( coll->lineBasedAnnotationsCount() );
newAnnotation->appearance()->setColor( newColor );
newAnnotation->appearance()->setSphereColor( newColor );
newAnnotation->enablePicking( true );
coll->addAnnotation( newAnnotation );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicCreateUserDefinedPolylinesAnnotationFeature::setupActionLook(QAction* actionToSetup)
void RicCreateUserDefinedPolylinesAnnotationFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/Plus.png"));
actionToSetup->setText("Create User Defined Polyline Annotation");
actionToSetup->setIcon( QIcon( ":/Plus.png" ) );
actionToSetup->setText( "Create User Defined Polyline Annotation" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimAnnotationCollection* RicCreateUserDefinedPolylinesAnnotationFeature::annotationCollection() const
RimAnnotationCollection* RicCreateUserDefinedPolylinesAnnotationFeature::annotationCollection() const
{
auto project = RiaApplication::instance()->project();
auto project = RiaApplication::instance()->project();
auto oilField = project->activeOilField();
return oilField ? oilField->annotationCollection() : nullptr;
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,10 +24,8 @@
#include <QString>
class RimAnnotationCollection;
//==================================================================================================
///
//==================================================================================================
@@ -38,8 +36,8 @@ class RicCreateUserDefinedPolylinesAnnotationFeature : 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;
private:
RimAnnotationCollection* annotationCollection() const;

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,13 +20,13 @@
#include "RiaApplication.h"
#include "RimTextAnnotation.h"
#include "RimReachCircleAnnotation.h"
#include "RimPolylinesAnnotation.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationInViewCollection.h"
#include "RimProject.h"
#include "RimOilField.h"
#include "RimPolylinesAnnotation.h"
#include "RimProject.h"
#include "RimReachCircleAnnotation.h"
#include "RimTextAnnotation.h"
#include "RiuMainWindow.h"
@@ -34,15 +34,14 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDeleteAnnotationFeature, "RicDeleteAnnotationFeature");
CAF_CMD_SOURCE_INIT( RicDeleteAnnotationFeature, "RicDeleteAnnotationFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDeleteAnnotationFeature::isCommandEnabled()
{
auto textAnnots = caf::selectedObjectsByTypeStrict<RimTextAnnotation*>();
auto textAnnots = caf::selectedObjectsByTypeStrict<RimTextAnnotation*>();
auto lineBasedAnnots = caf::selectedObjectsByTypeStrict<RimLineBasedAnnotation*>();
return !textAnnots.empty() || !lineBasedAnnots.empty();
@@ -51,35 +50,35 @@ bool RicDeleteAnnotationFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDeleteAnnotationFeature::onActionTriggered(bool isChecked)
void RicDeleteAnnotationFeature::onActionTriggered( bool isChecked )
{
{
auto annotations = caf::selectedObjectsByTypeStrict<RimTextAnnotation*>();
while(!annotations.empty())
while ( !annotations.empty() )
{
auto annotation = annotations.front();
RimAnnotationCollection* coll;
annotation->firstAncestorOrThisOfType(coll);
if (coll)
annotation->firstAncestorOrThisOfType( coll );
if ( coll )
{
coll->addAnnotation()
}
coll->addAnnotation(newAnnotation);
coll->addAnnotation( newAnnotation );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
}
}
{
auto coll = annotationInViewCollection();
if (coll)
if ( coll )
{
auto newAnnotation = new RimTextAnnotation();
coll->addAnnotation(newAnnotation);
coll->addAnnotation( newAnnotation );
coll->updateConnectedEditors();
RiuMainWindow::instance()->selectAsCurrentItem(newAnnotation);
RiuMainWindow::instance()->selectAsCurrentItem( newAnnotation );
}
}
}
@@ -87,8 +86,8 @@ void RicDeleteAnnotationFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDeleteAnnotationFeature::setupActionLook(QAction* actionToSetup)
void RicDeleteAnnotationFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/minus-sign-red.png"));
actionToSetup->setText("Delete Annotation");
actionToSetup->setIcon( QIcon( ":/minus-sign-red.png" ) );
actionToSetup->setText( "Delete Annotation" );
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,11 +20,11 @@
#include "RiaApplication.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationGroupCollection.h"
#include "RimOilField.h"
#include "RimPolylinesFromFileAnnotation.h"
#include "RimProject.h"
#include "Riu3DMainWindowTools.h"
@@ -33,11 +33,10 @@
#include <cafSelectionManagerTools.h>
CAF_CMD_SOURCE_INIT(RicImportPolylinesAnnotationFeature, "RicImportPolylinesAnnotationFeature");
CAF_CMD_SOURCE_INIT( RicImportPolylinesAnnotationFeature, "RicImportPolylinesAnnotationFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicImportPolylinesAnnotationFeature::isCommandEnabled()
{
@@ -45,57 +44,57 @@ bool RicImportPolylinesAnnotationFeature::isCommandEnabled()
auto selGroupColl = caf::selectedObjectsByTypeStrict<RimAnnotationGroupCollection*>();
return selObjs.size() == 1 ||
(selGroupColl.size() == 1 && selGroupColl.front()->uiCapability()->uiName() ==
RimAnnotationGroupCollection::POLYLINE_FROM_FILE_ANNOTATION_UI_NAME);
( selGroupColl.size() == 1 && selGroupColl.front()->uiCapability()->uiName() ==
RimAnnotationGroupCollection::POLYLINE_FROM_FILE_ANNOTATION_UI_NAME );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicImportPolylinesAnnotationFeature::onActionTriggered(bool isChecked)
void RicImportPolylinesAnnotationFeature::onActionTriggered( bool isChecked )
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory("BINARY_GRID");
QStringList fileNames = QFileDialog::getOpenFileNames(Riu3DMainWindowTools::mainWindowWidget(),
"Import Poly Lines Annotation",
defaultDir,
"Text File (*.txt);Polylines (*.dat);All Files (*.*)");
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory( "BINARY_GRID" );
QStringList fileNames = QFileDialog::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
"Import Poly Lines Annotation",
defaultDir,
"Text File (*.txt);Polylines (*.dat);All Files (*.*)" );
if (fileNames.isEmpty()) return;
if ( fileNames.isEmpty() ) return;
// Remember the path to next time
app->setLastUsedDialogDirectory("BINARY_GRID", QFileInfo(fileNames.last()).absolutePath());
app->setLastUsedDialogDirectory( "BINARY_GRID", QFileInfo( fileNames.last() ).absolutePath() );
// Find or create the AnnotationsCollection
RimProject* proj = RiaApplication::instance()->project();
RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
RimProject* proj = RiaApplication::instance()->project();
RimAnnotationCollection* annotColl = proj->activeOilField()->annotationCollection();
if (!annotColl)
if ( !annotColl )
{
annotColl = new RimAnnotationCollection;
annotColl = new RimAnnotationCollection;
proj->activeOilField()->annotationCollection = annotColl;
}
// For each file,
RimPolylinesFromFileAnnotation* lastCreatedOrUpdated = annotColl->importOrUpdatePolylinesFromFile(fileNames);
// For each file,
RimPolylinesFromFileAnnotation* lastCreatedOrUpdated = annotColl->importOrUpdatePolylinesFromFile( fileNames );
proj->updateConnectedEditors();
if (lastCreatedOrUpdated)
if ( lastCreatedOrUpdated )
{
Riu3DMainWindowTools::selectAsCurrentItem(lastCreatedOrUpdated);
Riu3DMainWindowTools::selectAsCurrentItem( lastCreatedOrUpdated );
}
annotColl->scheduleRedrawOfRelevantViews();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicImportPolylinesAnnotationFeature::setupActionLook(QAction* actionToSetup)
void RicImportPolylinesAnnotationFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/PolylinesFromFile16x16.png"));
actionToSetup->setText("Import Poly Lines Annotation");
actionToSetup->setIcon( QIcon( ":/PolylinesFromFile16x16.png" ) );
actionToSetup->setText( "Import Poly Lines Annotation" );
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,7 +21,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicImportPolylinesAnnotationFeature : public caf::CmdFeature
{
@@ -33,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,9 @@
#include "../WellPathCommands/PointTangentManipulator/RicPointTangentManipulator.h"
#include "RimTextAnnotation.h"
#include "Rim3dView.h"
#include "RimCase.h"
#include "RimTextAnnotation.h"
#include "RiuViewer.h"
@@ -30,159 +30,152 @@
#include "cafPdmUiCommandSystemProxy.h"
#include "cafSelectionManager.h"
#include "cvfPart.h"
#include "cvfModelBasicList.h"
#include "cvfPart.h"
CAF_PDM_UI_3D_OBJECT_EDITOR_SOURCE_INIT(RicTextAnnotation3dEditor);
CAF_PDM_UI_3D_OBJECT_EDITOR_SOURCE_INIT( RicTextAnnotation3dEditor );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RicTextAnnotation3dEditor::RicTextAnnotation3dEditor()
{
}
RicTextAnnotation3dEditor::RicTextAnnotation3dEditor() {}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RicTextAnnotation3dEditor::~RicTextAnnotation3dEditor()
{
RiuViewer* ownerRiuViewer = dynamic_cast<RiuViewer*>(ownerViewer());
RiuViewer* ownerRiuViewer = dynamic_cast<RiuViewer*>( ownerViewer() );
if (m_cvfModel.notNull() && ownerRiuViewer)
if ( m_cvfModel.notNull() && ownerRiuViewer )
{
// Could result in some circularities ....
ownerRiuViewer->removeStaticModel(m_cvfModel.p());
ownerRiuViewer->removeStaticModel( m_cvfModel.p() );
}
auto textAnnot = dynamic_cast<RimTextAnnotation*>(this->pdmObject());
if (textAnnot)
auto textAnnot = dynamic_cast<RimTextAnnotation*>( this->pdmObject() );
if ( textAnnot )
{
textAnnot->m_anchorPointXyd.uiCapability()->removeFieldEditor(this);
textAnnot->m_labelPointXyd.uiCapability()->removeFieldEditor(this);
textAnnot->m_anchorPointXyd.uiCapability()->removeFieldEditor( this );
textAnnot->m_labelPointXyd.uiCapability()->removeFieldEditor( this );
}
delete m_labelManipulator;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTextAnnotation3dEditor::configureAndUpdateUi(const QString& uiConfigName)
void RicTextAnnotation3dEditor::configureAndUpdateUi( const QString& uiConfigName )
{
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>(this->pdmObject());
RiuViewer* ownerRiuViewer = dynamic_cast<RiuViewer*>(ownerViewer());
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>( this->pdmObject() );
RiuViewer* ownerRiuViewer = dynamic_cast<RiuViewer*>( ownerViewer() );
if ( !textAnnot || !textAnnot->isActive())
if ( !textAnnot || !textAnnot->isActive() )
{
m_cvfModel->removeAllParts();
return;
}
textAnnot->m_anchorPointXyd.uiCapability()->addFieldEditor(this);
textAnnot->m_labelPointXyd.uiCapability()->addFieldEditor(this);
textAnnot->m_anchorPointXyd.uiCapability()->addFieldEditor( this );
textAnnot->m_labelPointXyd.uiCapability()->addFieldEditor( this );
if (m_labelManipulator.isNull())
if ( m_labelManipulator.isNull() )
{
m_labelManipulator = new RicPointTangentManipulator(ownerRiuViewer);
m_anchorManipulator = new RicPointTangentManipulator(ownerRiuViewer);
QObject::connect(m_labelManipulator,
SIGNAL( notifyUpdate(const cvf::Vec3d& , const cvf::Vec3d& ) ),
this,
SLOT( slotLabelUpdated(const cvf::Vec3d& , const cvf::Vec3d& ) ) );
QObject::connect(m_anchorManipulator,
SIGNAL( notifyUpdate(const cvf::Vec3d& , const cvf::Vec3d& ) ),
this,
SLOT( slotAnchorUpdated(const cvf::Vec3d& , const cvf::Vec3d& ) ) );
m_labelManipulator = new RicPointTangentManipulator( ownerRiuViewer );
m_anchorManipulator = new RicPointTangentManipulator( ownerRiuViewer );
QObject::connect( m_labelManipulator,
SIGNAL( notifyUpdate( const cvf::Vec3d&, const cvf::Vec3d& ) ),
this,
SLOT( slotLabelUpdated( const cvf::Vec3d&, const cvf::Vec3d& ) ) );
QObject::connect( m_anchorManipulator,
SIGNAL( notifyUpdate( const cvf::Vec3d&, const cvf::Vec3d& ) ),
this,
SLOT( slotAnchorUpdated( const cvf::Vec3d&, const cvf::Vec3d& ) ) );
m_cvfModel = new cvf::ModelBasicList;
ownerRiuViewer->addStaticModelOnce(m_cvfModel.p());
ownerRiuViewer->addStaticModelOnce( m_cvfModel.p() );
}
cvf::ref<caf::DisplayCoordTransform> dispXf;
double handleSize = 1.0;
double handleSize = 1.0;
{
dispXf = ownerRiuViewer->ownerReservoirView()->displayCoordTransform();
Rim3dView* view = dynamic_cast<Rim3dView*>(ownerRiuViewer->ownerReservoirView());
handleSize = 0.7 * view->ownerCase()->characteristicCellSize();
dispXf = ownerRiuViewer->ownerReservoirView()->displayCoordTransform();
Rim3dView* view = dynamic_cast<Rim3dView*>( ownerRiuViewer->ownerReservoirView() );
handleSize = 0.7 * view->ownerCase()->characteristicCellSize();
}
cvf::Vec3d labelPos(textAnnot->m_labelPointXyd());
cvf::Vec3d labelPos( textAnnot->m_labelPointXyd() );
labelPos.z() *= -1.0;
m_labelManipulator->setOrigin(dispXf->transformToDisplayCoord( labelPos ));
m_labelManipulator->setHandleSize(handleSize);
m_labelManipulator->setOrigin( dispXf->transformToDisplayCoord( labelPos ) );
m_labelManipulator->setHandleSize( handleSize );
cvf::Vec3d anchorPos(textAnnot->m_anchorPointXyd());
cvf::Vec3d anchorPos( textAnnot->m_anchorPointXyd() );
anchorPos.z() *= -1.0;
m_anchorManipulator->setOrigin(dispXf->transformToDisplayCoord( anchorPos ));
m_anchorManipulator->setHandleSize(handleSize);
m_anchorManipulator->setOrigin( dispXf->transformToDisplayCoord( anchorPos ) );
m_anchorManipulator->setHandleSize( handleSize );
m_cvfModel->removeAllParts();
m_labelManipulator->appendPartsToModel(m_cvfModel.p());
m_anchorManipulator->appendPartsToModel(m_cvfModel.p());
m_labelManipulator->appendPartsToModel( m_cvfModel.p() );
m_anchorManipulator->appendPartsToModel( m_cvfModel.p() );
m_cvfModel->updateBoundingBoxesRecursive();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTextAnnotation3dEditor::cleanupBeforeSettingPdmObject()
{
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>(this->pdmObject());
if (textAnnot)
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>( this->pdmObject() );
if ( textAnnot )
{
textAnnot->m_anchorPointXyd.uiCapability()->removeFieldEditor(this);
textAnnot->m_labelPointXyd.uiCapability()->removeFieldEditor(this);
textAnnot->m_anchorPointXyd.uiCapability()->removeFieldEditor( this );
textAnnot->m_labelPointXyd.uiCapability()->removeFieldEditor( this );
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTextAnnotation3dEditor::slotLabelUpdated(const cvf::Vec3d& origin, const cvf::Vec3d& tangent)
void RicTextAnnotation3dEditor::slotLabelUpdated( const cvf::Vec3d& origin, const cvf::Vec3d& tangent )
{
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>(this->pdmObject());
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>( this->pdmObject() );
if ( !textAnnot)
if ( !textAnnot )
{
return;
}
updatePoint(textAnnot->m_labelPointXyd.uiCapability(), origin);
updatePoint( textAnnot->m_labelPointXyd.uiCapability(), origin );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTextAnnotation3dEditor::slotAnchorUpdated(const cvf::Vec3d& origin, const cvf::Vec3d& dummy)
void RicTextAnnotation3dEditor::slotAnchorUpdated( const cvf::Vec3d& origin, const cvf::Vec3d& dummy )
{
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>(this->pdmObject());
RimTextAnnotation* textAnnot = dynamic_cast<RimTextAnnotation*>( this->pdmObject() );
if ( !textAnnot)
if ( !textAnnot )
{
return;
}
updatePoint(textAnnot->m_anchorPointXyd.uiCapability(), origin);
updatePoint( textAnnot->m_anchorPointXyd.uiCapability(), origin );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTextAnnotation3dEditor::updatePoint(caf::PdmUiFieldHandle* uiField, const cvf::Vec3d& newPos)
void RicTextAnnotation3dEditor::updatePoint( caf::PdmUiFieldHandle* uiField, const cvf::Vec3d& newPos )
{
cvf::ref<caf::DisplayCoordTransform> dispXf;
{
RiuViewer* viewer = dynamic_cast<RiuViewer*>(ownerViewer());
dispXf = viewer->ownerReservoirView()->displayCoordTransform();
RiuViewer* viewer = dynamic_cast<RiuViewer*>( ownerViewer() );
dispXf = viewer->ownerReservoirView()->displayCoordTransform();
}
cvf::Vec3d domainPos = dispXf->transformToDomainCoord( newPos);
domainPos.z() = -domainPos.z();
QVariant originVariant = caf::PdmValueFieldSpecialization < cvf::Vec3d >::convert(domainPos);
cvf::Vec3d domainPos = dispXf->transformToDomainCoord( newPos );
domainPos.z() = -domainPos.z();
QVariant originVariant = caf::PdmValueFieldSpecialization<cvf::Vec3d>::convert( domainPos );
caf::PdmUiCommandSystemProxy::instance()->setUiValueToField(uiField, originVariant);
caf::PdmUiCommandSystemProxy::instance()->setUiValueToField( uiField, originVariant );
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,11 +22,11 @@
class RicPointTangentManipulator;
#include "cvfObject.h"
#include "cvfVector3.h"
namespace cvf {
namespace cvf
{
class ModelBasicList;
}
@@ -42,18 +42,17 @@ public:
~RicTextAnnotation3dEditor() override;
protected:
void configureAndUpdateUi(const QString& uiConfigName) override;
void configureAndUpdateUi( const QString& uiConfigName ) override;
void cleanupBeforeSettingPdmObject() override;
private slots:
void slotLabelUpdated(const cvf::Vec3d& origin, const cvf::Vec3d& dummy);
void slotAnchorUpdated(const cvf::Vec3d& origin, const cvf::Vec3d& dummy);
void slotLabelUpdated( const cvf::Vec3d& origin, const cvf::Vec3d& dummy );
void slotAnchorUpdated( const cvf::Vec3d& origin, const cvf::Vec3d& dummy );
private:
void updatePoint(caf::PdmUiFieldHandle* uiField, const cvf::Vec3d& newPos);
void updatePoint( caf::PdmUiFieldHandle* uiField, const cvf::Vec3d& newPos );
QPointer<RicPointTangentManipulator> m_labelManipulator;
QPointer<RicPointTangentManipulator> m_anchorManipulator;
cvf::ref<cvf::ModelBasicList> m_cvfModel;
cvf::ref<cvf::ModelBasicList> m_cvfModel;
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,10 +22,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicCloseProjectFeature, "RicCloseProjectFeature");
CAF_CMD_SOURCE_INIT( RicCloseProjectFeature, "RicCloseProjectFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicCloseProjectFeature::isCommandEnabled()
{
@@ -33,22 +33,22 @@ bool RicCloseProjectFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicCloseProjectFeature::onActionTriggered(bool isChecked)
void RicCloseProjectFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
RiaGuiApplication* app = RiaGuiApplication::instance();
if (!app || !app->askUserToSaveModifiedProject()) return;
if ( !app || !app->askUserToSaveModifiedProject() ) return;
app->closeProject();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicCloseProjectFeature::setupActionLook(QAction* actionToSetup)
void RicCloseProjectFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("&Close Project");
actionToSetup->setText( "&Close Project" );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicCloseProjectFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -22,7 +22,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDefaultDockConfigEclipseFeature, "RicDefaultDockConfigEclipseFeature");
CAF_CMD_SOURCE_INIT( RicDefaultDockConfigEclipseFeature, "RicDefaultDockConfigEclipseFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -35,7 +35,7 @@ bool RicDefaultDockConfigEclipseFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDefaultDockConfigEclipseFeature::onActionTriggered(bool isChecked)
void RicDefaultDockConfigEclipseFeature::onActionTriggered( bool isChecked )
{
RiuDockWidgetTools::setVisibleDockingWindowsForEclipse();
}
@@ -43,12 +43,12 @@ void RicDefaultDockConfigEclipseFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDefaultDockConfigEclipseFeature::setupActionLook(QAction* actionToSetup)
void RicDefaultDockConfigEclipseFeature::setupActionLook( QAction* actionToSetup )
{
QString menuText = "Default Window Visibility";
#ifdef USE_ODB_API
menuText += " (Eclipse)";
#endif
actionToSetup->setText(menuText);
actionToSetup->setText( menuText );
}

View File

@@ -29,6 +29,6 @@ class RicDefaultDockConfigEclipseFeature : public caf::CmdFeature
protected:
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -22,7 +22,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDefaultDockConfigGeoMechFeature, "RicDefaultDockConfigGeoMechFeature");
CAF_CMD_SOURCE_INIT( RicDefaultDockConfigGeoMechFeature, "RicDefaultDockConfigGeoMechFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -35,7 +35,7 @@ bool RicDefaultDockConfigGeoMechFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDefaultDockConfigGeoMechFeature::onActionTriggered(bool isChecked)
void RicDefaultDockConfigGeoMechFeature::onActionTriggered( bool isChecked )
{
RiuDockWidgetTools::setVisibleDockingWindowsForGeoMech();
}
@@ -43,7 +43,7 @@ void RicDefaultDockConfigGeoMechFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDefaultDockConfigGeoMechFeature::setupActionLook(QAction* actionToSetup)
void RicDefaultDockConfigGeoMechFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Default Window Visibility (Geo Mech)");
actionToSetup->setText( "Default Window Visibility (Geo Mech)" );
}

View File

@@ -29,6 +29,6 @@ class RicDefaultDockConfigGeoMechFeature : public caf::CmdFeature
protected:
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -28,10 +28,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicEditPreferencesFeature, "RicEditPreferencesFeature");
CAF_CMD_SOURCE_INIT( RicEditPreferencesFeature, "RicEditPreferencesFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicEditPreferencesFeature::isCommandEnabled()
{
@@ -39,9 +39,9 @@ bool RicEditPreferencesFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
void RicEditPreferencesFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
@@ -49,25 +49,25 @@ void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
QStringList tabNames = app->preferences()->tabNames();
std::unique_ptr<RiaPreferences> oldPreferences = clonePreferences(app->preferences());
std::unique_ptr<RiaPreferences> oldPreferences = clonePreferences( app->preferences() );
RiuPropertyViewTabWidget propertyDialog(nullptr, app->preferences(), "Preferences", tabNames);
propertyDialog.setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
if (propertyDialog.exec() == QDialog::Accepted)
RiuPropertyViewTabWidget propertyDialog( nullptr, app->preferences(), "Preferences", tabNames );
propertyDialog.setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred );
if ( propertyDialog.exec() == QDialog::Accepted )
{
// Write preferences using QSettings and apply them to the application
app->applyPreferences(oldPreferences.get());
app->applyGuiPreferences(oldPreferences.get());
app->applyPreferences( oldPreferences.get() );
app->applyGuiPreferences( oldPreferences.get() );
app->updateGrpcServer();
}
else
{
// Read back currently stored values using QSettings
caf::PdmSettings::readFieldsFromApplicationStore(app->preferences());
caf::PdmSettings::readFieldsFromApplicationStore( app->preferences() );
app->preferences()->initAfterReadRecursively();
}
if (!app->isProjectSavedToDisc())
if ( !app->isProjectSavedToDisc() )
{
// Always reset change detector when modifying preferences, as these changes are irrelevant
// when the project we work on is not saved to disc
@@ -76,20 +76,20 @@ void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicEditPreferencesFeature::setupActionLook(QAction* actionToSetup)
void RicEditPreferencesFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("&Preferences...");
actionToSetup->setText( "&Preferences..." );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::unique_ptr<RiaPreferences> RicEditPreferencesFeature::clonePreferences(const RiaPreferences* preferences)
std::unique_ptr<RiaPreferences> RicEditPreferencesFeature::clonePreferences( const RiaPreferences* preferences )
{
caf::PdmObjectHandle* pdmClone =
preferences->xmlCapability()->copyByXmlSerialization(caf::PdmDefaultObjectFactory::instance());
return std::unique_ptr<RiaPreferences>(dynamic_cast<RiaPreferences*>(pdmClone));
caf::PdmObjectHandle* pdmClone = preferences->xmlCapability()->copyByXmlSerialization(
caf::PdmDefaultObjectFactory::instance() );
return std::unique_ptr<RiaPreferences>( dynamic_cast<RiaPreferences*>( pdmClone ) );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,19 +24,17 @@
class RiaPreferences;
//==================================================================================================
///
///
//==================================================================================================
class RicEditPreferencesFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
static std::unique_ptr<RiaPreferences> clonePreferences(const RiaPreferences* preferences);
static std::unique_ptr<RiaPreferences> clonePreferences( const RiaPreferences* preferences );
};

View File

@@ -25,7 +25,7 @@
#include <QAction>
#include <QDebug>
CAF_CMD_SOURCE_INIT(RicExitApplicationFeature, "RicExitApplicationFeature");
CAF_CMD_SOURCE_INIT( RicExitApplicationFeature, "RicExitApplicationFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -38,25 +38,25 @@ bool RicExitApplicationFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExitApplicationFeature::onActionTriggered(bool isChecked)
void RicExitApplicationFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
RiaGuiApplication* app = RiaGuiApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
if ( !app->askUserToSaveModifiedProject() ) return;
if (app->mainPlotWindow())
if ( app->mainPlotWindow() )
{
app->mainPlotWindow()->saveWinGeoAndDockToolBarLayout();
}
if (app->mainWindow())
if ( app->mainWindow() )
{
app->mainWindow()->saveWinGeoAndDockToolBarLayout();
}
// Hide all windows first to make sure they get closed properly
for (QWidget* topLevelWidget : app->topLevelWidgets())
for ( QWidget* topLevelWidget : app->topLevelWidgets() )
{
topLevelWidget->hide();
}
@@ -67,8 +67,8 @@ void RicExitApplicationFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExitApplicationFeature::setupActionLook(QAction* actionToSetup)
void RicExitApplicationFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("E&xit");
actionToSetup->setShortcut(QKeySequence::Quit);
actionToSetup->setText( "E&xit" );
actionToSetup->setShortcut( QKeySequence::Quit );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicExitApplicationFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -33,9 +33,9 @@
#include <QSslSocket>
#include <QUrl>
CAF_CMD_SOURCE_INIT(RicHelpAboutFeature, "RicHelpAboutFeature");
CAF_CMD_SOURCE_INIT(RicHelpCommandLineFeature, "RicHelpCommandLineFeature");
CAF_CMD_SOURCE_INIT(RicHelpOpenUsersGuideFeature, "RicHelpOpenUsersGuideFeature");
CAF_CMD_SOURCE_INIT( RicHelpAboutFeature, "RicHelpAboutFeature" );
CAF_CMD_SOURCE_INIT( RicHelpCommandLineFeature, "RicHelpCommandLineFeature" );
CAF_CMD_SOURCE_INIT( RicHelpOpenUsersGuideFeature, "RicHelpOpenUsersGuideFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -48,23 +48,23 @@ bool RicHelpAboutFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpAboutFeature::onActionTriggered(bool isChecked)
void RicHelpAboutFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
caf::AboutDialog dlg(nullptr);
caf::AboutDialog dlg( nullptr );
dlg.setApplicationName(RI_APPLICATION_NAME);
dlg.setApplicationVersion(RiaApplication::getVersionStringApp(true));
dlg.setCopyright("Copyright Equinor ASA, Ceetron Solutions AS, Ceetron AS");
dlg.showQtVersion(false);
dlg.setApplicationName( RI_APPLICATION_NAME );
dlg.setApplicationVersion( RiaApplication::getVersionStringApp( true ) );
dlg.setCopyright( "Copyright Equinor ASA, Ceetron Solutions AS, Ceetron AS" );
dlg.showQtVersion( false );
#ifdef _DEBUG
dlg.setIsDebugBuild(true);
dlg.setIsDebugBuild( true );
#endif
dlg.addVersionEntry(" ", "ResInsight is made available under the GNU General Public License v. 3");
dlg.addVersionEntry(" ", "See http://www.gnu.org/licenses/gpl.html");
dlg.addVersionEntry(" ", " ");
dlg.addVersionEntry( " ", "ResInsight is made available under the GNU General Public License v. 3" );
dlg.addVersionEntry( " ", "See http://www.gnu.org/licenses/gpl.html" );
dlg.addVersionEntry( " ", " " );
QStringList activeFeatures;
#ifdef USE_ODB_API
@@ -74,22 +74,22 @@ void RicHelpAboutFeature::onActionTriggered(bool isChecked)
activeFeatures += " Souring";
#endif
if (!activeFeatures.isEmpty())
if ( !activeFeatures.isEmpty() )
{
dlg.addVersionEntry(" ", "Features");
dlg.addVersionEntry( " ", "Features" );
for (const auto& feature : activeFeatures)
for ( const auto& feature : activeFeatures )
{
dlg.addVersionEntry(" ", feature);
dlg.addVersionEntry( " ", feature );
}
}
dlg.addVersionEntry(" ", " ");
dlg.addVersionEntry(" ", "Technical Information");
dlg.addVersionEntry(" ", QString(" Qt ") + qVersion());
dlg.addVersionEntry(" ", QString(" ") + caf::AboutDialog::versionStringForcurrentOpenGLContext());
dlg.addVersionEntry(" ", caf::Viewer::isShadersSupported() ? " Hardware OpenGL" : " Software OpenGL");
dlg.addVersionEntry(" ", QString(" Octave ") + QString(RESINSIGHT_OCTAVE_VERSION));
dlg.addVersionEntry( " ", " " );
dlg.addVersionEntry( " ", "Technical Information" );
dlg.addVersionEntry( " ", QString( " Qt " ) + qVersion() );
dlg.addVersionEntry( " ", QString( " " ) + caf::AboutDialog::versionStringForcurrentOpenGLContext() );
dlg.addVersionEntry( " ", caf::Viewer::isShadersSupported() ? " Hardware OpenGL" : " Software OpenGL" );
dlg.addVersionEntry( " ", QString( " Octave " ) + QString( RESINSIGHT_OCTAVE_VERSION ) );
bool isAbleToUseSsl = false;
bool isSslSupported = false;
@@ -101,10 +101,10 @@ void RicHelpAboutFeature::onActionTriggered(bool isChecked)
{
QString txt;
if (isAbleToUseSsl)
if ( isAbleToUseSsl )
{
txt = " Use of SSL is available";
if (isSslSupported)
if ( isSslSupported )
{
txt += " and supported";
}
@@ -118,51 +118,53 @@ void RicHelpAboutFeature::onActionTriggered(bool isChecked)
txt = " SSL is not available";
}
dlg.addVersionEntry(" ", txt);
dlg.addVersionEntry( " ", txt );
}
#ifdef ENABLE_GRPC
RiaGrpcServer* grpcServer = RiaApplication::instance()->grpcServer();
if (grpcServer && grpcServer->isRunning())
if ( grpcServer && grpcServer->isRunning() )
{
dlg.addVersionEntry(" ", QString(" Python Script Server available and running at port %1").arg(grpcServer->portNumber()));
dlg.addVersionEntry( " ",
QString( " Python Script Server available and running at port %1" )
.arg( grpcServer->portNumber() ) );
}
else
{
dlg.addVersionEntry(" ", QString(" Python Script Server available but currently disabled in preferences"));
dlg.addVersionEntry( " ", QString( " Python Script Server available but currently disabled in preferences" ) );
}
#else
dlg.addVersionEntry(" ", " gRPC disabled");
dlg.addVersionEntry( " ", " gRPC disabled" );
#endif
if (RiaApplication::enableDevelopmentFeatures())
if ( RiaApplication::enableDevelopmentFeatures() )
{
QString vendor("Unknown");
QString render("Unknown");
QString vendor( "Unknown" );
QString render( "Unknown" );
{
char* str = (char*)glGetString(GL_VENDOR);
char* str = (char*)glGetString( GL_VENDOR );
if (str)
if ( str )
{
vendor = str;
}
}
{
char* str = (char*)glGetString(GL_RENDERER);
char* str = (char*)glGetString( GL_RENDERER );
if (str)
if ( str )
{
render = str;
}
}
dlg.addVersionEntry(" ", QString(" ") + vendor + " : " + render);
dlg.addVersionEntry( " ", QString( " " ) + vendor + " : " + render );
}
dlg.create();
dlg.resize(300, 200);
dlg.resize( 300, 200 );
dlg.exec();
}
@@ -170,9 +172,9 @@ void RicHelpAboutFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpAboutFeature::setupActionLook(QAction* actionToSetup)
void RicHelpAboutFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("&About");
actionToSetup->setText( "&About" );
}
//--------------------------------------------------------------------------------------------------
@@ -186,21 +188,21 @@ bool RicHelpCommandLineFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpCommandLineFeature::onActionTriggered(bool isChecked)
void RicHelpCommandLineFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QString text = app->commandLineParameterHelp();
app->showFormattedTextInMessageBoxOrConsole(text);
app->showFormattedTextInMessageBoxOrConsole( text );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpCommandLineFeature::setupActionLook(QAction* actionToSetup)
void RicHelpCommandLineFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("&Command Line Help");
actionToSetup->setText( "&Command Line Help" );
}
//--------------------------------------------------------------------------------------------------
@@ -214,24 +216,24 @@ bool RicHelpOpenUsersGuideFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpOpenUsersGuideFeature::onActionTriggered(bool isChecked)
void RicHelpOpenUsersGuideFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
QString usersGuideUrl = "http://resinsight.org/docs/home";
if (!QDesktopServices::openUrl(usersGuideUrl))
if ( !QDesktopServices::openUrl( usersGuideUrl ) )
{
QErrorMessage* errorHandler = QErrorMessage::qtHandler();
errorHandler->showMessage("Failed open browser with the following url\n\n" + usersGuideUrl);
errorHandler->showMessage( "Failed open browser with the following url\n\n" + usersGuideUrl );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicHelpOpenUsersGuideFeature::setupActionLook(QAction* actionToSetup)
void RicHelpOpenUsersGuideFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("&Users Guide");
actionToSetup->setShortcut(QKeySequence::HelpContents);
actionToSetup->setText( "&Users Guide" );
actionToSetup->setShortcut( QKeySequence::HelpContents );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicHelpAboutFeature : public caf::CmdFeature
{
@@ -35,9 +34,8 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
};
//==================================================================================================
///
///
//==================================================================================================
class RicHelpCommandLineFeature : public caf::CmdFeature
{
@@ -46,13 +44,12 @@ class RicHelpCommandLineFeature : 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;
};
//==================================================================================================
///
///
//==================================================================================================
class RicHelpOpenUsersGuideFeature : public caf::CmdFeature
{
@@ -61,8 +58,6 @@ class RicHelpOpenUsersGuideFeature : 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;
};

View File

@@ -25,7 +25,7 @@
#include <QAction>
#include <QDir>
CAF_CMD_SOURCE_INIT(RicLaunchRegressionTestsFeature, "RicLaunchRegressionTestsFeature");
CAF_CMD_SOURCE_INIT( RicLaunchRegressionTestsFeature, "RicLaunchRegressionTestsFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -38,7 +38,7 @@ bool RicLaunchRegressionTestsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicLaunchRegressionTestsFeature::onActionTriggered(bool isChecked)
void RicLaunchRegressionTestsFeature::onActionTriggered( bool isChecked )
{
RiaRegressionTestRunner::instance()->executeRegressionTests();
}
@@ -46,7 +46,7 @@ void RicLaunchRegressionTestsFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicLaunchRegressionTestsFeature::setupActionLook(QAction* actionToSetup)
void RicLaunchRegressionTestsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Launch Regression Tests");
actionToSetup->setText( "Launch Regression Tests" );
}

View File

@@ -29,6 +29,6 @@ class RicLaunchRegressionTestsFeature : public caf::CmdFeature
private:
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -2,17 +2,17 @@
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,13 +21,12 @@
#include "RiaApplication.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicLaunchUnitTestsFeature, "RicLaunchUnitTestsFeature");
CAF_CMD_SOURCE_INIT( RicLaunchUnitTestsFeature, "RicLaunchUnitTestsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicLaunchUnitTestsFeature::isCommandEnabled()
{
@@ -39,9 +38,9 @@ bool RicLaunchUnitTestsFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicLaunchUnitTestsFeature::onActionTriggered(bool isChecked)
void RicLaunchUnitTestsFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
@@ -49,11 +48,9 @@ void RicLaunchUnitTestsFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicLaunchUnitTestsFeature::setupActionLook(QAction* actionToSetup)
void RicLaunchUnitTestsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Launch Unit Tests");
actionToSetup->setText( "Launch Unit Tests" );
}

View File

@@ -2,17 +2,17 @@
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,7 +22,7 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicLaunchUnitTestsFeature : public caf::CmdFeature
{
@@ -34,5 +34,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -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,10 +25,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicOpenLastUsedFileFeature, "RicOpenLastUsedFileFeature");
CAF_CMD_SOURCE_INIT( RicOpenLastUsedFileFeature, "RicOpenLastUsedFileFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicOpenLastUsedFileFeature::isCommandEnabled()
{
@@ -36,26 +36,26 @@ bool RicOpenLastUsedFileFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicOpenLastUsedFileFeature::onActionTriggered(bool isChecked)
void RicOpenLastUsedFileFeature::onActionTriggered( bool isChecked )
{
RiaGuiApplication* app = RiaGuiApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
if ( !app->askUserToSaveModifiedProject() ) return;
QString fileName = app->preferences()->lastUsedProjectFileName;
if (app->loadProject(fileName))
if ( app->loadProject( fileName ) )
{
app->addToRecentFiles(fileName);
app->addToRecentFiles( fileName );
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicOpenLastUsedFileFeature::setupActionLook(QAction* actionToSetup)
void RicOpenLastUsedFileFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Open &Last Used Project");
actionToSetup->setText( "Open &Last Used Project" );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicOpenLastUsedFileFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -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,10 +26,10 @@
#include <QFileDialog>
#include <QStyle>
CAF_CMD_SOURCE_INIT(RicOpenProjectFeature, "RicOpenProjectFeature");
CAF_CMD_SOURCE_INIT( RicOpenProjectFeature, "RicOpenProjectFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicOpenProjectFeature::isCommandEnabled()
{
@@ -37,34 +37,37 @@ bool RicOpenProjectFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicOpenProjectFeature::onActionTriggered(bool isChecked)
void RicOpenProjectFeature::onActionTriggered( bool isChecked )
{
RiaGuiApplication* app = RiaGuiApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
QString defaultDir = app->lastUsedDialogDirectory("BINARY_GRID");
QString fileName = QFileDialog::getOpenFileName(nullptr, "Open ResInsight Project", defaultDir, "ResInsight project (*.rsp *.rip);;All files(*.*)");
if ( !app->askUserToSaveModifiedProject() ) return;
if (fileName.isEmpty()) return;
QString defaultDir = app->lastUsedDialogDirectory( "BINARY_GRID" );
QString fileName = QFileDialog::getOpenFileName( nullptr,
"Open ResInsight Project",
defaultDir,
"ResInsight project (*.rsp *.rip);;All files(*.*)" );
if ( fileName.isEmpty() ) return;
// Remember the path to next time
app->setLastUsedDialogDirectory("BINARY_GRID", QFileInfo(fileName).absolutePath());
app->setLastUsedDialogDirectory( "BINARY_GRID", QFileInfo( fileName ).absolutePath() );
if (app->loadProject(fileName))
if ( app->loadProject( fileName ) )
{
app->addToRecentFiles(fileName);
app->addToRecentFiles( fileName );
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicOpenProjectFeature::setupActionLook(QAction* actionToSetup)
void RicOpenProjectFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Open Project");
actionToSetup->setIcon(QIcon(":/openFolder24x24.png"));
actionToSetup->setShortcuts(QKeySequence::Open);
actionToSetup->setText( "Open Project" );
actionToSetup->setIcon( QIcon( ":/openFolder24x24.png" ) );
actionToSetup->setShortcuts( QKeySequence::Open );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicOpenProjectFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -25,7 +25,7 @@
#include <QDir>
#include <QFileDialog>
CAF_CMD_SOURCE_INIT(RicRunCommandFileFeature, "RicRunCommandFileFeature");
CAF_CMD_SOURCE_INIT( RicRunCommandFileFeature, "RicRunCommandFileFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -38,30 +38,33 @@ bool RicRunCommandFileFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicRunCommandFileFeature::onActionTriggered(bool isChecked)
void RicRunCommandFileFeature::onActionTriggered( bool isChecked )
{
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectoryWithFallbackToProjectFolder("COMMAND_FILE");
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "COMMAND_FILE" );
QString fileName = QFileDialog::getOpenFileName(nullptr, "Open ResInsight Command File", defaultDir, "ResInsight Command File (*.txt);;All files(*.*)");
QString fileName = QFileDialog::getOpenFileName( nullptr,
"Open ResInsight Command File",
defaultDir,
"ResInsight Command File (*.txt);;All files(*.*)" );
if (!fileName.isEmpty())
if ( !fileName.isEmpty() )
{
QFile file(fileName);
if (file.open(QIODevice::ReadOnly | QIODevice::Text))
QFile file( fileName );
if ( file.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
QTextStream in(&file);
QTextStream in( &file );
QString applicationPath = QDir::currentPath();
QFileInfo fi(fileName);
QDir::setCurrent(fi.absolutePath());
QFileInfo fi( fileName );
QDir::setCurrent( fi.absolutePath() );
RicfCommandFileExecutor::instance()->executeCommands(in);
RicfCommandFileExecutor::instance()->executeCommands( in );
QDir::setCurrent(applicationPath);
app->setLastUsedDialogDirectory("COMMAND_FILE", QFileInfo(fileName).absolutePath());
QDir::setCurrent( applicationPath );
app->setLastUsedDialogDirectory( "COMMAND_FILE", QFileInfo( fileName ).absolutePath() );
}
}
}
@@ -69,7 +72,7 @@ void RicRunCommandFileFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicRunCommandFileFeature::setupActionLook(QAction* actionToSetup)
void RicRunCommandFileFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Run Command File");
actionToSetup->setText( "Run Command File" );
}

View File

@@ -29,6 +29,6 @@ class RicRunCommandFileFeature : public caf::CmdFeature
private:
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,13 +22,12 @@
#include "RiaGuiApplication.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicSaveProjectAsFeature, "RicSaveProjectAsFeature");
CAF_CMD_SOURCE_INIT( RicSaveProjectAsFeature, "RicSaveProjectAsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicSaveProjectAsFeature::isCommandEnabled()
{
@@ -36,26 +35,25 @@ bool RicSaveProjectAsFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicSaveProjectAsFeature::onActionTriggered(bool isChecked)
void RicSaveProjectAsFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
RiaGuiApplication* app = RiaGuiApplication::instance();
if (app)
if ( app )
{
app->saveProjectPromptForFileName();
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicSaveProjectAsFeature::setupActionLook(QAction* actionToSetup)
void RicSaveProjectAsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Save Project &As");
actionToSetup->setIcon(QIcon(":/Save.png"));
actionToSetup->setShortcuts(QKeySequence::SaveAs);
actionToSetup->setText( "Save Project &As" );
actionToSetup->setIcon( QIcon( ":/Save.png" ) );
actionToSetup->setShortcuts( QKeySequence::SaveAs );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicSaveProjectAsFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,10 +22,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicSaveProjectFeature, "RicSaveProjectFeature");
CAF_CMD_SOURCE_INIT( RicSaveProjectFeature, "RicSaveProjectFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicSaveProjectFeature::isCommandEnabled()
{
@@ -33,9 +33,9 @@ bool RicSaveProjectFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicSaveProjectFeature::onActionTriggered(bool isChecked)
void RicSaveProjectFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
@@ -45,13 +45,13 @@ void RicSaveProjectFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicSaveProjectFeature::setupActionLook(QAction* actionToSetup)
void RicSaveProjectFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("&Save Project");
actionToSetup->setIcon(QIcon(":/Save.png"));
actionToSetup->setShortcuts(QKeySequence::Save);
actionToSetup->setText( "&Save Project" );
actionToSetup->setIcon( QIcon( ":/Save.png" ) );
actionToSetup->setShortcuts( QKeySequence::Save );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicSaveProjectFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -24,7 +24,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowMainWindowFeature, "RicShowMainWindowFeature");
CAF_CMD_SOURCE_INIT( RicShowMainWindowFeature, "RicShowMainWindowFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -33,7 +33,7 @@ void RicShowMainWindowFeature::showMainWindow()
{
RiuMainWindow* mainWnd = RiuMainWindow::instance();
if (mainWnd->isMinimized())
if ( mainWnd->isMinimized() )
{
mainWnd->showNormal();
mainWnd->update();
@@ -59,7 +59,7 @@ bool RicShowMainWindowFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
void RicShowMainWindowFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
@@ -69,10 +69,10 @@ void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowMainWindowFeature::setupActionLook(QAction* actionToSetup)
void RicShowMainWindowFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Open 3D Window");
actionToSetup->setToolTip("Open 3D Window (Ctrl+Shift+3)");
actionToSetup->setIcon(QIcon(":/3DWindow24x24.png"));
applyShortcutWithHintToAction(actionToSetup, QKeySequence(tr("Ctrl+Shift+3")));
actionToSetup->setText( "Open 3D Window" );
actionToSetup->setToolTip( "Open 3D Window (Ctrl+Shift+3)" );
actionToSetup->setIcon( QIcon( ":/3DWindow24x24.png" ) );
applyShortcutWithHintToAction( actionToSetup, QKeySequence( tr( "Ctrl+Shift+3" ) ) );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicShowMainWindowFeature : public caf::CmdFeature
{
@@ -37,5 +36,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -30,10 +30,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowMemoryCleanupDialogFeature, "RicShowMemoryCleanupDialogFeature");
CAF_CMD_SOURCE_INIT( RicShowMemoryCleanupDialogFeature, "RicShowMemoryCleanupDialogFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicShowMemoryCleanupDialogFeature::isCommandEnabled()
{
@@ -41,29 +41,33 @@ bool RicShowMemoryCleanupDialogFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicShowMemoryCleanupDialogFeature::onActionTriggered(bool isChecked)
void RicShowMemoryCleanupDialogFeature::onActionTriggered( bool isChecked )
{
RiaMemoryCleanup memoryCleanup;
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if (view)
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
if ( view )
{
memoryCleanup.setPropertiesFromView(view);
memoryCleanup.setPropertiesFromView( view );
}
caf::PdmUiPropertyViewDialog dialog(RiuMainWindow::instance(), &memoryCleanup, "Clear Results From Memory", "", QDialogButtonBox::Close);
dialog.resize(QSize(400, 400));
if (dialog.exec() == QDialog::Accepted)
caf::PdmUiPropertyViewDialog dialog( RiuMainWindow::instance(),
&memoryCleanup,
"Clear Results From Memory",
"",
QDialogButtonBox::Close );
dialog.resize( QSize( 400, 400 ) );
if ( dialog.exec() == QDialog::Accepted )
{
memoryCleanup.clearSelectedResultsFromMemory();
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicShowMemoryCleanupDialogFeature::setupActionLook(QAction* actionToSetup)
void RicShowMemoryCleanupDialogFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("&Memory Cleanup...");
actionToSetup->setText( "&Memory Cleanup..." );
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Statoil ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicShowMemoryCleanupDialogFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -37,7 +37,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowPlotDataFeature, "RicShowPlotDataFeature");
CAF_CMD_SOURCE_INIT( RicShowPlotDataFeature, "RicShowPlotDataFeature" );
//--------------------------------------------------------------------------------------------------
/// Private text provider class for summary plots
@@ -45,8 +45,8 @@ CAF_CMD_SOURCE_INIT(RicShowPlotDataFeature, "RicShowPlotDataFeature");
class RiuTabbedSummaryPlotTextProvider : public RiuTabbedTextProvider
{
public:
RiuTabbedSummaryPlotTextProvider(RimSummaryPlot* summaryPlot)
: m_summaryPlot(summaryPlot)
RiuTabbedSummaryPlotTextProvider( RimSummaryPlot* summaryPlot )
: m_summaryPlot( summaryPlot )
{
}
@@ -57,34 +57,34 @@ public:
QString description() const override
{
CVF_ASSERT(m_summaryPlot.notNull() && "Need to check that provider is valid");
CVF_ASSERT( m_summaryPlot.notNull() && "Need to check that provider is valid" );
return m_summaryPlot->description();
}
QString tabTitle(int tabIndex) const override
QString tabTitle( int tabIndex ) const override
{
auto allTabs = tabs();
CVF_ASSERT(tabIndex < (int)allTabs.size());
CVF_ASSERT( tabIndex < (int)allTabs.size() );
DateTimePeriod timePeriod = allTabs[tabIndex];
if (timePeriod == DateTimePeriod::NONE)
if ( timePeriod == DateTimePeriod::NONE )
{
return "No Resampling";
}
else
{
return QString("Plot Data, %1").arg(RiaQDateTimeTools::dateTimePeriodName(timePeriod));
return QString( "Plot Data, %1" ).arg( RiaQDateTimeTools::dateTimePeriodName( timePeriod ) );
}
}
QString tabText(int tabIndex) const override
QString tabText( int tabIndex ) const override
{
CVF_ASSERT(m_summaryPlot.notNull() && "Need to check that provider is valid");
CVF_ASSERT( m_summaryPlot.notNull() && "Need to check that provider is valid" );
DateTimePeriod timePeriod = indexToPeriod(tabIndex);
DateTimePeriod timePeriod = indexToPeriod( tabIndex );
if (m_summaryPlot->containsResamplableCurves())
if ( m_summaryPlot->containsResamplableCurves() )
{
return m_summaryPlot->asciiDataForPlotExport(timePeriod);
return m_summaryPlot->asciiDataForPlotExport( timePeriod );
}
else
{
@@ -98,10 +98,10 @@ public:
}
private:
static DateTimePeriod indexToPeriod(int tabIndex)
static DateTimePeriod indexToPeriod( int tabIndex )
{
auto allTabs = tabs();
CVF_ASSERT(tabIndex < (int)allTabs.size());
CVF_ASSERT( tabIndex < (int)allTabs.size() );
DateTimePeriod timePeriod = allTabs[tabIndex];
return timePeriod;
}
@@ -109,8 +109,8 @@ private:
static std::vector<DateTimePeriod> tabs()
{
std::vector<DateTimePeriod> dateTimePeriods = RiaQDateTimeTools::dateTimePeriods();
dateTimePeriods.erase(std::remove(dateTimePeriods.begin(), dateTimePeriods.end(), DateTimePeriod::DECADE),
dateTimePeriods.end());
dateTimePeriods.erase( std::remove( dateTimePeriods.begin(), dateTimePeriods.end(), DateTimePeriod::DECADE ),
dateTimePeriods.end() );
return dateTimePeriods;
}
@@ -124,8 +124,8 @@ private:
class RiuTabbedGridCrossPlotTextProvider : public RiuTabbedTextProvider
{
public:
RiuTabbedGridCrossPlotTextProvider(RimGridCrossPlot* crossPlot)
: m_crossPlot(crossPlot)
RiuTabbedGridCrossPlotTextProvider( RimGridCrossPlot* crossPlot )
: m_crossPlot( crossPlot )
{
}
@@ -136,25 +136,25 @@ public:
virtual QString description() const override
{
CVF_ASSERT(m_crossPlot.notNull() && "Need to check that provider is valid");
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return m_crossPlot->createAutoName();
}
virtual QString tabTitle(int tabIndex) const override
virtual QString tabTitle( int tabIndex ) const override
{
CVF_ASSERT(m_crossPlot.notNull() && "Need to check that provider is valid");
return m_crossPlot->asciiTitleForPlotExport(tabIndex);
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return m_crossPlot->asciiTitleForPlotExport( tabIndex );
}
virtual QString tabText(int tabIndex) const override
virtual QString tabText( int tabIndex ) const override
{
CVF_ASSERT(m_crossPlot.notNull() && "Need to check that provider is valid");
return m_crossPlot->asciiDataForPlotExport(tabIndex);
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return m_crossPlot->asciiDataForPlotExport( tabIndex );
}
virtual int tabCount() const override
{
CVF_ASSERT(m_crossPlot.notNull() && "Need to check that provider is valid");
CVF_ASSERT( m_crossPlot.notNull() && "Need to check that provider is valid" );
return (int)m_crossPlot->dataSets().size();
}
@@ -172,17 +172,17 @@ private:
bool RicShowPlotDataFeature::isCommandEnabled()
{
QString content = RiaFeatureCommandContext::instance()->contentString();
if (!content.isEmpty())
if ( !content.isEmpty() )
{
return true;
}
auto selectedSummaryPlots = caf::selectedObjectsByType<RimSummaryPlot*>();
if (selectedSummaryPlots.size() > 0)
if ( selectedSummaryPlots.size() > 0 )
{
for (auto c : selectedSummaryPlots)
for ( auto c : selectedSummaryPlots )
{
if (dynamic_cast<RimSummaryCrossPlot*>(c))
if ( dynamic_cast<RimSummaryCrossPlot*>( c ) )
{
return false;
}
@@ -192,10 +192,10 @@ bool RicShowPlotDataFeature::isCommandEnabled()
}
auto wellLogPlots = caf::selectedObjectsByType<RimWellLogPlot*>();
if (wellLogPlots.size() > 0) return true;
if ( wellLogPlots.size() > 0 ) return true;
auto gridCrossPlots = caf::selectedObjectsByType<RimGridCrossPlot*>();
if (gridCrossPlots.size() > 0) return true;
if ( gridCrossPlots.size() > 0 ) return true;
return false;
}
@@ -203,18 +203,18 @@ bool RicShowPlotDataFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::onActionTriggered(bool isChecked)
void RicShowPlotDataFeature::onActionTriggered( bool isChecked )
{
QString content = RiaFeatureCommandContext::instance()->contentString();
if (!content.isEmpty())
if ( !content.isEmpty() )
{
QString title = "Data Content";
{
QString titleCandidate = RiaFeatureCommandContext::instance()->titleString();
if (!titleCandidate.isEmpty()) title = titleCandidate;
if ( !titleCandidate.isEmpty() ) title = titleCandidate;
}
RicShowPlotDataFeature::showTextWindow(title, content);
RicShowPlotDataFeature::showTextWindow( title, content );
return;
}
@@ -224,56 +224,56 @@ void RicShowPlotDataFeature::onActionTriggered(bool isChecked)
std::vector<RimSummaryPlot*> selectedSummaryPlots = caf::selectedObjectsByType<RimSummaryPlot*>();
std::vector<RimWellLogPlot*> wellLogPlots = caf::selectedObjectsByType<RimWellLogPlot*>();
std::vector<RimGridCrossPlot*> crossPlots = caf::selectedObjectsByType<RimGridCrossPlot*>();
if (selectedSummaryPlots.size() == 0 && wellLogPlots.size() == 0 && crossPlots.size() == 0)
if ( selectedSummaryPlots.size() == 0 && wellLogPlots.size() == 0 && crossPlots.size() == 0 )
{
CVF_ASSERT(false);
CVF_ASSERT( false );
return;
}
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
CVF_ASSERT(plotwindow);
CVF_ASSERT( plotwindow );
for (RimSummaryPlot* summaryPlot : selectedSummaryPlots)
for ( RimSummaryPlot* summaryPlot : selectedSummaryPlots )
{
auto textProvider = new RiuTabbedSummaryPlotTextProvider(summaryPlot);
RicShowPlotDataFeature::showTabbedTextWindow(textProvider);
auto textProvider = new RiuTabbedSummaryPlotTextProvider( summaryPlot );
RicShowPlotDataFeature::showTabbedTextWindow( textProvider );
}
for (RimWellLogPlot* wellLogPlot : wellLogPlots)
for ( RimWellLogPlot* wellLogPlot : wellLogPlots )
{
QString title = wellLogPlot->description();
QString text = wellLogPlot->asciiDataForPlotExport();
RicShowPlotDataFeature::showTextWindow(title, text);
RicShowPlotDataFeature::showTextWindow( title, text );
}
for (RimGridCrossPlot* crossPlot : crossPlots)
for ( RimGridCrossPlot* crossPlot : crossPlots )
{
auto textProvider = new RiuTabbedGridCrossPlotTextProvider(crossPlot);
RicShowPlotDataFeature::showTabbedTextWindow(textProvider);
auto textProvider = new RiuTabbedGridCrossPlotTextProvider( crossPlot );
RicShowPlotDataFeature::showTabbedTextWindow( textProvider );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::setupActionLook(QAction* actionToSetup)
void RicShowPlotDataFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Show Plot Data");
actionToSetup->setIcon(QIcon(":/PlotWindow24x24.png"));
actionToSetup->setText( "Show Plot Data" );
actionToSetup->setIcon( QIcon( ":/PlotWindow24x24.png" ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::showTabbedTextWindow(RiuTabbedTextProvider* textProvider)
void RicShowPlotDataFeature::showTabbedTextWindow( RiuTabbedTextProvider* textProvider )
{
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
CVF_ASSERT(plotwindow);
CVF_ASSERT( plotwindow );
RiuTabbedTextDialog* textWidget = new RiuTabbedTextDialog(textProvider);
textWidget->setMinimumSize(800, 600);
plotwindow->addToTemporaryWidgets(textWidget);
RiuTabbedTextDialog* textWidget = new RiuTabbedTextDialog( textProvider );
textWidget->setMinimumSize( 800, 600 );
plotwindow->addToTemporaryWidgets( textWidget );
textWidget->show();
textWidget->redrawText();
}
@@ -281,18 +281,18 @@ void RicShowPlotDataFeature::showTabbedTextWindow(RiuTabbedTextProvider* textPro
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::showTextWindow(const QString& title, const QString& text)
void RicShowPlotDataFeature::showTextWindow( const QString& title, const QString& text )
{
RiuPlotMainWindow* plotwindow = RiaGuiApplication::instance()->mainPlotWindow();
CVF_ASSERT(plotwindow);
CVF_ASSERT( plotwindow );
RiuTextDialog* textWiget = new RiuTextDialog();
textWiget->setMinimumSize(400, 600);
textWiget->setMinimumSize( 400, 600 );
textWiget->setWindowTitle(title);
textWiget->setText(text);
textWiget->setWindowTitle( title );
textWiget->setText( text );
textWiget->show();
plotwindow->addToTemporaryWidgets(textWiget);
plotwindow->addToTemporaryWidgets( textWiget );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -27,7 +27,7 @@
class RiuTabbedTextProvider;
//==================================================================================================
///
///
//==================================================================================================
class RicShowPlotDataFeature : public caf::CmdFeature
{
@@ -40,8 +40,6 @@ protected:
void setupActionLook( QAction* actionToSetup ) override;
public:
static void showTabbedTextWindow(RiuTabbedTextProvider* textProvider);
static void showTextWindow(const QString& title, const QString& text);
static void showTabbedTextWindow( RiuTabbedTextProvider* textProvider );
static void showTextWindow( const QString& title, const QString& text );
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,10 +22,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicShowPlotWindowFeature, "RicShowPlotWindowFeature");
CAF_CMD_SOURCE_INIT( RicShowPlotWindowFeature, "RicShowPlotWindowFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicShowPlotWindowFeature::isCommandEnabled()
{
@@ -33,9 +33,9 @@ bool RicShowPlotWindowFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotWindowFeature::onActionTriggered(bool isChecked)
void RicShowPlotWindowFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
@@ -43,12 +43,12 @@ void RicShowPlotWindowFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicShowPlotWindowFeature::setupActionLook(QAction* actionToSetup)
void RicShowPlotWindowFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Open Plot Window");
actionToSetup->setToolTip("Open Plot Window (Ctrl+Shift+P)");
actionToSetup->setIcon(QIcon(":/PlotWindow24x24.png"));
applyShortcutWithHintToAction(actionToSetup, QKeySequence(tr("Ctrl+Shift+P")));
actionToSetup->setText( "Open Plot Window" );
actionToSetup->setToolTip( "Open Plot Window (Ctrl+Shift+P)" );
actionToSetup->setIcon( QIcon( ":/PlotWindow24x24.png" ) );
applyShortcutWithHintToAction( actionToSetup, QKeySequence( tr( "Ctrl+Shift+P" ) ) );
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,9 +20,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicShowPlotWindowFeature : public caf::CmdFeature
{
@@ -34,5 +33,3 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -2,17 +2,17 @@
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,15 +26,15 @@
#include <QAction>
#include <QApplication>
CAF_CMD_SOURCE_INIT(RicTileWindowsFeature, "RicTileWindowsFeature");
CAF_CMD_SOURCE_INIT( RicTileWindowsFeature, "RicTileWindowsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicTileWindowsFeature::isCommandEnabled()
{
RiuMainWindow* mainWindow = RiuMainWindow::instance();
if (mainWindow)
if ( mainWindow )
{
return mainWindow->isAnyMdiSubWindowVisible();
}
@@ -43,16 +43,16 @@ bool RicTileWindowsFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTileWindowsFeature::onActionTriggered(bool isChecked)
void RicTileWindowsFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
RiuMainWindow* mainWindow = RiuMainWindow::instance();
if (mainWindow)
if ( mainWindow )
{
if (!mainWindow->subWindowsAreTiled())
if ( !mainWindow->subWindowsAreTiled() )
{
mainWindow->tileSubWindows();
}
@@ -64,38 +64,36 @@ void RicTileWindowsFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTileWindowsFeature::setupActionLook(QAction* actionToSetup)
void RicTileWindowsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Tile Windows");
actionToSetup->setIcon(QIcon(":/TileWindows24x24.png"));
actionToSetup->setCheckable(true);
actionToSetup->setText( "Tile Windows" );
actionToSetup->setIcon( QIcon( ":/TileWindows24x24.png" ) );
actionToSetup->setCheckable( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicTileWindowsFeature::isCommandChecked()
{
if (RiaGuiApplication::instance()->mainWindow())
if ( RiaGuiApplication::instance()->mainWindow() )
{
return RiaGuiApplication::instance()->mainWindow()->subWindowsAreTiled();
}
return false;
}
CAF_CMD_SOURCE_INIT(RicTilePlotWindowsFeature, "RicTilePlotWindowsFeature");
CAF_CMD_SOURCE_INIT( RicTilePlotWindowsFeature, "RicTilePlotWindowsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsFeature::isCommandEnabled()
{
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
if (mainPlotWindow)
if ( mainPlotWindow )
{
return mainPlotWindow->isAnyMdiSubWindowVisible();
}
@@ -104,14 +102,14 @@ bool RicTilePlotWindowsFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTilePlotWindowsFeature::onActionTriggered(bool isChecked)
void RicTilePlotWindowsFeature::onActionTriggered( bool isChecked )
{
RiuPlotMainWindow* mainPlotWindow = RiaGuiApplication::instance()->mainPlotWindow();
if (mainPlotWindow)
if ( mainPlotWindow )
{
if (!mainPlotWindow->subWindowsAreTiled())
if ( !mainPlotWindow->subWindowsAreTiled() )
{
mainPlotWindow->tileSubWindows();
}
@@ -123,13 +121,13 @@ void RicTilePlotWindowsFeature::onActionTriggered(bool isChecked)
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicTilePlotWindowsFeature::setupActionLook(QAction* actionToSetup)
void RicTilePlotWindowsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Tile Windows");
actionToSetup->setIcon(QIcon(":/TileWindows24x24.png"));
actionToSetup->setCheckable(true);
actionToSetup->setText( "Tile Windows" );
actionToSetup->setIcon( QIcon( ":/TileWindows24x24.png" ) );
actionToSetup->setCheckable( true );
}
//--------------------------------------------------------------------------------------------------
@@ -137,7 +135,7 @@ void RicTilePlotWindowsFeature::setupActionLook(QAction* actionToSetup)
//--------------------------------------------------------------------------------------------------
bool RicTilePlotWindowsFeature::isCommandChecked()
{
if (RiaGuiApplication::instance()->mainPlotWindow())
if ( RiaGuiApplication::instance()->mainPlotWindow() )
{
return RiaGuiApplication::instance()->mainPlotWindow()->subWindowsAreTiled();
}

View File

@@ -2,17 +2,17 @@
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,9 +21,8 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicTileWindowsFeature : public caf::CmdFeature
{
@@ -35,11 +34,10 @@ protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandChecked() override;
};
//==================================================================================================
///
///
//==================================================================================================
class RicTilePlotWindowsFeature : public caf::CmdFeature
{
@@ -48,8 +46,7 @@ class RicTilePlotWindowsFeature : 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;
bool isCommandChecked() override;
};

View File

@@ -26,14 +26,14 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicDeleteValveTemplateFeature, "RicDeleteValveTemplateFeature");
CAF_CMD_SOURCE_INIT( RicDeleteValveTemplateFeature, "RicDeleteValveTemplateFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicDeleteValveTemplateFeature::isCommandEnabled()
{
if (caf::SelectionManager::instance()->selectedItemOfType<RimValveTemplate>())
if ( caf::SelectionManager::instance()->selectedItemOfType<RimValveTemplate>() )
{
return true;
}
@@ -43,28 +43,28 @@ bool RicDeleteValveTemplateFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDeleteValveTemplateFeature::onActionTriggered(bool isChecked)
void RicDeleteValveTemplateFeature::onActionTriggered( bool isChecked )
{
RimValveTemplate* valveTemplate = caf::SelectionManager::instance()->selectedItemOfType<RimValveTemplate>();
if (valveTemplate)
if ( valveTemplate )
{
RimProject* project = nullptr;
valveTemplate->firstAncestorOrThisOfTypeAsserted(project);
valveTemplate->firstAncestorOrThisOfTypeAsserted( project );
std::vector<RimWellPathValve*> valves;
project->descendantsIncludingThisOfType(valves);
for (RimWellPathValve* valve : valves)
project->descendantsIncludingThisOfType( valves );
for ( RimWellPathValve* valve : valves )
{
if (valve->valveTemplate() == valveTemplate)
if ( valve->valveTemplate() == valveTemplate )
{
valve->setValveTemplate(nullptr);
valve->setValveTemplate( nullptr );
valve->updateAllRequiredEditors();
}
}
RimValveTemplateCollection* collection = nullptr;
valveTemplate->firstAncestorOrThisOfTypeAsserted(collection);
collection->removeAndDeleteValveTemplate(valveTemplate);
valveTemplate->firstAncestorOrThisOfTypeAsserted( collection );
collection->removeAndDeleteValveTemplate( valveTemplate );
collection->updateAllRequiredEditors();
project->scheduleCreateDisplayModelAndRedrawAllViews();
@@ -74,10 +74,9 @@ void RicDeleteValveTemplateFeature::onActionTriggered(bool isChecked)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicDeleteValveTemplateFeature::setupActionLook(QAction* actionToSetup)
void RicDeleteValveTemplateFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Delete Valve Template");
actionToSetup->setIcon(QIcon(":/Erase.png"));
applyShortcutWithHintToAction(actionToSetup, QKeySequence::Delete);
actionToSetup->setText( "Delete Valve Template" );
actionToSetup->setIcon( QIcon( ":/Erase.png" ) );
applyShortcutWithHintToAction( actionToSetup, QKeySequence::Delete );
}

View File

@@ -30,6 +30,6 @@ class RicDeleteValveTemplateFeature : 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;
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -28,12 +28,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicEditPerforationCollectionFeature, "RicEditPerforationCollectionFeature");
CAF_CMD_SOURCE_INIT( RicEditPerforationCollectionFeature, "RicEditPerforationCollectionFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicEditPerforationCollectionFeature::isCommandEnabled()
{
@@ -41,47 +39,47 @@ bool RicEditPerforationCollectionFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicEditPerforationCollectionFeature::onActionTriggered(bool isChecked)
void RicEditPerforationCollectionFeature::onActionTriggered( bool isChecked )
{
this->disableModelChangeContribution();
RimPerforationCollection* perforationCollection = selectedPerforationCollection();
if (perforationCollection == nullptr) return;
if ( perforationCollection == nullptr ) return;
RimWellPath* wellPath;
perforationCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
perforationCollection->firstAncestorOrThisOfTypeAsserted( wellPath );
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
RiuEditPerforationCollectionWidget dlg(nullptr, perforationCollection);
RiuEditPerforationCollectionWidget dlg( nullptr, perforationCollection );
dlg.exec();
perforationCollection->updateConnectedEditors();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicEditPerforationCollectionFeature::setupActionLook(QAction* actionToSetup)
void RicEditPerforationCollectionFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Edit Perforations");
actionToSetup->setText( "Edit Perforations" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimPerforationCollection* RicEditPerforationCollectionFeature::selectedPerforationCollection()
{
RimPerforationCollection* objToFind = nullptr;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
if (objHandle)
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
if ( objHandle )
{
objHandle->firstAncestorOrThisOfType(objToFind);
objHandle->firstAncestorOrThisOfType( objToFind );
}
return objToFind;

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -23,7 +23,7 @@
class RimPerforationCollection;
//==================================================================================================
///
///
//==================================================================================================
class RicEditPerforationCollectionFeature : public caf::CmdFeature
{
@@ -32,9 +32,8 @@ class RicEditPerforationCollectionFeature : public caf::CmdFeature
protected:
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook(QAction* actionToSetup) override;
void setupActionLook( QAction* actionToSetup ) override;
private:
static RimPerforationCollection* selectedPerforationCollection();
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -37,60 +37,61 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicExportFishbonesLateralsFeature, "RicExportFishbonesLateralsFeature");
CAF_CMD_SOURCE_INIT( RicExportFishbonesLateralsFeature, "RicExportFishbonesLateralsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
void RicExportFishbonesLateralsFeature::onActionTriggered( bool isChecked )
{
using EXP = RicExportSelectedWellPathsFeature;
RimFishbonesCollection* fishbonesCollection = selectedFishbonesCollection();
CVF_ASSERT(fishbonesCollection);
CVF_ASSERT( fishbonesCollection );
RimWellPath* wellPath = nullptr;
fishbonesCollection->firstAncestorOrThisOfType(wellPath);
CVF_ASSERT(wellPath);
fishbonesCollection->firstAncestorOrThisOfType( wellPath );
CVF_ASSERT( wellPath );
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectoryWithFallbackToProjectFolder("WELL_PATH_EXPORT_DIR");
auto fileName = caf::Utils::makeValidFileBasename(wellPath->name()) + "_laterals.dev";
QString defaultDir = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "WELL_PATH_EXPORT_DIR" );
auto fileName = caf::Utils::makeValidFileBasename( wellPath->name() ) + "_laterals.dev";
auto dialogData = EXP::openDialog();
if (dialogData)
if ( dialogData )
{
auto folder = dialogData->exportFolder();
auto folder = dialogData->exportFolder();
auto mdStepSize = dialogData->mdStepSize();
if (folder.isEmpty())
if ( folder.isEmpty() )
{
return;
}
auto exportFile = EXP::openFileForExport(folder, fileName);
auto stream = EXP::createOutputFileStream(*exportFile);
auto exportFile = EXP::openFileForExport( folder, fileName );
auto stream = EXP::createOutputFileStream( *exportFile );
for (RimFishbonesMultipleSubs* fishbone : wellPath->fishbonesCollection()->activeFishbonesSubs())
for ( RimFishbonesMultipleSubs* fishbone : wellPath->fishbonesCollection()->activeFishbonesSubs() )
{
const QString fishboneName = fishbone->generatedName();
for (auto& sub : fishbone->installedLateralIndices())
for ( auto& sub : fishbone->installedLateralIndices() )
{
for (size_t lateralIndex : sub.lateralIndices)
for ( size_t lateralIndex : sub.lateralIndices )
{
std::vector<std::pair<cvf::Vec3d, double>> coordsAndMD = fishbone->coordsAndMDForLateral(sub.subIndex, lateralIndex);
std::vector<std::pair<cvf::Vec3d, double>> coordsAndMD = fishbone->coordsAndMDForLateral( sub.subIndex,
lateralIndex );
std::vector<cvf::Vec3d> lateralCoords;
std::vector<double> lateralMDs;
lateralCoords.reserve(coordsAndMD.size());
lateralMDs.reserve(coordsAndMD.size());
lateralCoords.reserve( coordsAndMD.size() );
lateralMDs.reserve( coordsAndMD.size() );
for (auto& coordMD : coordsAndMD)
for ( auto& coordMD : coordsAndMD )
{
lateralCoords.push_back(coordMD.first);
lateralMDs.push_back(coordMD.second);
lateralCoords.push_back( coordMD.first );
lateralMDs.push_back( coordMD.second );
}
RigWellPath geometry;
@@ -98,10 +99,14 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
geometry.m_measuredDepths = lateralMDs;
// Pad with "0" to get a total of two characters defining the sub index text
QString subIndexText = QString("%1").arg(sub.subIndex, 2, 10, QChar('0'));
QString lateralName = QString("%1_%2_Sub%3_Lat%4").arg(wellPath->name()).arg(fishboneName).arg(subIndexText).arg(lateralIndex);
EXP::writeWellPathGeometryToStream(*stream, &geometry, lateralName, mdStepSize, false, 0.0, false);
QString subIndexText = QString( "%1" ).arg( sub.subIndex, 2, 10, QChar( '0' ) );
QString lateralName = QString( "%1_%2_Sub%3_Lat%4" )
.arg( wellPath->name() )
.arg( fishboneName )
.arg( subIndexText )
.arg( lateralIndex );
EXP::writeWellPathGeometryToStream( *stream, &geometry, lateralName, mdStepSize, false, 0.0, false );
}
}
}
@@ -109,42 +114,42 @@ void RicExportFishbonesLateralsFeature::onActionTriggered(bool isChecked)
exportFile->close();
}
RiaLogging::info("Completed export of Fishbones well path laterals to : " + fileName);
RiaLogging::info( "Completed export of Fishbones well path laterals to : " + fileName );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimFishbonesCollection* RicExportFishbonesLateralsFeature::selectedFishbonesCollection()
{
RimFishbonesCollection* objToFind = nullptr;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
if (objHandle)
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
if ( objHandle )
{
objHandle->firstAncestorOrThisOfType(objToFind);
objHandle->firstAncestorOrThisOfType( objToFind );
}
return objToFind;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicExportFishbonesLateralsFeature::setupActionLook(QAction* actionToSetup)
void RicExportFishbonesLateralsFeature::setupActionLook( QAction* actionToSetup )
{
//actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png"));
actionToSetup->setText("Export Laterals");
// actionToSetup->setIcon(QIcon(":/FractureSymbol16x16.png"));
actionToSetup->setText( "Export Laterals" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicExportFishbonesLateralsFeature::isCommandEnabled()
{
if (selectedFishbonesCollection())
if ( selectedFishbonesCollection() )
{
return true;
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -29,24 +29,24 @@ class RimWellPath;
class QTextStream;
//==================================================================================================
///
///
//==================================================================================================
#ifndef DOUBLE_INF
#define DOUBLE_INF std::numeric_limits<double>::infinity()
#define DOUBLE_INF std::numeric_limits<double>::infinity()
#endif
//==================================================================================================
///
///
//==================================================================================================
class RicExportFishbonesLateralsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
//static void exportFishboneLaterals(const RimWellPath* wellPath, QTextStream& stream, double mdStepSize);
// static void exportFishboneLaterals(const RimWellPath* wellPath, QTextStream& stream, double mdStepSize);
protected:
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
private:

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -33,66 +33,64 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicNewFishbonesSubsAtMeasuredDepthFeature, "RicNewFishbonesSubsAtMeasuredDepthFeature");
CAF_CMD_SOURCE_INIT( RicNewFishbonesSubsAtMeasuredDepthFeature, "RicNewFishbonesSubsAtMeasuredDepthFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered(bool isChecked)
void RicNewFishbonesSubsAtMeasuredDepthFeature::onActionTriggered( bool isChecked )
{
RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem();
CVF_ASSERT(wellPathSelItem);
CVF_ASSERT( wellPathSelItem );
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
CVF_ASSERT(wellPath);
CVF_ASSERT( wellPath );
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
RimFishbonesMultipleSubs* obj = new RimFishbonesMultipleSubs;
wellPath->fishbonesCollection()->appendFishbonesSubs(obj);
wellPath->fishbonesCollection()->appendFishbonesSubs( obj );
obj->setMeasuredDepthAndCount(wellPathSelItem->m_measuredDepth, 12.5, 13);
obj->setMeasuredDepthAndCount( wellPathSelItem->m_measuredDepth, 12.5, 13 );
RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(wellPath->fishbonesCollection());
RicNewFishbonesSubsFeature::askUserToSetUsefulScaling( wellPath->fishbonesCollection() );
wellPath->updateConnectedEditors();
Riu3DMainWindowTools::selectAsCurrentItem(obj);
Riu3DMainWindowTools::selectAsCurrentItem( obj );
RimProject* proj;
wellPath->firstAncestorOrThisOfTypeAsserted(proj);
wellPath->firstAncestorOrThisOfTypeAsserted( proj );
proj->reloadCompletionTypeResultsInAllViews();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RiuWellPathSelectionItem* RicNewFishbonesSubsAtMeasuredDepthFeature::wellPathSelectionItem()
{
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
RiuSelectionItem* selItem = riuSelManager->selectedItem(Riu3dSelectionManager::RUI_TEMPORARY);
RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY );
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>(selItem);
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>( selItem );
return wellPathItem;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook(QAction* actionToSetup)
void RicNewFishbonesSubsAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/FishBoneGroup16x16.png"));
actionToSetup->setText("Create Fishbones at this Depth");
actionToSetup->setIcon( QIcon( ":/FishBoneGroup16x16.png" ) );
actionToSetup->setText( "Create Fishbones at this Depth" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewFishbonesSubsAtMeasuredDepthFeature::isCommandEnabled()
{
if (wellPathSelectionItem())
if ( wellPathSelectionItem() )
{
return true;
}

View File

@@ -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,15 +23,15 @@
class RiuWellPathSelectionItem;
//==================================================================================================
///
///
//==================================================================================================
class RicNewFishbonesSubsAtMeasuredDepthFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
protected:
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
private:

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,11 +24,11 @@
#include "RigWellPath.h"
#include "RimProject.h"
#include "Rim3dView.h"
#include "RimFishboneWellPathCollection.h"
#include "RimFishbonesCollection.h"
#include "RimFishbonesMultipleSubs.h"
#include "Rim3dView.h"
#include "RimProject.h"
#include "RimWellPathCollection.h"
#include "RimWellPathCompletions.h"
@@ -41,84 +41,83 @@
#include <cmath>
CAF_CMD_SOURCE_INIT(RicNewFishbonesSubsFeature, "RicNewFishbonesSubsFeature");
CAF_CMD_SOURCE_INIT( RicNewFishbonesSubsFeature, "RicNewFishbonesSubsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
double getWellPathTipMd(RimWellPath* wellPath);
double getWellPathTipMd( RimWellPath* wellPath );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsFeature::onActionTriggered(bool isChecked)
void RicNewFishbonesSubsFeature::onActionTriggered( bool isChecked )
{
RimFishbonesCollection* fishbonesCollection = selectedFishbonesCollection();
CVF_ASSERT(fishbonesCollection);
CVF_ASSERT( fishbonesCollection );
RimWellPath* wellPath;
fishbonesCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
fishbonesCollection->firstAncestorOrThisOfTypeAsserted( wellPath );
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
RimFishbonesMultipleSubs* obj = new RimFishbonesMultipleSubs;
fishbonesCollection->appendFishbonesSubs(obj);
fishbonesCollection->appendFishbonesSubs( obj );
double wellPathTipMd = getWellPathTipMd(wellPath);
if (wellPathTipMd != HUGE_VAL)
double wellPathTipMd = getWellPathTipMd( wellPath );
if ( wellPathTipMd != HUGE_VAL )
{
double startMd = wellPathTipMd - 150 - 100;
if (startMd < 100) startMd = 100;
if ( startMd < 100 ) startMd = 100;
obj->setMeasuredDepthAndCount(startMd, 12.5, 13);
obj->setMeasuredDepthAndCount( startMd, 12.5, 13 );
}
RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(fishbonesCollection);
RicNewFishbonesSubsFeature::askUserToSetUsefulScaling( fishbonesCollection );
RimWellPathCollection* wellPathCollection = nullptr;
fishbonesCollection->firstAncestorOrThisOfType(wellPathCollection);
if (wellPathCollection)
fishbonesCollection->firstAncestorOrThisOfType( wellPathCollection );
if ( wellPathCollection )
{
wellPathCollection->uiCapability()->updateConnectedEditors();
}
RiuMainWindow::instance()->selectAsCurrentItem(obj);
RiuMainWindow::instance()->selectAsCurrentItem( obj );
RimProject* proj;
fishbonesCollection->firstAncestorOrThisOfTypeAsserted(proj);
fishbonesCollection->firstAncestorOrThisOfTypeAsserted( proj );
proj->reloadCompletionTypeResultsInAllViews();
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimFishbonesCollection* RicNewFishbonesSubsFeature::selectedFishbonesCollection()
{
std::vector<caf::PdmUiItem*> allSelectedItems;
caf::SelectionManager::instance()->selectedItems(allSelectedItems);
if (allSelectedItems.size() != 1u) return nullptr;
caf::SelectionManager::instance()->selectedItems( allSelectedItems );
if ( allSelectedItems.size() != 1u ) return nullptr;
RimFishbonesCollection* objToFind = nullptr;
caf::PdmUiItem* pdmUiItem = allSelectedItems.front();
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
if (objHandle)
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
if ( objHandle )
{
objHandle->firstAncestorOrThisOfType(objToFind);
objHandle->firstAncestorOrThisOfType( objToFind );
}
if (objToFind == nullptr)
if ( objToFind == nullptr )
{
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType(&wellPaths);
if (!wellPaths.empty())
caf::SelectionManager::instance()->objectsByType( &wellPaths );
if ( !wellPaths.empty() )
{
return wellPaths[0]->fishbonesCollection();
}
RimWellPathCompletions* completions = caf::SelectionManager::instance()->selectedItemOfType<RimWellPathCompletions>();
if (completions)
RimWellPathCompletions* completions = caf::SelectionManager::instance()
->selectedItemOfType<RimWellPathCompletions>();
if ( completions )
{
return completions->fishbonesCollection();
}
@@ -128,20 +127,20 @@ RimFishbonesCollection* RicNewFishbonesSubsFeature::selectedFishbonesCollection(
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsFeature::setupActionLook(QAction* actionToSetup)
void RicNewFishbonesSubsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/FishBoneGroup16x16.png"));
actionToSetup->setText("Create Fishbones");
actionToSetup->setIcon( QIcon( ":/FishBoneGroup16x16.png" ) );
actionToSetup->setText( "Create Fishbones" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewFishbonesSubsFeature::isCommandEnabled()
{
if (selectedFishbonesCollection())
if ( selectedFishbonesCollection() )
{
return true;
}
@@ -150,54 +149,55 @@ bool RicNewFishbonesSubsFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(RimFishbonesCollection* fishboneCollection)
void RicNewFishbonesSubsFeature::askUserToSetUsefulScaling( RimFishbonesCollection* fishboneCollection )
{
// Always reset well path collection scale factor
CVF_ASSERT(fishboneCollection);
CVF_ASSERT( fishboneCollection );
RimWellPathCollection* wellPathColl = nullptr;
fishboneCollection->firstAncestorOrThisOfTypeAsserted(wellPathColl);
fishboneCollection->firstAncestorOrThisOfTypeAsserted( wellPathColl );
wellPathColl->wellPathRadiusScaleFactor = 0.01;
Rim3dView* activeView = RiaApplication::instance()->activeReservoirView();
if (!activeView) return;
if ( !activeView ) return;
RiaApplication* app = RiaApplication::instance();
QString sessionKey = "AutoAdjustSettingsForFishbones";
RiaApplication* app = RiaApplication::instance();
QString sessionKey = "AutoAdjustSettingsForFishbones";
bool autoAdjustSettings = false;
QVariant v = app->cacheDataObject(sessionKey);
if (!v.isValid())
bool autoAdjustSettings = false;
QVariant v = app->cacheDataObject( sessionKey );
if ( !v.isValid() )
{
double currentScaleFactor = activeView->scaleZ();
if (fabs(currentScaleFactor - 1.0) < 0.1) return;
if ( fabs( currentScaleFactor - 1.0 ) < 0.1 ) return;
QMessageBox msgBox;
msgBox.setIcon(QMessageBox::Question);
msgBox.setIcon( QMessageBox::Question );
QString questionText;
questionText = QString("When displaying Fishbones structures, the view scaling should be set to 1.\n\nDo you want ResInsight to automatically set view scaling to 1?");
questionText = QString( "When displaying Fishbones structures, the view scaling should be set to 1.\n\nDo you "
"want ResInsight to automatically set view scaling to 1?" );
msgBox.setText(questionText);
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setText( questionText );
msgBox.setStandardButtons( QMessageBox::Yes | QMessageBox::No );
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
if ( ret == QMessageBox::Yes )
{
autoAdjustSettings = true;
}
app->setCacheDataObject(sessionKey, autoAdjustSettings);
app->setCacheDataObject( sessionKey, autoAdjustSettings );
}
else
{
autoAdjustSettings = v.toBool();
}
if (autoAdjustSettings)
if ( autoAdjustSettings )
{
activeView->setScaleZAndUpdate(1.0);
activeView->setScaleZAndUpdate( 1.0 );
activeView->scheduleCreateDisplayModelAndRedraw();
activeView->updateZScaleLabel();
@@ -206,13 +206,13 @@ void RicNewFishbonesSubsFeature::askUserToSetUsefulScaling(RimFishbonesCollectio
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
double getWellPathTipMd(RimWellPath* wellPath)
double getWellPathTipMd( RimWellPath* wellPath )
{
RigWellPath* geometry = wellPath ? wellPath->wellPathGeometry() : nullptr;
if (geometry && !geometry->m_measuredDepths.empty())
if ( geometry && !geometry->m_measuredDepths.empty() )
{
return geometry->m_measuredDepths.back();
}

View File

@@ -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,18 +23,18 @@
class RimFishbonesCollection;
//==================================================================================================
///
///
//==================================================================================================
class RicNewFishbonesSubsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
public:
static void askUserToSetUsefulScaling(RimFishbonesCollection* fishboneCollection);
static void askUserToSetUsefulScaling( RimFishbonesCollection* fishboneCollection );
protected:
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
private:

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -34,65 +34,64 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalAtMeasuredDepthFeature, "RicNewPerforationIntervalAtMeasuredDepthFeature");
CAF_CMD_SOURCE_INIT( RicNewPerforationIntervalAtMeasuredDepthFeature, "RicNewPerforationIntervalAtMeasuredDepthFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered(bool isChecked)
void RicNewPerforationIntervalAtMeasuredDepthFeature::onActionTriggered( bool isChecked )
{
RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem();
CVF_ASSERT(wellPathSelItem);
CVF_ASSERT( wellPathSelItem );
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
CVF_ASSERT(wellPath);
CVF_ASSERT( wellPath );
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
RimPerforationInterval* perforationInterval = new RimPerforationInterval;
double measuredDepth = wellPathSelItem->m_measuredDepth;
perforationInterval->setStartAndEndMD(measuredDepth, measuredDepth + 50);
double measuredDepth = wellPathSelItem->m_measuredDepth;
perforationInterval->setStartAndEndMD( measuredDepth, measuredDepth + 50 );
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
wellPath->perforationIntervalCollection()->appendPerforation( perforationInterval );
RimWellPathCollection* wellPathCollection = nullptr;
wellPath->firstAncestorOrThisOfTypeAsserted(wellPathCollection);
wellPath->firstAncestorOrThisOfTypeAsserted( wellPathCollection );
wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleRedrawAffectedViews();
Riu3DMainWindowTools::selectAsCurrentItem(perforationInterval);
Riu3DMainWindowTools::selectAsCurrentItem( perforationInterval );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RiuWellPathSelectionItem* RicNewPerforationIntervalAtMeasuredDepthFeature::wellPathSelectionItem()
{
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
RiuSelectionItem* selItem = riuSelManager->selectedItem(Riu3dSelectionManager::RUI_TEMPORARY);
RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY );
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>(selItem);
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>( selItem );
return wellPathItem;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewPerforationIntervalAtMeasuredDepthFeature::setupActionLook(QAction* actionToSetup)
void RicNewPerforationIntervalAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/PerforationIntervals16x16.png"));
actionToSetup->setText("Create Perforation Interval at this Depth");
actionToSetup->setIcon( QIcon( ":/PerforationIntervals16x16.png" ) );
actionToSetup->setText( "Create Perforation Interval at this Depth" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewPerforationIntervalAtMeasuredDepthFeature::isCommandEnabled()
{
if (wellPathSelectionItem())
if ( wellPathSelectionItem() )
{
return true;
}

View File

@@ -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,15 +23,15 @@
class RiuWellPathSelectionItem;
//==================================================================================================
///
///
//==================================================================================================
class RicNewPerforationIntervalAtMeasuredDepthFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
private:

View File

@@ -2,17 +2,17 @@
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -23,8 +23,8 @@
#include "Riu3DMainWindowTools.h"
#include "RimPerforationInterval.h"
#include "RimPerforationCollection.h"
#include "RimPerforationInterval.h"
#include "RimWellPathCollection.h"
#include "RimWellPathCompletions.h"
@@ -32,12 +32,10 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicNewPerforationIntervalFeature, "RicNewPerforationIntervalFeature");
CAF_CMD_SOURCE_INIT( RicNewPerforationIntervalFeature, "RicNewPerforationIntervalFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicNewPerforationIntervalFeature::isCommandEnabled()
{
@@ -45,67 +43,65 @@ bool RicNewPerforationIntervalFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewPerforationIntervalFeature::onActionTriggered(bool isChecked)
void RicNewPerforationIntervalFeature::onActionTriggered( bool isChecked )
{
RimPerforationCollection* perforationCollection = selectedPerforationCollection();
if (perforationCollection == nullptr) return;
if ( perforationCollection == nullptr ) return;
RimWellPath* wellPath;
perforationCollection->firstAncestorOrThisOfTypeAsserted(wellPath);
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
perforationCollection->firstAncestorOrThisOfTypeAsserted( wellPath );
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
RimPerforationInterval* perforationInterval = new RimPerforationInterval;
perforationCollection->appendPerforation(perforationInterval);
perforationCollection->appendPerforation( perforationInterval );
RimWellPathCollection* wellPathCollection = nullptr;
perforationCollection->firstAncestorOrThisOfType(wellPathCollection);
if (!wellPathCollection) return;
perforationCollection->firstAncestorOrThisOfType( wellPathCollection );
if ( !wellPathCollection ) return;
wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleRedrawAffectedViews();
Riu3DMainWindowTools::selectAsCurrentItem(perforationInterval);
Riu3DMainWindowTools::selectAsCurrentItem( perforationInterval );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicNewPerforationIntervalFeature::setupActionLook(QAction* actionToSetup)
void RicNewPerforationIntervalFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/PerforationInterval16x16.png"));
actionToSetup->setText("Create Perforation Interval");
actionToSetup->setIcon( QIcon( ":/PerforationInterval16x16.png" ) );
actionToSetup->setText( "Create Perforation Interval" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimPerforationCollection* RicNewPerforationIntervalFeature::selectedPerforationCollection()
{
{
std::vector<caf::PdmUiItem*> selectedItems;
caf::SelectionManager::instance()->selectedItems(selectedItems);
if (selectedItems.size() != 1u) return nullptr;
caf::SelectionManager::instance()->selectedItems( selectedItems );
if ( selectedItems.size() != 1u ) return nullptr;
caf::PdmUiItem* pdmUiItem = selectedItems.front();
RimPerforationCollection* perforationCollection = nullptr;
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
if (objHandle)
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
if ( objHandle )
{
objHandle->firstAncestorOrThisOfType(perforationCollection);
objHandle->firstAncestorOrThisOfType( perforationCollection );
if (perforationCollection)
return perforationCollection;
RimWellPath* wellPath = dynamic_cast<RimWellPath*>(objHandle);
if (wellPath)
return wellPath->perforationIntervalCollection();
if ( perforationCollection ) return perforationCollection;
RimWellPathCompletions* completions = caf::SelectionManager::instance()->selectedItemOfType<RimWellPathCompletions>();
if (completions)
return completions->perforationCollection();
RimWellPath* wellPath = dynamic_cast<RimWellPath*>( objHandle );
if ( wellPath ) return wellPath->perforationIntervalCollection();
RimWellPathCompletions* completions = caf::SelectionManager::instance()
->selectedItemOfType<RimWellPathCompletions>();
if ( completions ) return completions->perforationCollection();
}
return nullptr;
}

View File

@@ -2,17 +2,17 @@
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,13 +24,13 @@
class RimPerforationCollection;
//==================================================================================================
///
///
//==================================================================================================
class RicNewPerforationIntervalFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;

View File

@@ -34,64 +34,64 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicNewValveAtMeasuredDepthFeature, "RicNewValveAtMeasuredDepthFeature");
CAF_CMD_SOURCE_INIT( RicNewValveAtMeasuredDepthFeature, "RicNewValveAtMeasuredDepthFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveAtMeasuredDepthFeature::onActionTriggered(bool isChecked)
void RicNewValveAtMeasuredDepthFeature::onActionTriggered( bool isChecked )
{
RiuWellPathSelectionItem* wellPathSelItem = wellPathSelectionItem();
CVF_ASSERT(wellPathSelItem);
CVF_ASSERT( wellPathSelItem );
RimWellPath* wellPath = wellPathSelItem->m_wellpath;
CVF_ASSERT(wellPath);
CVF_ASSERT( wellPath );
if (!RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem(wellPath)) return;
if ( !RicWellPathsUnitSystemSettingsImpl::ensureHasUnitSystem( wellPath ) ) return;
RimPerforationInterval* perfInterval = dynamic_cast<RimPerforationInterval*>(wellPathSelItem->m_wellPathComponent);
double measuredDepth = wellPathSelItem->m_measuredDepth;
RimPerforationInterval* perfInterval = dynamic_cast<RimPerforationInterval*>( wellPathSelItem->m_wellPathComponent );
double measuredDepth = wellPathSelItem->m_measuredDepth;
RimWellPathValve* valve = new RimWellPathValve;
std::vector<RimWellPathValve*> existingValves = perfInterval->valves();
valve->setName(QString("Valve #%1").arg(existingValves.size() + 1));
valve->setName( QString( "Valve #%1" ).arg( existingValves.size() + 1 ) );
RimProject* project;
perfInterval->firstAncestorOrThisOfTypeAsserted(project);
perfInterval->firstAncestorOrThisOfTypeAsserted( project );
std::vector<RimValveTemplate*> allValveTemplates = project->allValveTemplates();
if (!allValveTemplates.empty())
if ( !allValveTemplates.empty() )
{
valve->setValveTemplate(allValveTemplates.front());
valve->setValveTemplate( allValveTemplates.front() );
}
perfInterval->addValve(valve);
valve->setMeasuredDepthAndCount(measuredDepth, perfInterval->endMD() - measuredDepth, 1);
perfInterval->addValve( valve );
valve->setMeasuredDepthAndCount( measuredDepth, perfInterval->endMD() - measuredDepth, 1 );
RimWellPathCollection* wellPathCollection = nullptr;
wellPath->firstAncestorOrThisOfTypeAsserted(wellPathCollection);
wellPath->firstAncestorOrThisOfTypeAsserted( wellPathCollection );
wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleRedrawAffectedViews();
Riu3DMainWindowTools::selectAsCurrentItem(valve);
Riu3DMainWindowTools::selectAsCurrentItem( valve );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveAtMeasuredDepthFeature::setupActionLook(QAction* actionToSetup)
void RicNewValveAtMeasuredDepthFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/ICDValve16x16.png"));
actionToSetup->setText("Create Valve at this Depth");
actionToSetup->setIcon( QIcon( ":/ICDValve16x16.png" ) );
actionToSetup->setText( "Create Valve at this Depth" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicNewValveAtMeasuredDepthFeature::isCommandEnabled()
bool RicNewValveAtMeasuredDepthFeature::isCommandEnabled()
{
if (wellPathSelectionItem() && dynamic_cast<RimPerforationInterval*>(wellPathSelectionItem()->m_wellPathComponent))
if ( wellPathSelectionItem() && dynamic_cast<RimPerforationInterval*>( wellPathSelectionItem()->m_wellPathComponent ) )
{
return true;
}
@@ -105,10 +105,9 @@ bool RicNewValveAtMeasuredDepthFeature::isCommandEnabled()
RiuWellPathSelectionItem* RicNewValveAtMeasuredDepthFeature::wellPathSelectionItem()
{
Riu3dSelectionManager* riuSelManager = Riu3dSelectionManager::instance();
RiuSelectionItem* selItem = riuSelManager->selectedItem(Riu3dSelectionManager::RUI_TEMPORARY);
RiuSelectionItem* selItem = riuSelManager->selectedItem( Riu3dSelectionManager::RUI_TEMPORARY );
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>(selItem);
RiuWellPathSelectionItem* wellPathItem = dynamic_cast<RiuWellPathSelectionItem*>( selItem );
return wellPathItem;
}

View File

@@ -18,7 +18,6 @@
#pragma once
#include "cafCmdFeature.h"
class RiuWellPathSelectionItem;
@@ -31,12 +30,10 @@ class RicNewValveAtMeasuredDepthFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT;
protected:
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
private:
static RiuWellPathSelectionItem* wellPathSelectionItem();
};

View File

@@ -4,14 +4,14 @@
#include "RiaApplication.h"
#include "RimPerforationInterval.h"
#include "RimProject.h"
#include "RimWellPathValve.h"
#include "RimWellPathCollection.h"
#include "RimWellPathValve.h"
#include "cafSelectionManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicNewValveFeature, "RicNewValveFeature");
CAF_CMD_SOURCE_INIT( RicNewValveFeature, "RicNewValveFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -19,55 +19,54 @@ CAF_CMD_SOURCE_INIT(RicNewValveFeature, "RicNewValveFeature");
bool RicNewValveFeature::isCommandEnabled()
{
std::vector<caf::PdmUiItem*> allSelectedItems;
caf::SelectionManager::instance()->selectedItems(allSelectedItems);
if (allSelectedItems.size() != 1u) return false;
caf::SelectionManager::instance()->selectedItems( allSelectedItems );
if ( allSelectedItems.size() != 1u ) return false;
const RimPerforationInterval* perfInterval = dynamic_cast<RimPerforationInterval*>(allSelectedItems.front());
const RimPerforationInterval* perfInterval = dynamic_cast<RimPerforationInterval*>( allSelectedItems.front() );
return perfInterval != nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveFeature::onActionTriggered(bool isChecked)
void RicNewValveFeature::onActionTriggered( bool isChecked )
{
RimPerforationInterval* perfInterval = caf::SelectionManager::instance()->selectedItemOfType<RimPerforationInterval>();
if (perfInterval)
if ( perfInterval )
{
RimWellPathValve* valve = new RimWellPathValve;
RimProject* project = nullptr;
perfInterval->firstAncestorOrThisOfTypeAsserted(project);
perfInterval->firstAncestorOrThisOfTypeAsserted( project );
std::vector<RimWellPathValve*> existingValves = perfInterval->valves();
valve->setName(QString("Valve #%1").arg(existingValves.size() + 1));
valve->setName( QString( "Valve #%1" ).arg( existingValves.size() + 1 ) );
std::vector<RimValveTemplate*> allValveTemplates = project->allValveTemplates();
if (!allValveTemplates.empty())
if ( !allValveTemplates.empty() )
{
valve->setValveTemplate(allValveTemplates.front());
valve->setValveTemplate( allValveTemplates.front() );
}
perfInterval->addValve(valve);
valve->setMeasuredDepthAndCount(perfInterval->startMD(), perfInterval->endMD() - perfInterval->startMD(), 1);
perfInterval->addValve( valve );
valve->setMeasuredDepthAndCount( perfInterval->startMD(), perfInterval->endMD() - perfInterval->startMD(), 1 );
RimWellPathCollection* wellPathCollection = nullptr;
perfInterval->firstAncestorOrThisOfType(wellPathCollection);
if (!wellPathCollection) return;
perfInterval->firstAncestorOrThisOfType( wellPathCollection );
if ( !wellPathCollection ) return;
wellPathCollection->uiCapability()->updateConnectedEditors();
wellPathCollection->scheduleRedrawAffectedViews();
Riu3DMainWindowTools::selectAsCurrentItem(valve);
Riu3DMainWindowTools::selectAsCurrentItem( valve );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveFeature::setupActionLook(QAction* actionToSetup)
void RicNewValveFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/ICDValve16x16.png"));
actionToSetup->setText("Create Valve");
actionToSetup->setIcon( QIcon( ":/ICDValve16x16.png" ) );
actionToSetup->setText( "Create Valve" );
}

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018- Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -21,16 +21,15 @@
#include "cafCmdFeature.h"
//==================================================================================================
///
///
//==================================================================================================
class RicNewValveFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
};

View File

@@ -21,10 +21,10 @@
#include "RiaApplication.h"
#include "RimEclipseView.h"
#include "RimValveTemplate.h"
#include "RimValveTemplateCollection.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimValveTemplate.h"
#include "RimValveTemplateCollection.h"
#include "RimWellPathValve.h"
#include "Riu3DMainWindowTools.h"
@@ -35,18 +35,18 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicNewValveTemplateFeature, "RicNewValveTemplateFeature");
CAF_CMD_SOURCE_INIT( RicNewValveTemplateFeature, "RicNewValveTemplateFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveTemplateFeature::selectValveTemplateAndUpdate(RimValveTemplate* valveTemplate)
void RicNewValveTemplateFeature::selectValveTemplateAndUpdate( RimValveTemplate* valveTemplate )
{
valveTemplate->loadDataAndUpdate();
RimValveTemplateCollection* templateCollection = nullptr;
valveTemplate->firstAncestorOrThisOfType(templateCollection);
if (templateCollection)
valveTemplate->firstAncestorOrThisOfType( templateCollection );
if ( templateCollection )
{
templateCollection->updateConnectedEditors();
}
@@ -54,27 +54,27 @@ void RicNewValveTemplateFeature::selectValveTemplateAndUpdate(RimValveTemplate*
RimProject* project = RiaApplication::instance()->project();
std::vector<Rim3dView*> views;
project->allVisibleViews(views);
project->allVisibleViews( views );
for (Rim3dView* view : views)
for ( Rim3dView* view : views )
{
if (dynamic_cast<RimEclipseView*>(view))
if ( dynamic_cast<RimEclipseView*>( view ) )
{
view->updateConnectedEditors();
}
}
Riu3DMainWindowTools::selectAsCurrentItem(valveTemplate);
Riu3DMainWindowTools::selectAsCurrentItem( valveTemplate );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveTemplateFeature::createNewValveTemplateForValveAndUpdate(RimWellPathValve* valve)
void RicNewValveTemplateFeature::createNewValveTemplateForValveAndUpdate( RimWellPathValve* valve )
{
RimValveTemplate* valveTemplate = createNewValveTemplate();
valve->setValveTemplate(valveTemplate);
selectValveTemplateAndUpdate(valveTemplate);
valve->setValveTemplate( valveTemplate );
selectValveTemplateAndUpdate( valveTemplate );
}
//--------------------------------------------------------------------------------------------------
@@ -83,20 +83,20 @@ void RicNewValveTemplateFeature::createNewValveTemplateForValveAndUpdate(RimWell
RimValveTemplate* RicNewValveTemplateFeature::createNewValveTemplate()
{
RimProject* project = RiaApplication::instance()->project();
CVF_ASSERT(project);
CVF_ASSERT( project );
RimOilField* oilfield = project->activeOilField();
if (oilfield == nullptr) return nullptr;
if ( oilfield == nullptr ) return nullptr;
RimValveTemplateCollection* valveTemplateColl = oilfield->valveTemplateCollection();
if (valveTemplateColl)
if ( valveTemplateColl )
{
RimValveTemplate* valveTemplate = new RimValveTemplate();
QString userLabel = QString("Valve Template #%1").arg(valveTemplateColl->valveTemplates().size() + 1);
valveTemplate->setUserLabel(userLabel);
valveTemplateColl->addValveTemplate(valveTemplate);
valveTemplate->setUnitSystem(valveTemplateColl->defaultUnitSystemType());
QString userLabel = QString( "Valve Template #%1" ).arg( valveTemplateColl->valveTemplates().size() + 1 );
valveTemplate->setUserLabel( userLabel );
valveTemplateColl->addValveTemplate( valveTemplate );
valveTemplate->setUnitSystem( valveTemplateColl->defaultUnitSystemType() );
valveTemplate->setDefaultValuesFromUnits();
return valveTemplate;
}
@@ -106,22 +106,22 @@ RimValveTemplate* RicNewValveTemplateFeature::createNewValveTemplate()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveTemplateFeature::onActionTriggered(bool isChecked)
void RicNewValveTemplateFeature::onActionTriggered( bool isChecked )
{
RimValveTemplate* valveTemplate = createNewValveTemplate();
if (valveTemplate)
if ( valveTemplate )
{
selectValveTemplateAndUpdate(valveTemplate);
selectValveTemplateAndUpdate( valveTemplate );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicNewValveTemplateFeature::setupActionLook(QAction* actionToSetup)
void RicNewValveTemplateFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setIcon(QIcon(":/ICDValve16x16.png"));
actionToSetup->setText("New Valve Template");
actionToSetup->setIcon( QIcon( ":/ICDValve16x16.png" ) );
actionToSetup->setText( "New Valve Template" );
}
//--------------------------------------------------------------------------------------------------

View File

@@ -34,11 +34,12 @@ class RicNewValveTemplateFeature : public caf::CmdFeature
CAF_CMD_HEADER_INIT;
public:
static void selectValveTemplateAndUpdate(RimValveTemplate* valveTemplate);
static void createNewValveTemplateForValveAndUpdate(RimWellPathValve* valve);
static void selectValveTemplateAndUpdate( RimValveTemplate* valveTemplate );
static void createNewValveTemplateForValveAndUpdate( RimWellPathValve* valve );
protected:
static RimValveTemplate* createNewValveTemplate();
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,8 +24,8 @@
#include "RimFishbonesCollection.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellPathCompletions.h"
#include "RimWellPathCollection.h"
#include "RimWellPathCompletions.h"
#include "Riu3DMainWindowTools.h"
@@ -34,14 +34,14 @@
#include <QAction>
#include <QFileDialog>
CAF_CMD_SOURCE_INIT(RicWellPathImportCompletionsFileFeature, "RicWellPathImportCompletionsFileFeature");
CAF_CMD_SOURCE_INIT( RicWellPathImportCompletionsFileFeature, "RicWellPathImportCompletionsFileFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathImportCompletionsFileFeature::isCommandEnabled()
{
if (RicWellPathImportCompletionsFileFeature::selectedWellPathCollection() != nullptr)
if ( RicWellPathImportCompletionsFileFeature::selectedWellPathCollection() != nullptr )
{
return true;
}
@@ -50,65 +50,70 @@ bool RicWellPathImportCompletionsFileFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellPathImportCompletionsFileFeature::onActionTriggered(bool isChecked)
void RicWellPathImportCompletionsFileFeature::onActionTriggered( bool isChecked )
{
RimFishboneWellPathCollection* fishbonesWellPathCollection = RicWellPathImportCompletionsFileFeature::selectedWellPathCollection();
CVF_ASSERT(fishbonesWellPathCollection);
RimFishboneWellPathCollection* fishbonesWellPathCollection =
RicWellPathImportCompletionsFileFeature::selectedWellPathCollection();
CVF_ASSERT( fishbonesWellPathCollection );
// Open dialog box to select well path files
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory("WELLPATH_DIR");
QStringList wellPathFilePaths = QFileDialog::getOpenFileNames(Riu3DMainWindowTools::mainWindowWidget(), "Import Fishbone Laterals", defaultDir, "Well Path Laterals (*.json *.asc *.asci *.ascii *.dev);;All Files (*.*)");
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory( "WELLPATH_DIR" );
QStringList wellPathFilePaths =
QFileDialog::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
"Import Fishbone Laterals",
defaultDir,
"Well Path Laterals (*.json *.asc *.asci *.ascii *.dev);;All Files (*.*)" );
if (wellPathFilePaths.size() < 1) return;
if ( wellPathFilePaths.size() < 1 ) return;
// Remember the path to next time
app->setLastUsedDialogDirectory("WELLPATH_DIR", QFileInfo(wellPathFilePaths.last()).absolutePath());
app->setLastUsedDialogDirectory( "WELLPATH_DIR", QFileInfo( wellPathFilePaths.last() ).absolutePath() );
fishbonesWellPathCollection->importCompletionsFromFile(wellPathFilePaths);
fishbonesWellPathCollection->importCompletionsFromFile( wellPathFilePaths );
RimWellPathCollection* wellPathCollection;
fishbonesWellPathCollection->firstAncestorOrThisOfType(wellPathCollection);
if (wellPathCollection)
fishbonesWellPathCollection->firstAncestorOrThisOfType( wellPathCollection );
if ( wellPathCollection )
{
wellPathCollection->updateConnectedEditors();
}
if (app->project())
if ( app->project() )
{
app->project()->scheduleCreateDisplayModelAndRedrawAllViews();
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellPathImportCompletionsFileFeature::setupActionLook(QAction* actionToSetup)
void RicWellPathImportCompletionsFileFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Import Fishbone Laterals");
actionToSetup->setIcon(QIcon(":/FishBoneGroupFromFile16x16.png"));
actionToSetup->setText( "Import Fishbone Laterals" );
actionToSetup->setIcon( QIcon( ":/FishBoneGroupFromFile16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimFishboneWellPathCollection* RicWellPathImportCompletionsFileFeature::selectedWellPathCollection()
{
RimFishbonesCollection* objToFind = nullptr;
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>(pdmUiItem);
if (objHandle)
caf::PdmUiItem* pdmUiItem = caf::SelectionManager::instance()->selectedItem();
caf::PdmObjectHandle* objHandle = dynamic_cast<caf::PdmObjectHandle*>( pdmUiItem );
if ( objHandle )
{
objHandle->firstAncestorOrThisOfType(objToFind);
objHandle->firstAncestorOrThisOfType( objToFind );
}
if (objToFind == nullptr)
if ( objToFind == nullptr )
{
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType(&wellPaths);
if (!wellPaths.empty())
caf::SelectionManager::instance()->objectsByType( &wellPaths );
if ( !wellPaths.empty() )
{
return wellPaths[0]->fishbonesCollection()->wellPathCollection();
}

View File

@@ -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,13 +23,13 @@
class RimFishboneWellPathCollection;
//==================================================================================================
///
///
//==================================================================================================
class RicWellPathImportCompletionsFileFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
@@ -38,4 +38,3 @@ protected:
private:
static RimFishboneWellPathCollection* selectedWellPathCollection();
};

View File

@@ -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,11 +21,11 @@
#include "RiaApplication.h"
#include "RiaLogging.h"
#include "RimPerforationCollection.h"
#include "RimPerforationInterval.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimPerforationInterval.h"
#include "RimPerforationCollection.h"
#include "RifPerforationIntervalReader.h"
@@ -36,14 +36,14 @@
#include <QAction>
#include <QFileDialog>
CAF_CMD_SOURCE_INIT(RicWellPathImportPerforationIntervalsFeature, "RicWellPathImportPerforationIntervalsFeature");
CAF_CMD_SOURCE_INIT( RicWellPathImportPerforationIntervalsFeature, "RicWellPathImportPerforationIntervalsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicWellPathImportPerforationIntervalsFeature::isCommandEnabled()
{
if (RicWellPathImportPerforationIntervalsFeature::selectedWellPathCollection() != nullptr)
if ( RicWellPathImportPerforationIntervalsFeature::selectedWellPathCollection() != nullptr )
{
return true;
}
@@ -52,81 +52,88 @@ bool RicWellPathImportPerforationIntervalsFeature::isCommandEnabled()
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellPathImportPerforationIntervalsFeature::onActionTriggered(bool isChecked)
void RicWellPathImportPerforationIntervalsFeature::onActionTriggered( bool isChecked )
{
RimWellPathCollection* wellPathCollection = RicWellPathImportPerforationIntervalsFeature::selectedWellPathCollection();
CVF_ASSERT(wellPathCollection);
CVF_ASSERT( wellPathCollection );
// Open dialog box to select well path files
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory("WELLPATH_DIR");
QStringList wellPathFilePaths = QFileDialog::getOpenFileNames(Riu3DMainWindowTools::mainWindowWidget(), "Import Well Path Perforation Intervals", defaultDir, "Well Path Perforation Intervals (*.ev);;All Files (*.*)");
RiaApplication* app = RiaApplication::instance();
QString defaultDir = app->lastUsedDialogDirectory( "WELLPATH_DIR" );
QStringList wellPathFilePaths =
QFileDialog::getOpenFileNames( Riu3DMainWindowTools::mainWindowWidget(),
"Import Well Path Perforation Intervals",
defaultDir,
"Well Path Perforation Intervals (*.ev);;All Files (*.*)" );
if (wellPathFilePaths.size() < 1) return;
if ( wellPathFilePaths.size() < 1 ) return;
// Remember the path to next time
app->setLastUsedDialogDirectory("WELLPATH_DIR", QFileInfo(wellPathFilePaths.last()).absolutePath());
app->setLastUsedDialogDirectory( "WELLPATH_DIR", QFileInfo( wellPathFilePaths.last() ).absolutePath() );
std::map<QString, std::vector<RifPerforationInterval> > perforationIntervals = RifPerforationIntervalReader::readPerforationIntervals(wellPathFilePaths);
std::map<QString, std::vector<RifPerforationInterval>> perforationIntervals =
RifPerforationIntervalReader::readPerforationIntervals( wellPathFilePaths );
RimPerforationInterval* lastPerforationInterval = nullptr;
for (auto& entry : perforationIntervals)
for ( auto& entry : perforationIntervals )
{
RimWellPath* wellPath = wellPathCollection->tryFindMatchingWellPath(entry.first);
if (wellPath == nullptr)
RimWellPath* wellPath = wellPathCollection->tryFindMatchingWellPath( entry.first );
if ( wellPath == nullptr )
{
RiaLogging::warning(QString("Import Well Path Perforation Intervals : Imported file contains unknown well path '%1'.").arg(entry.first));
RiaLogging::warning(
QString( "Import Well Path Perforation Intervals : Imported file contains unknown well path '%1'." )
.arg( entry.first ) );
}
else
{
for (auto& interval : entry.second)
for ( auto& interval : entry.second )
{
RimPerforationInterval* perforationInterval = new RimPerforationInterval;
perforationInterval->setStartAndEndMD(interval.startMD, interval.endMD);
perforationInterval->setDiameter(interval.diameter);
perforationInterval->setSkinFactor(interval.skinFactor);
if (!interval.startOfHistory)
perforationInterval->setStartAndEndMD( interval.startMD, interval.endMD );
perforationInterval->setDiameter( interval.diameter );
perforationInterval->setSkinFactor( interval.skinFactor );
if ( !interval.startOfHistory )
{
perforationInterval->setCustomStartDate(interval.date);
perforationInterval->enableCustomStartDate(true);
perforationInterval->setCustomStartDate( interval.date );
perforationInterval->enableCustomStartDate( true );
}
wellPath->perforationIntervalCollection()->appendPerforation(perforationInterval);
wellPath->perforationIntervalCollection()->appendPerforation( perforationInterval );
lastPerforationInterval = perforationInterval;
}
}
}
wellPathCollection->uiCapability()->updateConnectedEditors();
if (app->project())
if ( app->project() )
{
app->project()->scheduleCreateDisplayModelAndRedrawAllViews();
}
if (lastPerforationInterval)
if ( lastPerforationInterval )
{
Riu3DMainWindowTools::selectAsCurrentItem(lastPerforationInterval);
Riu3DMainWindowTools::selectAsCurrentItem( lastPerforationInterval );
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicWellPathImportPerforationIntervalsFeature::setupActionLook(QAction* actionToSetup)
void RicWellPathImportPerforationIntervalsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Import Perforation Intervals");
actionToSetup->setText( "Import Perforation Intervals" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RimWellPathCollection* RicWellPathImportPerforationIntervalsFeature::selectedWellPathCollection()
{
std::vector<RimWellPathCollection*> objects;
caf::SelectionManager::instance()->objectsByType(&objects);
caf::SelectionManager::instance()->objectsByType( &objects );
if (objects.size() == 1)
if ( objects.size() == 1 )
{
return objects[0];
}

View File

@@ -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,13 +23,13 @@
class RimWellPathCollection;
//==================================================================================================
///
///
//==================================================================================================
class RicWellPathImportPerforationIntervalsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
protected:
// Overrides
bool isCommandEnabled() override;
void onActionTriggered( bool isChecked ) override;
@@ -38,4 +38,3 @@ protected:
private:
static RimWellPathCollection* selectedWellPathCollection();
};

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -22,45 +22,49 @@
#include "cafPdmUiFilePathEditor.h"
CAF_PDM_SOURCE_INIT(RicCaseAndFileExportSettingsUi, "RicCaseAndFileExportSettingsUi");
CAF_PDM_SOURCE_INIT( RicCaseAndFileExportSettingsUi, "RicCaseAndFileExportSettingsUi" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
RicCaseAndFileExportSettingsUi::RicCaseAndFileExportSettingsUi()
{
CAF_PDM_InitObject("RimCaseAndFileExportSettings", "", "", "");
CAF_PDM_InitObject( "RimCaseAndFileExportSettings", "", "", "" );
CAF_PDM_InitFieldNoDefault(&folder, "Folder", "Export Folder", "", "", "");
folder.uiCapability()->setUiEditorTypeName(caf::PdmUiFilePathEditor::uiEditorTypeName());
CAF_PDM_InitFieldNoDefault( &folder, "Folder", "Export Folder", "", "", "" );
folder.uiCapability()->setUiEditorTypeName( caf::PdmUiFilePathEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault(&caseToApply, "CaseToApply", "Case to Apply", "", "", "");
CAF_PDM_InitFieldNoDefault( &caseToApply, "CaseToApply", "Case to Apply", "", "", "" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo> RicCaseAndFileExportSettingsUi::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
QList<caf::PdmOptionItemInfo>
RicCaseAndFileExportSettingsUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options;
if (fieldNeedingOptions == &caseToApply)
if ( fieldNeedingOptions == &caseToApply )
{
RimTools::caseOptionItems(&options);
RimTools::caseOptionItems( &options );
}
return options;
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicCaseAndFileExportSettingsUi::defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute)
void RicCaseAndFileExportSettingsUi::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{
if (field == &folder)
if ( field == &folder )
{
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>(attribute);
if (myAttr)
caf::PdmUiFilePathEditorAttribute* myAttr = dynamic_cast<caf::PdmUiFilePathEditorAttribute*>( attribute );
if ( myAttr )
{
myAttr->m_selectDirectory = true;
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -20,25 +20,29 @@
#include "RimEclipseCase.h"
#include "cafPdmObject.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmPtrField.h"
//==================================================================================================
///
///
///
///
//==================================================================================================
class RicCaseAndFileExportSettingsUi : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
public:
RicCaseAndFileExportSettingsUi();
caf::PdmField<QString> folder;
caf::PdmPtrField<RimEclipseCase*> caseToApply;
caf::PdmField<QString> folder;
caf::PdmPtrField<RimEclipseCase*> caseToApply;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
protected:
void defineEditorAttribute(const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
};

View File

@@ -67,44 +67,49 @@ namespace caf
}
// clang-format on
CAF_PDM_SOURCE_INIT(RicExportCompletionDataSettingsUi, "RicExportCompletionDataSettingsUi");
CAF_PDM_SOURCE_INIT( RicExportCompletionDataSettingsUi, "RicExportCompletionDataSettingsUi" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicExportCompletionDataSettingsUi::RicExportCompletionDataSettingsUi()
{
CAF_PDM_InitObject("RimExportCompletionDataSettings", "", "", "");
CAF_PDM_InitObject( "RimExportCompletionDataSettings", "", "", "" );
CAF_PDM_InitFieldNoDefault(&fileSplit, "FileSplit", "File Split", "", "", "");
CAF_PDM_InitFieldNoDefault( &fileSplit, "FileSplit", "File Split", "", "", "" );
CAF_PDM_InitFieldNoDefault(&compdatExport, "compdatExport", "Export", "", " ", "");
CAF_PDM_InitFieldNoDefault( &compdatExport, "compdatExport", "Export", "", " ", "" );
CAF_PDM_InitField(&timeStep, "TimeStepIndex", 0, " Time Step", "", "", "");
CAF_PDM_InitField( &timeStep, "TimeStepIndex", 0, " Time Step", "", "", "" );
CAF_PDM_InitField(&includeMsw, "IncludeMSW", true, "Include Multi Segment Well Model", "", "", "");
CAF_PDM_InitField( &includeMsw, "IncludeMSW", true, "Include Multi Segment Well Model", "", "", "" );
CAF_PDM_InitField(&useLateralNTG, "UseLateralNTG", false, "Use NTG Horizontally", "", "", "");
CAF_PDM_InitField( &useLateralNTG, "UseLateralNTG", false, "Use NTG Horizontally", "", "", "" );
CAF_PDM_InitField(&includePerforations, "IncludePerforations", true, "Perforations", "", "", "");
CAF_PDM_InitField(&includeFishbones, "IncludeFishbones", true, "Fishbones", "", "", "");
CAF_PDM_InitField(&includeFractures, "IncludeFractures", true, "Fractures", "", "", "");
CAF_PDM_InitField( &includePerforations, "IncludePerforations", true, "Perforations", "", "", "" );
CAF_PDM_InitField( &includeFishbones, "IncludeFishbones", true, "Fishbones", "", "", "" );
CAF_PDM_InitField( &includeFractures, "IncludeFractures", true, "Fractures", "", "", "" );
CAF_PDM_InitField(&performTransScaling, "TransScalingType", false, "Perform Transmissibility Scaling", "", "", "");
CAF_PDM_InitField(&transScalingTimeStep, "TransScalingTimeStep", 0, "Current Time Step", "", "", "");
CAF_PDM_InitFieldNoDefault(&transScalingWBHPSource, "TransScalingWBHPSource", "WBHP Selection", "", "", "");
CAF_PDM_InitField(&transScalingWBHP, "TransScalingWBHP", 200.0, "WBHP Before Production Start", "", "", "");
CAF_PDM_InitField( &performTransScaling, "TransScalingType", false, "Perform Transmissibility Scaling", "", "", "" );
CAF_PDM_InitField( &transScalingTimeStep, "TransScalingTimeStep", 0, "Current Time Step", "", "", "" );
CAF_PDM_InitFieldNoDefault( &transScalingWBHPSource, "TransScalingWBHPSource", "WBHP Selection", "", "", "" );
CAF_PDM_InitField( &transScalingWBHP, "TransScalingWBHP", 200.0, "WBHP Before Production Start", "", "", "" );
CAF_PDM_InitField(&excludeMainBoreForFishbones,
"ExcludeMainBoreForFishbones",
false,
" Exclude Main Bore Transmissibility",
"",
"Main bore perforation intervals are defined by start/end MD of each active fishbone sub definition",
"");
CAF_PDM_InitField( &excludeMainBoreForFishbones,
"ExcludeMainBoreForFishbones",
false,
" Exclude Main Bore Transmissibility",
"",
"Main bore perforation intervals are defined by start/end MD of each active fishbone sub "
"definition",
"" );
CAF_PDM_InitFieldNoDefault(
&m_reportCompletionTypesSeparately, "ReportCompletionTypesSeparately", "Export Completion Types", "", "", "");
CAF_PDM_InitFieldNoDefault( &m_reportCompletionTypesSeparately,
"ReportCompletionTypesSeparately",
"Export Completion Types",
"",
"",
"" );
m_displayForSimWell = true;
@@ -140,7 +145,7 @@ void RicExportCompletionDataSettingsUi::showForWellPath()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::setCombinationMode(CombinationMode combinationMode)
void RicExportCompletionDataSettingsUi::setCombinationMode( CombinationMode combinationMode )
{
m_reportCompletionTypesSeparately = combinationMode;
}
@@ -148,7 +153,7 @@ void RicExportCompletionDataSettingsUi::setCombinationMode(CombinationMode combi
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::showFractureInUi(bool enable)
void RicExportCompletionDataSettingsUi::showFractureInUi( bool enable )
{
m_fracturesEnabled = enable;
}
@@ -156,7 +161,7 @@ void RicExportCompletionDataSettingsUi::showFractureInUi(bool enable)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::showPerforationsInUi(bool enable)
void RicExportCompletionDataSettingsUi::showPerforationsInUi( bool enable )
{
m_perforationsEnabled = enable;
}
@@ -164,7 +169,7 @@ void RicExportCompletionDataSettingsUi::showPerforationsInUi(bool enable)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::showFishbonesInUi(bool enable)
void RicExportCompletionDataSettingsUi::showFishbonesInUi( bool enable )
{
m_fishbonesEnabled = enable;
}
@@ -180,17 +185,17 @@ bool RicExportCompletionDataSettingsUi::reportCompletionsTypesIndividually() con
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue)
void RicExportCompletionDataSettingsUi::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue )
{
if (changedField == &compdatExport)
if ( changedField == &compdatExport )
{
if (compdatExport == WPIMULT_AND_DEFAULT_CONNECTION_FACTORS)
if ( compdatExport == WPIMULT_AND_DEFAULT_CONNECTION_FACTORS )
{
includeFractures = false;
}
else if (compdatExport == TRANSMISSIBILITIES || includeMsw)
else if ( compdatExport == TRANSMISSIBILITIES || includeMsw )
{
includeFractures = true;
}
@@ -201,84 +206,88 @@ void RicExportCompletionDataSettingsUi::fieldChangedByUi(const caf::PdmFieldHand
///
//--------------------------------------------------------------------------------------------------
QList<caf::PdmOptionItemInfo>
RicExportCompletionDataSettingsUi::calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly)
RicExportCompletionDataSettingsUi::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly )
{
QList<caf::PdmOptionItemInfo> options;
if (fieldNeedingOptions == &timeStep)
if ( fieldNeedingOptions == &timeStep )
{
QStringList timeStepNames;
if (caseToApply)
if ( caseToApply )
{
timeStepNames = caseToApply->timeStepStrings();
}
for (int i = 0; i < timeStepNames.size(); i++)
for ( int i = 0; i < timeStepNames.size(); i++ )
{
options.push_back(caf::PdmOptionItemInfo(timeStepNames[i], i));
options.push_back( caf::PdmOptionItemInfo( timeStepNames[i], i ) );
}
}
else if (fieldNeedingOptions == &transScalingTimeStep)
else if ( fieldNeedingOptions == &transScalingTimeStep )
{
std::map<int, std::vector<std::pair<QString, QString>>> wellProductionStartStrings = generateWellProductionStartStrings();
std::map<int, std::vector<std::pair<QString, QString>>> wellProductionStartStrings =
generateWellProductionStartStrings();
QStringList timeStepNames;
if (caseToApply)
if ( caseToApply )
{
timeStepNames = caseToApply->timeStepStrings();
}
for (int i = 0; i < timeStepNames.size(); i++)
for ( int i = 0; i < timeStepNames.size(); i++ )
{
QString timeStepString = timeStepNames[i];
auto it = wellProductionStartStrings.find(i);
if (it != wellProductionStartStrings.end())
auto it = wellProductionStartStrings.find( i );
if ( it != wellProductionStartStrings.end() )
{
int numberOfWells = static_cast<int>(it->second.size());
int numberOfWells = static_cast<int>( it->second.size() );
QStringList wellList;
QStringList wellPressureList;
const int maxStringLength = 70;
QString startStringFormat(" [Start: %1]");
const int maxStringLength = 70;
QString startStringFormat( " [Start: %1]" );
for (int w = 0; w < numberOfWells; ++w)
for ( int w = 0; w < numberOfWells; ++w )
{
QString wellString = it->second[w].first;
QStringList candidateWellList = wellList; candidateWellList << wellString;
QString wellString = it->second[w].first;
QStringList candidateWellList = wellList;
candidateWellList << wellString;
if (startStringFormat.arg(candidateWellList.join(", ")).length() < maxStringLength)
if ( startStringFormat.arg( candidateWellList.join( ", " ) ).length() < maxStringLength )
{
wellList = candidateWellList;
}
QString wellStringWithPressure = QString("%1 (%2)").arg(it->second[w].first).arg(it->second[w].second);
QStringList candidateWellPressureList = wellPressureList; candidateWellPressureList << wellStringWithPressure;
if (startStringFormat.arg(candidateWellPressureList.join(", ")).length() < maxStringLength)
QString wellStringWithPressure = QString( "%1 (%2)" ).arg( it->second[w].first ).arg( it->second[w].second );
QStringList candidateWellPressureList = wellPressureList;
candidateWellPressureList << wellStringWithPressure;
if ( startStringFormat.arg( candidateWellPressureList.join( ", " ) ).length() < maxStringLength )
{
wellPressureList = candidateWellPressureList;
}
}
if (wellList.size() < numberOfWells)
if ( wellList.size() < numberOfWells )
{
wellList += QString("+ %1 more").arg(numberOfWells - wellList.size());
timeStepString += startStringFormat.arg(wellList.join(", "));
wellList += QString( "+ %1 more" ).arg( numberOfWells - wellList.size() );
timeStepString += startStringFormat.arg( wellList.join( ", " ) );
}
else if (wellPressureList.size() < numberOfWells)
else if ( wellPressureList.size() < numberOfWells )
{
timeStepString += startStringFormat.arg(wellList.join(", "));
timeStepString += startStringFormat.arg( wellList.join( ", " ) );
}
else
{
timeStepString += startStringFormat.arg(wellPressureList.join(", "));
timeStepString += startStringFormat.arg( wellPressureList.join( ", " ) );
}
}
options.push_back(caf::PdmOptionItemInfo(timeStepString, i));
options.push_back( caf::PdmOptionItemInfo( timeStepString, i ) );
}
}
else
{
options = RicCaseAndFileExportSettingsUi::calculateValueOptions(fieldNeedingOptions, useOptionsOnly);
options = RicCaseAndFileExportSettingsUi::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
}
return options;
}
@@ -286,97 +295,98 @@ QList<caf::PdmOptionItemInfo>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionDataSettingsUi::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
void RicExportCompletionDataSettingsUi::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Export Settings");
group->add(&compdatExport);
group->add(&caseToApply);
group->add(&useLateralNTG);
group->add(&includeMsw);
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Export Settings" );
group->add( &compdatExport );
group->add( &caseToApply );
group->add( &useLateralNTG );
group->add( &includeMsw );
}
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup("File Settings");
group->add(&fileSplit);
group->add(&m_reportCompletionTypesSeparately);
group->add(&folder);
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "File Settings" );
group->add( &fileSplit );
group->add( &m_reportCompletionTypesSeparately );
group->add( &folder );
}
{
caf::PdmUiGroup* group = uiOrdering.addNewGroup("Completions Export Selection");
if (!m_displayForSimWell)
caf::PdmUiGroup* group = uiOrdering.addNewGroup( "Completions Export Selection" );
if ( !m_displayForSimWell )
{
if (m_perforationsEnabled)
if ( m_perforationsEnabled )
{
group->add(&includePerforations);
group->add(&timeStep);
if (!includePerforations)
timeStep.uiCapability()->setUiReadOnly(true);
group->add( &includePerforations );
group->add( &timeStep );
if ( !includePerforations )
timeStep.uiCapability()->setUiReadOnly( true );
else
timeStep.uiCapability()->setUiReadOnly(false);
timeStep.uiCapability()->setUiReadOnly( false );
}
}
if (m_fracturesEnabled)
if ( m_fracturesEnabled )
{
group->add(&includeFractures);
group->add( &includeFractures );
caf::PdmUiGroup* pddGroup = group->addNewGroup("Pressure Differential Depletion Scaling");
pddGroup->setUiReadOnly(!includeFractures());
caf::PdmUiGroup* pddGroup = group->addNewGroup( "Pressure Differential Depletion Scaling" );
pddGroup->setUiReadOnly( !includeFractures() );
pddGroup->add(&performTransScaling);
pddGroup->add(&transScalingTimeStep);
pddGroup->add(&transScalingWBHPSource);
pddGroup->add(&transScalingWBHP);
pddGroup->add( &performTransScaling );
pddGroup->add( &transScalingTimeStep );
pddGroup->add( &transScalingWBHPSource );
pddGroup->add( &transScalingWBHP );
if (!includeFractures())
if ( !includeFractures() )
{
performTransScaling = false;
performTransScaling.uiCapability()->setUiReadOnly(true);
performTransScaling.uiCapability()->setUiReadOnly( true );
}
else
{
performTransScaling.uiCapability()->setUiReadOnly(false);
performTransScaling.uiCapability()->setUiReadOnly( false );
}
if (!performTransScaling())
if ( !performTransScaling() )
{
transScalingTimeStep.uiCapability()->setUiReadOnly(true);
transScalingWBHPSource.uiCapability()->setUiReadOnly(true);
transScalingWBHP.uiCapability()->setUiReadOnly(true);
transScalingTimeStep.uiCapability()->setUiReadOnly( true );
transScalingWBHPSource.uiCapability()->setUiReadOnly( true );
transScalingWBHP.uiCapability()->setUiReadOnly( true );
}
else
{
transScalingTimeStep.uiCapability()->setUiReadOnly(false);
transScalingWBHPSource.uiCapability()->setUiReadOnly(false);
transScalingWBHP.uiCapability()->setUiReadOnly(false);
if (transScalingWBHPSource == RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY)
{
transScalingTimeStep.uiCapability()->setUiReadOnly( false );
transScalingWBHPSource.uiCapability()->setUiReadOnly( false );
transScalingWBHP.uiCapability()->setUiReadOnly( false );
if ( transScalingWBHPSource == RicExportFractureCompletionsImpl::WBHP_FROM_SUMMARY )
{
transScalingWBHP.uiCapability()->setUiName("WBHP Before Production Start");
transScalingWBHP.uiCapability()->setUiName( "WBHP Before Production Start" );
}
else
{
transScalingWBHP.uiCapability()->setUiName("User Defined WBHP");
transScalingWBHP.uiCapability()->setUiName( "User Defined WBHP" );
}
}
// Set visibility
includeFractures.uiCapability()->setUiHidden(compdatExport == WPIMULT_AND_DEFAULT_CONNECTION_FACTORS && !includeMsw);
includeFractures.uiCapability()->setUiHidden( compdatExport == WPIMULT_AND_DEFAULT_CONNECTION_FACTORS &&
!includeMsw );
}
if (!m_displayForSimWell)
if ( !m_displayForSimWell )
{
if (m_fishbonesEnabled)
if ( m_fishbonesEnabled )
{
group->add(&includeFishbones);
group->add(&excludeMainBoreForFishbones);
group->add( &includeFishbones );
group->add( &excludeMainBoreForFishbones );
// Set visibility
if (!includeFishbones)
excludeMainBoreForFishbones.uiCapability()->setUiReadOnly(true);
if ( !includeFishbones )
excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( true );
else
excludeMainBoreForFishbones.uiCapability()->setUiReadOnly(false);
excludeMainBoreForFishbones.uiCapability()->setUiReadOnly( false );
}
}
}
@@ -387,29 +397,33 @@ void RicExportCompletionDataSettingsUi::defineUiOrdering(QString uiConfigName, c
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<int, std::vector<std::pair<QString, QString>>> RicExportCompletionDataSettingsUi::generateWellProductionStartStrings()
std::map<int, std::vector<std::pair<QString, QString>>>
RicExportCompletionDataSettingsUi::generateWellProductionStartStrings()
{
std::map<int, std::vector<std::pair<QString, QString>>> wellProductionStartStrings;
const RimProject* project = nullptr;
if (caseToApply)
if ( caseToApply )
{
caseToApply->firstAncestorOrThisOfTypeAsserted(project);
for (const RimWellPath* wellPath : project->allWellPaths())
caseToApply->firstAncestorOrThisOfTypeAsserted( project );
for ( const RimWellPath* wellPath : project->allWellPaths() )
{
int initialWellProductionTimeStep = -1;
double initialWellPressure = 0.0;
double currentWellPressure = 0.0;
RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeStepFromSummaryData(caseToApply,
wellPath->completions()->wellNameForExport(),
0,
&initialWellProductionTimeStep,
&initialWellPressure,
&currentWellPressure);
if (initialWellProductionTimeStep >= 0)
double initialWellPressure = 0.0;
double currentWellPressure = 0.0;
RicExportFractureCompletionsImpl::
getWellPressuresAndInitialProductionTimeStepFromSummaryData( caseToApply,
wellPath->completions()->wellNameForExport(),
0,
&initialWellProductionTimeStep,
&initialWellPressure,
&currentWellPressure );
if ( initialWellProductionTimeStep >= 0 )
{
QString pressureUnits = RiaEclipseUnitTools::unitStringPressure(wellPath->unitSystem());
wellProductionStartStrings[initialWellProductionTimeStep].push_back(std::make_pair(wellPath->name(), QString("%1 %2").arg(initialWellPressure, 4, 'f', 1).arg(pressureUnits)));
QString pressureUnits = RiaEclipseUnitTools::unitStringPressure( wellPath->unitSystem() );
wellProductionStartStrings[initialWellProductionTimeStep].push_back(
std::make_pair( wellPath->name(),
QString( "%1 %2" ).arg( initialWellPressure, 4, 'f', 1 ).arg( pressureUnits ) ) );
}
}
}

View File

@@ -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,19 +21,21 @@
#include "RicCaseAndFileExportSettingsUi.h"
#include "RicExportFractureCompletionsImpl.h"
#include "cafPdmField.h"
#include "cafAppEnum.h"
#include "cafPdmField.h"
//==================================================================================================
///
///
///
///
//==================================================================================================
class RicExportCompletionDataSettingsUi : public RicCaseAndFileExportSettingsUi
{
CAF_PDM_HEADER_INIT;
public:
// Exported in .proto file. Do not change without changing .proto
enum ExportSplit {
enum ExportSplit
{
UNIFIED_FILE,
SPLIT_ON_WELL,
SPLIT_ON_WELL_AND_COMPLETION_TYPE,
@@ -41,7 +43,8 @@ public:
typedef caf::AppEnum<ExportSplit> ExportSplitType;
// Exported in .proto file. Do not change without changing .proto
enum CompdatExport {
enum CompdatExport
{
TRANSMISSIBILITIES,
WPIMULT_AND_DEFAULT_CONNECTION_FACTORS,
@@ -55,56 +58,60 @@ public:
enum CombinationMode
{
INDIVIDUALLY,
COMBINED,
COMBINED,
};
typedef caf::AppEnum<CombinationMode> CombinationModeType;
typedef caf::AppEnum<RicExportFractureCompletionsImpl::PressureDepletionWBHPSource> TransScalingWBHPSource;
typedef caf::AppEnum<RicExportFractureCompletionsImpl::PressureDepletionWBHPSource> TransScalingWBHPSource;
RicExportCompletionDataSettingsUi();
caf::PdmField<int> timeStep;
caf::PdmField<int> timeStep;
caf::PdmField<ExportSplitType> fileSplit;
caf::PdmField<CompdatExportType> compdatExport;
caf::PdmField<ExportSplitType> fileSplit;
caf::PdmField<CompdatExportType> compdatExport;
caf::PdmField<bool> performTransScaling;
caf::PdmField<int> transScalingTimeStep;
caf::PdmField<TransScalingWBHPSource> transScalingWBHPSource;
caf::PdmField<double> transScalingWBHP;
caf::PdmField<bool> performTransScaling;
caf::PdmField<int> transScalingTimeStep;
caf::PdmField<TransScalingWBHPSource> transScalingWBHPSource;
caf::PdmField<double> transScalingWBHP;
caf::PdmField<bool> includeMsw;
caf::PdmField<bool> useLateralNTG;
caf::PdmField<bool> includePerforations;
caf::PdmField<bool> includeFishbones;
caf::PdmField<bool> excludeMainBoreForFishbones;
caf::PdmField<bool> includeFractures;
void enableIncludeMsw();
void showForSimWells();
void showForWellPath();
caf::PdmField<bool> includeMsw;
caf::PdmField<bool> useLateralNTG;
caf::PdmField<bool> includePerforations;
caf::PdmField<bool> includeFishbones;
caf::PdmField<bool> excludeMainBoreForFishbones;
void setCombinationMode(CombinationMode combinationMode);
caf::PdmField<bool> includeFractures;
void showFractureInUi(bool enable);
void showPerforationsInUi(bool enable);
void showFishbonesInUi(bool enable);
void enableIncludeMsw();
void showForSimWells();
void showForWellPath();
bool reportCompletionsTypesIndividually() const;
void setCombinationMode( CombinationMode combinationMode );
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void showFractureInUi( bool enable );
void showPerforationsInUi( bool enable );
void showFishbonesInUi( bool enable );
bool reportCompletionsTypesIndividually() const;
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
const QVariant& oldValue,
const QVariant& newValue ) override;
protected:
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
std::map<int, std::vector<std::pair<QString, QString>>> generateWellProductionStartStrings();
private:
caf::PdmField<CombinationModeType> m_reportCompletionTypesSeparately;
bool m_displayForSimWell;
bool m_fracturesEnabled;
bool m_perforationsEnabled;
bool m_fishbonesEnabled;
private:
caf::PdmField<CombinationModeType> m_reportCompletionTypesSeparately;
bool m_displayForSimWell;
bool m_fracturesEnabled;
bool m_perforationsEnabled;
bool m_fishbonesEnabled;
};

View File

@@ -36,14 +36,14 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicExportCompletionsForTemporaryLgrsFeature, "RicExportCompletionsForTemporaryLgrsFeature");
CAF_CMD_SOURCE_INIT( RicExportCompletionsForTemporaryLgrsFeature, "RicExportCompletionsForTemporaryLgrsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExportCompletionsForTemporaryLgrsFeature::isCommandEnabled()
{
if (wellPathsAssociatedWithLgrs().empty())
if ( wellPathsAssociatedWithLgrs().empty() )
{
return false;
}
@@ -55,10 +55,10 @@ bool RicExportCompletionsForTemporaryLgrsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered(bool isChecked)
void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered( bool isChecked )
{
std::vector<RimWellPath*> wellPaths = wellPathsAssociatedWithLgrs();
if (wellPaths.empty())
if ( wellPaths.empty() )
{
return;
}
@@ -66,16 +66,16 @@ void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered(bool isCheck
std::vector<RimSimWellInView*> simWells;
QString dialogTitle = "Export Completion Data for Temporary LGRs";
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions(dialogTitle, wellPaths, simWells);
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsForTemporaryLgrsFeature::setupActionLook(QAction* actionToSetup)
void RicExportCompletionsForTemporaryLgrsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Export Completion Data");
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
actionToSetup->setText( "Export Completion Data" );
actionToSetup->setIcon( QIcon( ":/ExportCompletionsSymbol16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
@@ -86,29 +86,29 @@ std::vector<RimWellPath*> RicExportCompletionsForTemporaryLgrsFeature::wellPaths
std::vector<RimWellPath*> wellPaths;
auto selectedEclipseCase = caf::firstAncestorOfTypeFromSelectedObject<RimEclipseCase*>();
if (selectedEclipseCase)
if ( selectedEclipseCase )
{
auto mainGrid = selectedEclipseCase->mainGrid();
std::set<QString> wellPathNames;
for (size_t i = 0; i < mainGrid->gridCount(); i++)
for ( size_t i = 0; i < mainGrid->gridCount(); i++ )
{
const RigGridBase* grid = mainGrid->gridByIndex(i);
const RigGridBase* grid = mainGrid->gridByIndex( i );
if (!grid->associatedWellPathName().empty())
if ( !grid->associatedWellPathName().empty() )
{
wellPathNames.insert(QString::fromStdString(grid->associatedWellPathName()));
wellPathNames.insert( QString::fromStdString( grid->associatedWellPathName() ) );
}
}
auto project = RiaApplication::instance()->project();
for (const auto& wellPathName : wellPathNames)
for ( const auto& wellPathName : wellPathNames )
{
auto wellPath = project->wellPathByName(wellPathName);
if (wellPath)
auto wellPath = project->wellPathByName( wellPathName );
if ( wellPath )
{
wellPaths.push_back(wellPath);
wellPaths.push_back( wellPath );
}
}
}

View File

@@ -33,8 +33,8 @@ class RicExportCompletionsForTemporaryLgrsFeature : public caf::CmdFeature
protected:
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
public:
static std::vector<RimWellPath*> wellPathsAssociatedWithLgrs();

View File

@@ -27,7 +27,7 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicExportCompletionsForVisibleSimWellsFeature, "RicExportCompletionsForVisibleSimWellsFeature");
CAF_CMD_SOURCE_INIT( RicExportCompletionsForVisibleSimWellsFeature, "RicExportCompletionsForVisibleSimWellsFeature" );
//--------------------------------------------------------------------------------------------------
///
@@ -36,7 +36,7 @@ bool RicExportCompletionsForVisibleSimWellsFeature::isCommandEnabled()
{
std::vector<RimSimWellInView*> simWells = visibleSimWells();
if (simWells.empty())
if ( simWells.empty() )
{
return false;
}
@@ -47,25 +47,24 @@ bool RicExportCompletionsForVisibleSimWellsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsForVisibleSimWellsFeature::onActionTriggered(bool isChecked)
void RicExportCompletionsForVisibleSimWellsFeature::onActionTriggered( bool isChecked )
{
std::vector<RimSimWellInView*> simWells = visibleSimWells();
CVF_ASSERT(!simWells.empty());
CVF_ASSERT( !simWells.empty() );
std::vector<RimWellPath*> wellPaths;
QString dialogTitle = "Export Completion Data for Visible Simulation Wells";
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions(dialogTitle, wellPaths, simWells);
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsForVisibleSimWellsFeature::setupActionLook(QAction* actionToSetup)
void RicExportCompletionsForVisibleSimWellsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Export Completion Data for Visible Simulation Wells");
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
actionToSetup->setText( "Export Completion Data for Visible Simulation Wells" );
actionToSetup->setIcon( QIcon( ":/ExportCompletionsSymbol16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
@@ -77,38 +76,38 @@ std::vector<RimSimWellInView*> RicExportCompletionsForVisibleSimWellsFeature::vi
{
std::vector<RimSimWellInViewCollection*> simWellCollection;
caf::SelectionManager::instance()->objectsByType(&simWellCollection);
caf::SelectionManager::instance()->objectsByType( &simWellCollection );
if (simWellCollection.empty())
if ( simWellCollection.empty() )
{
std::vector<RimSimWellInView*> selectedSimWells;
caf::SelectionManager::instance()->objectsByType(&selectedSimWells);
caf::SelectionManager::instance()->objectsByType( &selectedSimWells );
if (!selectedSimWells.empty())
if ( !selectedSimWells.empty() )
{
RimSimWellInViewCollection* parent = nullptr;
selectedSimWells[0]->firstAncestorOrThisOfType(parent);
if (parent)
selectedSimWells[0]->firstAncestorOrThisOfType( parent );
if ( parent )
{
simWellCollection.push_back(parent);
simWellCollection.push_back( parent );
}
}
}
for (auto coll : simWellCollection)
for ( auto coll : simWellCollection )
{
for (const auto& wellPath : coll->wells())
for ( const auto& wellPath : coll->wells() )
{
if (wellPath->showWell())
if ( wellPath->showWell() )
{
simWells.push_back(wellPath);
simWells.push_back( wellPath );
}
}
}
}
std::set<RimSimWellInView*> uniqueWellPaths(simWells.begin(), simWells.end());
simWells.assign(uniqueWellPaths.begin(), uniqueWellPaths.end());
std::set<RimSimWellInView*> uniqueWellPaths( simWells.begin(), simWells.end() );
simWells.assign( uniqueWellPaths.begin(), uniqueWellPaths.end() );
return simWells;
}

View File

@@ -31,8 +31,8 @@ class RicExportCompletionsForVisibleSimWellsFeature : public caf::CmdFeature
protected:
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
private:
std::vector<RimSimWellInView*> visibleSimWells();

View File

@@ -24,44 +24,44 @@
#include "RiuPlotMainWindow.h"
#include "RimWellPath.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "cafSelectionManager.h"
#include <QAction>
CAF_CMD_SOURCE_INIT(RicExportCompletionsForVisibleWellPathsFeature, "RicExportCompletionsForVisibleWellPathsFeature");
CAF_CMD_SOURCE_INIT( RicExportCompletionsForVisibleWellPathsFeature, "RicExportCompletionsForVisibleWellPathsFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExportCompletionsForVisibleWellPathsFeature::isCommandEnabled()
{
bool foundWellPathCollection = false;
bool foundWellPathCollection = false;
std::vector<caf::PdmObject*> selectedObjects;
caf::SelectionManager::instance()->objectsByType(&selectedObjects);
for (caf::PdmObject* object : selectedObjects)
caf::SelectionManager::instance()->objectsByType( &selectedObjects );
for ( caf::PdmObject* object : selectedObjects )
{
RimWellPathCollection* wellPathCollection;
object->firstAncestorOrThisOfType(wellPathCollection);
if (wellPathCollection)
object->firstAncestorOrThisOfType( wellPathCollection );
if ( wellPathCollection )
{
foundWellPathCollection = true;
break;
}
}
if (!foundWellPathCollection)
if ( !foundWellPathCollection )
{
return false;
}
std::vector<RimWellPath*> wellPaths = visibleWellPaths();
if (wellPaths.empty())
if ( wellPaths.empty() )
{
return false;
}
@@ -72,25 +72,24 @@ bool RicExportCompletionsForVisibleWellPathsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsForVisibleWellPathsFeature::onActionTriggered(bool isChecked)
void RicExportCompletionsForVisibleWellPathsFeature::onActionTriggered( bool isChecked )
{
std::vector<RimWellPath*> wellPaths = visibleWellPaths();
CVF_ASSERT(wellPaths.size() > 0);
CVF_ASSERT( wellPaths.size() > 0 );
std::vector<RimSimWellInView*> simWells;
QString dialogTitle = "Export Completion Data for Visible Well Paths";
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions(dialogTitle, wellPaths, simWells);
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsForVisibleWellPathsFeature::setupActionLook(QAction* actionToSetup)
void RicExportCompletionsForVisibleWellPathsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Export Completion Data for Visible Well Paths");
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
actionToSetup->setText( "Export Completion Data for Visible Well Paths" );
actionToSetup->setIcon( QIcon( ":/ExportCompletionsSymbol16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
@@ -102,55 +101,54 @@ std::vector<RimWellPath*> RicExportCompletionsForVisibleWellPathsFeature::visibl
{
std::vector<RimWellPathCollection*> wellPathCollections;
caf::SelectionManager::instance()->objectsByType(&wellPathCollections);
caf::SelectionManager::instance()->objectsByType( &wellPathCollections );
if (wellPathCollections.empty())
if ( wellPathCollections.empty() )
{
std::vector<RimWellPath*> selectedWellPaths;
caf::SelectionManager::instance()->objectsByType(&selectedWellPaths);
caf::SelectionManager::instance()->objectsByType( &selectedWellPaths );
if (!selectedWellPaths.empty())
if ( !selectedWellPaths.empty() )
{
RimWellPathCollection* parent = nullptr;
selectedWellPaths[0]->firstAncestorOrThisOfType(parent);
if (parent)
selectedWellPaths[0]->firstAncestorOrThisOfType( parent );
if ( parent )
{
wellPathCollections.push_back(parent);
wellPathCollections.push_back( parent );
}
}
}
if (!wellPathCollections.empty())
if ( !wellPathCollections.empty() )
{
for (auto wellPathCollection : wellPathCollections)
for ( auto wellPathCollection : wellPathCollections )
{
for (const auto& wellPath : wellPathCollection->wellPaths())
for ( const auto& wellPath : wellPathCollection->wellPaths() )
{
if (wellPath->showWellPath())
if ( wellPath->showWellPath() )
{
wellPaths.push_back(wellPath);
wellPaths.push_back( wellPath );
}
}
}
}
else
{
// No well path or well path collection selected
// No well path or well path collection selected
auto allWellPaths = RiaApplication::instance()->project()->allWellPaths();
for (const auto& w : allWellPaths)
for ( const auto& w : allWellPaths )
{
if (w->showWellPath())
if ( w->showWellPath() )
{
wellPaths.push_back(w);
wellPaths.push_back( w );
}
}
}
}
std::set<RimWellPath*> uniqueWellPaths(wellPaths.begin(), wellPaths.end());
wellPaths.assign(uniqueWellPaths.begin(), uniqueWellPaths.end());
std::set<RimWellPath*> uniqueWellPaths( wellPaths.begin(), wellPaths.end() );
wellPaths.assign( uniqueWellPaths.begin(), uniqueWellPaths.end() );
return wellPaths;
}

View File

@@ -32,8 +32,8 @@ class RicExportCompletionsForVisibleWellPathsFeature : public caf::CmdFeature
protected:
bool isCommandEnabled() override;
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
public:
static std::vector<RimWellPath*> visibleWellPaths();

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,26 +26,26 @@
#include "RicExportFeatureImpl.h"
#include "RicMswExportInfo.h"
#include "RicWellPathExportCompletionDataFeatureImpl.h"
#include "RicWellPathExportMswCompletionsImpl.h"
#include "RicWellPathExportCompletionsFileTools.h"
#include "RicWellPathExportMswCompletionsImpl.h"
#include "RimProject.h"
#include "RimEclipseCase.h"
#include "RimFishboneWellPathCollection.h"
#include "RimFishbonesCollection.h"
#include "RimFishbonesMultipleSubs.h"
#include "RimPerforationCollection.h"
#include "RimProject.h"
#include "RimWellPath.h"
#include "RimWellPathFractureCollection.h"
#include "RimEclipseCase.h"
#include "RigMainGrid.h"
#include "RigEclipseCaseData.h"
#include "RigMainGrid.h"
#include "RigWellPath.h"
#include "Riu3DMainWindowTools.h"
#include "cafSelectionManager.h"
#include "cafPdmUiPropertyViewDialog.h"
#include "cafSelectionManager.h"
#include "cafUtils.h"
#include "cvfMath.h"
@@ -53,37 +53,37 @@
#include <QAction>
#include <QDir>
CAF_CMD_SOURCE_INIT(RicExportCompletionsWellSegmentsFeature, "RicExportCompletionsWellSegmentsFeature");
CAF_CMD_SOURCE_INIT( RicExportCompletionsWellSegmentsFeature, "RicExportCompletionsWellSegmentsFeature" );
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsWellSegmentsFeature::onActionTriggered(bool isChecked)
void RicExportCompletionsWellSegmentsFeature::onActionTriggered( bool isChecked )
{
RimWellPath* wellPath = caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPath>();
CVF_ASSERT(wellPath);
CVF_ASSERT( wellPath );
RimFishbonesCollection* fishbonesCollection =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFishbonesCollection>();
RimWellPathFractureCollection* fractureCollection =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPathFractureCollection>();
RimPerforationCollection* perforationCollection =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimPerforationCollection>();
RimFishbonesCollection* fishbonesCollection = caf::SelectionManager::instance()
->selectedItemAncestorOfType<RimFishbonesCollection>();
RimWellPathFractureCollection* fractureCollection = caf::SelectionManager::instance()
->selectedItemAncestorOfType<RimWellPathFractureCollection>();
RimPerforationCollection* perforationCollection = caf::SelectionManager::instance()
->selectedItemAncestorOfType<RimPerforationCollection>();
CVF_ASSERT(fishbonesCollection || fractureCollection || perforationCollection);
CVF_ASSERT( fishbonesCollection || fractureCollection || perforationCollection );
RiaApplication* app = RiaApplication::instance();
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder("COMPLETIONS");
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder(
"COMPLETIONS" );
RicCaseAndFileExportSettingsUi exportSettings;
std::vector<RimCase*> cases;
app->project()->allCases(cases);
for (auto c : cases)
std::vector<RimCase*> cases;
app->project()->allCases( cases );
for ( auto c : cases )
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(c);
if (eclipseCase != nullptr)
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( c );
if ( eclipseCase != nullptr )
{
exportSettings.caseToApply = eclipseCase;
break;
@@ -92,46 +92,53 @@ void RicExportCompletionsWellSegmentsFeature::onActionTriggered(bool isChecked)
exportSettings.folder = defaultDir;
caf::PdmUiPropertyViewDialog propertyDialog(Riu3DMainWindowTools::mainWindowWidget(), &exportSettings, "Export Well Segments", "");
RicExportFeatureImpl::configureForExport(propertyDialog.dialogButtonBox());
caf::PdmUiPropertyViewDialog propertyDialog( Riu3DMainWindowTools::mainWindowWidget(),
&exportSettings,
"Export Well Segments",
"" );
RicExportFeatureImpl::configureForExport( propertyDialog.dialogButtonBox() );
if (propertyDialog.exec() == QDialog::Accepted)
if ( propertyDialog.exec() == QDialog::Accepted )
{
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", QFileInfo(exportSettings.folder).absolutePath());
RiaApplication::instance()->setLastUsedDialogDirectory( "COMPLETIONS",
QFileInfo( exportSettings.folder ).absolutePath() );
RicExportCompletionDataSettingsUi completionExportSettings;
completionExportSettings.caseToApply.setValue(exportSettings.caseToApply);
completionExportSettings.folder.setValue(exportSettings.folder);
completionExportSettings.caseToApply.setValue( exportSettings.caseToApply );
completionExportSettings.folder.setValue( exportSettings.folder );
completionExportSettings.includeFishbones = fishbonesCollection != nullptr && !fishbonesCollection->activeFishbonesSubs().empty();
completionExportSettings.includeFractures = fractureCollection != nullptr && !fractureCollection->activeFractures().empty();
completionExportSettings.includePerforations = perforationCollection != nullptr && !perforationCollection->activePerforations().empty();
completionExportSettings.includeFishbones = fishbonesCollection != nullptr &&
!fishbonesCollection->activeFishbonesSubs().empty();
completionExportSettings.includeFractures = fractureCollection != nullptr &&
!fractureCollection->activeFractures().empty();
completionExportSettings.includePerforations = perforationCollection != nullptr &&
!perforationCollection->activePerforations().empty();
RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions(completionExportSettings, { wellPath });
RicWellPathExportMswCompletionsImpl::exportWellSegmentsForAllCompletions( completionExportSettings, {wellPath} );
}
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
void RicExportCompletionsWellSegmentsFeature::setupActionLook(QAction* actionToSetup)
void RicExportCompletionsWellSegmentsFeature::setupActionLook( QAction* actionToSetup )
{
actionToSetup->setText("Export Well Segments");
actionToSetup->setText( "Export Well Segments" );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
bool RicExportCompletionsWellSegmentsFeature::isCommandEnabled()
{
if (caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFishbonesCollection>())
if ( caf::SelectionManager::instance()->selectedItemAncestorOfType<RimFishbonesCollection>() )
{
return true;
}
else if (caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPathFractureCollection>())
else if ( caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPathFractureCollection>() )
{
return true;
}
else if (caf::SelectionManager::instance()->selectedItemAncestorOfType<RimPerforationCollection>())
else if ( caf::SelectionManager::instance()->selectedItemAncestorOfType<RimPerforationCollection>() )
{
return true;
}

View File

@@ -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.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -26,18 +26,15 @@ class RimFishbonesCollection;
class RimFishbonesMultipleSubs;
class RimWellPath;
//==================================================================================================
///
///
//==================================================================================================
class RicExportCompletionsWellSegmentsFeature : public caf::CmdFeature
{
CAF_CMD_HEADER_INIT;
protected:
void onActionTriggered(bool isChecked) override;
void setupActionLook(QAction* actionToSetup) override;
void onActionTriggered( bool isChecked ) override;
void setupActionLook( QAction* actionToSetup ) override;
bool isCommandEnabled() override;
};

View File

@@ -71,59 +71,59 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
RimEclipseCase* caseToApply,
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams)
PressureDepletionParameters pdParams )
{
std::vector<const RimFracture*> fracturesAlongWellPath;
for (auto& frac : wellPath->fractureCollection()->activeFractures())
for ( auto& frac : wellPath->fractureCollection()->activeFractures() )
{
frac->ensureValidNonDarcyProperties();
fracturesAlongWellPath.push_back(frac);
fracturesAlongWellPath.push_back( frac );
}
return generateCompdatValues(caseToApply,
wellPath->completions()->wellNameForExport(),
wellPath->wellPathGeometry(),
fracturesAlongWellPath,
fractureDataForReport,
outputStreamForIntermediateResultsText,
pdParams);
return generateCompdatValues( caseToApply,
wellPath->completions()->wellNameForExport(),
wellPath->wellPathGeometry(),
fracturesAlongWellPath,
fractureDataForReport,
outputStreamForIntermediateResultsText,
pdParams );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData>
RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase,
const RimSimWellInView* well,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams)
RicExportFractureCompletionsImpl::generateCompdatValuesForSimWell( RimEclipseCase* eclipseCase,
const RimSimWellInView* well,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams )
{
std::vector<RigCompletionData> completionData;
auto branches = well->wellPipeBranches();
for (size_t branchIndex = 0; branchIndex < branches.size(); ++branchIndex)
for ( size_t branchIndex = 0; branchIndex < branches.size(); ++branchIndex )
{
std::vector<const RimFracture*> fractures;
for (RimSimWellFracture* fracture : well->simwellFractureCollection->simwellFractures())
for ( RimSimWellFracture* fracture : well->simwellFractureCollection->simwellFractures() )
{
if (fracture->isChecked() && static_cast<size_t>(fracture->branchIndex()) == branchIndex)
if ( fracture->isChecked() && static_cast<size_t>( fracture->branchIndex() ) == branchIndex )
{
fractures.push_back(fracture);
fractures.push_back( fracture );
}
}
std::vector<RigCompletionData> branchCompletions = generateCompdatValues(eclipseCase,
well->name(),
branches[branchIndex],
fractures,
nullptr,
outputStreamForIntermediateResultsText,
pdParams);
std::vector<RigCompletionData> branchCompletions = generateCompdatValues( eclipseCase,
well->name(),
branches[branchIndex],
fractures,
nullptr,
outputStreamForIntermediateResultsText,
pdParams );
completionData.insert(completionData.end(), branchCompletions.begin(), branchCompletions.end());
completionData.insert( completionData.end(), branchCompletions.begin(), branchCompletions.end() );
}
return completionData;
@@ -132,18 +132,18 @@ std::vector<RigCompletionData>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData>
RicExportFractureCompletionsImpl::generateCompdatValues(RimEclipseCase* caseToApply,
const QString& wellNameForExport,
const RigWellPath* wellPathGeometry,
const std::vector<const RimFracture*>& fractures,
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams)
std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdatValues(
RimEclipseCase* caseToApply,
const QString& wellNameForExport,
const RigWellPath* wellPathGeometry,
const std::vector<const RimFracture*>& fractures,
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams )
{
std::vector<RigCompletionData> fractureCompletions;
if (!caseToApply || !caseToApply->eclipseCaseData())
if ( !caseToApply || !caseToApply->eclipseCaseData() )
{
return fractureCompletions;
}
@@ -153,17 +153,17 @@ std::vector<RigCompletionData>
std::vector<QString> resultNames = RigEclipseToStimPlanCellTransmissibilityCalculator::requiredResultNames();
if (!caseToApply->loadStaticResultsByName(resultNames))
if ( !caseToApply->loadStaticResultsByName( resultNames ) )
{
QString msg;
msg += "Compdat Export : Required data missing. Required results ";
for (const auto& r : resultNames)
for ( const auto& r : resultNames )
{
msg += " ";
msg += r;
}
RiaLogging::error(msg);
RiaLogging::error( msg );
return fractureCompletions;
}
@@ -174,29 +174,29 @@ std::vector<RigCompletionData>
std::vector<QString> resultNames{"TRANX", "TRANY", "TRANZ"};
caseToApply->loadStaticResultsByName(resultNames);
caseToApply->loadStaticResultsByName( resultNames );
}
{
// Optional results
std::vector<QString> resultNames = RigEclipseToStimPlanCellTransmissibilityCalculator::optionalResultNames();
caseToApply->loadStaticResultsByName(resultNames);
caseToApply->loadStaticResultsByName( resultNames );
}
if (pdParams.performScaling)
if ( pdParams.performScaling )
{
RigCaseCellResultsData* results = caseToApply->results(RiaDefines::MATRIX_MODEL);
results->ensureKnownResultLoaded(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, "PRESSURE"));
RigCaseCellResultsData* results = caseToApply->results( RiaDefines::MATRIX_MODEL );
results->ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::DYNAMIC_NATIVE, "PRESSURE" ) );
}
return generateCompdatValuesConst(caseToApply,
wellNameForExport,
wellPathGeometry,
fractures,
fractureDataReportItems,
outputStreamForIntermediateResultsText,
pdParams);
return generateCompdatValuesConst( caseToApply,
wellNameForExport,
wellPathGeometry,
fractures,
fractureDataReportItems,
outputStreamForIntermediateResultsText,
pdParams );
}
//--------------------------------------------------------------------------------------------------
@@ -209,44 +209,44 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
const std::vector<const RimFracture*>& fractures,
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams)
PressureDepletionParameters pdParams )
{
std::vector<RigCompletionData> fractureCompletions;
if (!caseToApply || !caseToApply->eclipseCaseData())
if ( !caseToApply || !caseToApply->eclipseCaseData() )
{
return fractureCompletions;
}
double cDarcyInCorrectUnit = RiaEclipseUnitTools::darcysConstant(caseToApply->eclipseCaseData()->unitsType());
const RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid();
double cDarcyInCorrectUnit = RiaEclipseUnitTools::darcysConstant( caseToApply->eclipseCaseData()->unitsType() );
const RigMainGrid* mainGrid = caseToApply->eclipseCaseData()->mainGrid();
const RigCaseCellResultsData* results = caseToApply->results(RiaDefines::MATRIX_MODEL);
const RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
const RigCaseCellResultsData* results = caseToApply->results( RiaDefines::MATRIX_MODEL );
const RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo( RiaDefines::MATRIX_MODEL );
bool performPressureDepletionScaling = pdParams.performScaling;
int initialWellProductionTimeStep = 0;
double currentWellPressure = 0;
if (performPressureDepletionScaling)
if ( performPressureDepletionScaling )
{
double userWBHP = pdParams.userWBHP;
double initialWBHPFromSummary = 0.0;
double currentWBHPFromSummary = 0.0;
// Find well pressures (WBHP) from summary case.
getWellPressuresAndInitialProductionTimeStepFromSummaryData(caseToApply,
wellNameForExport,
pdParams.pressureScalingTimeStep,
&initialWellProductionTimeStep,
&initialWBHPFromSummary,
&currentWBHPFromSummary);
getWellPressuresAndInitialProductionTimeStepFromSummaryData( caseToApply,
wellNameForExport,
pdParams.pressureScalingTimeStep,
&initialWellProductionTimeStep,
&initialWBHPFromSummary,
&currentWBHPFromSummary );
if (pdParams.wbhpSource == WBHP_FROM_SUMMARY)
if ( pdParams.wbhpSource == WBHP_FROM_SUMMARY )
{
currentWellPressure = currentWBHPFromSummary;
if (pdParams.pressureScalingTimeStep <= initialWellProductionTimeStep)
if ( pdParams.pressureScalingTimeStep <= initialWellProductionTimeStep )
{
currentWellPressure = userWBHP;
}
@@ -259,14 +259,15 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
const std::vector<std::vector<double>>* pressureResultVector = nullptr;
const std::vector<double>* currentMatrixPressures = nullptr;
if (performPressureDepletionScaling)
if ( performPressureDepletionScaling )
{
pressureResultVector = &results->cellScalarResults(RigEclipseResultAddress(RiaDefines::DYNAMIC_NATIVE, "PRESSURE"));
CVF_ASSERT(!pressureResultVector->empty());
pressureResultVector = &results->cellScalarResults(
RigEclipseResultAddress( RiaDefines::DYNAMIC_NATIVE, "PRESSURE" ) );
CVF_ASSERT( !pressureResultVector->empty() );
if (pdParams.pressureScalingTimeStep < static_cast<int>(pressureResultVector->size()))
if ( pdParams.pressureScalingTimeStep < static_cast<int>( pressureResultVector->size() ) )
{
currentMatrixPressures = &pressureResultVector->at(pdParams.pressureScalingTimeStep);
currentMatrixPressures = &pressureResultVector->at( pdParams.pressureScalingTimeStep );
}
else
{
@@ -280,23 +281,24 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
// std::map <eclipseCellIndex ,map< fracture, trans> >
// std::map<size_t, std::map<const RimFracture*, double>> eclCellIdxToTransPrFractureMap;
std::vector<std::vector<RigCompletionData>> sharedComplForFracture(fractures.size());
std::vector<std::vector<RigCompletionData>> sharedComplForFracture( fractures.size() );
#pragma omp parallel for
for (int i = 0; i < (int)fractures.size(); i++)
for ( int i = 0; i < (int)fractures.size(); i++ )
{
const RimFracture* fracture = fractures[i];
const RimFractureTemplate* fracTemplate = fracture->fractureTemplate();
if (!fracTemplate) continue;
if ( !fracTemplate ) continue;
const RigFractureGrid* fractureGrid = fracTemplate->fractureGrid();
if (!fractureGrid) continue;
if ( !fractureGrid ) continue;
bool useFiniteConductivityInFracture = (fracTemplate->conductivityType() == RimFractureTemplate::FINITE_CONDUCTIVITY);
bool useFiniteConductivityInFracture = ( fracTemplate->conductivityType() ==
RimFractureTemplate::FINITE_CONDUCTIVITY );
// If finite cond chosen and conductivity not present in stimplan file, do not calculate trans for this fracture
if (useFiniteConductivityInFracture && !checkForStimPlanConductivity(fracTemplate, fracture))
if ( useFiniteConductivityInFracture && !checkForStimPlanConductivity( fracTemplate, fracture ) )
{
continue;
}
@@ -305,33 +307,45 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
//////
// Calculate Matrix To Fracture Trans
RigEclipseToStimPlanCalculator eclToFractureCalc(
caseToApply, fracture->transformMatrix(), fracTemplate->skinFactor(), cDarcyInCorrectUnit, *fractureGrid, fracture);
RigEclipseToStimPlanCalculator eclToFractureCalc( caseToApply,
fracture->transformMatrix(),
fracTemplate->skinFactor(),
cDarcyInCorrectUnit,
*fractureGrid,
fracture );
eclToFractureCalc.appendDataToTransmissibilityCondenser(useFiniteConductivityInFracture, &transCondenser);
eclToFractureCalc.appendDataToTransmissibilityCondenser( useFiniteConductivityInFracture, &transCondenser );
if (useFiniteConductivityInFracture)
if ( useFiniteConductivityInFracture )
{
calculateInternalFractureTransmissibilities(fractureGrid, cDarcyInCorrectUnit, transCondenser);
calculateInternalFractureTransmissibilities( fractureGrid, cDarcyInCorrectUnit, transCondenser );
}
if (useFiniteConductivityInFracture)
if ( useFiniteConductivityInFracture )
{
calculateFractureToWellTransmissibilities(
fracTemplate, fractureGrid, fracture, cDarcyInCorrectUnit, wellPathGeometry, transCondenser);
calculateFractureToWellTransmissibilities( fracTemplate,
fractureGrid,
fracture,
cDarcyInCorrectUnit,
wellPathGeometry,
transCondenser );
}
/////
// Insert total transmissibility from eclipse-cell to well for this fracture into the map
std::map<size_t, double> matrixToWellTrans = calculateMatrixToWellTransmissibilities(transCondenser);
std::map<size_t, double> matrixToWellTrans = calculateMatrixToWellTransmissibilities( transCondenser );
double maxPressureDrop = 0.0, minPressureDrop = 0.0;
if (performPressureDepletionScaling)
if ( performPressureDepletionScaling )
{
RigTransmissibilityCondenser scaledCondenser = transCondenser;
// 1. Scale matrix to fracture transmissibilities by matrix to fracture pressure
std::map<size_t, double> originalLumpedMatrixToFractureTrans = scaledCondenser.scaleMatrixToFracTransByMatrixWellDP(
actCellInfo, currentWellPressure, *currentMatrixPressures, &minPressureDrop, &maxPressureDrop);
std::map<size_t, double> originalLumpedMatrixToFractureTrans =
scaledCondenser.scaleMatrixToFracTransByMatrixWellDP( actCellInfo,
currentWellPressure,
*currentMatrixPressures,
&minPressureDrop,
&maxPressureDrop );
// 2: Calculate new external transmissibilities
scaledCondenser.calculateCondensedTransmissibilities();
@@ -342,55 +356,65 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
scaledCondenser.calculateFicticiousFractureToWellTransmissibilities();
// b. Calculate new effective matrix to well transmissibilities
std::map<size_t, double> effectiveMatrixToWellTrans =
scaledCondenser.calculateEffectiveMatrixToWellTransmissibilities(originalLumpedMatrixToFractureTrans,
fictitiousFractureToWellTransmissibilities);
scaledCondenser
.calculateEffectiveMatrixToWellTransmissibilities( originalLumpedMatrixToFractureTrans,
fictitiousFractureToWellTransmissibilities );
matrixToWellTrans = effectiveMatrixToWellTrans;
}
}
std::vector<RigCompletionData> allCompletionsForOneFracture =
generateCompdatValuesForFracture(matrixToWellTrans, wellNameForExport, caseToApply, fracture, fracTemplate);
std::vector<RigCompletionData> allCompletionsForOneFracture = generateCompdatValuesForFracture( matrixToWellTrans,
wellNameForExport,
caseToApply,
fracture,
fracTemplate );
if (fractureDataReportItems)
if ( fractureDataReportItems )
{
RicWellPathFractureReportItem reportItem(
wellNameForExport, fracture->name(), fracTemplate->name(), fracture->fractureMD());
reportItem.setUnitSystem(fracTemplate->fractureTemplateUnit());
reportItem.setPressureDepletionParameters(
performPressureDepletionScaling,
caseToApply->timeStepStrings()[pdParams.pressureScalingTimeStep],
caf::AppEnum<PressureDepletionWBHPSource>::uiTextFromIndex(pdParams.wbhpSource),
pdParams.userWBHP,
currentWellPressure,
minPressureDrop,
maxPressureDrop);
RicWellPathFractureReportItem reportItem( wellNameForExport,
fracture->name(),
fracTemplate->name(),
fracture->fractureMD() );
reportItem.setUnitSystem( fracTemplate->fractureTemplateUnit() );
reportItem.setPressureDepletionParameters( performPressureDepletionScaling,
caseToApply->timeStepStrings()[pdParams.pressureScalingTimeStep],
caf::AppEnum<PressureDepletionWBHPSource>::uiTextFromIndex(
pdParams.wbhpSource ),
pdParams.userWBHP,
currentWellPressure,
minPressureDrop,
maxPressureDrop );
RicExportFractureCompletionsImpl::calculateAndSetReportItemData(
allCompletionsForOneFracture, eclToFractureCalc, reportItem);
RicExportFractureCompletionsImpl::calculateAndSetReportItemData( allCompletionsForOneFracture,
eclToFractureCalc,
reportItem );
#pragma omp critical(critical_section_fractureDataReportItems)
#pragma omp critical( critical_section_fractureDataReportItems )
{
fractureDataReportItems->push_back(reportItem);
fractureDataReportItems->push_back( reportItem );
}
}
std::copy(allCompletionsForOneFracture.begin(),
allCompletionsForOneFracture.end(),
std::back_inserter(sharedComplForFracture[i]));
std::copy( allCompletionsForOneFracture.begin(),
allCompletionsForOneFracture.end(),
std::back_inserter( sharedComplForFracture[i] ) );
if (outputStreamForIntermediateResultsText)
if ( outputStreamForIntermediateResultsText )
{
#pragma omp critical(critical_section_outputStreamForIntermediateResultsText)
#pragma omp critical( critical_section_outputStreamForIntermediateResultsText )
{
outputIntermediateResultsText(
outputStreamForIntermediateResultsText, fracture, transCondenser, mainGrid, fractureGrid);
outputIntermediateResultsText( outputStreamForIntermediateResultsText,
fracture,
transCondenser,
mainGrid,
fractureGrid );
}
}
}
for (const auto& completions : sharedComplForFracture)
for ( const auto& completions : sharedComplForFracture )
{
std::copy(completions.begin(), completions.end(), std::back_inserter(fractureCompletions));
std::copy( completions.begin(), completions.end(), std::back_inserter( fractureCompletions ) );
}
return fractureCompletions;
}
@@ -404,15 +428,15 @@ void RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeS
int currentTimeStep,
int* initialCaseTimeStep,
double* initialWellPressure,
double* currentWellPressure)
double* currentWellPressure )
{
const RimEclipseResultCase* resultCase = dynamic_cast<const RimEclipseResultCase*>(caseToApply);
if (resultCase)
const RimEclipseResultCase* resultCase = dynamic_cast<const RimEclipseResultCase*>( caseToApply );
if ( resultCase )
{
std::vector<QDateTime> caseTimeSteps = resultCase->timeStepDates();
QDateTime initialProductionDate;
QDateTime currentDate;
if (currentTimeStep < static_cast<int>(caseTimeSteps.size()))
if ( currentTimeStep < static_cast<int>( caseTimeSteps.size() ) )
{
currentDate = caseTimeSteps[currentTimeStep];
}
@@ -421,28 +445,29 @@ void RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeS
currentDate = caseTimeSteps.back();
}
RifEclipseSummaryAddress wbhpPressureAddress = RifEclipseSummaryAddress::wellAddress("WBHP", wellPathName.toStdString());
RimSummaryCaseMainCollection* mainCollection = RiaSummaryTools::summaryCaseMainCollection();
if (mainCollection)
RifEclipseSummaryAddress wbhpPressureAddress = RifEclipseSummaryAddress::wellAddress( "WBHP",
wellPathName.toStdString() );
RimSummaryCaseMainCollection* mainCollection = RiaSummaryTools::summaryCaseMainCollection();
if ( mainCollection )
{
RimSummaryCase* summaryCase = mainCollection->findSummaryCaseFromEclipseResultCase(resultCase);
RimSummaryCase* summaryCase = mainCollection->findSummaryCaseFromEclipseResultCase( resultCase );
if (summaryCase)
if ( summaryCase )
{
std::vector<double> values;
if (summaryCase->summaryReader()->values(wbhpPressureAddress, &values))
if ( summaryCase->summaryReader()->values( wbhpPressureAddress, &values ) )
{
std::vector<time_t> summaryTimeSteps = summaryCase->summaryReader()->timeSteps(wbhpPressureAddress);
CVF_ASSERT(values.size() == summaryTimeSteps.size());
for (size_t i = 0; i < summaryTimeSteps.size(); ++i)
std::vector<time_t> summaryTimeSteps = summaryCase->summaryReader()->timeSteps( wbhpPressureAddress );
CVF_ASSERT( values.size() == summaryTimeSteps.size() );
for ( size_t i = 0; i < summaryTimeSteps.size(); ++i )
{
QDateTime summaryDate = RiaQDateTimeTools::fromTime_t(summaryTimeSteps[i]);
if (initialProductionDate.isNull() && values[i] > 0.0)
QDateTime summaryDate = RiaQDateTimeTools::fromTime_t( summaryTimeSteps[i] );
if ( initialProductionDate.isNull() && values[i] > 0.0 )
{
initialProductionDate = summaryDate;
*initialWellPressure = values[i];
}
if (summaryDate <= currentDate)
if ( summaryDate <= currentDate )
{
*currentWellPressure = values[i];
}
@@ -450,14 +475,14 @@ void RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeS
}
}
}
if (initialProductionDate.isValid())
if ( initialProductionDate.isValid() )
{
for (size_t i = 0; i < caseTimeSteps.size(); ++i)
for ( size_t i = 0; i < caseTimeSteps.size(); ++i )
{
// Pick last time step that isn't bigger than the initial production time.
if (caseTimeSteps[i] < initialProductionDate)
if ( caseTimeSteps[i] < initialProductionDate )
{
*initialCaseTimeStep = static_cast<int>(i);
*initialCaseTimeStep = static_cast<int>( i );
}
else
{
@@ -471,17 +496,17 @@ void RicExportFractureCompletionsImpl::getWellPressuresAndInitialProductionTimeS
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicExportFractureCompletionsImpl::checkForStimPlanConductivity(const RimFractureTemplate* fracTemplate,
const RimFracture* fracture)
bool RicExportFractureCompletionsImpl::checkForStimPlanConductivity( const RimFractureTemplate* fracTemplate,
const RimFracture* fracture )
{
auto fracTemplateStimPlan = dynamic_cast<const RimStimPlanFractureTemplate*>(fracTemplate);
if (fracTemplateStimPlan)
auto fracTemplateStimPlan = dynamic_cast<const RimStimPlanFractureTemplate*>( fracTemplate );
if ( fracTemplateStimPlan )
{
if (!fracTemplateStimPlan->hasConductivity())
if ( !fracTemplateStimPlan->hasConductivity() )
{
RiaLogging::error("Trying to export completion data for stimPlan fracture without conductivity data for " +
fracture->name());
RiaLogging::error("No transmissibilities will be calculated for " + fracture->name());
RiaLogging::error( "Trying to export completion data for stimPlan fracture without conductivity data for " +
fracture->name() );
RiaLogging::error( "No transmissibilities will be calculated for " + fracture->name() );
return false;
}
}
@@ -491,58 +516,63 @@ bool RicExportFractureCompletionsImpl::checkForStimPlanConductivity(const RimFra
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFractureCompletionsImpl::calculateInternalFractureTransmissibilities(const RigFractureGrid* fractureGrid,
double cDarcyInCorrectUnit,
RigTransmissibilityCondenser& transCondenser)
void RicExportFractureCompletionsImpl::calculateInternalFractureTransmissibilities(
const RigFractureGrid* fractureGrid, double cDarcyInCorrectUnit, RigTransmissibilityCondenser& transCondenser )
{
for (size_t i = 0; i < fractureGrid->iCellCount(); i++)
for ( size_t i = 0; i < fractureGrid->iCellCount(); i++ )
{
for (size_t j = 0; j < fractureGrid->jCellCount(); j++)
for ( size_t j = 0; j < fractureGrid->jCellCount(); j++ )
{
size_t fractureCellIndex = fractureGrid->getGlobalIndexFromIJ(i, j);
size_t fractureCellIndex = fractureGrid->getGlobalIndexFromIJ( i, j );
const RigFractureCell& fractureCell = fractureGrid->cellFromIndex(fractureCellIndex);
const RigFractureCell& fractureCell = fractureGrid->cellFromIndex( fractureCellIndex );
if (!fractureCell.hasNonZeroConductivity()) continue;
if ( !fractureCell.hasNonZeroConductivity() ) continue;
if (i < fractureGrid->iCellCount() - 1)
if ( i < fractureGrid->iCellCount() - 1 )
{
size_t fractureCellNeighbourXIndex = fractureGrid->getGlobalIndexFromIJ(i + 1, j);
const RigFractureCell& fractureCellNeighbourX = fractureGrid->cellFromIndex(fractureCellNeighbourXIndex);
size_t fractureCellNeighbourXIndex = fractureGrid->getGlobalIndexFromIJ( i + 1, j );
const RigFractureCell& fractureCellNeighbourX = fractureGrid->cellFromIndex( fractureCellNeighbourXIndex );
double horizontalTransToXneigbour = RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(
fractureCell.getConductivityValue(),
fractureCell.cellSizeX(),
fractureCell.cellSizeZ(),
fractureCellNeighbourX.getConductivityValue(),
fractureCellNeighbourX.cellSizeX(),
fractureCellNeighbourX.cellSizeZ(),
cDarcyInCorrectUnit);
double horizontalTransToXneigbour = RigFractureTransmissibilityEquations::
centerToCenterFractureCellTrans( fractureCell.getConductivityValue(),
fractureCell.cellSizeX(),
fractureCell.cellSizeZ(),
fractureCellNeighbourX.getConductivityValue(),
fractureCellNeighbourX.cellSizeX(),
fractureCellNeighbourX.cellSizeZ(),
cDarcyInCorrectUnit );
transCondenser.addNeighborTransmissibility(
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourXIndex},
horizontalTransToXneigbour);
transCondenser.addNeighborTransmissibility( {false,
RigTransmissibilityCondenser::CellAddress::STIMPLAN,
fractureCellIndex},
{false,
RigTransmissibilityCondenser::CellAddress::STIMPLAN,
fractureCellNeighbourXIndex},
horizontalTransToXneigbour );
}
if (j < fractureGrid->jCellCount() - 1)
if ( j < fractureGrid->jCellCount() - 1 )
{
size_t fractureCellNeighbourZIndex = fractureGrid->getGlobalIndexFromIJ(i, j + 1);
const RigFractureCell& fractureCellNeighbourZ = fractureGrid->cellFromIndex(fractureCellNeighbourZIndex);
size_t fractureCellNeighbourZIndex = fractureGrid->getGlobalIndexFromIJ( i, j + 1 );
const RigFractureCell& fractureCellNeighbourZ = fractureGrid->cellFromIndex( fractureCellNeighbourZIndex );
double verticalTransToZneigbour = RigFractureTransmissibilityEquations::centerToCenterFractureCellTrans(
fractureCell.getConductivityValue(),
fractureCell.cellSizeZ(),
fractureCell.cellSizeX(),
fractureCellNeighbourZ.getConductivityValue(),
fractureCellNeighbourZ.cellSizeZ(),
fractureCellNeighbourZ.cellSizeX(),
cDarcyInCorrectUnit);
double verticalTransToZneigbour = RigFractureTransmissibilityEquations::
centerToCenterFractureCellTrans( fractureCell.getConductivityValue(),
fractureCell.cellSizeZ(),
fractureCell.cellSizeX(),
fractureCellNeighbourZ.getConductivityValue(),
fractureCellNeighbourZ.cellSizeZ(),
fractureCellNeighbourZ.cellSizeX(),
cDarcyInCorrectUnit );
transCondenser.addNeighborTransmissibility(
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellIndex},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fractureCellNeighbourZIndex},
verticalTransToZneigbour);
transCondenser.addNeighborTransmissibility( {false,
RigTransmissibilityCondenser::CellAddress::STIMPLAN,
fractureCellIndex},
{false,
RigTransmissibilityCondenser::CellAddress::STIMPLAN,
fractureCellNeighbourZIndex},
verticalTransToZneigbour );
}
}
}
@@ -551,71 +581,77 @@ void RicExportFractureCompletionsImpl::calculateInternalFractureTransmissibiliti
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFractureCompletionsImpl::calculateFractureToWellTransmissibilities(const RimFractureTemplate* fracTemplate,
const RigFractureGrid* fractureGrid,
const RimFracture* fracture,
double cDarcyInCorrectUnit,
const RigWellPath* wellPathGeometry,
RigTransmissibilityCondenser& transCondenser)
void RicExportFractureCompletionsImpl::calculateFractureToWellTransmissibilities(
const RimFractureTemplate* fracTemplate,
const RigFractureGrid* fractureGrid,
const RimFracture* fracture,
double cDarcyInCorrectUnit,
const RigWellPath* wellPathGeometry,
RigTransmissibilityCondenser& transCondenser )
{
////
// If fracture has orientation Azimuth or Transverse, assume only radial inflow
if (fracTemplate->orientationType() == RimFractureTemplate::AZIMUTH ||
fracTemplate->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH)
if ( fracTemplate->orientationType() == RimFractureTemplate::AZIMUTH ||
fracTemplate->orientationType() == RimFractureTemplate::TRANSVERSE_WELL_PATH )
{
std::pair<size_t, size_t> wellCellIJ = fractureGrid->fractureCellAtWellCenter();
size_t wellCellIndex = fractureGrid->getGlobalIndexFromIJ(wellCellIJ.first, wellCellIJ.second);
std::pair<size_t, size_t> wellCellIJ = fractureGrid->fractureCellAtWellCenter();
size_t wellCellIndex = fractureGrid->getGlobalIndexFromIJ( wellCellIJ.first, wellCellIJ.second );
const RigFractureCell& wellCell = fractureGrid->cellFromIndex(wellCellIndex);
const RigFractureCell& wellCell = fractureGrid->cellFromIndex( wellCellIndex );
double radialTrans = RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans(wellCell.getConductivityValue(),
wellCell.cellSizeX(),
wellCell.cellSizeZ(),
fracture->wellRadius(),
fracTemplate->skinFactor(),
cDarcyInCorrectUnit);
double radialTrans =
RigFractureTransmissibilityEquations::fractureCellToWellRadialTrans( wellCell.getConductivityValue(),
wellCell.cellSizeX(),
wellCell.cellSizeZ(),
fracture->wellRadius(),
fracTemplate->skinFactor(),
cDarcyInCorrectUnit );
transCondenser.addNeighborTransmissibility({true, RigTransmissibilityCondenser::CellAddress::WELL, 1},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, wellCellIndex},
radialTrans);
transCondenser.addNeighborTransmissibility( {true, RigTransmissibilityCondenser::CellAddress::WELL, 1},
{false,
RigTransmissibilityCondenser::CellAddress::STIMPLAN,
wellCellIndex},
radialTrans );
}
else if (fracTemplate->orientationType() == RimFractureTemplate::ALONG_WELL_PATH)
else if ( fracTemplate->orientationType() == RimFractureTemplate::ALONG_WELL_PATH )
{
////
// If fracture has orientation along well, linear inflow along well and radial flow at endpoints
RigWellPathStimplanIntersector wellFractureIntersector(wellPathGeometry, fracture);
RigWellPathStimplanIntersector wellFractureIntersector( wellPathGeometry, fracture );
const std::map<size_t, RigWellPathStimplanIntersector::WellCellIntersection>& fractureWellCells =
wellFractureIntersector.intersections();
for (const auto& fracCellIdxIsectDataPair : fractureWellCells)
for ( const auto& fracCellIdxIsectDataPair : fractureWellCells )
{
size_t fracWellCellIdx = fracCellIdxIsectDataPair.first;
RigWellPathStimplanIntersector::WellCellIntersection intersection = fracCellIdxIsectDataPair.second;
const RigFractureCell& fractureWellCell = fractureGrid->cellFromIndex(fracWellCellIdx);
const RigFractureCell& fractureWellCell = fractureGrid->cellFromIndex( fracWellCellIdx );
double linearTrans = 0.0;
if (intersection.hlength > 0.0 || intersection.vlength > 0.0)
if ( intersection.hlength > 0.0 || intersection.vlength > 0.0 )
{
linearTrans =
RigFractureTransmissibilityEquations::fractureCellToWellLinearTrans(fractureWellCell.getConductivityValue(),
fractureWellCell.cellSizeX(),
fractureWellCell.cellSizeZ(),
intersection.vlength,
intersection.hlength,
fracture->perforationEfficiency(),
fracTemplate->skinFactor(),
cDarcyInCorrectUnit,
fracture->wellRadius());
RigFractureTransmissibilityEquations::fractureCellToWellLinearTrans( fractureWellCell
.getConductivityValue(),
fractureWellCell.cellSizeX(),
fractureWellCell.cellSizeZ(),
intersection.vlength,
intersection.hlength,
fracture->perforationEfficiency(),
fracTemplate->skinFactor(),
cDarcyInCorrectUnit,
fracture->wellRadius() );
}
transCondenser.addNeighborTransmissibility(
{true, RigTransmissibilityCondenser::CellAddress::WELL, 1},
{false, RigTransmissibilityCondenser::CellAddress::STIMPLAN, fracWellCellIdx},
linearTrans);
transCondenser.addNeighborTransmissibility( {true, RigTransmissibilityCondenser::CellAddress::WELL, 1},
{false,
RigTransmissibilityCondenser::CellAddress::STIMPLAN,
fracWellCellIdx},
linearTrans );
}
}
}
@@ -623,20 +659,22 @@ void RicExportFractureCompletionsImpl::calculateFractureToWellTransmissibilities
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<size_t, double>
RicExportFractureCompletionsImpl::calculateMatrixToWellTransmissibilities(RigTransmissibilityCondenser& transCondenser)
std::map<size_t, double> RicExportFractureCompletionsImpl::calculateMatrixToWellTransmissibilities(
RigTransmissibilityCondenser& transCondenser )
{
std::map<size_t, double> matrixToWellTransmissibilities;
std::set<RigTransmissibilityCondenser::CellAddress> externalCells = transCondenser.externalCells();
for (RigTransmissibilityCondenser::CellAddress externalCell : externalCells)
for ( RigTransmissibilityCondenser::CellAddress externalCell : externalCells )
{
if (externalCell.m_cellIndexSpace == RigTransmissibilityCondenser::CellAddress::ECLIPSE)
if ( externalCell.m_cellIndexSpace == RigTransmissibilityCondenser::CellAddress::ECLIPSE )
{
double trans = transCondenser.condensedTransmissibility(externalCell,
{true, RigTransmissibilityCondenser::CellAddress::WELL, 1});
double trans = transCondenser.condensedTransmissibility( externalCell,
{true,
RigTransmissibilityCondenser::CellAddress::WELL,
1} );
matrixToWellTransmissibilities.insert(std::make_pair(externalCell.m_globalCellIdx, trans));
matrixToWellTransmissibilities.insert( std::make_pair( externalCell.m_globalCellIdx, trans ) );
}
}
return matrixToWellTransmissibilities;
@@ -650,26 +688,27 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
const QString& wellNameForExport,
const RimEclipseCase* caseToApply,
const RimFracture* fracture,
const RimFractureTemplate* fracTemplate)
const RimFractureTemplate* fracTemplate )
{
std::vector<RigCompletionData> allCompletionsForOneFracture;
for (const auto& matrixToWellTransmissibility : matrixToWellTransmissibilites)
for ( const auto& matrixToWellTransmissibility : matrixToWellTransmissibilites )
{
size_t globalCellIndex = matrixToWellTransmissibility.first;
double trans = matrixToWellTransmissibility.second;
RigCompletionData compDat(
wellNameForExport, RigCompletionDataGridCell(globalCellIndex, caseToApply->mainGrid()), fracture->fractureMD());
RigCompletionData compDat( wellNameForExport,
RigCompletionDataGridCell( globalCellIndex, caseToApply->mainGrid() ),
fracture->fractureMD() );
double diameter = 2.0 * fracture->wellRadius();
compDat.setFromFracture(trans, fracTemplate->skinFactor(), diameter);
compDat.addMetadata(fracture->name(), QString::number(trans));
compDat.setSourcePdmObject(fracture);
allCompletionsForOneFracture.push_back(compDat);
compDat.setFromFracture( trans, fracTemplate->skinFactor(), diameter );
compDat.addMetadata( fracture->name(), QString::number( trans ) );
compDat.setSourcePdmObject( fracture );
allCompletionsForOneFracture.push_back( compDat );
}
if (fracTemplate->isNonDarcyFlowEnabled())
if ( fracTemplate->isNonDarcyFlowEnabled() )
{
computeNonDarcyFlowParameters(fracture, allCompletionsForOneFracture);
computeNonDarcyFlowParameters( fracture, allCompletionsForOneFracture );
}
return allCompletionsForOneFracture;
@@ -678,35 +717,35 @@ std::vector<RigCompletionData> RicExportFractureCompletionsImpl::generateCompdat
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFractureCompletionsImpl::computeNonDarcyFlowParameters(const RimFracture* fracture,
std::vector<RigCompletionData>& allCompletionsForOneFracture)
void RicExportFractureCompletionsImpl::computeNonDarcyFlowParameters(
const RimFracture* fracture, std::vector<RigCompletionData>& allCompletionsForOneFracture )
{
double dFactorForFracture = fracture->nonDarcyProperties().dFactor;
double khForFracture = fracture->nonDarcyProperties().conductivity;
double sumOfTransmissibilitiesInFracture = sumUpTransmissibilities(allCompletionsForOneFracture);
double sumOfTransmissibilitiesInFracture = sumUpTransmissibilities( allCompletionsForOneFracture );
for (auto& c : allCompletionsForOneFracture)
for ( auto& c : allCompletionsForOneFracture )
{
// NOTE : What is supposed to happen when the transmissibility is close to zero?
double dFactorForOneConnection = dFactorForFracture * sumOfTransmissibilitiesInFracture / c.transmissibility();
c.setDFactor(dFactorForOneConnection);
c.setDFactor( dFactorForOneConnection );
double khForOneConnection = khForFracture * c.transmissibility() / sumOfTransmissibilitiesInFracture;
c.setKh(khForOneConnection);
c.setKh( khForOneConnection );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double
RicExportFractureCompletionsImpl::sumUpTransmissibilities(const std::vector<RigCompletionData>& allCompletionsForOneFracture)
double RicExportFractureCompletionsImpl::sumUpTransmissibilities(
const std::vector<RigCompletionData>& allCompletionsForOneFracture )
{
double transmissibility = 0.0;
for (const auto& c : allCompletionsForOneFracture)
for ( const auto& c : allCompletionsForOneFracture )
{
transmissibility += c.transmissibility();
}
@@ -719,57 +758,57 @@ double
void RicExportFractureCompletionsImpl::calculateAndSetReportItemData(
const std::vector<RigCompletionData>& allCompletionsForOneFracture,
const RigEclipseToStimPlanCalculator& eclToFractureCalc,
RicWellPathFractureReportItem& reportItem)
RicWellPathFractureReportItem& reportItem )
{
double areaWeightedMatrixPermeability = eclToFractureCalc.areaWeightedMatrixPermeability();
reportItem.setAreaWeightedPermeability(areaWeightedMatrixPermeability);
reportItem.setAreaWeightedPermeability( areaWeightedMatrixPermeability );
double totalAreaOpenForFlow = eclToFractureCalc.totalEclipseAreaOpenForFlow();
double areaWeightedConductivity = eclToFractureCalc.areaWeightedConductivity();
if (totalAreaOpenForFlow > 0.0)
if ( totalAreaOpenForFlow > 0.0 )
{
double halfLength = 0.0;
double height = eclToFractureCalc.longestYSectionOpenForFlow();
if (height > 0.0)
if ( height > 0.0 )
{
double length = totalAreaOpenForFlow / height;
halfLength = length / 2.0;
}
reportItem.setHeightAndHalfLength(height, halfLength);
reportItem.setHeightAndHalfLength( height, halfLength );
}
double aggregatedTransmissibility = sumUpTransmissibilities(allCompletionsForOneFracture);
reportItem.setData(aggregatedTransmissibility, allCompletionsForOneFracture.size(), totalAreaOpenForFlow);
double aggregatedTransmissibility = sumUpTransmissibilities( allCompletionsForOneFracture );
reportItem.setData( aggregatedTransmissibility, allCompletionsForOneFracture.size(), totalAreaOpenForFlow );
reportItem.setWidthAndConductivity(eclToFractureCalc.areaWeightedWidth(), areaWeightedConductivity);
reportItem.setWidthAndConductivity( eclToFractureCalc.areaWeightedWidth(), areaWeightedConductivity );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicExportFractureCompletionsImpl::outputIntermediateResultsText(QTextStream* outputStreamForIntermediateResultsText,
const RimFracture* fracture,
RigTransmissibilityCondenser& transCondenser,
const RigMainGrid* mainGrid,
const RigFractureGrid* fractureGrid)
void RicExportFractureCompletionsImpl::outputIntermediateResultsText( QTextStream* outputStreamForIntermediateResultsText,
const RimFracture* fracture,
RigTransmissibilityCondenser& transCondenser,
const RigMainGrid* mainGrid,
const RigFractureGrid* fractureGrid )
{
(*outputStreamForIntermediateResultsText)
( *outputStreamForIntermediateResultsText )
<< "\n"
<< "\n"
<< "\n----------- All Transmissibilities " << fracture->name() << " -------------------- \n\n";
(*outputStreamForIntermediateResultsText)
<< QString::fromStdString(transCondenser.neighborTransDebugOutput(mainGrid, fractureGrid));
( *outputStreamForIntermediateResultsText )
<< QString::fromStdString( transCondenser.neighborTransDebugOutput( mainGrid, fractureGrid ) );
(*outputStreamForIntermediateResultsText)
( *outputStreamForIntermediateResultsText )
<< "\n"
<< "\n"
<< "\n----------- Condensed Results " << fracture->name() << " -------------------- \n\n";
(*outputStreamForIntermediateResultsText)
<< QString::fromStdString(transCondenser.condensedTransDebugOutput(mainGrid, fractureGrid));
( *outputStreamForIntermediateResultsText )
<< QString::fromStdString( transCondenser.condensedTransDebugOutput( mainGrid, fractureGrid ) );
(*outputStreamForIntermediateResultsText) << "\n";
( *outputStreamForIntermediateResultsText ) << "\n";
}

View File

@@ -44,7 +44,6 @@ class QString;
class RicExportFractureCompletionsImpl
{
public:
enum PressureDepletionWBHPSource
{
WBHP_FROM_SUMMARY,
@@ -56,89 +55,96 @@ public:
//--------------------------------------------------------------------------------------------------
struct PressureDepletionParameters
{
PressureDepletionParameters(bool performScaling = false,
int pressureScalingTimeStep = 0,
PressureDepletionWBHPSource wbhpSource = WBHP_FROM_SUMMARY,
double userWBHP = 200.0)
: performScaling(performScaling)
, pressureScalingTimeStep(pressureScalingTimeStep)
, wbhpSource(wbhpSource)
, userWBHP(userWBHP)
{}
PressureDepletionParameters( bool performScaling = false,
int pressureScalingTimeStep = 0,
PressureDepletionWBHPSource wbhpSource = WBHP_FROM_SUMMARY,
double userWBHP = 200.0 )
: performScaling( performScaling )
, pressureScalingTimeStep( pressureScalingTimeStep )
, wbhpSource( wbhpSource )
, userWBHP( userWBHP )
{
}
bool performScaling;
int pressureScalingTimeStep;
PressureDepletionWBHPSource wbhpSource;
double userWBHP;
};
};
static std::vector<RigCompletionData> generateCompdatValuesForWellPath(RimWellPath* wellPath,
RimEclipseCase* caseToApply,
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams = PressureDepletionParameters());
static std::vector<RigCompletionData>
generateCompdatValuesForWellPath( RimWellPath* wellPath,
RimEclipseCase* caseToApply,
std::vector<RicWellPathFractureReportItem>* fractureDataForReport,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams = PressureDepletionParameters() );
static std::vector<RigCompletionData> generateCompdatValuesForSimWell(RimEclipseCase* eclipseCase,
const RimSimWellInView* well,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams = PressureDepletionParameters());
static std::vector<RigCompletionData>
generateCompdatValuesForSimWell( RimEclipseCase* eclipseCase,
const RimSimWellInView* well,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams = PressureDepletionParameters() );
static std::vector<RigCompletionData> generateCompdatValues(RimEclipseCase* caseToApply,
const QString& wellNameForExport,
const RigWellPath* wellPathGeometry,
const std::vector<const RimFracture*>& fractures,
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams = PressureDepletionParameters());
static std::vector<RigCompletionData>
generateCompdatValues( RimEclipseCase* caseToApply,
const QString& wellNameForExport,
const RigWellPath* wellPathGeometry,
const std::vector<const RimFracture*>& fractures,
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams = PressureDepletionParameters() );
static void getWellPressuresAndInitialProductionTimeStepFromSummaryData(const RimEclipseCase* caseToApply,
const QString& wellPathName,
int currentTimeStep,
int* initialTimeStep,
double* initialWellPressure,
double* currentWellPressure);
static void getWellPressuresAndInitialProductionTimeStepFromSummaryData( const RimEclipseCase* caseToApply,
const QString& wellPathName,
int currentTimeStep,
int* initialTimeStep,
double* initialWellPressure,
double* currentWellPressure );
private:
static std::vector<RigCompletionData> generateCompdatValuesConst(const RimEclipseCase* caseToApply,
const QString& wellPathName,
const RigWellPath* wellPathGeometry,
const std::vector<const RimFracture*>& fractures,
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams);
static std::vector<RigCompletionData>
generateCompdatValuesConst( const RimEclipseCase* caseToApply,
const QString& wellPathName,
const RigWellPath* wellPathGeometry,
const std::vector<const RimFracture*>& fractures,
std::vector<RicWellPathFractureReportItem>* fractureDataReportItems,
QTextStream* outputStreamForIntermediateResultsText,
PressureDepletionParameters pdParams );
static bool checkForStimPlanConductivity(const RimFractureTemplate* fracTemplate, const RimFracture* fracture);
static bool checkForStimPlanConductivity( const RimFractureTemplate* fracTemplate, const RimFracture* fracture );
static void calculateInternalFractureTransmissibilities(const RigFractureGrid* fractureGrid,
double cDarcyInCorrectUnit,
RigTransmissibilityCondenser& transCondenser);
static void calculateInternalFractureTransmissibilities( const RigFractureGrid* fractureGrid,
double cDarcyInCorrectUnit,
RigTransmissibilityCondenser& transCondenser );
static void calculateFractureToWellTransmissibilities(const RimFractureTemplate* fracTemplate,
const RigFractureGrid* fractureGrid,
const RimFracture* fracture,
double cDarcyInCorrectUnit,
const RigWellPath* wellPathGeometry,
RigTransmissibilityCondenser& transCondenser);
static void calculateFractureToWellTransmissibilities( const RimFractureTemplate* fracTemplate,
const RigFractureGrid* fractureGrid,
const RimFracture* fracture,
double cDarcyInCorrectUnit,
const RigWellPath* wellPathGeometry,
RigTransmissibilityCondenser& transCondenser );
static std::map<size_t, double> calculateMatrixToWellTransmissibilities(RigTransmissibilityCondenser& transCondenser);
static std::map<size_t, double> calculateMatrixToWellTransmissibilities( RigTransmissibilityCondenser& transCondenser );
static std::vector<RigCompletionData> generateCompdatValuesForFracture(const std::map<size_t, double>& matrixToWellTransmissibilites,
const QString& wellPathName,
const RimEclipseCase* caseToApply,
const RimFracture* fracture,
const RimFractureTemplate* fracTemplate);
static std::vector<RigCompletionData>
generateCompdatValuesForFracture( const std::map<size_t, double>& matrixToWellTransmissibilites,
const QString& wellPathName,
const RimEclipseCase* caseToApply,
const RimFracture* fracture,
const RimFractureTemplate* fracTemplate );
static void computeNonDarcyFlowParameters(const RimFracture* fracture, std::vector<RigCompletionData>& allCompletionsForOneFracture);
static void computeNonDarcyFlowParameters( const RimFracture* fracture,
std::vector<RigCompletionData>& allCompletionsForOneFracture );
static double sumUpTransmissibilities(const std::vector<RigCompletionData>& allCompletionsForOneFracture);
static double sumUpTransmissibilities( const std::vector<RigCompletionData>& allCompletionsForOneFracture );
static void calculateAndSetReportItemData(const std::vector<RigCompletionData>& allCompletionsForOneFracture,
const RigEclipseToStimPlanCalculator& calculator,
RicWellPathFractureReportItem& reportItem);
static void calculateAndSetReportItemData( const std::vector<RigCompletionData>& allCompletionsForOneFracture,
const RigEclipseToStimPlanCalculator& calculator,
RicWellPathFractureReportItem& reportItem );
static void outputIntermediateResultsText(QTextStream* outputStreamForIntermediateResultsText,
const RimFracture* fracture,
RigTransmissibilityCondenser& transCondenser,
const RigMainGrid* mainGrid,
const RigFractureGrid* fractureGrid);
static void outputIntermediateResultsText( QTextStream* outputStreamForIntermediateResultsText,
const RimFracture* fracture,
RigTransmissibilityCondenser& transCondenser,
const RigMainGrid* mainGrid,
const RigFractureGrid* fractureGrid );
};

View File

@@ -46,14 +46,15 @@
//==================================================================================================
struct WellBorePartForTransCalc
{
WellBorePartForTransCalc(cvf::Vec3d lengthsInCell, double wellRadius, double skinFactor, bool isMainBore, QString metaData)
: lengthsInCell(lengthsInCell)
, wellRadius(wellRadius)
, skinFactor(skinFactor)
, isMainBore(isMainBore)
, metaData(metaData)
, intersectionWithWellMeasuredDepth(HUGE_VAL)
, lateralIndex(cvf::UNDEFINED_SIZE_T)
WellBorePartForTransCalc(
cvf::Vec3d lengthsInCell, double wellRadius, double skinFactor, bool isMainBore, QString metaData )
: lengthsInCell( lengthsInCell )
, wellRadius( wellRadius )
, skinFactor( skinFactor )
, isMainBore( isMainBore )
, metaData( metaData )
, intersectionWithWellMeasuredDepth( HUGE_VAL )
, lateralIndex( cvf::UNDEFINED_SIZE_T )
{
}
@@ -66,7 +67,10 @@ struct WellBorePartForTransCalc
double intersectionWithWellMeasuredDepth;
size_t lateralIndex;
void setSourcePdmObject(const caf::PdmObject* sourcePdmObj) { this->sourcePdmObject = const_cast<caf::PdmObject*>(sourcePdmObj); }
void setSourcePdmObject( const caf::PdmObject* sourcePdmObj )
{
this->sourcePdmObject = const_cast<caf::PdmObject*>( sourcePdmObj );
}
caf::PdmPointer<caf::PdmObject> sourcePdmObject;
};
@@ -75,72 +79,73 @@ struct WellBorePartForTransCalc
//--------------------------------------------------------------------------------------------------
std::vector<RigCompletionData>
RicFishbonesTransmissibilityCalculationFeatureImp::generateFishboneCompdatValuesUsingAdjustedCellVolume(
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings)
const RimWellPath* wellPath, const RicExportCompletionDataSettingsUi& settings )
{
std::vector<RigCompletionData> completionData;
if (!wellPath || !wellPath->completions())
if ( !wellPath || !wellPath->completions() )
{
return completionData;
}
std::map<size_t, std::vector<WellBorePartForTransCalc>> wellBorePartsInCells; // wellBore = main bore or fishbone lateral
findFishboneLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
findFishboneImportedLateralsWellBoreParts(wellBorePartsInCells, wellPath, settings);
findFishboneLateralsWellBoreParts( wellBorePartsInCells, wellPath, settings );
findFishboneImportedLateralsWellBoreParts( wellBorePartsInCells, wellPath, settings );
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
const RigActiveCellInfo* activeCellInfo = settings.caseToApply->eclipseCaseData()->activeCellInfo(
RiaDefines::MATRIX_MODEL );
for (const auto& cellAndWellBoreParts : wellBorePartsInCells)
for ( const auto& cellAndWellBoreParts : wellBorePartsInCells )
{
size_t globalCellIndex = cellAndWellBoreParts.first;
const std::vector<WellBorePartForTransCalc>& wellBoreParts = cellAndWellBoreParts.second;
bool cellIsActive = activeCellInfo->isActive(globalCellIndex);
if (!cellIsActive) continue;
bool cellIsActive = activeCellInfo->isActive( globalCellIndex );
if ( !cellIsActive ) continue;
// Find main bore and number of laterals
size_t numberOfLaterals = 0;
CellDirection mainBoreDirection = DIR_I;
for (const auto& wellBorePart : wellBoreParts)
for ( const auto& wellBorePart : wellBoreParts )
{
if (!wellBorePart.isMainBore)
if ( !wellBorePart.isMainBore )
{
numberOfLaterals++;
}
else
{
mainBoreDirection = RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection(
settings.caseToApply, globalCellIndex, wellBorePart.lengthsInCell);
mainBoreDirection =
RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection( settings.caseToApply,
globalCellIndex,
wellBorePart.lengthsInCell );
}
}
for (WellBorePartForTransCalc wellBorePart : wellBoreParts)
for ( WellBorePartForTransCalc wellBorePart : wellBoreParts )
{
if (wellBorePart.isMainBore && settings.excludeMainBoreForFishbones())
if ( wellBorePart.isMainBore && settings.excludeMainBoreForFishbones() )
{
continue;
}
RigCompletionData completion(wellPath->completions()->wellNameForExport(),
RigCompletionDataGridCell(globalCellIndex, settings.caseToApply->mainGrid()),
wellBorePart.intersectionWithWellMeasuredDepth);
completion.setSecondOrderingValue(wellBorePart.lateralIndex);
RigCompletionData completion( wellPath->completions()->wellNameForExport(),
RigCompletionDataGridCell( globalCellIndex, settings.caseToApply->mainGrid() ),
wellBorePart.intersectionWithWellMeasuredDepth );
completion.setSecondOrderingValue( wellBorePart.lateralIndex );
double transmissibility = 0.0;
if (wellBorePart.isMainBore)
if ( wellBorePart.isMainBore )
{
// No change in transmissibility for main bore
auto transmissibilityAndPermeability =
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityData(
settings.caseToApply,
wellPath,
wellBorePart.lengthsInCell,
wellBorePart.skinFactor,
wellBorePart.wellRadius,
globalCellIndex,
settings.useLateralNTG);
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityData( settings.caseToApply,
wellPath,
wellBorePart.lengthsInCell,
wellBorePart.skinFactor,
wellBorePart.wellRadius,
globalCellIndex,
settings.useLateralNTG );
transmissibility = transmissibilityAndPermeability.connectionFactor();
}
@@ -148,29 +153,33 @@ std::vector<RigCompletionData>
{
// Adjust transmissibility for fishbone laterals
auto transmissibilityAndPermeability =
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityData(
settings.caseToApply,
wellPath,
wellBorePart.lengthsInCell,
wellBorePart.skinFactor,
wellBorePart.wellRadius,
globalCellIndex,
settings.useLateralNTG,
numberOfLaterals,
mainBoreDirection);
RicWellPathExportCompletionDataFeatureImpl::calculateTransmissibilityData( settings.caseToApply,
wellPath,
wellBorePart.lengthsInCell,
wellBorePart.skinFactor,
wellBorePart.wellRadius,
globalCellIndex,
settings.useLateralNTG,
numberOfLaterals,
mainBoreDirection );
transmissibility = transmissibilityAndPermeability.connectionFactor();
}
CellDirection direction = RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection(
settings.caseToApply, globalCellIndex, wellBorePart.lengthsInCell);
CellDirection direction =
RicWellPathExportCompletionDataFeatureImpl::calculateCellMainDirection( settings.caseToApply,
globalCellIndex,
wellBorePart.lengthsInCell );
completion.setTransAndWPImultBackgroundDataFromFishbone(
transmissibility, wellBorePart.skinFactor, wellBorePart.wellRadius * 2, direction, wellBorePart.isMainBore);
completion.setTransAndWPImultBackgroundDataFromFishbone( transmissibility,
wellBorePart.skinFactor,
wellBorePart.wellRadius * 2,
direction,
wellBorePart.isMainBore );
completion.addMetadata(wellBorePart.metaData, QString::number(transmissibility));
completion.setSourcePdmObject(wellBorePart.sourcePdmObject);
completionData.push_back(completion);
completion.addMetadata( wellBorePart.metaData, QString::number( transmissibility ) );
completion.setSourcePdmObject( wellBorePart.sourcePdmObject );
completionData.push_back( completion );
}
}
return completionData;
@@ -182,38 +191,42 @@ std::vector<RigCompletionData>
void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWellBoreParts(
std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings)
const RicExportCompletionDataSettingsUi& settings )
{
if (!wellPath) return;
if ( !wellPath ) return;
// Generate data
const RigEclipseCaseData* caseData = settings.caseToApply()->eclipseCaseData();
RicMswExportInfo exportInfo =
RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo(settings.caseToApply(), wellPath, false);
RicWellPathExportMswCompletionsImpl::generateFishbonesMswExportInfo( settings.caseToApply(), wellPath, false );
RiaEclipseUnitTools::UnitSystem unitSystem = caseData->unitsType();
bool isMainBore = false;
for (std::shared_ptr<RicMswSegment> location : exportInfo.wellSegmentLocations())
for ( std::shared_ptr<RicMswSegment> location : exportInfo.wellSegmentLocations() )
{
for (std::shared_ptr<RicMswCompletion> completion : location->completions())
for ( std::shared_ptr<RicMswCompletion> completion : location->completions() )
{
for (std::shared_ptr<RicMswSubSegment> segment : completion->subSegments())
for ( std::shared_ptr<RicMswSubSegment> segment : completion->subSegments() )
{
for (std::shared_ptr<RicMswSubSegmentCellIntersection> intersection : segment->intersections())
for ( std::shared_ptr<RicMswSubSegmentCellIntersection> intersection : segment->intersections() )
{
double diameter = location->holeDiameter();
QString completionMetaData =
(location->label() + QString(": Sub: %1 Lateral: %2").arg(location->subIndex()).arg(completion->index()));
double diameter = location->holeDiameter();
QString completionMetaData = ( location->label() + QString( ": Sub: %1 Lateral: %2" )
.arg( location->subIndex() )
.arg( completion->index() ) );
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc(
intersection->lengthsInCell(), diameter / 2.0, location->skinFactor(), isMainBore, completionMetaData);
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc( intersection->lengthsInCell(),
diameter / 2.0,
location->skinFactor(),
isMainBore,
completionMetaData );
wellBorePart.intersectionWithWellMeasuredDepth = location->endMD();
wellBorePart.lateralIndex = completion->index();
wellBorePart.setSourcePdmObject(location->sourcePdmObject());
wellBorePart.setSourcePdmObject( location->sourcePdmObject() );
wellBorePartsInCells[intersection->globalCellIndex()].push_back(wellBorePart);
wellBorePartsInCells[intersection->globalCellIndex()].push_back( wellBorePart );
}
}
}
@@ -223,24 +236,31 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell
// Note that it is not supported to export main bore perforation intervals for Imported Laterals, only for fishbones
// defined by ResInsight. It is not trivial to define the open section of the main bore for imported laterals.
if (wellPath->fishbonesCollection()->isChecked())
if ( wellPath->fishbonesCollection()->isChecked() )
{
double holeRadius = wellPath->fishbonesCollection()->mainBoreDiameter(unitSystem) / 2.0;
double holeRadius = wellPath->fishbonesCollection()->mainBoreDiameter( unitSystem ) / 2.0;
double skinFactor = wellPath->fishbonesCollection()->mainBoreSkinFactor();
for (const auto& fishboneDefinition : wellPath->fishbonesCollection()->activeFishbonesSubs())
for ( const auto& fishboneDefinition : wellPath->fishbonesCollection()->activeFishbonesSubs() )
{
double startMD = fishboneDefinition->startMD();
double endMD = fishboneDefinition->endMD();
if (fabs(startMD - endMD) < 1e-3)
if ( fabs( startMD - endMD ) < 1e-3 )
{
// Start and end md are close, adjust to be sure we get an intersection along the well path
startMD -= 0.5;
endMD += 0.5;
}
appendMainWellBoreParts(wellBorePartsInCells, wellPath, settings, skinFactor, holeRadius, startMD, endMD, fishboneDefinition);
appendMainWellBoreParts( wellBorePartsInCells,
wellPath,
settings,
skinFactor,
holeRadius,
startMD,
endMD,
fishboneDefinition );
}
}
}
@@ -252,36 +272,40 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneLateralsWell
void RicFishbonesTransmissibilityCalculationFeatureImp::findFishboneImportedLateralsWellBoreParts(
std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings)
const RicExportCompletionDataSettingsUi& settings )
{
RiaEclipseUnitTools::UnitSystem unitSystem = settings.caseToApply->eclipseCaseData()->unitsType();
if (!wellPath) return;
if (!wellPath->wellPathGeometry()) return;
if ( !wellPath ) return;
if ( !wellPath->wellPathGeometry() ) return;
bool isMainBore = false;
double holeRadius = wellPath->fishbonesCollection()->wellPathCollection()->holeDiameter(unitSystem) / 2.0;
double holeRadius = wellPath->fishbonesCollection()->wellPathCollection()->holeDiameter( unitSystem ) / 2.0;
double skinFactor = wellPath->fishbonesCollection()->wellPathCollection()->skinFactor();
for (const RimFishboneWellPath* fishbonesPath : wellPath->fishbonesCollection()->wellPathCollection()->wellPaths())
for ( const RimFishboneWellPath* fishbonesPath : wellPath->fishbonesCollection()->wellPathCollection()->wellPaths() )
{
if (!fishbonesPath->isChecked())
if ( !fishbonesPath->isChecked() )
{
continue;
}
std::vector<WellPathCellIntersectionInfo> intersectedCells =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(
settings.caseToApply->eclipseCaseData(), fishbonesPath->coordinates(), fishbonesPath->measuredDepths());
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(),
fishbonesPath->coordinates(),
fishbonesPath->measuredDepths() );
for (const auto& cellIntersectionInfo : intersectedCells)
for ( const auto& cellIntersectionInfo : intersectedCells )
{
QString completionMetaData = fishbonesPath->name();
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc(
cellIntersectionInfo.intersectionLengthsInCellCS, holeRadius, skinFactor, isMainBore, completionMetaData);
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc( cellIntersectionInfo.intersectionLengthsInCellCS,
holeRadius,
skinFactor,
isMainBore,
completionMetaData );
wellBorePart.intersectionWithWellMeasuredDepth = cellIntersectionInfo.startMD;
wellBorePartsInCells[cellIntersectionInfo.globCellIndex].push_back(wellBorePart);
wellBorePartsInCells[cellIntersectionInfo.globCellIndex].push_back( wellBorePart );
}
}
@@ -300,30 +324,34 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::appendMainWellBoreParts(
double holeRadius,
double startMeasuredDepth,
double endMeasuredDepth,
const RimFishbonesMultipleSubs* fishbonesDefintions)
const RimFishbonesMultipleSubs* fishbonesDefintions )
{
if (!wellPath) return;
if (!wellPath->wellPathGeometry()) return;
if (!wellPath->fishbonesCollection()) return;
if ( !wellPath ) return;
if ( !wellPath->wellPathGeometry() ) return;
if ( !wellPath->fishbonesCollection() ) return;
bool isMainBore = true;
std::pair<std::vector<cvf::Vec3d>, std::vector<double>> fishbonePerfWellPathCoords =
wellPath->wellPathGeometry()->clippedPointSubset(startMeasuredDepth, endMeasuredDepth);
wellPath->wellPathGeometry()->clippedPointSubset( startMeasuredDepth, endMeasuredDepth );
std::vector<WellPathCellIntersectionInfo> intersectedCellsIntersectionInfo =
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath(
settings.caseToApply->eclipseCaseData(), fishbonePerfWellPathCoords.first, fishbonePerfWellPathCoords.second);
RigWellPathIntersectionTools::findCellIntersectionInfosAlongPath( settings.caseToApply->eclipseCaseData(),
fishbonePerfWellPathCoords.first,
fishbonePerfWellPathCoords.second );
for (const auto& cellIntersectionInfo : intersectedCellsIntersectionInfo)
for ( const auto& cellIntersectionInfo : intersectedCellsIntersectionInfo )
{
QString completionMetaData = wellPath->name() + " main bore";
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc(
cellIntersectionInfo.intersectionLengthsInCellCS, holeRadius, skinFactor, isMainBore, completionMetaData);
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc( cellIntersectionInfo.intersectionLengthsInCellCS,
holeRadius,
skinFactor,
isMainBore,
completionMetaData );
wellBorePart.intersectionWithWellMeasuredDepth = cellIntersectionInfo.startMD;
wellBorePart.setSourcePdmObject(fishbonesDefintions);
wellBorePartsInCells[cellIntersectionInfo.globCellIndex].push_back(wellBorePart);
wellBorePart.setSourcePdmObject( fishbonesDefintions );
wellBorePartsInCells[cellIntersectionInfo.globCellIndex].push_back( wellBorePart );
}
}

View File

@@ -18,7 +18,6 @@
#pragma once
#include "cvfVector3.h"
#include <map>
@@ -40,25 +39,26 @@ class RicFishbonesTransmissibilityCalculationFeatureImp
{
public:
static std::vector<RigCompletionData>
generateFishboneCompdatValuesUsingAdjustedCellVolume(const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings);
generateFishboneCompdatValuesUsingAdjustedCellVolume( const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings );
private:
static void findFishboneLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings);
static void
findFishboneImportedLateralsWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings);
findFishboneLateralsWellBoreParts( std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings );
static void appendMainWellBoreParts(std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings,
double skinFactor,
double holeRadius,
double startMeasuredDepth,
double endMeasuredDepth,
const RimFishbonesMultipleSubs* fishbonesDefintions);
static void findFishboneImportedLateralsWellBoreParts(
std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings );
static void appendMainWellBoreParts( std::map<size_t, std::vector<WellBorePartForTransCalc>>& wellBorePartsInCells,
const RimWellPath* wellPath,
const RicExportCompletionDataSettingsUi& settings,
double skinFactor,
double holeRadius,
double startMeasuredDepth,
double endMeasuredDepth,
const RimFishbonesMultipleSubs* fishbonesDefintions );
};

View File

@@ -24,12 +24,12 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswCompletion::RicMswCompletion(const QString& label,
size_t index /* = cvf::UNDEFINED_SIZE_T */,
int branchNumber /*= 0*/)
: m_label(label)
, m_index(index)
, m_branchNumber(branchNumber)
RicMswCompletion::RicMswCompletion( const QString& label,
size_t index /* = cvf::UNDEFINED_SIZE_T */,
int branchNumber /*= 0*/ )
: m_label( label )
, m_index( index )
, m_branchNumber( branchNumber )
{
}
@@ -60,7 +60,7 @@ int RicMswCompletion::branchNumber() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswCompletion::setBranchNumber(int branchNumber)
void RicMswCompletion::setBranchNumber( int branchNumber )
{
m_branchNumber = branchNumber;
}
@@ -68,9 +68,9 @@ void RicMswCompletion::setBranchNumber(int branchNumber)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswCompletion::addSubSegment(std::shared_ptr<RicMswSubSegment> subSegment)
void RicMswCompletion::addSubSegment( std::shared_ptr<RicMswSubSegment> subSegment )
{
m_subSegments.push_back(subSegment);
m_subSegments.push_back( subSegment );
}
//--------------------------------------------------------------------------------------------------
@@ -92,7 +92,7 @@ const std::vector<std::shared_ptr<RicMswSubSegment>>& RicMswCompletion::subSegme
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswCompletion::setLabel(const QString& label)
void RicMswCompletion::setLabel( const QString& label )
{
m_label = label;
}
@@ -100,10 +100,10 @@ void RicMswCompletion::setLabel(const QString& label)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswFracture::RicMswFracture(const QString& label,
size_t index /*= cvf::UNDEFINED_SIZE_T*/,
int branchNumber /*= cvf::UNDEFINED_INT*/)
: RicMswCompletion(label, index, branchNumber)
RicMswFracture::RicMswFracture( const QString& label,
size_t index /*= cvf::UNDEFINED_SIZE_T*/,
int branchNumber /*= cvf::UNDEFINED_INT*/ )
: RicMswCompletion( label, index, branchNumber )
{
}
@@ -118,10 +118,10 @@ RigCompletionData::CompletionType RicMswFracture::completionType() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswPerforation::RicMswPerforation(const QString& label,
size_t index /*= cvf::UNDEFINED_SIZE_T*/,
int branchNumber /*= cvf::UNDEFINED_INT*/)
: RicMswCompletion(label, index, branchNumber)
RicMswPerforation::RicMswPerforation( const QString& label,
size_t index /*= cvf::UNDEFINED_SIZE_T*/,
int branchNumber /*= cvf::UNDEFINED_INT*/ )
: RicMswCompletion( label, index, branchNumber )
{
}
@@ -136,10 +136,9 @@ RigCompletionData::CompletionType RicMswPerforation::completionType() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswValve::RicMswValve(const QString& label,
const RimWellPathValve* wellPathValve)
: RicMswCompletion(label)
, m_wellPathValve(wellPathValve)
RicMswValve::RicMswValve( const QString& label, const RimWellPathValve* wellPathValve )
: RicMswCompletion( label )
, m_wellPathValve( wellPathValve )
{
}
@@ -154,10 +153,10 @@ const RimWellPathValve* RicMswValve::wellPathValve() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswWsegValve::RicMswWsegValve(const QString& label, const RimWellPathValve* wellPathValve)
: RicMswValve(label, wellPathValve)
, m_flowCoefficient(0.0)
, m_area(0.0)
RicMswWsegValve::RicMswWsegValve( const QString& label, const RimWellPathValve* wellPathValve )
: RicMswValve( label, wellPathValve )
, m_flowCoefficient( 0.0 )
, m_area( 0.0 )
{
}
@@ -180,7 +179,7 @@ double RicMswWsegValve::area() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswWsegValve::setFlowCoefficient(double icdFlowCoefficient)
void RicMswWsegValve::setFlowCoefficient( double icdFlowCoefficient )
{
m_flowCoefficient = icdFlowCoefficient;
}
@@ -188,7 +187,7 @@ void RicMswWsegValve::setFlowCoefficient(double icdFlowCoefficient)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswWsegValve::setArea(double icdArea)
void RicMswWsegValve::setArea( double icdArea )
{
m_area = icdArea;
}
@@ -196,8 +195,8 @@ void RicMswWsegValve::setArea(double icdArea)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswFishbonesICD::RicMswFishbonesICD(const QString& label, const RimWellPathValve* wellPathValve)
: RicMswWsegValve(label, wellPathValve)
RicMswFishbonesICD::RicMswFishbonesICD( const QString& label, const RimWellPathValve* wellPathValve )
: RicMswWsegValve( label, wellPathValve )
{
}
@@ -212,9 +211,8 @@ RigCompletionData::CompletionType RicMswFishbonesICD::completionType() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswPerforationICD::RicMswPerforationICD(const QString& label,
const RimWellPathValve* wellPathValve)
: RicMswWsegValve(label, wellPathValve)
RicMswPerforationICD::RicMswPerforationICD( const QString& label, const RimWellPathValve* wellPathValve )
: RicMswWsegValve( label, wellPathValve )
{
}
@@ -229,9 +227,8 @@ RigCompletionData::CompletionType RicMswPerforationICD::completionType() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswPerforationICV::RicMswPerforationICV(const QString& label,
const RimWellPathValve* wellPathValve)
: RicMswWsegValve(label, wellPathValve)
RicMswPerforationICV::RicMswPerforationICV( const QString& label, const RimWellPathValve* wellPathValve )
: RicMswWsegValve( label, wellPathValve )
{
}
@@ -246,11 +243,11 @@ RigCompletionData::CompletionType RicMswPerforationICV::completionType() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswPerforationAICD::RicMswPerforationAICD(const QString& label, const RimWellPathValve* wellPathValve)
: RicMswValve(label, wellPathValve)
, m_valid(false)
, m_deviceOpen(false)
, m_length(0.0)
RicMswPerforationAICD::RicMswPerforationAICD( const QString& label, const RimWellPathValve* wellPathValve )
: RicMswValve( label, wellPathValve )
, m_valid( false )
, m_deviceOpen( false )
, m_length( 0.0 )
{
}
@@ -273,7 +270,7 @@ bool RicMswPerforationAICD::isValid() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswPerforationAICD::setIsValid(bool valid)
void RicMswPerforationAICD::setIsValid( bool valid )
{
m_valid = valid;
}
@@ -289,7 +286,7 @@ bool RicMswPerforationAICD::isOpen() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswPerforationAICD::setIsOpen(bool deviceOpen)
void RicMswPerforationAICD::setIsOpen( bool deviceOpen )
{
m_deviceOpen = deviceOpen;
}
@@ -305,7 +302,7 @@ double RicMswPerforationAICD::length() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswPerforationAICD::setLength(double length)
void RicMswPerforationAICD::setLength( double length )
{
m_length = length;
}

View File

@@ -23,7 +23,6 @@
#include "RimWellPathAicdParameters.h"
#include "cvfMath.h"
#include <QString>
@@ -32,31 +31,31 @@
class RimWellPathValve;
//==================================================================================================
///
///
//==================================================================================================
class RicMswCompletion
{
public:
RicMswCompletion(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT);
RicMswCompletion( const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT );
virtual RigCompletionData::CompletionType completionType() const = 0;
virtual RigCompletionData::CompletionType completionType() const = 0;
const QString& label() const;
size_t index() const;
int branchNumber() const;
void setBranchNumber(int branchNumber);
const QString& label() const;
size_t index() const;
int branchNumber() const;
void setBranchNumber( int branchNumber );
void addSubSegment(std::shared_ptr<RicMswSubSegment> subSegment);
void addSubSegment( std::shared_ptr<RicMswSubSegment> subSegment );
std::vector<std::shared_ptr<RicMswSubSegment>>& subSegments();
const std::vector<std::shared_ptr<RicMswSubSegment>>& subSegments() const;
void setLabel(const QString& label);
void setLabel( const QString& label );
private:
QString m_label;
size_t m_index;
int m_branchNumber;
QString m_label;
size_t m_index;
int m_branchNumber;
std::vector<std::shared_ptr<RicMswSubSegment>> m_subSegments;
};
@@ -64,11 +63,15 @@ private:
class RicMswFishbones : public RicMswCompletion
{
public:
RicMswFishbones(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT)
: RicMswCompletion(label, index, branchNumber)
{}
RicMswFishbones( const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT )
: RicMswCompletion( label, index, branchNumber )
{
}
RigCompletionData::CompletionType completionType() const override { return RigCompletionData::FISHBONES; }
RigCompletionData::CompletionType completionType() const override
{
return RigCompletionData::FISHBONES;
}
};
//==================================================================================================
@@ -77,7 +80,7 @@ public:
class RicMswFracture : public RicMswCompletion
{
public:
RicMswFracture(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT);
RicMswFracture( const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT );
RigCompletionData::CompletionType completionType() const override;
};
@@ -87,7 +90,7 @@ public:
class RicMswPerforation : public RicMswCompletion
{
public:
RicMswPerforation(const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT);
RicMswPerforation( const QString& label, size_t index = cvf::UNDEFINED_SIZE_T, int branchNumber = cvf::UNDEFINED_INT );
RigCompletionData::CompletionType completionType() const override;
};
@@ -97,7 +100,7 @@ public:
class RicMswValve : public RicMswCompletion
{
public:
RicMswValve(const QString& label, const RimWellPathValve* wellPathValve);
RicMswValve( const QString& label, const RimWellPathValve* wellPathValve );
virtual ~RicMswValve() {}
@@ -113,15 +116,16 @@ private:
class RicMswWsegValve : public RicMswValve
{
public:
RicMswWsegValve(const QString& label, const RimWellPathValve* wellPathValve);
RicMswWsegValve( const QString& label, const RimWellPathValve* wellPathValve );
double flowCoefficient() const;
double area() const;
void setFlowCoefficient(double icdFlowCoefficient);
void setArea(double icdArea);
void setFlowCoefficient( double icdFlowCoefficient );
void setArea( double icdArea );
private:
double m_flowCoefficient;
double m_area;
double m_flowCoefficient;
double m_area;
};
//==================================================================================================
@@ -130,7 +134,7 @@ private:
class RicMswFishbonesICD : public RicMswWsegValve
{
public:
RicMswFishbonesICD(const QString& label, const RimWellPathValve* wellPathValve);
RicMswFishbonesICD( const QString& label, const RimWellPathValve* wellPathValve );
RigCompletionData::CompletionType completionType() const override;
};
@@ -140,7 +144,7 @@ public:
class RicMswPerforationICD : public RicMswWsegValve
{
public:
RicMswPerforationICD(const QString& label, const RimWellPathValve* wellPathValve);
RicMswPerforationICD( const QString& label, const RimWellPathValve* wellPathValve );
RigCompletionData::CompletionType completionType() const override;
};
@@ -150,7 +154,7 @@ public:
class RicMswPerforationICV : public RicMswWsegValve
{
public:
RicMswPerforationICV(const QString& label, const RimWellPathValve* wellPathValve);
RicMswPerforationICV( const QString& label, const RimWellPathValve* wellPathValve );
RigCompletionData::CompletionType completionType() const override;
};
@@ -160,15 +164,15 @@ public:
class RicMswPerforationAICD : public RicMswValve
{
public:
RicMswPerforationAICD(const QString& label, const RimWellPathValve* wellPathValve);
RicMswPerforationAICD( const QString& label, const RimWellPathValve* wellPathValve );
RigCompletionData::CompletionType completionType() const override;
bool isValid() const;
void setIsValid(bool valid);
void setIsValid( bool valid );
bool isOpen() const;
void setIsOpen(bool deviceOpen);
void setIsOpen( bool deviceOpen );
double length() const;
void setLength(double length);
void setLength( double length );
const std::array<double, AICD_NUM_PARAMS>& values() const;
std::array<double, AICD_NUM_PARAMS>& values();

View File

@@ -28,32 +28,30 @@
#include <algorithm>
#include <limits>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswExportInfo::RicMswExportInfo(const RimWellPath* wellPath,
RiaEclipseUnitTools::UnitSystem unitSystem,
double initialMD,
const QString& lengthAndDepthText,
const QString& pressureDropText)
: m_wellPath(wellPath)
, m_initialMD(initialMD)
, m_unitSystem(unitSystem)
, m_topWellBoreVolume(RicMswExportInfo::defaultDoubleValue())
, m_linerDiameter(RimMswCompletionParameters::defaultLinerDiameter(unitSystem))
, m_roughnessFactor(RimMswCompletionParameters::defaultRoughnessFactor(unitSystem))
, m_lengthAndDepthText(lengthAndDepthText)
, m_pressureDropText(pressureDropText)
, m_hasSubGridIntersections(false)
RicMswExportInfo::RicMswExportInfo( const RimWellPath* wellPath,
RiaEclipseUnitTools::UnitSystem unitSystem,
double initialMD,
const QString& lengthAndDepthText,
const QString& pressureDropText )
: m_wellPath( wellPath )
, m_initialMD( initialMD )
, m_unitSystem( unitSystem )
, m_topWellBoreVolume( RicMswExportInfo::defaultDoubleValue() )
, m_linerDiameter( RimMswCompletionParameters::defaultLinerDiameter( unitSystem ) )
, m_roughnessFactor( RimMswCompletionParameters::defaultRoughnessFactor( unitSystem ) )
, m_lengthAndDepthText( lengthAndDepthText )
, m_pressureDropText( pressureDropText )
, m_hasSubGridIntersections( false )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswExportInfo::setLinerDiameter(double linerDiameter)
void RicMswExportInfo::setLinerDiameter( double linerDiameter )
{
m_linerDiameter = linerDiameter;
}
@@ -61,7 +59,7 @@ void RicMswExportInfo::setLinerDiameter(double linerDiameter)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswExportInfo::setRoughnessFactor(double roughnessFactor)
void RicMswExportInfo::setRoughnessFactor( double roughnessFactor )
{
m_roughnessFactor = roughnessFactor;
}
@@ -69,7 +67,7 @@ void RicMswExportInfo::setRoughnessFactor(double roughnessFactor)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswExportInfo::setHasSubGridIntersections(bool subGridIntersections)
void RicMswExportInfo::setHasSubGridIntersections( bool subGridIntersections )
{
m_hasSubGridIntersections = subGridIntersections;
}
@@ -77,9 +75,9 @@ void RicMswExportInfo::setHasSubGridIntersections(bool subGridIntersections)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswExportInfo::addWellSegment(std::shared_ptr<RicMswSegment> location)
void RicMswExportInfo::addWellSegment( std::shared_ptr<RicMswSegment> location )
{
m_wellSegmentLocations.push_back(location);
m_wellSegmentLocations.push_back( location );
}
//--------------------------------------------------------------------------------------------------
@@ -87,12 +85,9 @@ void RicMswExportInfo::addWellSegment(std::shared_ptr<RicMswSegment> location)
//--------------------------------------------------------------------------------------------------
void RicMswExportInfo::sortLocations()
{
std::sort(m_wellSegmentLocations.begin(),
m_wellSegmentLocations.end(),
[](std::shared_ptr<RicMswSegment> lhs, std::shared_ptr<RicMswSegment> rhs)
{
return *lhs < *rhs;
});
std::sort( m_wellSegmentLocations.begin(),
m_wellSegmentLocations.end(),
[]( std::shared_ptr<RicMswSegment> lhs, std::shared_ptr<RicMswSegment> rhs ) { return *lhs < *rhs; } );
}
//--------------------------------------------------------------------------------------------------
@@ -116,7 +111,7 @@ double RicMswExportInfo::initialMD() const
//--------------------------------------------------------------------------------------------------
double RicMswExportInfo::initialTVD() const
{
return -m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath(m_initialMD).z();
return -m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_initialMD ).z();
}
//--------------------------------------------------------------------------------------------------

View File

@@ -1,17 +1,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2018 Equinor ASA
//
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -35,17 +35,17 @@ class RimFishbonesMultipleSubs;
class RicMswExportInfo
{
public:
RicMswExportInfo(const RimWellPath* wellPath,
RiaEclipseUnitTools::UnitSystem unitSystem,
double initialMD,
const QString& lengthAndDepthText,
const QString& pressureDropText);
void setLinerDiameter(double linerDiameter);
void setRoughnessFactor(double roughnessFactor);
void setHasSubGridIntersections(bool subGridIntersections);
RicMswExportInfo( const RimWellPath* wellPath,
RiaEclipseUnitTools::UnitSystem unitSystem,
double initialMD,
const QString& lengthAndDepthText,
const QString& pressureDropText );
void addWellSegment(std::shared_ptr<RicMswSegment> location);
void setLinerDiameter( double linerDiameter );
void setRoughnessFactor( double roughnessFactor );
void setHasSubGridIntersections( bool subGridIntersections );
void addWellSegment( std::shared_ptr<RicMswSegment> location );
void sortLocations();
const RimWellPath* wellPath() const;
@@ -54,7 +54,7 @@ public:
double initialTVD() const;
double topWellBoreVolume() const;
double linerDiameter() const;
double roughnessFactor() const;
double roughnessFactor() const;
QString lengthAndDepthText() const;
QString pressureDropText() const;
bool hasSubGridIntersections() const;
@@ -64,16 +64,15 @@ public:
std::vector<std::shared_ptr<RicMswSegment>>& wellSegmentLocations();
private:
const RimWellPath* m_wellPath;
RiaEclipseUnitTools::UnitSystem m_unitSystem;
double m_initialMD;
double m_topWellBoreVolume;
double m_linerDiameter;
double m_roughnessFactor;
QString m_lengthAndDepthText;
QString m_pressureDropText;
bool m_hasSubGridIntersections;
const RimWellPath* m_wellPath;
RiaEclipseUnitTools::UnitSystem m_unitSystem;
double m_initialMD;
double m_topWellBoreVolume;
double m_linerDiameter;
double m_roughnessFactor;
QString m_lengthAndDepthText;
QString m_pressureDropText;
bool m_hasSubGridIntersections;
std::vector<std::shared_ptr<RicMswSegment>> m_wellSegmentLocations;
};

View File

@@ -26,24 +26,24 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswSegment::RicMswSegment(const QString& label,
double startMD,
double endMD,
double startTVD,
double endTVD,
size_t subIndex,
int segmentNumber /*= -1*/)
: m_label(label)
, m_startMD(startMD)
, m_endMD(endMD)
, m_startTVD(startTVD)
, m_endTVD(endTVD)
, m_effectiveDiameter(0.15)
, m_holeDiameter(RicMswExportInfo::defaultDoubleValue())
, m_openHoleRoughnessFactor(5.0e-5)
, m_skinFactor(RicMswExportInfo::defaultDoubleValue())
, m_subIndex(subIndex)
, m_segmentNumber(segmentNumber)
RicMswSegment::RicMswSegment( const QString& label,
double startMD,
double endMD,
double startTVD,
double endTVD,
size_t subIndex,
int segmentNumber /*= -1*/ )
: m_label( label )
, m_startMD( startMD )
, m_endMD( endMD )
, m_startTVD( startTVD )
, m_endTVD( endTVD )
, m_effectiveDiameter( 0.15 )
, m_holeDiameter( RicMswExportInfo::defaultDoubleValue() )
, m_openHoleRoughnessFactor( 5.0e-5 )
, m_skinFactor( RicMswExportInfo::defaultDoubleValue() )
, m_subIndex( subIndex )
, m_segmentNumber( segmentNumber )
{
}
@@ -170,7 +170,7 @@ std::vector<std::shared_ptr<RicMswCompletion>>& RicMswSegment::completions()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::setLabel(const QString& label)
void RicMswSegment::setLabel( const QString& label )
{
m_label = label;
}
@@ -178,7 +178,7 @@ void RicMswSegment::setLabel(const QString& label)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::setEffectiveDiameter(double effectiveDiameter)
void RicMswSegment::setEffectiveDiameter( double effectiveDiameter )
{
m_effectiveDiameter = effectiveDiameter;
}
@@ -186,7 +186,7 @@ void RicMswSegment::setEffectiveDiameter(double effectiveDiameter)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::setHoleDiameter(double holeDiameter)
void RicMswSegment::setHoleDiameter( double holeDiameter )
{
m_holeDiameter = holeDiameter;
}
@@ -194,7 +194,7 @@ void RicMswSegment::setHoleDiameter(double holeDiameter)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::setOpenHoleRoughnessFactor(double roughnessFactor)
void RicMswSegment::setOpenHoleRoughnessFactor( double roughnessFactor )
{
m_openHoleRoughnessFactor = roughnessFactor;
}
@@ -202,7 +202,7 @@ void RicMswSegment::setOpenHoleRoughnessFactor(double roughnessFactor)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::setSkinFactor(double skinFactor)
void RicMswSegment::setSkinFactor( double skinFactor )
{
m_skinFactor = skinFactor;
}
@@ -210,7 +210,7 @@ void RicMswSegment::setSkinFactor(double skinFactor)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::setSegmentNumber(int segmentNumber)
void RicMswSegment::setSegmentNumber( int segmentNumber )
{
m_segmentNumber = segmentNumber;
}
@@ -218,21 +218,21 @@ void RicMswSegment::setSegmentNumber(int segmentNumber)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::addCompletion(std::shared_ptr<RicMswCompletion> completion)
void RicMswSegment::addCompletion( std::shared_ptr<RicMswCompletion> completion )
{
m_completions.push_back(completion);
m_completions.push_back( completion );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::removeCompletion(std::shared_ptr<RicMswCompletion> completion)
void RicMswSegment::removeCompletion( std::shared_ptr<RicMswCompletion> completion )
{
for (auto it = m_completions.begin(); it != m_completions.end(); ++it)
for ( auto it = m_completions.begin(); it != m_completions.end(); ++it )
{
if ((*it) == completion)
if ( ( *it ) == completion )
{
m_completions.erase(it);
m_completions.erase( it );
break;
}
}
@@ -241,9 +241,9 @@ void RicMswSegment::removeCompletion(std::shared_ptr<RicMswCompletion> completio
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSegment::setSourcePdmObject(const caf::PdmObject* object)
void RicMswSegment::setSourcePdmObject( const caf::PdmObject* object )
{
m_sourcePdmObject = const_cast<caf::PdmObject*>(object);
m_sourcePdmObject = const_cast<caf::PdmObject*>( object );
}
//--------------------------------------------------------------------------------------------------
@@ -257,8 +257,7 @@ const caf::PdmObject* RicMswSegment::sourcePdmObject() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicMswSegment::operator<(const RicMswSegment& rhs) const
bool RicMswSegment::operator<( const RicMswSegment& rhs ) const
{
return startMD() < rhs.startMD();
}

View File

@@ -24,69 +24,68 @@
#include <memory>
//==================================================================================================
///
///
//==================================================================================================
class RicMswSegment
{
public:
RicMswSegment(const QString& label,
double startMD,
double endMD,
double startTVD,
double endTVD,
size_t subIndex = cvf::UNDEFINED_SIZE_T,
int segmentNumber = -1);
RicMswSegment( const QString& label,
double startMD,
double endMD,
double startTVD,
double endTVD,
size_t subIndex = cvf::UNDEFINED_SIZE_T,
int segmentNumber = -1 );
QString label() const;
double startMD() const;
double endMD() const;
double deltaMD() const;
double startTVD() const;
double endTVD() const;
double deltaTVD() const;
double startMD() const;
double endMD() const;
double deltaMD() const;
double startTVD() const;
double endTVD() const;
double deltaTVD() const;
double effectiveDiameter() const;
double holeDiameter() const;
double openHoleRoughnessFactor() const;
double skinFactor() const;
size_t subIndex() const;
int segmentNumber() const;
double effectiveDiameter() const;
double holeDiameter() const;
double openHoleRoughnessFactor() const;
double skinFactor() const;
size_t subIndex() const;
int segmentNumber() const;
const std::vector<std::shared_ptr<RicMswCompletion>>& completions() const;
std::vector<std::shared_ptr<RicMswCompletion>>& completions();
void setLabel(const QString& label);
void setEffectiveDiameter(double effectiveDiameter);
void setHoleDiameter(double holeDiameter);
void setOpenHoleRoughnessFactor(double roughnessFactor);
void setSkinFactor(double skinFactor);
void setSegmentNumber(int segmentNumber);
void addCompletion(std::shared_ptr<RicMswCompletion> completion);
void removeCompletion(std::shared_ptr<RicMswCompletion> completion);
void setLabel( const QString& label );
void setEffectiveDiameter( double effectiveDiameter );
void setHoleDiameter( double holeDiameter );
void setOpenHoleRoughnessFactor( double roughnessFactor );
void setSkinFactor( double skinFactor );
void setSegmentNumber( int segmentNumber );
void addCompletion( std::shared_ptr<RicMswCompletion> completion );
void removeCompletion( std::shared_ptr<RicMswCompletion> completion );
void setSourcePdmObject(const caf::PdmObject* object);
void setSourcePdmObject( const caf::PdmObject* object );
const caf::PdmObject* sourcePdmObject() const;
bool operator<(const RicMswSegment& rhs) const;
private:
QString m_label;
double m_startMD;
double m_endMD;
double m_startTVD;
double m_endTVD;
double m_effectiveDiameter;
double m_holeDiameter;
double m_openHoleRoughnessFactor;
double m_skinFactor;
bool operator<( const RicMswSegment& rhs ) const;
size_t m_subIndex;
int m_segmentNumber;
private:
QString m_label;
double m_startMD;
double m_endMD;
double m_startTVD;
double m_endTVD;
double m_effectiveDiameter;
double m_holeDiameter;
double m_openHoleRoughnessFactor;
double m_skinFactor;
size_t m_subIndex;
int m_segmentNumber;
std::vector<std::shared_ptr<RicMswCompletion>> m_completions;
caf::PdmPointer<caf::PdmObject> m_sourcePdmObject;
};

View File

@@ -21,14 +21,14 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswSubSegmentCellIntersection::RicMswSubSegmentCellIntersection(const QString& gridName,
size_t globalCellIndex,
const cvf::Vec3st& gridLocalCellIJK,
const cvf::Vec3d& lengthsInCell)
: m_gridName(gridName)
, m_globalCellIndex(globalCellIndex)
, m_gridLocalCellIJK(gridLocalCellIJK)
, m_lengthsInCell(lengthsInCell)
RicMswSubSegmentCellIntersection::RicMswSubSegmentCellIntersection( const QString& gridName,
size_t globalCellIndex,
const cvf::Vec3st& gridLocalCellIJK,
const cvf::Vec3d& lengthsInCell )
: m_gridName( gridName )
, m_globalCellIndex( globalCellIndex )
, m_gridLocalCellIJK( gridLocalCellIJK )
, m_lengthsInCell( lengthsInCell )
{
}
@@ -67,13 +67,13 @@ const cvf::Vec3d& RicMswSubSegmentCellIntersection::lengthsInCell() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswSubSegment::RicMswSubSegment(double startMD, double endMD, double startTVD, double endTVD)
: m_startMD(startMD)
, m_endMD(endMD)
, m_startTVD(startTVD)
, m_endTVD(endTVD)
, m_segmentNumber(-1)
, m_attachedSegmentNumber(-1)
RicMswSubSegment::RicMswSubSegment( double startMD, double endMD, double startTVD, double endTVD )
: m_startMD( startMD )
, m_endMD( endMD )
, m_startTVD( startTVD )
, m_endTVD( endTVD )
, m_segmentNumber( -1 )
, m_attachedSegmentNumber( -1 )
{
}
@@ -144,7 +144,7 @@ int RicMswSubSegment::attachedSegmentNumber() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSubSegment::setSegmentNumber(int segmentNumber)
void RicMswSubSegment::setSegmentNumber( int segmentNumber )
{
m_segmentNumber = segmentNumber;
}
@@ -152,7 +152,7 @@ void RicMswSubSegment::setSegmentNumber(int segmentNumber)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSubSegment::setAttachedSegmentNumber(int attachedSegmentNumber)
void RicMswSubSegment::setAttachedSegmentNumber( int attachedSegmentNumber )
{
m_attachedSegmentNumber = attachedSegmentNumber;
}
@@ -160,9 +160,9 @@ void RicMswSubSegment::setAttachedSegmentNumber(int attachedSegmentNumber)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswSubSegment::addIntersection(std::shared_ptr<RicMswSubSegmentCellIntersection> intersection)
void RicMswSubSegment::addIntersection( std::shared_ptr<RicMswSubSegmentCellIntersection> intersection )
{
m_intersections.push_back(intersection);
m_intersections.push_back( intersection );
}
//--------------------------------------------------------------------------------------------------
@@ -180,5 +180,3 @@ std::vector<std::shared_ptr<RicMswSubSegmentCellIntersection>>& RicMswSubSegment
{
return m_intersections;
}

View File

@@ -17,7 +17,6 @@
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cvfVector3.h"
#include <QString>
@@ -25,19 +24,20 @@
#include <vector>
//==================================================================================================
///
///
//==================================================================================================
class RicMswSubSegmentCellIntersection
{
public:
RicMswSubSegmentCellIntersection(const QString& gridName, // Pass in empty string for main grid
size_t globalCellIndex,
const cvf::Vec3st& gridLocalCellIJK,
const cvf::Vec3d& lengthsInCell);
RicMswSubSegmentCellIntersection( const QString& gridName, // Pass in empty string for main grid
size_t globalCellIndex,
const cvf::Vec3st& gridLocalCellIJK,
const cvf::Vec3d& lengthsInCell );
const QString& gridName() const;
size_t globalCellIndex() const;
cvf::Vec3st gridLocalCellIJK() const;
const cvf::Vec3d& lengthsInCell() const;
private:
QString m_gridName;
size_t m_globalCellIndex;
@@ -46,43 +46,37 @@ private:
};
//==================================================================================================
///
///
//==================================================================================================
class RicMswSubSegment
{
public:
RicMswSubSegment(double startMD,
double endMD,
double startTVD,
double endTVD);
RicMswSubSegment( double startMD, double endMD, double startTVD, double endTVD );
double startMD() const;
double endMD() const;
double deltaMD() const;
double startTVD() const;
double endTVD() const;
double deltaTVD() const;
double startMD() const;
double endMD() const;
double deltaMD() const;
double startTVD() const;
double endTVD() const;
double deltaTVD() const;
int segmentNumber() const;
int attachedSegmentNumber() const;
int segmentNumber() const;
int attachedSegmentNumber() const;
void setSegmentNumber(int segmentNumber);
void setAttachedSegmentNumber(int attachedSegmentNumber);
void addIntersection(std::shared_ptr<RicMswSubSegmentCellIntersection> intersection);
void setSegmentNumber( int segmentNumber );
void setAttachedSegmentNumber( int attachedSegmentNumber );
void addIntersection( std::shared_ptr<RicMswSubSegmentCellIntersection> intersection );
const std::vector<std::shared_ptr<RicMswSubSegmentCellIntersection>>& intersections() const;
std::vector<std::shared_ptr<RicMswSubSegmentCellIntersection>>& intersections();
private:
double m_startMD;
double m_endMD;
double m_startTVD;
double m_endTVD;
int m_segmentNumber;
int m_attachedSegmentNumber;
double m_startMD;
double m_endMD;
double m_startTVD;
double m_endTVD;
int m_segmentNumber;
int m_attachedSegmentNumber;
std::vector<std::shared_ptr<RicMswSubSegmentCellIntersection>> m_intersections;
};

View File

@@ -27,25 +27,27 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswICDAccumulator::RicMswICDAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem)
: RicMswValveAccumulator(unitSystem)
, m_areaSum(0.0)
RicMswICDAccumulator::RicMswICDAccumulator( RiaEclipseUnitTools::UnitSystem unitSystem )
: RicMswValveAccumulator( unitSystem )
, m_areaSum( 0.0 )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicMswICDAccumulator::accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction)
bool RicMswICDAccumulator::accumulateValveParameters( const RimWellPathValve* wellPathValve,
size_t subValve,
double contributionFraction )
{
CVF_ASSERT(wellPathValve);
if (wellPathValve->componentType() == RiaDefines::ICV || wellPathValve->componentType() == RiaDefines::ICD)
CVF_ASSERT( wellPathValve );
if ( wellPathValve->componentType() == RiaDefines::ICV || wellPathValve->componentType() == RiaDefines::ICD )
{
double icdOrificeRadius = wellPathValve->orificeDiameter(m_unitSystem) / 2;
double icdArea = icdOrificeRadius * icdOrificeRadius * cvf::PI_D;
double icdOrificeRadius = wellPathValve->orificeDiameter( m_unitSystem ) / 2;
double icdArea = icdOrificeRadius * icdOrificeRadius * cvf::PI_D;
m_areaSum += icdArea * contributionFraction;
m_coefficientCalculator.addValueAndWeight(wellPathValve->flowCoefficient(), icdArea * contributionFraction);
m_coefficientCalculator.addValueAndWeight( wellPathValve->flowCoefficient(), icdArea * contributionFraction );
return true;
}
return false;
@@ -54,55 +56,60 @@ bool RicMswICDAccumulator::accumulateValveParameters(const RimWellPathValve* wel
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswICDAccumulator::applyToSuperValve(std::shared_ptr<RicMswValve> valve)
void RicMswICDAccumulator::applyToSuperValve( std::shared_ptr<RicMswValve> valve )
{
std::shared_ptr<RicMswWsegValve> icd = std::dynamic_pointer_cast<RicMswWsegValve>(valve);
CVF_ASSERT(icd);
icd->setArea(m_areaSum);
if (m_coefficientCalculator.validAggregatedWeight())
std::shared_ptr<RicMswWsegValve> icd = std::dynamic_pointer_cast<RicMswWsegValve>( valve );
CVF_ASSERT( icd );
icd->setArea( m_areaSum );
if ( m_coefficientCalculator.validAggregatedWeight() )
{
icd->setFlowCoefficient(m_coefficientCalculator.weightedMean());
icd->setFlowCoefficient( m_coefficientCalculator.weightedMean() );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RicMswAICDAccumulator::RicMswAICDAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem)
: RicMswValveAccumulator(unitSystem), m_valid(false), m_deviceOpen(false), m_accumulatedLength(0.0)
RicMswAICDAccumulator::RicMswAICDAccumulator( RiaEclipseUnitTools::UnitSystem unitSystem )
: RicMswValveAccumulator( unitSystem )
, m_valid( false )
, m_deviceOpen( false )
, m_accumulatedLength( 0.0 )
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RicMswAICDAccumulator::accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction)
bool RicMswAICDAccumulator::accumulateValveParameters( const RimWellPathValve* wellPathValve,
size_t subValve,
double contributionFraction )
{
CVF_ASSERT(wellPathValve);
if (wellPathValve->componentType() == RiaDefines::AICD)
CVF_ASSERT( wellPathValve );
if ( wellPathValve->componentType() == RiaDefines::AICD )
{
const RimWellPathAicdParameters* params = wellPathValve->aicdParameters();
if (params->isValid())
if ( params->isValid() )
{
m_valid = true;
m_valid = true;
m_deviceOpen = m_deviceOpen || params->isOpen();
if (params->isOpen())
if ( params->isOpen() )
{
std::array<double, AICD_NUM_PARAMS> values = params->doubleValues();
for (size_t i = 0; i < (size_t)AICD_NUM_PARAMS; ++i)
for ( size_t i = 0; i < (size_t)AICD_NUM_PARAMS; ++i )
{
if (RiaStatisticsTools::isValidNumber(values[i]))
if ( RiaStatisticsTools::isValidNumber( values[i] ) )
{
m_meanCalculators[i].addValueAndWeight(values[i], contributionFraction);
m_meanCalculators[i].addValueAndWeight( values[i], contributionFraction );
}
}
std::pair<double, double> valveSegment = wellPathValve->valveSegments()[subValve];
double valveSegmentLength = std::fabs(valveSegment.second - valveSegment.first);
const RimPerforationInterval* perfInterval = nullptr;
wellPathValve->firstAncestorOrThisOfTypeAsserted(perfInterval);
double perfIntervalLength = std::fabs(perfInterval->endMD() - perfInterval->startMD());
double lengthFraction = 1.0;
if (perfIntervalLength > 1.0e-8)
std::pair<double, double> valveSegment = wellPathValve->valveSegments()[subValve];
double valveSegmentLength = std::fabs( valveSegment.second - valveSegment.first );
const RimPerforationInterval* perfInterval = nullptr;
wellPathValve->firstAncestorOrThisOfTypeAsserted( perfInterval );
double perfIntervalLength = std::fabs( perfInterval->endMD() - perfInterval->startMD() );
double lengthFraction = 1.0;
if ( perfIntervalLength > 1.0e-8 )
{
lengthFraction = valveSegmentLength / perfIntervalLength;
}
@@ -117,17 +124,17 @@ bool RicMswAICDAccumulator::accumulateValveParameters(const RimWellPathValve* we
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicMswAICDAccumulator::applyToSuperValve(std::shared_ptr<RicMswValve> valve)
void RicMswAICDAccumulator::applyToSuperValve( std::shared_ptr<RicMswValve> valve )
{
std::shared_ptr<RicMswPerforationAICD> aicd = std::dynamic_pointer_cast<RicMswPerforationAICD>(valve);
std::shared_ptr<RicMswPerforationAICD> aicd = std::dynamic_pointer_cast<RicMswPerforationAICD>( valve );
if (aicd)
if ( aicd )
{
std::array<double, AICD_NUM_PARAMS> values;
for (size_t i = 0; i < (size_t) AICD_NUM_PARAMS; ++i)
for ( size_t i = 0; i < (size_t)AICD_NUM_PARAMS; ++i )
{
if (m_meanCalculators[i].validAggregatedWeight())
if ( m_meanCalculators[i].validAggregatedWeight() )
{
values[i] = m_meanCalculators[i].weightedMean();
}
@@ -136,10 +143,10 @@ void RicMswAICDAccumulator::applyToSuperValve(std::shared_ptr<RicMswValve> valve
values[i] = std::numeric_limits<double>::infinity();
}
}
aicd->setIsValid(m_valid);
aicd->setIsOpen(m_deviceOpen);
aicd->setLength(m_accumulatedLength);
aicd->setIsValid( m_valid );
aicd->setIsOpen( m_deviceOpen );
aicd->setLength( m_accumulatedLength );
aicd->values() = values;
}
}
}

View File

@@ -33,9 +33,14 @@ class RicMswValve;
class RicMswValveAccumulator
{
public:
RicMswValveAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem) : m_unitSystem(unitSystem) {}
virtual bool accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction) = 0;
virtual void applyToSuperValve(std::shared_ptr<RicMswValve> valve) = 0;
RicMswValveAccumulator( RiaEclipseUnitTools::UnitSystem unitSystem )
: m_unitSystem( unitSystem )
{
}
virtual bool accumulateValveParameters( const RimWellPathValve* wellPathValve,
size_t subValve,
double contributionFraction ) = 0;
virtual void applyToSuperValve( std::shared_ptr<RicMswValve> valve ) = 0;
protected:
RiaEclipseUnitTools::UnitSystem m_unitSystem;
@@ -47,9 +52,11 @@ protected:
class RicMswICDAccumulator : public RicMswValveAccumulator
{
public:
RicMswICDAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem);
bool accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction) override;
void applyToSuperValve(std::shared_ptr<RicMswValve> valve) override;
RicMswICDAccumulator( RiaEclipseUnitTools::UnitSystem unitSystem );
bool accumulateValveParameters( const RimWellPathValve* wellPathValve,
size_t subValve,
double contributionFraction ) override;
void applyToSuperValve( std::shared_ptr<RicMswValve> valve ) override;
private:
RiaWeightedMeanCalculator<double> m_coefficientCalculator;
@@ -62,13 +69,15 @@ private:
class RicMswAICDAccumulator : public RicMswValveAccumulator
{
public:
RicMswAICDAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem);
bool accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction) override;
void applyToSuperValve(std::shared_ptr<RicMswValve> valve) override;
RicMswAICDAccumulator( RiaEclipseUnitTools::UnitSystem unitSystem );
bool accumulateValveParameters( const RimWellPathValve* wellPathValve,
size_t subValve,
double contributionFraction ) override;
void applyToSuperValve( std::shared_ptr<RicMswValve> valve ) override;
private:
bool m_valid;
bool m_deviceOpen;
bool m_valid;
bool m_deviceOpen;
std::array<RiaWeightedMeanCalculator<double>, AICD_NUM_PARAMS> m_meanCalculators;
double m_accumulatedLength;
};

View File

@@ -44,23 +44,22 @@
#include <QAction>
CAF_CMD_SOURCE_INIT(RicWellPathExportCompletionDataFeature, "RicWellPathExportCompletionDataFeature");
CAF_CMD_SOURCE_INIT( RicWellPathExportCompletionDataFeature, "RicWellPathExportCompletionDataFeature" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions(
const QString& dialogTitle,
const std::vector<RimWellPath*>& wellPaths,
const std::vector<RimSimWellInView*>& simWells)
const QString& dialogTitle, const std::vector<RimWellPath*>& wellPaths, const std::vector<RimSimWellInView*>& simWells )
{
RiaApplication* app = RiaApplication::instance();
RimProject* project = app->project();
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder("COMPLETIONS");
QString defaultDir = RiaApplication::instance()->lastUsedDialogDirectoryWithFallbackToProjectFolder(
"COMPLETIONS" );
RicExportCompletionDataSettingsUi* exportSettings = project->dialogData()->exportCompletionData();
if (wellPaths.empty())
if ( wellPaths.empty() )
{
exportSettings->showForSimWells();
}
@@ -69,14 +68,14 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl
exportSettings->showForWellPath();
}
if (!exportSettings->caseToApply())
if ( !exportSettings->caseToApply() )
{
std::vector<RimCase*> cases;
app->project()->allCases(cases);
for (auto c : cases)
app->project()->allCases( cases );
for ( auto c : cases )
{
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>(c);
if (eclipseCase != nullptr)
RimEclipseCase* eclipseCase = dynamic_cast<RimEclipseCase*>( c );
if ( eclipseCase != nullptr )
{
exportSettings->caseToApply = eclipseCase;
break;
@@ -84,71 +83,71 @@ void RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompl
}
}
if (exportSettings->folder().isEmpty()) exportSettings->folder = defaultDir;
if ( exportSettings->folder().isEmpty() ) exportSettings->folder = defaultDir;
std::vector<RimSimWellFracture*> simWellFractures;
std::vector<RimWellPathFracture*> wellPathFractures;
std::vector<RimFishbonesMultipleSubs*> wellPathFishbones;
std::vector<RimPerforationInterval*> wellPathPerforations;
for (auto s : simWells)
for ( auto s : simWells )
{
s->descendantsIncludingThisOfType(simWellFractures);
s->descendantsIncludingThisOfType( simWellFractures );
}
for (auto w : wellPaths)
for ( auto w : wellPaths )
{
w->descendantsIncludingThisOfType(wellPathFractures);
w->descendantsIncludingThisOfType(wellPathFishbones);
w->descendantsIncludingThisOfType(wellPathPerforations);
w->descendantsIncludingThisOfType( wellPathFractures );
w->descendantsIncludingThisOfType( wellPathFishbones );
w->descendantsIncludingThisOfType( wellPathPerforations );
}
if ((!simWellFractures.empty()) || (!wellPathFractures.empty()))
if ( ( !simWellFractures.empty() ) || ( !wellPathFractures.empty() ) )
{
exportSettings->showFractureInUi(true);
exportSettings->showFractureInUi( true );
}
else
{
exportSettings->showFractureInUi(false);
exportSettings->showFractureInUi( false );
}
if (!wellPathFishbones.empty())
if ( !wellPathFishbones.empty() )
{
exportSettings->showFishbonesInUi(true);
exportSettings->showFishbonesInUi( true );
}
else
{
exportSettings->showFishbonesInUi(false);
exportSettings->showFishbonesInUi( false );
}
if (!wellPathPerforations.empty())
if ( !wellPathPerforations.empty() )
{
exportSettings->showPerforationsInUi(true);
exportSettings->showPerforationsInUi( true );
std::vector<const RimWellPathValve*> perforationValves;
for (const auto& perf : wellPathPerforations)
for ( const auto& perf : wellPathPerforations )
{
perf->descendantsIncludingThisOfType(perforationValves);
perf->descendantsIncludingThisOfType( perforationValves );
}
if (!perforationValves.empty())
if ( !perforationValves.empty() )
{
exportSettings->enableIncludeMsw();
}
}
else
{
exportSettings->showPerforationsInUi(false);
exportSettings->showPerforationsInUi( false );
}
caf::PdmUiPropertyViewDialog propertyDialog(Riu3DMainWindowTools::mainWindowWidget(), exportSettings, dialogTitle, "");
RicExportFeatureImpl::configureForExport(propertyDialog.dialogButtonBox());
caf::PdmUiPropertyViewDialog propertyDialog( Riu3DMainWindowTools::mainWindowWidget(), exportSettings, dialogTitle, "" );
RicExportFeatureImpl::configureForExport( propertyDialog.dialogButtonBox() );
if (propertyDialog.exec() == QDialog::Accepted)
if ( propertyDialog.exec() == QDialog::Accepted )
{
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings->folder);
RiaApplication::instance()->setLastUsedDialogDirectory( "COMPLETIONS", exportSettings->folder );
RicWellPathExportCompletionDataFeatureImpl::exportCompletions(wellPaths, simWells, *exportSettings);
RicWellPathExportCompletionDataFeatureImpl::exportCompletions( wellPaths, simWells, *exportSettings );
}
}
@@ -159,7 +158,7 @@ bool RicWellPathExportCompletionDataFeature::isCommandEnabled()
{
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
if (wellPaths.empty())
if ( wellPaths.empty() )
{
return false;
}
@@ -170,32 +169,32 @@ bool RicWellPathExportCompletionDataFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
void RicWellPathExportCompletionDataFeature::onActionTriggered( bool isChecked )
{
std::vector<RimWellPath*> wellPaths = selectedWellPaths();
CVF_ASSERT(!wellPaths.empty());
CVF_ASSERT( !wellPaths.empty() );
std::vector<RimSimWellInView*> simWells;
QString dialogTitle = "Export Completion Data for Selected Well Paths";
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions(dialogTitle, wellPaths, simWells);
RicWellPathExportCompletionDataFeature::prepareExportSettingsAndExportCompletions( dialogTitle, wellPaths, simWells );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSetup)
void RicWellPathExportCompletionDataFeature::setupActionLook( QAction* actionToSetup )
{
std::vector<RimWellPath*> selected = selectedWellPaths();
if (selected.size() == 1u)
if ( selected.size() == 1u )
{
actionToSetup->setText("Export Completion Data for Current Well Path");
actionToSetup->setText( "Export Completion Data for Current Well Path" );
}
else
{
actionToSetup->setText("Export Completion Data for Selected Well Paths");
actionToSetup->setText( "Export Completion Data for Selected Well Paths" );
}
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
actionToSetup->setIcon( QIcon( ":/ExportCompletionsSymbol16x16.png" ) );
}
//--------------------------------------------------------------------------------------------------
@@ -204,20 +203,20 @@ void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSe
std::vector<RimWellPath*> RicWellPathExportCompletionDataFeature::selectedWellPaths()
{
std::vector<RimWellPath*> wellPaths;
caf::SelectionManager::instance()->objectsByType(&wellPaths);
caf::SelectionManager::instance()->objectsByType( &wellPaths );
std::set<RimWellPath*> uniqueWellPaths(wellPaths.begin(), wellPaths.end());
wellPaths.assign(uniqueWellPaths.begin(), uniqueWellPaths.end());
std::set<RimWellPath*> uniqueWellPaths( wellPaths.begin(), wellPaths.end() );
wellPaths.assign( uniqueWellPaths.begin(), uniqueWellPaths.end() );
if (wellPaths.empty())
if ( wellPaths.empty() )
{
RimWellPathCompletions* completions =
caf::SelectionManager::instance()->selectedItemAncestorOfType<RimWellPathCompletions>();
if (completions)
RimWellPathCompletions* completions = caf::SelectionManager::instance()
->selectedItemAncestorOfType<RimWellPathCompletions>();
if ( completions )
{
RimWellPath* wellPath = nullptr;
completions->firstAncestorOrThisOfTypeAsserted(wellPath);
wellPaths.push_back(wellPath);
completions->firstAncestorOrThisOfTypeAsserted( wellPath );
wellPaths.push_back( wellPath );
}
}

Some files were not shown because too many files have changed in this diff Show More