mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#51 Add background to standard legends. Needed a separate legend implementation, now in caf. Cleaned up CategoryLegend to make it ready for the new background.
This commit is contained in:
@@ -82,10 +82,10 @@
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafFrameAnimationControl.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafOverlayScalarMapperLegend.h"
|
||||
|
||||
#include "cvfDrawable.h"
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfScene.h"
|
||||
#include "cvfViewport.h"
|
||||
|
||||
@@ -55,9 +55,9 @@
|
||||
#include "cafFrameAnimationControl.h"
|
||||
#include "cafPdmUiTreeOrdering.h"
|
||||
#include "cafProgressInfo.h"
|
||||
#include "cafOverlayScalarMapperLegend.h"
|
||||
|
||||
#include "cvfModelBasicList.h"
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfScene.h"
|
||||
#include "cvfTransform.h"
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "cafCategoryLegend.h"
|
||||
#include "cafCategoryMapper.h"
|
||||
#include "cafOverlayScalarMapperLegend.h"
|
||||
|
||||
#include "cafFactory.h"
|
||||
#include "cafPdmFieldCvfColor.h"
|
||||
@@ -39,7 +40,6 @@
|
||||
#include "cafPdmUiComboBoxEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
#include "cvfScalarMapperContinuousLinear.h"
|
||||
#include "cvfScalarMapperContinuousLog.h"
|
||||
#include "cvfScalarMapperDiscreteLinear.h"
|
||||
@@ -143,7 +143,7 @@ RimLegendConfig::RimLegendConfig()
|
||||
m_categoryMapper = new caf::CategoryMapper;
|
||||
|
||||
cvf::Font* standardFont = RiaApplication::instance()->standardFont();
|
||||
m_scalarMapperLegend = new cvf::OverlayScalarMapperLegend(standardFont);
|
||||
m_scalarMapperLegend = new caf::OverlayScalarMapperLegend(standardFont);
|
||||
m_categoryLegend = new caf::CategoryLegend(standardFont, m_categoryMapper.p());
|
||||
|
||||
updateFieldVisibility();
|
||||
@@ -359,7 +359,7 @@ void RimLegendConfig::updateLegend()
|
||||
|
||||
// Using Fixed format
|
||||
NumberFormatType nft = m_tickNumberFormat();
|
||||
m_scalarMapperLegend->setTickFormat((cvf::OverlayScalarMapperLegend::NumberFormat)nft);
|
||||
m_scalarMapperLegend->setTickFormat((caf::OverlayScalarMapperLegend::NumberFormat)nft);
|
||||
|
||||
// Set the fixed number of digits after the decimal point to the number needed to show all the significant digits.
|
||||
int numDecimalDigits = m_precision();
|
||||
@@ -510,7 +510,7 @@ void RimLegendConfig::recreateLegend()
|
||||
// the legend disappeared because of this, so workaround: recreate the legend when needed:
|
||||
|
||||
cvf::Font* standardFont = RiaApplication::instance()->standardFont();
|
||||
m_scalarMapperLegend = new cvf::OverlayScalarMapperLegend(standardFont);
|
||||
m_scalarMapperLegend = new caf::OverlayScalarMapperLegend(standardFont);
|
||||
m_categoryLegend = new caf::CategoryLegend(standardFont, m_categoryMapper.p());
|
||||
|
||||
updateLegend();
|
||||
|
||||
@@ -33,7 +33,6 @@ namespace cvf
|
||||
class ScalarMapperContinuousLog;
|
||||
class ScalarMapperContinuousLinear;
|
||||
class OverlayItem;
|
||||
class OverlayScalarMapperLegend;
|
||||
class ScalarMapperDiscreteLinear;
|
||||
class ScalarMapperDiscreteLog;
|
||||
class ScalarMapper;
|
||||
@@ -44,6 +43,7 @@ namespace caf
|
||||
{
|
||||
class CategoryLegend;
|
||||
class CategoryMapper;
|
||||
class OverlayScalarMapperLegend;
|
||||
}
|
||||
|
||||
class Rim3dView;
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
cvf::ref<cvf::ScalarMapperContinuousLinear> m_linSmoothScalarMapper;
|
||||
cvf::ref<cvf::ScalarMapper> m_currentScalarMapper;
|
||||
|
||||
cvf::ref<cvf::OverlayScalarMapperLegend> m_scalarMapperLegend;
|
||||
cvf::ref<caf::OverlayScalarMapperLegend> m_scalarMapperLegend;
|
||||
|
||||
cvf::ref<caf::CategoryMapper> m_categoryMapper;
|
||||
cvf::ref<caf::CategoryLegend> m_categoryLegend;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "RiuViewerCommands.h"
|
||||
|
||||
#include "cafCategoryLegend.h"
|
||||
#include "cafOverlayScalarMapperLegend.h"
|
||||
#include "cafCeetronPlusNavigation.h"
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafEffectGenerator.h"
|
||||
@@ -49,7 +50,6 @@
|
||||
#include "cvfFont.h"
|
||||
#include "cvfOpenGLResourceManager.h"
|
||||
#include "cvfOverlayAxisCross.h"
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
#include "cvfRenderQueueSorter.h"
|
||||
#include "cvfRenderSequence.h"
|
||||
#include "cvfRendering.h"
|
||||
@@ -908,17 +908,17 @@ void RiuViewer::updateLegendTextAndTickMarkColor(cvf::OverlayItem* legend)
|
||||
|
||||
cvf::Color3f contrastColor = computeContrastColor();
|
||||
|
||||
cvf::OverlayScalarMapperLegend* scalarMapperLegend = dynamic_cast<cvf::OverlayScalarMapperLegend*>(legend);
|
||||
caf::OverlayScalarMapperLegend* scalarMapperLegend = dynamic_cast<caf::OverlayScalarMapperLegend*>(legend);
|
||||
if (scalarMapperLegend)
|
||||
{
|
||||
scalarMapperLegend->setColor(contrastColor);
|
||||
scalarMapperLegend->setTextColor(contrastColor);
|
||||
scalarMapperLegend->setLineColor(contrastColor);
|
||||
}
|
||||
|
||||
caf::CategoryLegend* categoryLegend = dynamic_cast<caf::CategoryLegend*>(legend);
|
||||
if (categoryLegend)
|
||||
{
|
||||
categoryLegend->setColor(contrastColor);
|
||||
categoryLegend->setTextColor(contrastColor);
|
||||
categoryLegend->setLineColor(contrastColor);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,11 +81,11 @@
|
||||
#include "cafDisplayCoordTransform.h"
|
||||
#include "cafPdmUiTreeView.h"
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafOverlayScalarMapperLegend.h"
|
||||
|
||||
#include "cvfDrawableGeo.h"
|
||||
#include "cvfHitItemCollection.h"
|
||||
#include "cvfOverlayAxisCross.h"
|
||||
#include "cvfOverlayScalarMapperLegend.h"
|
||||
#include "cvfPart.h"
|
||||
#include "cvfTransform.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user