///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2015- Statoil ASA // Copyright (C) 2015- Ceetron Solutions AS // // 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 "cafPdmObject.h" #include "cafPdmField.h" #include "cafPdmChildArrayField.h" #include "cafAppEnum.h" #include "RiaDefines.h" #include "RimViewWindow.h" #include class RiuWellLogPlot; class RimWellLogTrack; //================================================================================================== /// /// //================================================================================================== class RimWellLogPlot : public RimViewWindow { CAF_PDM_HEADER_INIT; public: enum DepthTypeEnum { MEASURED_DEPTH, TRUE_VERTICAL_DEPTH, PSEUDO_LENGTH, CONNECTION_NUMBER }; public: RimWellLogPlot(); virtual ~RimWellLogPlot(); void setDescription(const QString& description); QString description() const; DepthTypeEnum depthType() const; void setDepthType(DepthTypeEnum depthType); RiaDefines::DepthUnitType depthUnit() const; void setDepthUnit(RiaDefines::DepthUnitType depthUnit); QString depthPlotTitle() const; bool isTrackLegendsVisible() const; void setTrackLegendsVisible(bool doShow); void addTrack(RimWellLogTrack* track); void insertTrack(RimWellLogTrack* track, size_t index); size_t trackCount() { return m_tracks.size();} void removeTrackByIndex(size_t index); void removeTrack(RimWellLogTrack* track); size_t trackIndex(RimWellLogTrack* track); void moveTracks(RimWellLogTrack* insertAfterTrack, const std::vector& tracksToMove); RimWellLogTrack* trackByIndex(size_t index); virtual void loadDataAndUpdate() override; void updateTracks(); void updateTrackNames(); void updateDepthZoom(); void setDepthZoomByFactorAndCenter(double zoomFactor, double zoomCenter); void panDepth(double panFactor); void setDepthZoomMinMax(double minimumDepth, double maximumDepth); void depthZoomMinMax(double* minimumDepth, double* maximumDepth) const; void calculateAvailableDepthRange(); void availableDepthRange(double* minimumDepth, double* maximumDepth) const; bool hasAvailableDepthRange() const; virtual void zoomAll() override; virtual QWidget* viewWidget() override; QString asciiDataForPlotExport() const; protected: // Overridden PDM methods virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue); virtual void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering); virtual caf::PdmFieldHandle* userDescriptionField() { return &m_userName; } virtual QList calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override; virtual QImage snapshotWindowContent() override; private: void applyZoomAllDepths(); void applyDepthZoomFromVisibleDepth(); void recreateTrackPlots(); void detachAllCurves(); void updateDisabledDepthTypes(); public: // Needed by RiuWellAllocation Plot // RimViewWindow overrides virtual QWidget* createViewWidget(QWidget* mainWindowParent) override; virtual void deleteViewWidget() override; private: caf::PdmField m_userName; caf::PdmField< caf::AppEnum< DepthTypeEnum > > m_depthType; caf::PdmField< caf::AppEnum< RiaDefines::DepthUnitType > > m_depthUnit; std::set m_disabledDepthTypes; caf::PdmChildArrayField m_tracks; caf::PdmField m_minVisibleDepth; caf::PdmField m_maxVisibleDepth; caf::PdmField m_isAutoScaleDepthEnabled; caf::PdmField m_showTrackLegends; double m_minAvailableDepth; double m_maxAvailableDepth; friend class RiuWellLogPlot; QPointer m_viewer; };