ResInsight/ApplicationCode/ProjectDataModel/RimWellLogPlot.h

147 lines
5.7 KiB
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2015- Statoil ASA
// Copyright (C) 2015- Ceetron Solutions AS
2019-09-06 06:17:36 -05: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 06:17:36 -05: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 06:17:36 -05:00
//
// 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"
2019-10-10 06:33:57 -05:00
#include "cafPdmFieldHandle.h"
#include "cafPdmObject.h"
#include "RiaDefines.h"
2019-11-15 06:35:39 -06:00
#include "RimMultiPlotWindow.h"
2018-08-07 06:34:13 -05:00
#include "RimWellLogPlotNameConfig.h"
#include <QPointer>
#include <set>
class RimWellLogCurveCommonDataSource;
2019-12-19 04:37:40 -06:00
class RiuMultiPlotPage;
class RimPlotWindow;
class QKeyEvent;
//==================================================================================================
2019-09-06 06:17:36 -05:00
///
///
//==================================================================================================
2019-11-15 06:35:39 -06:00
class RimWellLogPlot : public RimMultiPlotWindow, public RimNameConfigHolderInterface
{
CAF_PDM_HEADER_INIT;
public:
2019-09-06 06:17:36 -05:00
enum AxisGridVisibility
{
AXIS_GRID_NONE = 0x00,
AXIS_GRID_MAJOR = 0x01,
AXIS_GRID_MINOR = 0x02,
AXIS_GRID_MAJOR_AND_MINOR = 0x03
2019-09-06 06:17:36 -05:00
};
2016-07-05 03:47:03 -05:00
typedef caf::AppEnum<AxisGridVisibility> AxisGridEnum;
using DepthTypeEnum = RiaDefines::DepthTypeEnum;
public:
RimWellLogPlot();
~RimWellLogPlot() override;
QWidget* createPlotWidget( QWidget* mainWindowParent = nullptr );
RimWellLogPlot& operator=( RimWellLogPlot&& rhs );
2019-09-06 06:17:36 -05:00
DepthTypeEnum depthType() const;
void setDepthType( DepthTypeEnum depthType );
2019-09-06 06:17:36 -05:00
RiaDefines::DepthUnitType depthUnit() const;
void setDepthUnit( RiaDefines::DepthUnitType depthUnit );
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 );
2019-09-06 06:17:36 -05:00
void calculateAvailableDepthRange();
void availableDepthRange( double* minimumDepth, double* maximumDepth ) const;
void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const;
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QString createAutoName() const override;
RimWellLogPlotNameConfig* nameConfig() const;
2019-09-06 06:17:36 -05:00
RimWellLogCurveCommonDataSource* commonDataSource() const;
void updateCommonDataSource();
void setCommonDataSourceEnabled( bool enable );
void setAvailableDepthUnits( const std::set<RiaDefines::DepthUnitType>& depthUnits );
void setAvailableDepthTypes( const std::set<DepthTypeEnum>& depthTypes );
void onPlotAdditionOrRemoval() override;
void handleKeyPressEvent( QKeyEvent* keyEvent );
protected:
QWidget* createViewWidget( QWidget* mainWindowParent ) override;
void performAutoNameUpdate() override;
// Overridden PDM methods
2019-09-06 06:17:36 -05: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 14:01:17 -05:00
2019-09-06 06:17:36 -05:00
void initAfterRead() override;
2019-10-10 06:33:57 -05:00
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
private:
void updateSubPlotNames() override;
void updatePlotWindowTitle() override;
2019-11-27 04:44:56 -06:00
void doSetAutoScaleYEnabled( bool enabled ) override;
protected:
2019-09-06 06:17:36 -05:00
caf::PdmChildField<RimWellLogCurveCommonDataSource*> m_commonDataSource;
bool m_commonDataSourceEnabled;
2019-09-06 06:17:36 -05: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;
std::set<RiaDefines::DepthUnitType> m_availableDepthUnits;
std::set<DepthTypeEnum> m_availableDepthTypes;
double m_minAvailableDepth;
double m_maxAvailableDepth;
};