#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:
Jacob Støren
2018-03-08 11:20:27 +01:00
parent 00236c493e
commit c258528dc5
14 changed files with 1258 additions and 107 deletions

View File

@@ -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);
}

View File

@@ -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"