2015-08-26 12:27:29 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
//
|
|
|
|
|
// Copyright (C) 2015- Statoil ASA
|
|
|
|
|
// Copyright (C) 2015- Ceetron Solutions AS
|
2019-09-06 13:17:36 +02:00
|
|
|
//
|
2015-08-26 12:27:29 +02:00
|
|
|
// 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.
|
2019-09-06 13:17:36 +02:00
|
|
|
//
|
2015-08-26 12:27:29 +02:00
|
|
|
// 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.
|
2019-09-06 13:17:36 +02:00
|
|
|
//
|
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2015-08-26 12:27:29 +02:00
|
|
|
// for more details.
|
|
|
|
|
//
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-09-10 15:29:50 +02:00
|
|
|
#include "cafAppEnum.h"
|
2018-07-10 12:44:58 +02:00
|
|
|
#include "cafPdmChildArrayField.h"
|
|
|
|
|
#include "cafPdmChildField.h"
|
|
|
|
|
#include "cafPdmField.h"
|
2019-10-10 13:33:57 +02:00
|
|
|
#include "cafPdmFieldHandle.h"
|
2018-07-10 12:44:58 +02:00
|
|
|
#include "cafPdmObject.h"
|
2015-08-27 16:13:49 +02:00
|
|
|
|
2017-06-13 15:41:52 +02:00
|
|
|
#include "RiaDefines.h"
|
2019-11-15 13:35:39 +01:00
|
|
|
#include "RimMultiPlotWindow.h"
|
2018-08-07 13:34:13 +02:00
|
|
|
#include "RimWellLogPlotNameConfig.h"
|
2016-05-24 10:37:10 +02:00
|
|
|
|
2017-01-20 16:25:05 +01:00
|
|
|
#include <QPointer>
|
|
|
|
|
|
2019-09-04 15:51:44 +02:00
|
|
|
#include <set>
|
|
|
|
|
|
2018-07-10 12:44:58 +02:00
|
|
|
class RimWellLogCurveCommonDataSource;
|
2019-12-19 11:37:40 +01:00
|
|
|
class RiuMultiPlotPage;
|
2019-11-15 10:12:19 +01:00
|
|
|
class RimPlotWindow;
|
2018-09-05 11:04:42 +02:00
|
|
|
class QKeyEvent;
|
2015-08-26 12:27:29 +02:00
|
|
|
|
|
|
|
|
//==================================================================================================
|
2019-09-06 13:17:36 +02:00
|
|
|
///
|
|
|
|
|
///
|
2015-08-26 12:27:29 +02:00
|
|
|
//==================================================================================================
|
2019-11-15 13:35:39 +01:00
|
|
|
class RimWellLogPlot : public RimMultiPlotWindow, public RimNameConfigHolderInterface
|
2015-08-26 12:27:29 +02:00
|
|
|
{
|
|
|
|
|
CAF_PDM_HEADER_INIT;
|
2015-09-10 15:29:50 +02:00
|
|
|
|
|
|
|
|
public:
|
2019-09-06 13:17:36 +02:00
|
|
|
enum AxisGridVisibility
|
|
|
|
|
{
|
2019-10-25 10:53:12 +02:00
|
|
|
AXIS_GRID_NONE = 0x00,
|
|
|
|
|
AXIS_GRID_MAJOR = 0x01,
|
|
|
|
|
AXIS_GRID_MINOR = 0x02,
|
|
|
|
|
AXIS_GRID_MAJOR_AND_MINOR = 0x03
|
2019-09-06 13:17:36 +02:00
|
|
|
};
|
2016-07-05 10:47:03 +02:00
|
|
|
|
2018-07-06 11:22:18 +02:00
|
|
|
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
|
2019-11-19 13:19:56 +01:00
|
|
|
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
|
2017-02-09 13:30:36 +01:00
|
|
|
|
2015-08-26 12:27:29 +02:00
|
|
|
public:
|
2015-08-27 16:13:49 +02:00
|
|
|
RimWellLogPlot();
|
2018-10-18 19:45:57 +02:00
|
|
|
~RimWellLogPlot() override;
|
2015-08-27 16:13:49 +02:00
|
|
|
|
2019-10-11 15:54:19 +02:00
|
|
|
QWidget* createPlotWidget( QWidget* mainWindowParent = nullptr );
|
2019-09-04 15:51:44 +02:00
|
|
|
|
2019-10-11 15:54:19 +02:00
|
|
|
RimWellLogPlot& operator=( RimWellLogPlot&& rhs );
|
2018-07-03 12:54:51 +02:00
|
|
|
|
2019-09-06 13:17:36 +02:00
|
|
|
DepthTypeEnum depthType() const;
|
|
|
|
|
void setDepthType( DepthTypeEnum depthType );
|
2015-09-04 16:45:09 +02:00
|
|
|
|
2019-09-06 13:17:36 +02:00
|
|
|
RiaDefines::DepthUnitType depthUnit() const;
|
|
|
|
|
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
|
2015-12-02 15:07:12 +01:00
|
|
|
|
2019-10-11 15:54:19 +02:00
|
|
|
QString depthAxisTitle() const;
|
|
|
|
|
void enableDepthAxisGridLines( AxisGridVisibility gridVisibility );
|
|
|
|
|
AxisGridVisibility depthAxisGridLinesEnabled() const;
|
|
|
|
|
|
|
|
|
|
void updateZoom() override;
|
|
|
|
|
void setDepthAxisRangeByFactorAndCenter( double zoomFactor, double zoomCenter );
|
|
|
|
|
void setDepthAxisRangeByPanDepth( double panFactor );
|
|
|
|
|
void setDepthAxisRange( double minimumDepth, double maximumDepth );
|
2015-09-01 14:50:26 +02:00
|
|
|
|
2019-09-06 13:17:36 +02:00
|
|
|
void calculateAvailableDepthRange();
|
|
|
|
|
void availableDepthRange( double* minimumDepth, double* maximumDepth ) const;
|
2019-11-27 11:22:34 +01:00
|
|
|
void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const;
|
2015-09-16 12:56:48 +02:00
|
|
|
|
2019-11-15 10:12:19 +01:00
|
|
|
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
|
|
|
|
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
2017-03-09 14:27:41 +01:00
|
|
|
|
2019-11-25 12:40:51 +01:00
|
|
|
QString createAutoName() const override;
|
|
|
|
|
RimWellLogPlotNameConfig* nameConfig() const;
|
2017-11-03 13:22:51 +01:00
|
|
|
|
2019-09-06 13:17:36 +02:00
|
|
|
RimWellLogCurveCommonDataSource* commonDataSource() const;
|
2019-09-25 11:59:31 +02:00
|
|
|
void updateCommonDataSource();
|
2019-10-18 14:23:16 +02:00
|
|
|
void setCommonDataSourceEnabled( bool enable );
|
2018-07-16 08:56:28 +02:00
|
|
|
|
2019-09-09 11:00:11 +02:00
|
|
|
void setAvailableDepthUnits( const std::set<RiaDefines::DepthUnitType>& depthUnits );
|
2019-11-19 13:19:56 +01:00
|
|
|
void setAvailableDepthTypes( const std::set<DepthTypeEnum>& depthTypes );
|
2019-10-11 15:54:19 +02:00
|
|
|
|
|
|
|
|
void onPlotAdditionOrRemoval() override;
|
2019-09-09 11:00:11 +02:00
|
|
|
|
2019-11-15 10:12:19 +01:00
|
|
|
void handleKeyPressEvent( QKeyEvent* keyEvent );
|
2019-10-24 14:01:16 +02:00
|
|
|
|
2015-08-27 16:13:49 +02:00
|
|
|
protected:
|
2019-11-13 11:44:54 +01:00
|
|
|
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
|
|
|
|
|
void performAutoNameUpdate() override;
|
2015-08-27 16:13:49 +02:00
|
|
|
|
|
|
|
|
// Overridden PDM methods
|
2019-09-06 13:17:36 +02:00
|
|
|
void fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
|
const QVariant& oldValue,
|
|
|
|
|
const QVariant& newValue ) override;
|
|
|
|
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
|
|
|
|
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
|
|
|
|
|
bool* useOptionsOnly ) override;
|
2016-06-27 21:01:17 +02:00
|
|
|
|
2019-09-06 13:17:36 +02:00
|
|
|
void initAfterRead() override;
|
2019-10-10 13:33:57 +02:00
|
|
|
void defineEditorAttribute( const caf::PdmFieldHandle* field,
|
|
|
|
|
QString uiConfigName,
|
|
|
|
|
caf::PdmUiEditorAttribute* attribute ) override;
|
2018-07-10 12:44:58 +02:00
|
|
|
|
2019-11-26 08:45:17 +01:00
|
|
|
private:
|
|
|
|
|
void updateSubPlotNames() override;
|
|
|
|
|
void updatePlotWindowTitle() override;
|
2019-11-27 11:44:56 +01:00
|
|
|
void doSetAutoScaleYEnabled( bool enabled ) override;
|
2019-11-26 08:45:17 +01:00
|
|
|
|
2019-09-04 15:51:44 +02:00
|
|
|
protected:
|
2019-09-06 13:17:36 +02:00
|
|
|
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
|
2019-10-18 14:23:16 +02:00
|
|
|
bool m_commonDataSourceEnabled;
|
2019-09-06 13:17:36 +02:00
|
|
|
|
|
|
|
|
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::PdmChildField<RimWellLogPlotNameConfig*> m_nameConfig;
|
2015-12-02 13:39:16 +01:00
|
|
|
|
2019-11-19 13:19:56 +01:00
|
|
|
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
|
|
|
|
|
std::set<DepthTypeEnum> m_availableDepthTypes;
|
2019-09-09 11:00:11 +02:00
|
|
|
|
2018-07-06 11:22:18 +02:00
|
|
|
double m_minAvailableDepth;
|
|
|
|
|
double m_maxAvailableDepth;
|
2015-08-26 12:27:29 +02:00
|
|
|
};
|