#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

@@ -38,6 +38,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimcWellPathCompletionSettings.h
${CMAKE_CURRENT_LIST_DIR}/RimcWellPathValve.h
${CMAKE_CURRENT_LIST_DIR}/RimcWellEventTimeline.h
${CMAKE_CURRENT_LIST_DIR}/RimcColorLegend.h
)
set(SOURCE_GROUP_SOURCE_FILES
@@ -80,6 +81,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimcWellPathCompletionSettings.cpp
${CMAKE_CURRENT_LIST_DIR}/RimcWellPathValve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimcWellEventTimeline.cpp
${CMAKE_CURRENT_LIST_DIR}/RimcColorLegend.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})