mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3103 Set axis tick intervals based on track width: more ticks for wide tracks.
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
|
||||
#define RI_LOGPLOTTRACK_MINX_DEFAULT -10.0
|
||||
#define RI_LOGPLOTTRACK_MAXX_DEFAULT 100.0
|
||||
|
||||
#define RI_LOGPLOTTRACK_MINOR_TICK_DEFAULT
|
||||
|
||||
CAF_PDM_SOURCE_INIT(RimWellLogTrack, "WellLogPlotTrack");
|
||||
|
||||
@@ -239,7 +239,8 @@ void RimWellLogTrack::fieldChangedByUi(const caf::PdmFieldHandle* changedField,
|
||||
else if (changedField == &m_widthScaleFactor)
|
||||
{
|
||||
updateParentPlotLayout();
|
||||
|
||||
updateAxisAndGridTickIntervals();
|
||||
m_wellLogTrackPlotWidget->replot();
|
||||
}
|
||||
else if (changedField == &m_visibleXRangeMin || changedField == &m_visibleXRangeMax)
|
||||
{
|
||||
@@ -381,6 +382,43 @@ void RimWellLogTrack::updateParentPlotLayout()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogTrack::updateAxisAndGridTickIntervals()
|
||||
{
|
||||
if (!m_wellLogTrackPlotWidget) return;
|
||||
|
||||
int xMajorTickIntervals = 3;
|
||||
int xMinorTickIntervals = 0;
|
||||
switch (m_widthScaleFactor())
|
||||
{
|
||||
case EXTRA_NARROW_TRACK:
|
||||
xMajorTickIntervals = 3;
|
||||
xMinorTickIntervals = 2;
|
||||
break;
|
||||
case NARROW_TRACK:
|
||||
xMajorTickIntervals = 3;
|
||||
xMinorTickIntervals = 5;
|
||||
break;
|
||||
case NORMAL_TRACK:
|
||||
xMajorTickIntervals = 5;
|
||||
xMinorTickIntervals = 5;
|
||||
break;
|
||||
case WIDE_TRACK:
|
||||
xMajorTickIntervals = 5;
|
||||
xMinorTickIntervals = 10;
|
||||
break;
|
||||
case EXTRA_WIDE_TRACK:
|
||||
xMajorTickIntervals = 10;
|
||||
xMinorTickIntervals = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
m_wellLogTrackPlotWidget->setAxisMaxMajor(QwtPlot::xTop, xMajorTickIntervals);
|
||||
m_wellLogTrackPlotWidget->setAxisMaxMinor(QwtPlot::xTop, xMinorTickIntervals);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -581,6 +619,7 @@ void RimWellLogTrack::loadDataAndUpdate()
|
||||
if ( m_wellLogTrackPlotWidget )
|
||||
{
|
||||
m_wellLogTrackPlotWidget->updateLegend();
|
||||
this->updateAxisAndGridTickIntervals();
|
||||
this->updateAxisScaleEngine();
|
||||
this->updateFormationNamesOnPlot();
|
||||
this->applyXZoomFromVisibleRange();
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
enum TrajectoryType { WELL_PATH, SIMULATION_WELL };
|
||||
enum FormationSource { CASE, WELL_PICK_FILTER };
|
||||
enum WidthScaleFactor { EXTRA_NARROW_TRACK = 2, NARROW_TRACK = 3, NORMAL_TRACK = 4, WIDE_TRACK = 6, EXTRA_WIDE_TRACK = 8};
|
||||
enum WidthScaleFactor { EXTRA_NARROW_TRACK = 2, NARROW_TRACK = 3, NORMAL_TRACK = 4, WIDE_TRACK = 6, EXTRA_WIDE_TRACK = 10 };
|
||||
|
||||
void setDescription(const QString& description);
|
||||
bool isVisible();
|
||||
@@ -132,6 +132,7 @@ public:
|
||||
private:
|
||||
virtual void fieldChangedByUi(const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue) override;
|
||||
void updateParentPlotLayout();
|
||||
void updateAxisAndGridTickIntervals();
|
||||
virtual QList<caf::PdmOptionItemInfo> calculateValueOptions(const caf::PdmFieldHandle* fieldNeedingOptions, bool * useOptionsOnly) override;
|
||||
|
||||
virtual caf::PdmFieldHandle* objectToggleField() override;
|
||||
@@ -166,18 +167,17 @@ private:
|
||||
private:
|
||||
QString m_xAxisTitle;
|
||||
|
||||
caf::PdmField<bool> m_show;
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmChildArrayField<RimWellLogCurve*> curves;
|
||||
caf::PdmField<double> m_visibleXRangeMin;
|
||||
caf::PdmField<double> m_visibleXRangeMax;
|
||||
caf::PdmField<bool> m_isAutoScaleXEnabled;
|
||||
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
|
||||
|
||||
caf::PdmField<bool> m_show;
|
||||
caf::PdmField<QString> m_userName;
|
||||
caf::PdmChildArrayField<RimWellLogCurve*> curves;
|
||||
caf::PdmField<double> m_visibleXRangeMin;
|
||||
caf::PdmField<double> m_visibleXRangeMax;
|
||||
caf::PdmField<bool> m_isAutoScaleXEnabled;
|
||||
caf::PdmField<bool> m_isLogarithmicScaleEnabled;
|
||||
caf::PdmField<bool> m_showFormations;
|
||||
caf::PdmField<caf::AppEnum<FormationSource> > m_formationSource;
|
||||
caf::PdmField<caf::AppEnum<FormationSource>> m_formationSource;
|
||||
caf::PdmPtrField<RimCase*> m_formationCase;
|
||||
caf::PdmField<caf::AppEnum<TrajectoryType> > m_formationTrajectoryType;
|
||||
caf::PdmField<caf::AppEnum<TrajectoryType>> m_formationTrajectoryType;
|
||||
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceCase;
|
||||
caf::PdmPtrField<RimWellPath*> m_formationWellPathForSourceWellPath;
|
||||
caf::PdmField<QString> m_formationSimWellName;
|
||||
@@ -185,7 +185,7 @@ private:
|
||||
caf::PdmField<caf::AppEnum<RigWellPathFormations::FormationLevel>> m_formationLevel;
|
||||
caf::PdmField<bool> m_showformationFluids;
|
||||
caf::PdmField<caf::AppEnum<WidthScaleFactor>> m_widthScaleFactor;
|
||||
caf::PdmField<bool> m_formationBranchDetection;
|
||||
caf::PdmField<bool> m_formationBranchDetection;
|
||||
|
||||
bool m_formationsForCaseWithSimWellOnly;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user