Re: [Inkscape-devel] RDF nodes
I don't seem to get what you mean by "values" and "building blocks"? Is it necessary to create a class just holding a key and a value? Wouldn't a std::map suffice?
1) The SPObject class exposes a method "connectModified" which you can use to register a sigc::slot with the modification signal. This should work I hope. Or look at "src/ui/dialog/document-metadata.cpp". Inside this file there's a method called "on_repr_attr_changed": /** * Called when XML node attribute changed; updates dialog widgets. */ I don't know why this does not work currently.
2) Sorry? When the xml tree is modified, the corresponding SPObject is automatically informed, I don't think you have to do anything there yourself. When you want to update the xml node after you made a change to an SPObject, just call the modified SPObject's updateRepr method.
3) Yes, I think so. The SPObject will stay, not as a struct but as a real class ;) . For the moment you'll have to get into creating a derived GObject "class". There is an example in sp-skeleton.cpp. I'm just waiting for the 0.49 release to propose for merging, as I made some big changes to the code base with probably some nasty bugs.
-----Ursprüngliche Nachricht----- Von: inkscape-devel-request@lists.sourceforge.net [mailto:inkscape-devel-request@lists.sourceforge.net] Gesendet: Mittwoch, 31. Juli 2013 14:59 An: inkscape-devel@lists.sourceforge.net Betreff: Inkscape-devel Digest, Vol 86, Issue 47
Send Inkscape-devel mailing list submissions to inkscape-devel@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/inkscape-devel or, via email, send a message with subject or body 'help' to inkscape-devel-request@lists.sourceforge.net
You can reach the person managing the list at inkscape-devel-owner@lists.sourceforge.net
When replying, please edit your Subject line so it is more specific than "Re: Contents of Inkscape-devel digest..."
Today's Topics:
1. Re: [CAD] Next steps, a trivia question and discussion of the semantics for what objects a connector should avoid (Sebastian G?tte) 2. Re: [Tracing] Report #6 (Vin?cius dos Santos Oliveira) 3. GObject object instantiation problem (Sebastian G?tte) 4. Re: GObject object instantiation problem (Jon Cruz) 5. Re: GObject object instantiation problem (Sebastian G?tte) 6. Re: GObject object instantiation problem (Tavmjong Bah) 7. Re: RDF nodes (Christoffer Holmstedt)
----------------------------------------------------------------------
Message: 1 Date: Tue, 30 Jul 2013 21:20:42 +0200 From: Sebastian G?tte <jaseg@...2974...> Subject: Re: [Inkscape-devel] [CAD] Next steps, a trivia question and discussion of the semantics for what objects a connector should avoid To: inkscape-devel@lists.sourceforge.net Message-ID: <51F8120A.6060506@...2974...> Content-Type: text/plain; charset=ISO-8859-1
On 07/30/2013 01:57 AM, Michael Wybrow wrote:
Hi Sebastian,
A couple of quick thoughts:
- You won't get the behaviour of avoiding specific obstacles with
different connectors using libavoid, since it routes connectors using a single visibility graph built from the obstacles for the whole diagram.
Ok, I think that's fine. The only use case I can imagine is something like PCB routing where you could want one visibility graph per layer.
- I think it would be fine to mark objects as obstacles using something
other than a property.
- The reason for not avoiding all obstacles by default is that libavoid
can be slow -- O(n^2 log n) -- especially if there are a lot of obstacles. You don't want this slowness if you open a file with hundreds or thousands of objects that libavoid tracks as objects by default. That was the reason for the original decision to have the user explicit mark objects as obstacles for routing.
Shouldn't this be in O(n log n)?
I'm now moving on to implement (somewhat minimalistic) "points" as
described in [0] so I can then head towards renovating connector-context.cpp. My latest commit to launchpad breaks in an assertion when drawing a connector since it needs these changes. The commit before that should work, though.
These "points" will be placed whenever one places a connector's end, except if one places a connector's end on an existing "point". When drawing a connector, all visible points will be rendered as knots. This enables template-based diagram elements which are just are groups that contain a shape and one or more points for the connector to attach
FWIW, newer versions of libavoid understand and track "connection pins".
These are points specified based on a position on shapes. They move if the parent shape is moved and can be specified as the endpoints for connectors. You might want to make of these.
Thanks. This behavior can easily be implemented by putting a few SPPoints into a group with some shape. The new connector code just creates these SPPoints as needed, and handling of object centers/corners/nodes etc. should be done by just snapping their locations to these points.
It could be worth updating the version of libavoid in Inkscape to the
latest version found here:
https://github.com/mjwybrow/adaptagrams The only real work there would be how you find and track attached objects
once using connection pins.
By moving to SPPoints this is actually pretty non-problematic since they will just move with the groups containing them.
I think there was a previous dev who started doing the connection pin work
in Inkscape but I'm not sure what happened to that. It doesn't seem to be on the trunk.
I will remove any logic from connector-context responsible for handling
anything but two endpoints (if you want to draw a connector with multiple "stops", just chain together multiple connectors) and remove the "snap connector end point to connector's intersection with destination shape outline"-logic since I do not think this is too useful.
Do you mean the functionality that adjusts the endpoint of a connector to
stop at the intersection with the destination shape? If so, the reason for this is that the arrowhead is drawn at the end of the connector and people frequently want this to coincide with the edge of the shape.
I removed that because it would have been even more work porting and because with the addition of SPPoints it is not really necessary anymore (I am not totally against re-adding it, though).
Best regards, Sebastian
[1] http://dev.w3.org/SVG/modules/connector/SVGConnector.html
------------------------------
Message: 2 Date: Tue, 30 Jul 2013 18:02:00 -0300 From: Vin?cius dos Santos Oliveira <vini.ipsmaker@...400...> Subject: Re: [Inkscape-devel] [Tracing] Report #6 To: Inkscape-dev inkscape-devel@lists.sourceforge.net Message-ID: <1375218120.1439.6.camel@...16...> Content-Type: text/plain; charset="utf-8"
Em Ter, 2013-07-30 ?s 04:23 -0300, Vin?cius dos Santos Oliveira escreveu:
I'll upload a short video later today showing the project summary.
Video uploaded: http://vimeo.com/71364024
-- Vin?cius dos Santos Oliveira https://about.me/vinipsmaker
If it's just a key and value, a std::map will be just fine but I'm not sure if that's the case just yet. If the value is a bag/list of other values this may turn into a problem. Maybe I'm looking at it in the wrong way and trying to force a mapping from each XML node to an object/class.
Concerning "building blocks" and "values". Building blocks for me are XML nodes such as rdf:RDF, rdf:Bag and rdf:li. These are used in several places to structure the metadata. Values are node such as dc:date which just has a value and that is it.
1) I will take a look. document-metadata.cpp is not used anymore since the metadata dialog was moved to document-properties.cpp maybe this functionality was lost during that refactoring process. I have another branch where I've removed all the dead code https://code.launchpad.net/~inkscape.dev/inkscape/document-metadata-code-cle... could merge it into trunk but I'm still worried that I have removed something of value.
2) Perfect. Will take a look at the updateRepr methods.
3) Thanks for clarification.
As a last note I will wait two/three weeks to start refactoring this as I'm leaving for my honeymoon trip this Sunday. When I get back the others from Commons Machinery is back from their holiday as well so I can get more feedback from them concerning the RDF/RDFa side of things.
Regards
participants (2)
-
Christoffer Holmstedt
-
Markus Engel