ResInsight/ApplicationCode/ProjectDataModel/RimWellLogPlot.h

178 lines
8.5 KiB
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafAppEnum.h"
#include "cafPdmChildArrayField.h"
#include "cafPdmChildField.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "RiaDefines.h"
#include "RimViewWindow.h"
2018-08-07 06:34:13 -05:00
#include "RimWellLogPlotNameConfig.h"
#include <QPointer>
#include <set>
class RimWellLogCurveCommonDataSource;
class RiuWellLogPlot;
class RimWellLogTrack;
class QKeyEvent;
//==================================================================================================
///
///
//==================================================================================================
2018-08-07 06:34:13 -05:00
class RimWellLogPlot : public RimViewWindow, public RimNameConfigHolderInterface
{
CAF_PDM_HEADER_INIT;
public:
enum DepthTypeEnum
{
MEASURED_DEPTH,
TRUE_VERTICAL_DEPTH,
PSEUDO_LENGTH,
CONNECTION_NUMBER
};
enum AxisGridVisibility { AXIS_GRID_NONE, AXIS_GRID_MAJOR, AXIS_GRID_MAJOR_AND_MINOR };
2016-07-05 03:47:03 -05:00
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
public:
RimWellLogPlot();
~RimWellLogPlot() override;
RimWellLogPlot& operator=(RimWellLogPlot&& rhs);
QWidget* createPlotWidget();
QWidget* viewWidget() override;
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;
void enableDepthGridLines(AxisGridVisibility gridVisibility);
AxisGridVisibility depthGridLinesVisibility() const;
bool isPlotTitleVisible() const;
void setPlotTitleVisible(bool visible);
bool areTrackLegendsVisible() const;
void setTrackLegendsVisible(bool doShow);
bool areTrackLegendsHorizontal() const;
void setTrackLegendsHorizontal(bool horizontal);
void addTrack(RimWellLogTrack* track);
void insertTrack(RimWellLogTrack* track, size_t index);
size_t trackCount() const { return m_tracks.size();}
void removeTrack(RimWellLogTrack* track);
2018-07-06 02:17:16 -05:00
size_t trackIndex(const RimWellLogTrack* track) const;
RimWellLogTrack* trackByIndex(size_t index) const;
2018-07-06 02:17:16 -05:00
size_t firstVisibleTrackIndex() const;
2019-08-20 08:09:13 -05:00
std::vector<RimWellLogTrack*> tracks() const;
void updateTracks(bool autoScaleXAxis = false);
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;
void zoomAll() override;
void setDepthAutoZoom(bool on);
void enableAllAutoNameTags(bool enable);
2016-07-05 03:47:03 -05:00
QString asciiDataForPlotExport() const;
void uiOrderingForDepthAxis(caf::PdmUiOrdering& uiOrdering);
void uiOrderingForPlotSettings(caf::PdmUiOrdering& uiOrdering);
QString createAutoName() const override;
void handleKeyPressEvent(QKeyEvent* keyEvent);
RimWellLogCurveCommonDataSource* commonDataSource() const;
protected:
3d Cross Plot: First implementation (#4127) * First cross plot commit * Made cross plot deal with "all time steps" and categorise curves based on time step * Support STATIC vs DYNAMIC plotting * #4115 Avoid updating plots in RimEclipseCase::computeCachedData() * Make sure loading of Cross plot from file works * Show Legend in Cross Plot * Uncheck / Check curves to disable/enable * Axis titles and checkable data set * Name config and setting of common plot look * Fix category indentation in GeoMech results * Support name configuration for Grid Cross Plot * Support adding new curve sets * Improve colors and symbols with better cycling * Moved GridCrossPlot files to sub directory in ProjectDataModel and Commands * #4111 3D calculations : Always show difference options * Whitespace * #4111 Move resultDefinition field to private * Whitespace * #4087 Ensemble : When importing and ensemble, show by default an ensemble plot * #4085 3D view: Improve overlay item colors * #4106 Crash on Linux Temporary workaround to avoid crash * #4106 Stop trying to do recursive setting tab order widget * The double pointer was handled wrongly and shift-tab order isn't working anyway. * #4114 Regression Test : Remove cached pointer to eclipse case * Revert "#4114 Regression Test : Remove cached pointer to eclipse case" This reverts commit f2146c600705280c85391f88a861a070812ae83a. * #4114 Regression Test : Missing data for flow diag property filter * #4085 3D view: Add check box for version info text * Whtespace * Improve labelling of static results * Fix update of result property when changing type
2019-02-21 05:52:23 -06:00
void performAutoNameUpdate() override;
// Overridden PDM methods
void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
void defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering) override;
caf::PdmFieldHandle* userDescriptionField() override;
QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly) override;
void onLoadDataAndUpdate() override;
QImage snapshotWindowContent() override;
QWidget* createViewWidget(QWidget* mainWindowParent) override;
void deleteViewWidget() override;
2016-06-27 14:01:17 -05:00
void initAfterRead() override;
private:
void applyZoomAllDepths();
void applyDepthZoomFromVisibleDepth();
void recreateTrackPlots();
void detachAllCurves();
virtual std::set<RiaDefines::DepthUnitType> availableDepthUnits() const;
virtual std::set<RimWellLogPlot::DepthTypeEnum> availableDepthTypes() const;
void updatePlotTitle();
virtual void onDepthTypeChanged();
protected:
2018-08-07 06:34:13 -05:00
caf::PdmField<QString> m_userName_OBSOLETE;
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
caf::PdmChildArrayField<RimWellLogTrack*> m_tracks;
caf::PdmField< caf::AppEnum<DepthTypeEnum>> m_depthType;
caf::PdmField< caf::AppEnum<RiaDefines::DepthUnitType>> m_depthUnit;
caf::PdmField<double> m_minVisibleDepth;
caf::PdmField<double> m_maxVisibleDepth;
caf::PdmField<AxisGridEnum> m_depthAxisGridVisibility;
caf::PdmField<bool> m_isAutoScaleDepthEnabled;
caf::PdmField<bool> m_showTitleInPlot;
caf::PdmField<bool> m_showTrackLegends;
caf::PdmField<bool> m_trackLegendsHorizontal;
2018-08-07 06:34:13 -05:00
caf::PdmChildField<RimWellLogPlotNameConfig*> m_nameConfig;
double m_minAvailableDepth;
double m_maxAvailableDepth;
friend class RiuWellLogPlot;
QPointer<RiuWellLogPlot> m_viewer;
};