Files
ResInsight/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryAddressSelector.h
T
Magne Sjaastad a8ac98ce06 Replace PdmUiPushButtonEditor fields with dynamic buttons
Replace boolean push button fields used as UI triggers with dynamic buttons
added via addNewButton in defineUiOrdering, removing unnecessary field
boilerplate across multiple classes.
2026-03-31 09:16:52 +02:00

89 lines
3.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2023 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>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaDateTimeDefines.h"
#include "RifEclipseSummaryAddress.h"
#include "RifEclipseSummaryAddressQMetaType.h"
#include "RimPlotAxisProperties.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "cafPdmProxyValueField.h"
#include "cafPdmPtrField.h"
class RimSummaryCase;
class RimSummaryEnsemble;
class RimSummaryAddress;
class RimPlotAxisPropertiesInterface;
class RimSummaryAddressSelector : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
caf::Signal<> addressChanged;
public:
RimSummaryAddressSelector();
void setSummaryCase( RimSummaryCase* summaryCase );
void setEnsemble( RimSummaryEnsemble* ensemble );
void setAddress( const RifEclipseSummaryAddress& address );
void setResamplingPeriod( RiaDefines::DateTimePeriodEnum resampling );
void setPlotAxisProperties( RimPlotAxisPropertiesInterface* plotAxisProperties );
void setAxisOrientation( RimPlotAxisProperties::Orientation orientation );
void setShowDataSource( bool enable );
void setShowResampling( bool enable );
void setShowAxis( bool enable );
RimSummaryCase* summaryCase() const;
RimSummaryEnsemble* ensemble() const;
RifEclipseSummaryAddress summaryAddress() const;
RiaDefines::DateTimePeriodEnum resamplingPeriod() const;
RimPlotAxisPropertiesInterface* plotAxisProperties() const;
private:
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
bool isEnsemble() const;
void onSummaryAddressButtonClicked();
private:
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
caf::PdmPtrField<RimSummaryEnsemble*> m_summaryCaseCollection;
caf::PdmChildField<RimSummaryAddress*> m_summaryAddress;
caf::PdmProxyValueField<RifEclipseSummaryAddress> m_summaryAddressUiField;
caf::PdmPtrField<RimPlotAxisPropertiesInterface*> m_plotAxisProperties;
caf::PdmField<RiaDefines::DateTimePeriodEnum> m_resamplingPeriod;
bool m_showDataSource;
bool m_showResampling;
bool m_showAxis;
RimPlotAxisProperties::Orientation m_plotAxisOrientation;
};