W dniu 16 stycznia 2012 13:14 użytkownik Maximilian Albert <maximilian.albert@...1439...> napisał:
Hi Krzysztof!
Thanks for the quick reply! What is the correct way to obtain the PathVector? (Or a list of PathVectorS in case multiple paths are being edited?) I presume I need to extract it from _multipath (in the node tool context), but this is a pointer to a MultiPathManipulator, and it looks like the path data in that class is not publicly accessable.
If you want to work with multiple paths, the simplest way might be to add the necessary code to MultiPathManipulator and/or PathManipulator, but that depends on what you want to do - writing public methods to access the node-based representation of a path might be better. If you supply more detail about what you want to do, I can offer some suggestions.
Also, is there a canonical way to find out which of the nodes I'm traversing are selected? From what I gather from the code it seems that the path data itself is conceptually separated from UI stuff like selected nodes. Do I need to check for each encountered node whether it occurs in _selected_nodes (e.g. by comparing the position) or is there a better way?
Use the selected() method (it's inherited from SelectableControlPoint).
Regards, Krzysztof