Hi all,
it may seem to be a stupid question, but I can't find answer anywhere...
How can I get SPItem from Inkscape::XML::Node? (or create group object and get xml node from that - I need both)
I'm hacking on automatically grouping objects when setting clip/mask (as mentioned in another thread) and I need to create new group, so mask can be applied to the group instead of selected objects. Currently, I know how to create the svg:g XML element, move other objects into it and where to pass reference to the group to do what I want, but it needs to be a reference to SPItem and not Inkcape::XML::Node.
Is there any documentation for object tree and xml tree and how do they interact?
Thanks.
Best regards, Martin Sucha
2010/2/2 Martin Sucha <martin.sucha-ml@...2313...>:
Hi all,
it may seem to be a stupid question, but I can't find answer anywhere...
How can I get SPItem from Inkscape::XML::Node? (or create group object and get xml node from that - I need both)
Use SPDocument::getObjectByRepr and cast the result to SPItem.
There is some Doxygen documentation for the XML tree, but the SP tree is mostly undocumented. Run Doxygen in the toplevel source directory to create the documentation. It should appear in doc/html; open the file doc/html/index.html to access it.
Note that directly modifying the XML is somewhat wrong. I think we should make the XML representation private to SPObjects. However, this is a long term goal. If there's no way to do what you want using only SP tree methods, it's OK to operate on XML nodes for now.
Regards, Krzysztof
participants (2)
-
Krzysztof Kosiński
-
Martin Sucha