#13806 Python: Add color legend scripting API

Expose RimColorLegendCollection and RimColorLegend to Python via
CAF_PDM_OBJECT_METHOD entries that let callers create a legend, append
category items with a hex-string color, bind a legend to a (case,
resultName) pair and delete that binding.

Scriptable fields on RimColorLegend and RimColorLegendItem make the
created objects inspectable from Python.

The (case, resultName) binding interface in RimColorLegendCollection,
RimRegularLegendConfig and RimEclipseCellColors now takes a const RimCase*
instead of a case id, matching the caller patterns and avoiding ambiguity
when multiple cases share an id domain.
This commit is contained in:
Magne Sjaastad committed 2026-04-20 18:55:36 +02:00
1 parent 75c1cedaec
commit cf62f07224
13 files changed
+323 -39

No files matched your search

@@ -373,10 +373,7 @@ void RimIntersectionResultDefinition::setDefaultEclipseLegendConfig()
auto eclResultDef = eclipseResultDefinition();
eclResultDef->updateRangesForExplicitLegends( regularLegendConfig(), ternaryLegendConfig(), timeStep() );
m_legendConfig->setDefaultConfigForResultName( m_case->caseId(),
m_eclipseResultDefinition->resultVariable(),
useDiscreteLogLevels,
isCategoryResult );
m_legendConfig->setDefaultConfigForResultName( m_case, m_eclipseResultDefinition->resultVariable(), useDiscreteLogLevels, isCategoryResult );
}
//--------------------------------------------------------------------------------------------------