///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2020 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaSummaryCurveDefinition.h" #include "RimPlot.h" #include "cafPdmPtrField.h" #include class RiuSummaryQwtPlot; class RiuGroupedBarChartBuilder; class RimAnalysisPlotDataEntry; class RimCurveDefinitionAnalyser; class RimPlotAxisPropertiesInterface; class RimPlotAxisProperties; //================================================================================================== /// /// //================================================================================================== class RimAnalysisPlot : public RimPlot { CAF_PDM_HEADER_INIT; public: RimAnalysisPlot(); ~RimAnalysisPlot() override; void updateCaseNameHasChanged(); public: // Internal. Public needed for AppEnum setup enum BarOrientation { BARS_HORIZONTAL, BARS_VERTICAL }; enum SortGroupType { NONE, SUMMARY_ITEM, QUANTITY, CASE, ENSEMBLE, VALUE, ABS_VALUE, OTHER_VALUE, ABS_OTHER_VALUE, TIME_STEP, }; typedef caf::AppEnum SortGroupAppEnum; private: // Overridden PDM methods void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; caf::PdmFieldHandle* userDescriptionField() override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; // RimViewWindow overrides QWidget* viewWidget() override; void deleteViewWidget() override; void onLoadDataAndUpdate() override; void zoomAll() override {} QImage snapshotWindowContent() override; bool applyFontSize( RiaDefines::FontSettingType fontSettingType, int oldFontSize, int fontSize, bool forceChange = false ) override; // RimPlotWindow overrides QString description() const override; void doUpdateLayout() override {} // RimPlot Overrides RiuQwtPlotWidget* doCreatePlotViewWidget( QWidget* mainWindowParent = nullptr ) override; RiuQwtPlotWidget* viewer() override; void detachAllCurves() override; void reattachAllCurves() override {} void doRemoveFromCollection() override {} void updateAxes() override; void onAxisSelected( int axis, bool toggle ) override; void updateZoomInQwt() override {} void updateZoomFromQwt() override {} void setAutoScaleXEnabled( bool enabled ) override {} void setAutoScaleYEnabled( bool enabled ) override {} void updateLegend() override{}; QString asciiDataForPlotExport() const override { return ""; } caf::PdmObject* findPdmObjectFromQwtCurve( const QwtPlotCurve* curve ) const override { return nullptr; } // Private methods void cleanupBeforeClose(); void addDataToChartBuilder( RiuGroupedBarChartBuilder& chartBuilder ); void updatePlotTitle(); std::vector curveDefinitions(); std::set allPlotAxes() const; void buildTestPlot( RiuGroupedBarChartBuilder& chartBuilder ); private: std::unique_ptr m_analyserOfSelectedCurveDefs; QPointer m_plotWidget; // Fields caf::PdmField m_selectedVarsUiField; caf::PdmField m_selectVariablesButtonField; caf::PdmChildArrayField m_data; caf::PdmField m_addTimestepUiField; caf::PdmField> m_selectedTimeSteps; caf::PdmPtrField m_referenceCase; caf::PdmField m_showPlotTitle; caf::PdmField m_useAutoPlotTitle; caf::PdmField m_description; caf::PdmField> m_barOrientation; caf::PdmField m_majorGroupType; caf::PdmField m_mediumGroupType; caf::PdmField m_minorGroupType; caf::PdmField m_valueSortOperation; caf::PdmField m_useTopBarsFilter; caf::PdmField m_maxBarCount; caf::PdmField m_sortGroupForLegend; caf::PdmField m_useBarText; caf::PdmField m_useCaseInBarText; caf::PdmField m_useEnsembleInBarText; caf::PdmField m_useSummaryItemInBarText; caf::PdmField m_useTimeStepInBarText; caf::PdmField m_useQuantityInBarText; caf::PdmChildField m_valueAxisProperties; };