mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-04 13:16:56 -06:00
#8822 Summary Axis: Add tick mark count to y-axis
This commit is contained in:
1 parent
b6f7dd931e
commit
853b4a26d5
20 files changed
+157
-38
No files matched your search
@@ -15,9 +15,13 @@
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimPlotAxisPropertiesInterface.h"
|
||||
|
||||
#include "RimSummaryMultiPlot.h"
|
||||
|
||||
#include "cafAppEnum.h"
|
||||
#include "cafPdmUiTreeAttributes.h"
|
||||
|
||||
CAF_PDM_XML_ABSTRACT_SOURCE_INIT( RimPlotAxisPropertiesInterface,
|
||||
"PlotAxisPropertiesInterface",
|
||||
@@ -68,3 +72,53 @@ bool RimPlotAxisPropertiesInterface::isLogarithmicScaleEnabled() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimPlotAxisPropertiesInterface::tickmarkCountFromEnum( LegendTickmarkCount count )
|
||||
{
|
||||
int maxTickmarkCount = 8;
|
||||
|
||||
switch ( count )
|
||||
{
|
||||
case LegendTickmarkCount::TICKMARK_VERY_FEW:
|
||||
maxTickmarkCount = 2;
|
||||
break;
|
||||
case LegendTickmarkCount::TICKMARK_FEW:
|
||||
maxTickmarkCount = 4;
|
||||
break;
|
||||
case LegendTickmarkCount::TICKMARK_DEFAULT:
|
||||
maxTickmarkCount = 8; // Taken from QwtPlot::initAxesData()
|
||||
break;
|
||||
case LegendTickmarkCount::TICKMARK_MANY:
|
||||
maxTickmarkCount = 10;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return maxTickmarkCount;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimPlotAxisPropertiesInterface::defineObjectEditorAttribute( QString uiConfigName, caf::PdmUiEditorAttribute* attribute )
|
||||
{
|
||||
RimSummaryMultiPlot* summaryMultiPlot = nullptr;
|
||||
firstAncestorOfType( summaryMultiPlot );
|
||||
|
||||
if ( summaryMultiPlot && summaryMultiPlot->isSubPlotAxesLinked() )
|
||||
{
|
||||
auto* treeItemAttribute = dynamic_cast<caf::PdmUiTreeViewItemAttribute*>( attribute );
|
||||
if ( treeItemAttribute )
|
||||
{
|
||||
treeItemAttribute->tags.clear();
|
||||
auto tag = caf::PdmUiTreeViewItemAttribute::Tag::create();
|
||||
tag->icon = caf::IconProvider( ":/chain.png" );
|
||||
|
||||
treeItemAttribute->tags.push_back( std::move( tag ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user