2017-10-11 12:48:35 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2017 Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-10-11 12:48:35 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2017-10-11 12:48:35 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2017-10-11 12:48:35 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "RifEclipseSummaryAddress.h"
|
|
|
|
|
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
#include "cafPdmChildField.h"
|
|
|
|
#include "cafPdmField.h"
|
|
|
|
#include "cafPdmObject.h"
|
|
|
|
#include "cafPdmPtrArrayField.h"
|
|
|
|
#include "cafPdmPtrField.h"
|
|
|
|
|
2017-10-23 04:41:16 -05:00
|
|
|
#include <functional>
|
2017-10-11 12:48:35 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#define OBSERVED_DATA_AVALUE_POSTFIX "_OBSDATA"
|
2017-10-11 12:48:35 -05:00
|
|
|
|
|
|
|
class RimSummaryCase;
|
2018-05-10 14:29:55 -05:00
|
|
|
class RimSummaryCaseCollection;
|
2017-10-11 12:48:35 -05:00
|
|
|
class RimSummaryCurveAutoName;
|
|
|
|
class RimSummaryPlot;
|
|
|
|
class RiaSummaryCurveDefinition;
|
2018-08-14 04:01:19 -05:00
|
|
|
class RiaCurveSetDefinition;
|
2017-10-24 03:05:11 -05:00
|
|
|
class SummaryIdentifierAndField;
|
2017-10-11 12:48:35 -05:00
|
|
|
|
2018-05-10 14:29:55 -05:00
|
|
|
using SummarySource = caf::PdmObject;
|
|
|
|
|
2017-10-11 12:48:35 -05:00
|
|
|
//==================================================================================================
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
|
|
|
///
|
2017-10-11 12:48:35 -05:00
|
|
|
//==================================================================================================
|
2020-02-18 07:10:10 -06:00
|
|
|
class RiuSummaryVectorSelectionUi : public caf::PdmObject
|
2017-10-11 12:48:35 -05:00
|
|
|
{
|
|
|
|
CAF_PDM_HEADER_INIT;
|
|
|
|
|
|
|
|
public:
|
2020-02-18 07:10:10 -06:00
|
|
|
RiuSummaryVectorSelectionUi();
|
|
|
|
~RiuSummaryVectorSelectionUi() override;
|
2017-10-11 12:48:35 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
void setSelectedCurveDefinitions( const std::vector<RiaSummaryCurveDefinition>& curveDefinitions );
|
2019-09-06 03:40:57 -05:00
|
|
|
std::vector<RiaSummaryCurveDefinition> allCurveDefinitionsFromSelection() const;
|
|
|
|
std::vector<RiaCurveSetDefinition> allCurveSetDefinitionsFromSelections() const;
|
|
|
|
std::vector<RiaSummaryCurveDefinition> selection() const;
|
2018-05-15 06:56:25 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setMultiSelectionMode( bool multiSelectionMode );
|
|
|
|
void hideEnsembles( bool hide );
|
|
|
|
void hideSummaryCases( bool hide );
|
2020-03-03 02:49:54 -06:00
|
|
|
void enableIndividualEnsembleCaseSelection( bool enable );
|
|
|
|
|
2021-06-09 09:25:19 -05:00
|
|
|
void hideDifferenceVectors( bool hide );
|
|
|
|
void hideHistoryVectors( bool hide );
|
|
|
|
void hideVectorsWithoutHistory( bool hide );
|
2023-02-26 01:08:06 -06:00
|
|
|
void hideCalculationIncompatibleCategories( bool hide );
|
2021-06-09 09:25:19 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setFieldChangedHandler( const std::function<void()>& handlerFunc );
|
2017-10-11 12:48:35 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
void setDefaultSelection( const std::vector<SummarySource*>& defaultCases );
|
2017-12-04 07:36:17 -06:00
|
|
|
|
2021-12-23 02:30:36 -06:00
|
|
|
static QList<caf::PdmOptionItemInfo>
|
|
|
|
optionsForSummaryDataSource( bool hideSummaryCases, bool hideEnsembles, bool showIndividualEnsembleCases );
|
|
|
|
|
2017-10-11 12:48:35 -05:00
|
|
|
private:
|
2023-02-26 03:48:40 -06:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
2022-05-29 06:01:27 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
2019-09-06 03:40:57 -05:00
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
2023-02-26 03:48:40 -06:00
|
|
|
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
std::set<RifEclipseSummaryAddress> findPossibleSummaryAddresses( const std::vector<SummarySource*>& selectedSources,
|
|
|
|
const SummaryIdentifierAndField* identifierAndField ) const;
|
|
|
|
std::set<RifEclipseSummaryAddress> findPossibleSummaryAddressesFromSelectedCases( const SummaryIdentifierAndField* identifierAndField ) const;
|
2019-09-09 05:52:23 -05:00
|
|
|
std::set<RifEclipseSummaryAddress>
|
2023-02-26 01:08:06 -06:00
|
|
|
findPossibleSummaryAddressesFromSelectedObservedData( const SummaryIdentifierAndField* identifierAndField ) const;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2023-02-26 03:48:40 -06:00
|
|
|
std::vector<SummaryIdentifierAndField*> buildControllingFieldList( const SummaryIdentifierAndField* identifierAndField ) const;
|
|
|
|
SummaryIdentifierAndField* lookupIdentifierAndFieldFromFieldHandle( const caf::PdmFieldHandle* pdmFieldHandle ) const;
|
|
|
|
SummaryIdentifierAndField* lookupControllingField( const SummaryIdentifierAndField* dependentField ) const;
|
|
|
|
bool isAddressCompatibleWithControllingFieldSelection( const RifEclipseSummaryAddress& address,
|
|
|
|
const std::vector<SummaryIdentifierAndField*>& identifierAndFieldList ) const;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
std::set<RifEclipseSummaryAddress> buildAddressListFromSelections() const;
|
2023-02-26 03:48:40 -06:00
|
|
|
void buildAddressListForCategoryRecursively( RifEclipseSummaryAddress::SummaryVarCategory category,
|
|
|
|
std::vector<SummaryIdentifierAndField*>::const_iterator identifierAndFieldItr,
|
|
|
|
std::vector<std::pair<RifEclipseSummaryAddress::SummaryIdentifierType, QString>>& identifierPath,
|
|
|
|
std::set<RifEclipseSummaryAddress>& addressSet ) const;
|
2019-09-06 03:40:57 -05:00
|
|
|
|
|
|
|
void resetAllFields();
|
|
|
|
bool isObservedData( const RimSummaryCase* sumCase ) const;
|
|
|
|
|
|
|
|
std::vector<SummarySource*> selectedSummarySources() const;
|
|
|
|
static RimSummaryCase* calculatedSummaryCase();
|
2017-10-18 01:20:21 -05:00
|
|
|
|
2019-09-09 05:52:23 -05:00
|
|
|
void appendOptionItemsForSources( QList<caf::PdmOptionItemInfo>& options ) const;
|
|
|
|
void appendOptionItemsForCategories( QList<caf::PdmOptionItemInfo>& options ) const;
|
|
|
|
void appendOptionItemsForSubCategoriesAndVectors( QList<caf::PdmOptionItemInfo>& options,
|
|
|
|
SummaryIdentifierAndField* identifierAndField ) const;
|
|
|
|
|
2017-10-11 12:48:35 -05:00
|
|
|
private:
|
2019-09-06 03:40:57 -05:00
|
|
|
caf::PdmPtrArrayField<SummarySource*> m_selectedSources;
|
|
|
|
|
|
|
|
caf::PdmField<std::vector<caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>>> m_selectedSummaryCategories;
|
|
|
|
caf::PdmField<caf::AppEnum<RifEclipseSummaryAddress::SummaryVarCategory>> m_currentSummaryCategory;
|
|
|
|
|
|
|
|
std::map<RifEclipseSummaryAddress::SummaryVarCategory, std::vector<SummaryIdentifierAndField*>> m_identifierFieldsMap;
|
2017-10-11 12:48:35 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool m_multiSelectionMode;
|
2017-10-23 04:41:16 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool m_hideEnsembles;
|
|
|
|
bool m_hideSummaryCases;
|
2020-03-03 02:49:54 -06:00
|
|
|
bool m_showIndividualEnsembleCases;
|
2017-10-23 04:41:16 -05:00
|
|
|
|
2021-06-09 09:25:19 -05:00
|
|
|
bool m_hideHistoryVectors;
|
|
|
|
bool m_hideVectorsWithoutHistory;
|
|
|
|
bool m_hideDifferenceVectors;
|
|
|
|
|
2023-02-26 01:08:06 -06:00
|
|
|
bool m_hideCalculationIncompatibleCategories;
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::function<void()> m_toggleChangedHandler;
|
2018-09-11 06:09:34 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
size_t m_prevCurveCount;
|
|
|
|
size_t m_prevCurveSetCount;
|
2017-10-11 12:48:35 -05:00
|
|
|
};
|