(viz): clean layer initialisation
Description
Layer initialisation seems very hacky. The constructor has no parameters while the object needs many parameters to be set before being actually used. This is dangerous and very messy.
Proposal
Pass all mandatory arguments in the constructor. That might help to retaining values in member variables, for instance the number of peels of the transparency. That might also help to remove unnecessary getters and setters.
Outcomes
Clearer API, less error-prone.
Links / references
The idea of the refactor came from this discussion.
-
@fbridault started a discussion: (+3 comments) Could you please set the default number of peels to 4? This will not be coherent with the rest of the code (8) but I will create a dedicated ticket for this refactoring.