mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -2,17 +2,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,55 +22,57 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimFractureTemplate.h"
|
||||
#include "RimFractureTemplateCollection.h"
|
||||
#include "RimProject.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RicfSetFractureContainment, "setFractureContainment");
|
||||
CAF_PDM_SOURCE_INIT( RicfSetFractureContainment, "setFractureContainment" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfSetFractureContainment::RicfSetFractureContainment()
|
||||
{
|
||||
RICF_InitField(&m_id, "id", -1, "Id", "", "", "");
|
||||
RICF_InitField(&m_topLayer, "topLayer", -1, "TopLayer", "", "", "");
|
||||
RICF_InitField(&m_baseLayer, "baseLayer", -1, "BaseLayer", "", "", "");
|
||||
RICF_InitField( &m_id, "id", -1, "Id", "", "", "" );
|
||||
RICF_InitField( &m_topLayer, "topLayer", -1, "TopLayer", "", "", "" );
|
||||
RICF_InitField( &m_baseLayer, "baseLayer", -1, "BaseLayer", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicfSetFractureContainment::execute()
|
||||
{
|
||||
if (m_id < 0 || m_topLayer < 0 || m_baseLayer < 0)
|
||||
if ( m_id < 0 || m_topLayer < 0 || m_baseLayer < 0 )
|
||||
{
|
||||
QString error("setFractureContainment: Required argument missing");
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
QString error( "setFractureContainment: Required argument missing" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
|
||||
if (!project)
|
||||
if ( !project )
|
||||
{
|
||||
QString error("setFractureContainment: Project not found");
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
QString error( "setFractureContainment: Project not found" );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
RimFractureTemplateCollection* templColl = !project->allFractureTemplateCollections().empty() ? project->allFractureTemplateCollections()[0] : nullptr;
|
||||
RimFractureTemplate* templ = templColl ? templColl->fractureTemplate(m_id) : nullptr;
|
||||
|
||||
if (!templ)
|
||||
RimFractureTemplateCollection* templColl = !project->allFractureTemplateCollections().empty()
|
||||
? project->allFractureTemplateCollections()[0]
|
||||
: nullptr;
|
||||
RimFractureTemplate* templ = templColl ? templColl->fractureTemplate( m_id ) : nullptr;
|
||||
|
||||
if ( !templ )
|
||||
{
|
||||
QString error = QString("setFractureContainment: Fracture template not found. Id=%1").arg(m_id);
|
||||
RiaLogging::error(error);
|
||||
return RicfCommandResponse(RicfCommandResponse::COMMAND_ERROR, error);
|
||||
QString error = QString( "setFractureContainment: Fracture template not found. Id=%1" ).arg( m_id );
|
||||
RiaLogging::error( error );
|
||||
return RicfCommandResponse( RicfCommandResponse::COMMAND_ERROR, error );
|
||||
}
|
||||
|
||||
templ->setContainmentTopKLayer(m_topLayer);
|
||||
templ->setContainmentBaseKLayer(m_baseLayer);
|
||||
templ->setContainmentTopKLayer( m_topLayer );
|
||||
templ->setContainmentBaseKLayer( m_baseLayer );
|
||||
templ->loadDataAndUpdateGeometryHasChanged();
|
||||
return RicfCommandResponse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user