Knotholder C++ification
Hi all,
in rev. 18775 I committed some changes to C++ify the knotholder-related classes (this was made necessary by my LPE-integration work). Basically, I just rewrapped the existing functions as methods of the new classes KnotHolder, KnotHolderEntity etc. Although the changes were quite straightforward, there is a chance that some code got lost in the process, so please watch out for any regressions!!
The main change to be aware of when writing new knotholder code is perhaps that each knotholder entity (which among other things encapsulates a visual on-canvas handle) should now derive from the "general" KnotHolderEntity class and override the virtual functions knot_(get|set|click) which are responsible for the actions taken when the associated handle's position is read/set or when the handle is clicked.
Similarly, each item-specific knotholder class (like RectKnotHolder) now derives from the general KnotHolder class, and in its constructor the necessary KnotHolderEntities for all required handles are created. Note that a KnotHolderEntity must currently be explicitly created using the create() method (i.e., this does not happen in the constructor).[1]
I'd welcome any comments because although it works well, it still seems slightly awkward to have a new class for each knotholder entity and each knotholder. Did I miss anything and is there a more elegant way to organize things or is this indeed the way to go?
More on my other and yet-to-be-committed work in a separate email. Cheers, Max
P.S.: Known issue: LPE PointParams are currently broken and they cannot be edited on-canvas. I hope to get this fixed very soon and then the cumbersome edit-on-vanas button will disappear, too. :)
[1] I know that there used to be a good reason for this but it may be the case that due to some later refactoring it's not necessary any more to have it this way. In any case, I left it for now because it slightly declutters the declarations of the derived classes. Please tell me if you want it changed.
participants (1)
-
Maximilian Albert