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) 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -27,23 +27,21 @@
|
||||
|
||||
#include "cvfAssert.h"
|
||||
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimGeoMechPropertyFilterCollection, "GeoMechPropertyFilters");
|
||||
CAF_PDM_SOURCE_INIT( RimGeoMechPropertyFilterCollection, "GeoMechPropertyFilters" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechPropertyFilterCollection::RimGeoMechPropertyFilterCollection()
|
||||
{
|
||||
CAF_PDM_InitObject("Property Filters", ":/CellFilter_Values.png", "", "");
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&propertyFilters, "PropertyFilters", "Property Filters", "", "", "");
|
||||
propertyFilters.uiCapability()->setUiHidden(true);
|
||||
CAF_PDM_InitObject( "Property Filters", ":/CellFilter_Values.png", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &propertyFilters, "PropertyFilters", "Property Filters", "", "", "" );
|
||||
propertyFilters.uiCapability()->setUiHidden( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechPropertyFilterCollection::~RimGeoMechPropertyFilterCollection()
|
||||
{
|
||||
@@ -51,42 +49,41 @@ RimGeoMechPropertyFilterCollection::~RimGeoMechPropertyFilterCollection()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimGeoMechView* RimGeoMechPropertyFilterCollection::reservoirView()
|
||||
{
|
||||
RimGeoMechView* geoMechView = nullptr;
|
||||
firstAncestorOrThisOfType(geoMechView);
|
||||
|
||||
firstAncestorOrThisOfType( geoMechView );
|
||||
|
||||
return geoMechView;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechPropertyFilterCollection::loadAndInitializePropertyFilters()
|
||||
{
|
||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||
{
|
||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||
propertyFilter->resultDefinition->setGeoMechCase(reservoirView()->geoMechCase());
|
||||
propertyFilter->resultDefinition->setGeoMechCase( reservoirView()->geoMechCase() );
|
||||
propertyFilter->resultDefinition->loadResult();
|
||||
propertyFilter->computeResultValueRange();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechPropertyFilterCollection::initAfterRead()
|
||||
{
|
||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||
{
|
||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||
|
||||
propertyFilter->setParentContainer(this);
|
||||
propertyFilter->resultDefinition->setGeoMechCase(reservoirView()->geoMechCase());
|
||||
propertyFilter->setParentContainer( this );
|
||||
propertyFilter->resultDefinition->setGeoMechCase( reservoirView()->geoMechCase() );
|
||||
propertyFilter->updateIconState();
|
||||
}
|
||||
|
||||
@@ -94,16 +91,16 @@ void RimGeoMechPropertyFilterCollection::initAfterRead()
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechPropertyFilterCollection::hasActiveFilters() const
|
||||
{
|
||||
if (!isActive) return false;
|
||||
if ( !isActive ) return false;
|
||||
|
||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||
{
|
||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||
if (propertyFilter->isActive() && propertyFilter->resultDefinition->hasResult()) return true;
|
||||
if ( propertyFilter->isActive() && propertyFilter->resultDefinition->hasResult() ) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -117,9 +114,8 @@ bool RimGeoMechPropertyFilterCollection::hasActiveDynamicFilters() const
|
||||
return hasActiveFilters();
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGeoMechPropertyFilterCollection::isUsingFormationNames() const
|
||||
{
|
||||
@@ -128,44 +124,43 @@ bool RimGeoMechPropertyFilterCollection::isUsingFormationNames() const
|
||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||
{
|
||||
RimGeoMechPropertyFilter* propertyFilter = propertyFilters[i];
|
||||
if ( propertyFilter->isActive()
|
||||
&& propertyFilter->resultDefinition->resultPositionType() == RIG_FORMATION_NAMES
|
||||
&& propertyFilter->resultDefinition->resultFieldName() != "") return true;
|
||||
if ( propertyFilter->isActive() && propertyFilter->resultDefinition->resultPositionType() == RIG_FORMATION_NAMES &&
|
||||
propertyFilter->resultDefinition->resultFieldName() != "" )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimGeoMechPropertyFilterCollection::updateIconState()
|
||||
{
|
||||
bool activeIcon = true;
|
||||
|
||||
RimGeoMechView* view = nullptr;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
if (view)
|
||||
this->firstAncestorOrThisOfType( view );
|
||||
if ( view )
|
||||
{
|
||||
RimViewController* viewController = view->viewController();
|
||||
if (viewController && ( viewController->isPropertyFilterOveridden()
|
||||
|| viewController->isVisibleCellsOveridden()))
|
||||
if ( viewController &&
|
||||
( viewController->isPropertyFilterOveridden() || viewController->isVisibleCellsOveridden() ) )
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isActive)
|
||||
if ( !isActive )
|
||||
{
|
||||
activeIcon = false;
|
||||
}
|
||||
|
||||
updateUiIconFromState(activeIcon);
|
||||
updateUiIconFromState( activeIcon );
|
||||
|
||||
for (size_t i = 0; i < propertyFilters.size(); i++)
|
||||
for ( size_t i = 0; i < propertyFilters.size(); i++ )
|
||||
{
|
||||
RimGeoMechPropertyFilter* propFilter = propertyFilters[i];
|
||||
propFilter->updateActiveState();
|
||||
propFilter->updateIconState();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user