In the developing widgets documentation under the widget states section it is stated that:
Finally, other sub-states can be created via state.addField({ name, initialValue }). This allows to store data not restricted to the mixin list, but these are not passed to representations for rendering. They allow for more complex widget states.
However when testing with the vtkPolyLineRepresentation adding the substate via addField
does result in representation reading the state.
For example below code changes the line thickness.
...
.addField({ name: "lineThickness", initialValue: 0.1 })
.build();
And vtkPolyLineRepresentation does use passed in state to get the line thickness.
outData[0].getPoints().modified();
outData[0].modified();
const lineThickness = state.getLineThickness?.() ?? model.lineThickness;
applyLineThickness(lineThickness);
};
Is this expected behaviour or am i misreading the documentation? And can i realy on this to work in the future?