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:
@@ -48,51 +48,51 @@
|
||||
|
||||
namespace caf
|
||||
{ // Obsolete stuff
|
||||
template<>
|
||||
template <>
|
||||
void caf::AppEnum<RimEclipsePropertyFilter::EvaluationRegionType>::setUp()
|
||||
{
|
||||
addItem(RimEclipsePropertyFilter::RANGE_FILTER_REGION, "RANGE_FILTER_REGION", "Range filter cells");
|
||||
addItem(RimEclipsePropertyFilter::GLOBAL_REGION, "GLOBAL_REGION", "All cells");
|
||||
setDefault(RimEclipsePropertyFilter::RANGE_FILTER_REGION);
|
||||
addItem( RimEclipsePropertyFilter::RANGE_FILTER_REGION, "RANGE_FILTER_REGION", "Range filter cells" );
|
||||
addItem( RimEclipsePropertyFilter::GLOBAL_REGION, "GLOBAL_REGION", "All cells" );
|
||||
setDefault( RimEclipsePropertyFilter::RANGE_FILTER_REGION );
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimEclipsePropertyFilter, "CellPropertyFilter");
|
||||
CAF_PDM_SOURCE_INIT( RimEclipsePropertyFilter, "CellPropertyFilter" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipsePropertyFilter::RimEclipsePropertyFilter()
|
||||
{
|
||||
CAF_PDM_InitObject("Cell Property Filter", ":/CellFilter_Values.png", "", "");
|
||||
CAF_PDM_InitObject( "Cell Property Filter", ":/CellFilter_Values.png", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&obsoleteField_evaluationRegion, "EvaluationRegion", "Evaluation Region", "", "", "");
|
||||
RiaFieldhandleTools::disableWriteAndSetFieldHidden(&obsoleteField_evaluationRegion);
|
||||
CAF_PDM_InitFieldNoDefault( &obsoleteField_evaluationRegion, "EvaluationRegion", "Evaluation Region", "", "", "" );
|
||||
RiaFieldhandleTools::disableWriteAndSetFieldHidden( &obsoleteField_evaluationRegion );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault(&m_resultDefinition, "ResultDefinition", "Result Definition", "", "", "");
|
||||
CAF_PDM_InitFieldNoDefault( &m_resultDefinition, "ResultDefinition", "Result Definition", "", "", "" );
|
||||
m_resultDefinition = new RimEclipseResultDefinition();
|
||||
m_resultDefinition->setDiffResultOptionsEnabled(true);
|
||||
m_resultDefinition->setDiffResultOptionsEnabled( true );
|
||||
|
||||
// Set to hidden to avoid this item to been displayed as a child item
|
||||
// Fields in this object are displayed using defineUiOrdering()
|
||||
m_resultDefinition.uiCapability()->setUiHidden(true);
|
||||
m_resultDefinition.uiCapability()->setUiTreeChildrenHidden(true);
|
||||
m_resultDefinition.uiCapability()->setUiHidden( true );
|
||||
m_resultDefinition.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
|
||||
CAF_PDM_InitField(&m_rangeLabelText, "Dummy_keyword", QString("Range Type"), "Range Type", "", "", "");
|
||||
CAF_PDM_InitField( &m_rangeLabelText, "Dummy_keyword", QString( "Range Type" ), "Range Type", "", "", "" );
|
||||
m_rangeLabelText.xmlCapability()->disableIO();
|
||||
m_rangeLabelText.uiCapability()->setUiReadOnly(true);
|
||||
m_rangeLabelText.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
CAF_PDM_InitField(&m_lowerBound, "LowerBound", 0.0, "Min", "", "", "");
|
||||
m_lowerBound.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
CAF_PDM_InitField( &m_lowerBound, "LowerBound", 0.0, "Min", "", "", "" );
|
||||
m_lowerBound.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField(&m_upperBound, "UpperBound", 0.0, "Max", "", "", "");
|
||||
m_upperBound.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
CAF_PDM_InitField( &m_upperBound, "UpperBound", 0.0, "Max", "", "", "" );
|
||||
m_upperBound.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField(&m_useCategorySelection, "CategorySelection", false, "Category Selection", "", "", "");
|
||||
m_upperBound.uiCapability()->setUiEditorTypeName(caf::PdmUiDoubleSliderEditor::uiEditorTypeName());
|
||||
CAF_PDM_InitField( &m_useCategorySelection, "CategorySelection", false, "Category Selection", "", "", "" );
|
||||
m_upperBound.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
// HEADLESS HACK
|
||||
if (RiaGuiApplication::isRunning())
|
||||
if ( RiaGuiApplication::isRunning() )
|
||||
{
|
||||
updateIconState();
|
||||
}
|
||||
@@ -120,7 +120,7 @@ RimEclipseResultDefinition* RimEclipsePropertyFilter::resultDefinition() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::rangeValues(double* lower, double* upper) const
|
||||
void RimEclipsePropertyFilter::rangeValues( double* lower, double* upper ) const
|
||||
{
|
||||
*lower = this->m_lowerBound;
|
||||
*upper = this->m_upperBound;
|
||||
@@ -131,7 +131,7 @@ void RimEclipsePropertyFilter::rangeValues(double* lower, double* upper) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipsePropertyFilter::isCategorySelectionActive() const
|
||||
{
|
||||
if (m_resultDefinition->hasCategoryResult() && m_useCategorySelection)
|
||||
if ( m_resultDefinition->hasCategoryResult() && m_useCategorySelection )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -142,9 +142,9 @@ bool RimEclipsePropertyFilter::isCategorySelectionActive() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue)
|
||||
void RimEclipsePropertyFilter::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
// clang-format off
|
||||
if ( &m_lowerBound == changedField
|
||||
@@ -172,7 +172,7 @@ void RimEclipsePropertyFilter::fieldChangedByUi(const caf::PdmFieldHandle* chang
|
||||
RimEclipsePropertyFilterCollection* RimEclipsePropertyFilter::parentContainer()
|
||||
{
|
||||
RimEclipsePropertyFilterCollection* propFilterColl = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(propFilterColl);
|
||||
this->firstAncestorOrThisOfTypeAsserted( propFilterColl );
|
||||
|
||||
return propFilterColl;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ RimEclipsePropertyFilterCollection* RimEclipsePropertyFilter::parentContainer()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::setToDefaultValues()
|
||||
{
|
||||
CVF_ASSERT(parentContainer());
|
||||
CVF_ASSERT( parentContainer() );
|
||||
|
||||
computeResultValueRange();
|
||||
|
||||
@@ -196,38 +196,38 @@ void RimEclipsePropertyFilter::setToDefaultValues()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
|
||||
void RimEclipsePropertyFilter::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
||||
{
|
||||
// Fields declared in RimCellFilter
|
||||
uiOrdering.add(&name);
|
||||
uiOrdering.add( &name );
|
||||
|
||||
// Fields declared in Rimm_resultDefinition
|
||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup("Result");
|
||||
m_resultDefinition->uiOrdering(uiConfigName, *group1);
|
||||
caf::PdmUiGroup* group1 = uiOrdering.addNewGroup( "Result" );
|
||||
m_resultDefinition->uiOrdering( uiConfigName, *group1 );
|
||||
|
||||
caf::PdmUiGroup& group2 = *(uiOrdering.addNewGroup("Filter Settings"));
|
||||
caf::PdmUiGroup& group2 = *( uiOrdering.addNewGroup( "Filter Settings" ) );
|
||||
|
||||
// Fields declared in RimCellFilter
|
||||
group2.add(&filterMode);
|
||||
group2.add( &filterMode );
|
||||
|
||||
group2.add(&m_rangeLabelText);
|
||||
group2.add( &m_rangeLabelText );
|
||||
|
||||
if (m_resultDefinition->hasCategoryResult())
|
||||
if ( m_resultDefinition->hasCategoryResult() )
|
||||
{
|
||||
group2.add(&m_useCategorySelection);
|
||||
group2.add( &m_useCategorySelection );
|
||||
}
|
||||
|
||||
if (m_resultDefinition->hasCategoryResult() && m_useCategorySelection())
|
||||
if ( m_resultDefinition->hasCategoryResult() && m_useCategorySelection() )
|
||||
{
|
||||
group2.add(&m_selectedCategoryValues);
|
||||
group2.add( &m_selectedCategoryValues );
|
||||
}
|
||||
else
|
||||
{
|
||||
group2.add(&m_lowerBound);
|
||||
group2.add(&m_upperBound);
|
||||
group2.add( &m_lowerBound );
|
||||
group2.add( &m_upperBound );
|
||||
}
|
||||
|
||||
uiOrdering.skipRemainingFields(true);
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
|
||||
updateReadOnlyStateOfAllFields();
|
||||
updateRangeLabel();
|
||||
@@ -236,9 +236,9 @@ void RimEclipsePropertyFilter::defineUiOrdering(QString uiConfigName, caf::PdmUi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName)
|
||||
void RimEclipsePropertyFilter::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName )
|
||||
{
|
||||
PdmObject::defineUiTreeOrdering(uiTreeOrdering, uiConfigName);
|
||||
PdmObject::defineUiTreeOrdering( uiTreeOrdering, uiConfigName );
|
||||
|
||||
updateActiveState();
|
||||
}
|
||||
@@ -251,18 +251,18 @@ void RimEclipsePropertyFilter::updateReadOnlyStateOfAllFields()
|
||||
bool readOnlyState = isPropertyFilterControlled();
|
||||
|
||||
std::vector<caf::PdmFieldHandle*> objFields;
|
||||
this->fields(objFields);
|
||||
this->fields( objFields );
|
||||
|
||||
// Include fields declared in Rimm_resultDefinition
|
||||
objFields.push_back(&(m_resultDefinition->m_resultTypeUiField));
|
||||
objFields.push_back(&(m_resultDefinition->m_porosityModelUiField));
|
||||
objFields.push_back(&(m_resultDefinition->m_resultVariableUiField));
|
||||
objFields.push_back( &( m_resultDefinition->m_resultTypeUiField ) );
|
||||
objFields.push_back( &( m_resultDefinition->m_porosityModelUiField ) );
|
||||
objFields.push_back( &( m_resultDefinition->m_resultVariableUiField ) );
|
||||
|
||||
for (auto f : objFields)
|
||||
for ( auto f : objFields )
|
||||
{
|
||||
if (f == &m_rangeLabelText) continue;
|
||||
if ( f == &m_rangeLabelText ) continue;
|
||||
|
||||
f->uiCapability()->setUiReadOnly(readOnlyState);
|
||||
f->uiCapability()->setUiReadOnly( readOnlyState );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ void RimEclipsePropertyFilter::updateReadOnlyStateOfAllFields()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::updateRangeLabel()
|
||||
{
|
||||
if (m_resultDefinition->isFlowDiagOrInjectionFlooding())
|
||||
if ( m_resultDefinition->isFlowDiagOrInjectionFlooding() )
|
||||
{
|
||||
m_rangeLabelText = "Current Timestep";
|
||||
}
|
||||
@@ -287,12 +287,12 @@ void RimEclipsePropertyFilter::updateRangeLabel()
|
||||
bool RimEclipsePropertyFilter::isPropertyFilterControlled()
|
||||
{
|
||||
Rim3dView* rimView = nullptr;
|
||||
firstAncestorOrThisOfTypeAsserted(rimView);
|
||||
firstAncestorOrThisOfTypeAsserted( rimView );
|
||||
|
||||
bool isPropertyFilterControlled = false;
|
||||
|
||||
RimViewController* vc = rimView->viewController();
|
||||
if (vc && vc->isPropertyFilterOveridden())
|
||||
if ( vc && vc->isPropertyFilterOveridden() )
|
||||
{
|
||||
isPropertyFilterControlled = true;
|
||||
}
|
||||
@@ -303,25 +303,25 @@ bool RimEclipsePropertyFilter::isPropertyFilterControlled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::setCategoriesFromTracerNames(const std::vector<QString>& tracerNames)
|
||||
void RimEclipsePropertyFilter::setCategoriesFromTracerNames( const std::vector<QString>& tracerNames )
|
||||
{
|
||||
std::vector<std::pair<QString, int>> tracerNameValuesSorted;
|
||||
|
||||
{
|
||||
std::set<std::pair<QString, int>> tracerNameSet;
|
||||
|
||||
for (size_t i = 0; i < tracerNames.size(); i++)
|
||||
for ( size_t i = 0; i < tracerNames.size(); i++ )
|
||||
{
|
||||
tracerNameSet.insert(std::make_pair(tracerNames[i], static_cast<int>(i)));
|
||||
tracerNameSet.insert( std::make_pair( tracerNames[i], static_cast<int>( i ) ) );
|
||||
}
|
||||
|
||||
for (const auto& it : tracerNameSet)
|
||||
for ( const auto& it : tracerNameSet )
|
||||
{
|
||||
tracerNameValuesSorted.push_back(it);
|
||||
tracerNameValuesSorted.push_back( it );
|
||||
}
|
||||
}
|
||||
|
||||
setCategoryNamesAndValues(tracerNameValuesSorted);
|
||||
setCategoryNamesAndValues( tracerNameValuesSorted );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -329,25 +329,25 @@ void RimEclipsePropertyFilter::setCategoriesFromTracerNames(const std::vector<QS
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::updateActiveState()
|
||||
{
|
||||
isActive.uiCapability()->setUiReadOnly(isPropertyFilterControlled());
|
||||
isActive.uiCapability()->setUiReadOnly( isPropertyFilterControlled() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::defineEditorAttribute(const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute)
|
||||
void RimEclipsePropertyFilter::defineEditorAttribute( const caf::PdmFieldHandle* field,
|
||||
QString uiConfigName,
|
||||
caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
if (m_minimumResultValue == cvf::UNDEFINED_DOUBLE || m_maximumResultValue == cvf::UNDEFINED_DOUBLE)
|
||||
if ( m_minimumResultValue == cvf::UNDEFINED_DOUBLE || m_maximumResultValue == cvf::UNDEFINED_DOUBLE )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (field == &m_lowerBound || field == &m_upperBound)
|
||||
if ( field == &m_lowerBound || field == &m_upperBound )
|
||||
{
|
||||
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>(attribute);
|
||||
if (!myAttr)
|
||||
caf::PdmUiDoubleSliderEditorAttribute* myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute );
|
||||
if ( !myAttr )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -362,48 +362,49 @@ void RimEclipsePropertyFilter::defineEditorAttribute(const caf::PdmFieldHandle*
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
{
|
||||
CVF_ASSERT(parentContainer());
|
||||
CVF_ASSERT( parentContainer() );
|
||||
|
||||
double min = HUGE_VAL;
|
||||
double max = -HUGE_VAL;
|
||||
|
||||
clearCategories();
|
||||
|
||||
if (m_resultDefinition->isFlowDiagOrInjectionFlooding())
|
||||
if ( m_resultDefinition->isFlowDiagOrInjectionFlooding() )
|
||||
{
|
||||
Rim3dView* view;
|
||||
this->firstAncestorOrThisOfType(view);
|
||||
this->firstAncestorOrThisOfType( view );
|
||||
|
||||
int timeStep = 0;
|
||||
if (view) timeStep = view->currentTimeStep();
|
||||
if ( view ) timeStep = view->currentTimeStep();
|
||||
RigFlowDiagResultAddress resAddr = m_resultDefinition->flowDiagResAddress();
|
||||
if (m_resultDefinition->flowDiagSolution())
|
||||
if ( m_resultDefinition->flowDiagSolution() )
|
||||
{
|
||||
RigFlowDiagResults* results = m_resultDefinition->flowDiagSolution()->flowDiagResults();
|
||||
results->minMaxScalarValues(resAddr, timeStep, &min, &max);
|
||||
results->minMaxScalarValues( resAddr, timeStep, &min, &max );
|
||||
|
||||
if (m_resultDefinition->hasCategoryResult())
|
||||
if ( m_resultDefinition->hasCategoryResult() )
|
||||
{
|
||||
setCategoriesFromTracerNames(m_resultDefinition->flowDiagSolution()->tracerNames());
|
||||
setCategoriesFromTracerNames( m_resultDefinition->flowDiagSolution()->tracerNames() );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
RigEclipseResultAddress scalarIndex = m_resultDefinition->eclipseResultAddress();
|
||||
if (scalarIndex.isValid())
|
||||
if ( scalarIndex.isValid() )
|
||||
{
|
||||
RigCaseCellResultsData* results = m_resultDefinition->currentGridCellResults();
|
||||
if (results)
|
||||
if ( results )
|
||||
{
|
||||
results->minMaxCellScalarValues(scalarIndex, min, max);
|
||||
results->minMaxCellScalarValues( scalarIndex, min, max );
|
||||
|
||||
if (m_resultDefinition->hasCategoryResult())
|
||||
if ( m_resultDefinition->hasCategoryResult() )
|
||||
{
|
||||
if (m_resultDefinition->resultType() == RiaDefines::FORMATION_NAMES)
|
||||
if ( m_resultDefinition->resultType() == RiaDefines::FORMATION_NAMES )
|
||||
{
|
||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData());
|
||||
CVF_ASSERT(parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames());
|
||||
CVF_ASSERT( parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData() );
|
||||
CVF_ASSERT(
|
||||
parentContainer()->reservoirView()->eclipseCase()->eclipseCaseData()->activeFormationNames() );
|
||||
|
||||
const std::vector<QString>& fnVector = parentContainer()
|
||||
->reservoirView()
|
||||
@@ -411,23 +412,25 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
->eclipseCaseData()
|
||||
->activeFormationNames()
|
||||
->formationNames();
|
||||
setCategoryNames(fnVector);
|
||||
setCategoryNames( fnVector );
|
||||
}
|
||||
else if (m_resultDefinition->resultVariable() == RiaDefines::completionTypeResultName())
|
||||
else if ( m_resultDefinition->resultVariable() == RiaDefines::completionTypeResultName() )
|
||||
{
|
||||
std::vector<RiaDefines::WellPathComponentType> componentTypes = {
|
||||
RiaDefines::WELL_PATH, RiaDefines::PERFORATION_INTERVAL, RiaDefines::FISHBONES, RiaDefines::FRACTURE};
|
||||
std::vector<std::pair<QString, int>> ctNamesAndValues;
|
||||
for (RiaDefines::WellPathComponentType type : componentTypes)
|
||||
std::vector<RiaDefines::WellPathComponentType> componentTypes = {RiaDefines::WELL_PATH,
|
||||
RiaDefines::PERFORATION_INTERVAL,
|
||||
RiaDefines::FISHBONES,
|
||||
RiaDefines::FRACTURE};
|
||||
std::vector<std::pair<QString, int>> ctNamesAndValues;
|
||||
for ( RiaDefines::WellPathComponentType type : componentTypes )
|
||||
{
|
||||
ctNamesAndValues.push_back(
|
||||
std::make_pair(caf::AppEnum<RiaDefines::WellPathComponentType>::uiText(type), type));
|
||||
std::make_pair( caf::AppEnum<RiaDefines::WellPathComponentType>::uiText( type ), type ) );
|
||||
}
|
||||
setCategoryNamesAndValues(ctNamesAndValues);
|
||||
setCategoryNamesAndValues( ctNamesAndValues );
|
||||
}
|
||||
else
|
||||
{
|
||||
setCategoryValues(results->uniqueCellScalarValues(scalarIndex));
|
||||
setCategoryValues( results->uniqueCellScalarValues( scalarIndex ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -436,8 +439,8 @@ void RimEclipsePropertyFilter::computeResultValueRange()
|
||||
m_maximumResultValue = max;
|
||||
m_minimumResultValue = min;
|
||||
|
||||
m_lowerBound.uiCapability()->setUiName(QString("Min (%1)").arg(min));
|
||||
m_upperBound.uiCapability()->setUiName(QString("Max (%1)").arg(max));
|
||||
m_lowerBound.uiCapability()->setUiName( QString( "Min (%1)" ).arg( min ) );
|
||||
m_upperBound.uiCapability()->setUiName( QString( "Max (%1)" ).arg( max ) );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -452,20 +455,20 @@ void RimEclipsePropertyFilter::updateFromCurrentTimeStep()
|
||||
//
|
||||
// If the user manually has set a filter value, this value is left untouched
|
||||
|
||||
if (!m_resultDefinition->isFlowDiagOrInjectionFlooding())
|
||||
if ( !m_resultDefinition->isFlowDiagOrInjectionFlooding() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
double threshold = 1e-6;
|
||||
bool followMin = false;
|
||||
if (fabs(m_lowerBound - m_minimumResultValue) < threshold || m_minimumResultValue == HUGE_VAL)
|
||||
if ( fabs( m_lowerBound - m_minimumResultValue ) < threshold || m_minimumResultValue == HUGE_VAL )
|
||||
{
|
||||
followMin = true;
|
||||
}
|
||||
|
||||
bool followMax = false;
|
||||
if (fabs(m_upperBound - m_maximumResultValue) < threshold || m_maximumResultValue == -HUGE_VAL)
|
||||
if ( fabs( m_upperBound - m_maximumResultValue ) < threshold || m_maximumResultValue == -HUGE_VAL )
|
||||
{
|
||||
followMax = true;
|
||||
}
|
||||
@@ -476,43 +479,43 @@ void RimEclipsePropertyFilter::updateFromCurrentTimeStep()
|
||||
clearCategories();
|
||||
|
||||
Rim3dView* view = nullptr;
|
||||
this->firstAncestorOrThisOfTypeAsserted(view);
|
||||
this->firstAncestorOrThisOfTypeAsserted( view );
|
||||
|
||||
int timeStep = view->currentTimeStep();
|
||||
RigFlowDiagResultAddress resAddr = m_resultDefinition->flowDiagResAddress();
|
||||
if (m_resultDefinition->flowDiagSolution())
|
||||
if ( m_resultDefinition->flowDiagSolution() )
|
||||
{
|
||||
RigFlowDiagResults* results = m_resultDefinition->flowDiagSolution()->flowDiagResults();
|
||||
results->minMaxScalarValues(resAddr, timeStep, &min, &max);
|
||||
results->minMaxScalarValues( resAddr, timeStep, &min, &max );
|
||||
|
||||
if (m_resultDefinition->hasCategoryResult())
|
||||
if ( m_resultDefinition->hasCategoryResult() )
|
||||
{
|
||||
setCategoriesFromTracerNames(m_resultDefinition->flowDiagSolution()->tracerNames());
|
||||
setCategoriesFromTracerNames( m_resultDefinition->flowDiagSolution()->tracerNames() );
|
||||
}
|
||||
}
|
||||
|
||||
if (min == HUGE_VAL && max == -HUGE_VAL)
|
||||
if ( min == HUGE_VAL && max == -HUGE_VAL )
|
||||
{
|
||||
m_lowerBound.uiCapability()->setUiName(QString("Min (inf)"));
|
||||
m_upperBound.uiCapability()->setUiName(QString("Max (inf)"));
|
||||
m_lowerBound.uiCapability()->setUiName( QString( "Min (inf)" ) );
|
||||
m_upperBound.uiCapability()->setUiName( QString( "Max (inf)" ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_maximumResultValue = max;
|
||||
m_minimumResultValue = min;
|
||||
|
||||
if (followMin)
|
||||
if ( followMin )
|
||||
{
|
||||
m_lowerBound = min;
|
||||
}
|
||||
|
||||
if (followMax)
|
||||
if ( followMax )
|
||||
{
|
||||
m_upperBound = m_maximumResultValue;
|
||||
}
|
||||
|
||||
m_lowerBound.uiCapability()->setUiName(QString("Min (%1)").arg(min));
|
||||
m_upperBound.uiCapability()->setUiName(QString("Max (%1)").arg(max));
|
||||
m_lowerBound.uiCapability()->setUiName( QString( "Min (%1)" ).arg( min ) );
|
||||
m_upperBound.uiCapability()->setUiName( QString( "Max (%1)" ).arg( max ) );
|
||||
}
|
||||
|
||||
m_lowerBound.uiCapability()->updateConnectedEditors();
|
||||
@@ -529,26 +532,26 @@ void RimEclipsePropertyFilter::updateFilterName()
|
||||
{
|
||||
QString newFiltername = m_resultDefinition->resultVariableUiShortName();
|
||||
|
||||
if (isCategorySelectionActive())
|
||||
if ( isCategorySelectionActive() )
|
||||
{
|
||||
if (m_categoryNames.empty())
|
||||
if ( m_categoryNames.empty() )
|
||||
{
|
||||
newFiltername += " (";
|
||||
|
||||
if (!m_selectedCategoryValues().empty() && m_selectedCategoryValues().size() == m_categoryValues.size())
|
||||
if ( !m_selectedCategoryValues().empty() && m_selectedCategoryValues().size() == m_categoryValues.size() )
|
||||
{
|
||||
newFiltername += QString::number(m_selectedCategoryValues()[0]);
|
||||
newFiltername += QString::number( m_selectedCategoryValues()[0] );
|
||||
newFiltername += "..";
|
||||
newFiltername += QString::number(m_selectedCategoryValues()[m_selectedCategoryValues().size() - 1]);
|
||||
newFiltername += QString::number( m_selectedCategoryValues()[m_selectedCategoryValues().size() - 1] );
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < m_selectedCategoryValues().size(); i++)
|
||||
for ( size_t i = 0; i < m_selectedCategoryValues().size(); i++ )
|
||||
{
|
||||
int val = m_selectedCategoryValues()[i];
|
||||
newFiltername += QString::number(val);
|
||||
newFiltername += QString::number( val );
|
||||
|
||||
if (i < m_selectedCategoryValues().size() - 1)
|
||||
if ( i < m_selectedCategoryValues().size() - 1 )
|
||||
{
|
||||
newFiltername += ", ";
|
||||
}
|
||||
@@ -560,7 +563,7 @@ void RimEclipsePropertyFilter::updateFilterName()
|
||||
}
|
||||
else
|
||||
{
|
||||
newFiltername += " (" + QString::number(m_lowerBound) + " .. " + QString::number(m_upperBound) + ")";
|
||||
newFiltername += " (" + QString::number( m_lowerBound ) + " .. " + QString::number( m_upperBound ) + ")";
|
||||
}
|
||||
|
||||
this->name = newFiltername;
|
||||
@@ -573,7 +576,7 @@ void RimEclipsePropertyFilter::initAfterRead()
|
||||
{
|
||||
m_resultDefinition->initAfterRead();
|
||||
|
||||
m_resultDefinition->setEclipseCase(parentContainer()->reservoirView()->eclipseCase());
|
||||
m_resultDefinition->setEclipseCase( parentContainer()->reservoirView()->eclipseCase() );
|
||||
updateIconState();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user