///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2019- 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 "RimAbstractPlotCollection.h" #include "RimPlotAxisPropertiesInterface.h" #include "RimPlotWindow.h" #include "RiuMultiPlotBook.h" #include "cafAppEnum.h" #include "cafPdmChildArrayField.h" #include "cafPdmChildField.h" #include "cafPdmField.h" #include "cafPdmFieldHandle.h" #include "cafPdmObject.h" #include #include #include class RimPlot; class RimMultiPlot : public RimPlotWindow, public RimTypedPlotCollection { CAF_PDM_HEADER_INIT; public: using ColumnCount = RiuMultiPlotBook::ColumnCount; using ColumnCountEnum = caf::AppEnum; enum RowCount { ROWS_1 = 1, ROWS_2 = 2, ROWS_3 = 3, ROWS_4 = 4, }; using RowCountEnum = caf::AppEnum; public: RimMultiPlot(); ~RimMultiPlot() override; RimMultiPlot& operator=( RimMultiPlot&& rhs ); QWidget* viewWidget() override; QString description() const override; bool isMultiPlotTitleVisible() const; void setMultiPlotTitleVisible( bool visible ); QString multiPlotTitle() const; void setMultiPlotTitle( const QString& title ); void insertPlot( RimPlot* plot, size_t index ) override; void removePlot( RimPlot* plot ) override; void movePlotsToThis( const std::vector& plots, int insertAtPosition ); size_t plotCount() const override; size_t plotIndex( const RimPlot* plot ) const; std::vector plots() const override; std::vector visiblePlots() const; void updatePlotOrderFromGridWidget(); void setAutoScaleXEnabled( bool enabled ); void setAutoScaleYEnabled( bool enabled ); int columnCount() const override; int rowsPerPage() const; caf::PdmFieldHandle* columnCountField(); caf::PdmFieldHandle* rowsPerPageField(); caf::PdmFieldHandle* pagePreviewField(); bool showPlotTitles() const; void zoomAll() override; QString asciiDataForPlotExport() const; bool previewModeEnabled() const; int subTitleFontSize() const; int axisTitleFontSize() const; int axisValueFontSize() const; protected: QImage snapshotWindowContent() override; QWidget* createViewWidget( QWidget* mainWindowParent ) override; void deleteViewWidget() override; caf::PdmFieldHandle* userDescriptionField() override; 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; void uiOrderingForMultiPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ); QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; void onLoadDataAndUpdate() override; void initAfterRead() override; void applyPlotWindowTitleToWidgets(); void updatePlots(); void updateZoom(); void recreatePlotWidgets(); private: void cleanupBeforeClose(); void doUpdateLayout() override; void updateSubPlotNames(); void updatePlotWindowTitle(); void doRenderWindowContent( QPaintDevice* paintDevice ) override; void onPlotAdditionOrRemoval(); void onPlotsReordered( const caf::SignalEmitter* emitter ); void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector& referringObjects ) override; protected: caf::PdmField m_showPlotWindowTitle; caf::PdmField m_plotWindowTitle; caf::PdmField m_columnCount; caf::PdmField m_rowsPerPage; caf::PdmField m_showIndividualPlotTitles; caf::PdmField m_subTitleFontSize; caf::PdmField m_axisTitleFontSize; caf::PdmField m_axisValueFontSize; caf::PdmField m_pagePreviewMode; caf::PdmField m_majorTickmarkCount; friend class RiuMultiPlotBook; QPointer m_viewer; private: caf::PdmChildArrayField m_plots; };