This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi Jason, how can i avoid that connections are behind a DiagramNodeElement. I'm currently using the A*-Pathfinder. Thanks Patrick |
|
|
Hi Patrick, The best way to do this is to set the ZOrder property of all your nodes and connections. If you have custom implementations of nodes and connections, then you can set this property in their constructors. If you have custom builder classes, then you could set this property on the newly created items in the Create* methods. For any items that you don't have custom implementations or builders (using built in implementation instead), then you could listen to when connections or nodes are added to your DiagramModel, and then set their ZOrder properties then. To keep all connections above the nodes, set the ZOrder property of the connections to be higher than the nodes. The ZOrder of all connections can be the same, and the ZOrder for all the nodes can be the same. e.g. Nodes = 0, Connections = 100 Let me know how it goes. -Jason Fauchelle |
|
|
Hi Jason, yes, setting the ZOrder works. But the behaviour now is not the same i expected. Now some connections are over my Nodes and what i want to achieve is that the connections respect all my nodes and go/route around them. When i set the ZOrder of both, connections and nodes, to 1 the connections are behind some nodes, like befor without setting the zorder. And there is another issue/question. If i have two Connectors on my Node (i'm calculating their possition at the moment) and their edge is left (or right, noifference) the connections overlap each other although they are not going/coming from the same connector. Is is possible that their is some space between the connections which are not going to the same connector? picture1 one shows my current situation and picture2 what i want to achieve. Hope you can help me. Thanks |
|
|
Hi Patrick, Setting the ZOrder should not affect the path routing. The A* path router should be causing the connections to route around all nodes regardless of the ZOrder. Note that there are some scenarios (such as placing a new node) that doesn't cause the path router to be updated, and there are some times where a collisionless path can not be found, maybe these are the reason you see some connections overlapping nodes? Are you setting the ZOrder of everything, nodes and connections, to be the same (1)? This won't work, make sure that the ZOrder of the connections are different/higher than the ZOrder you set on the nodes. Let me know if this works for you. Fortunately, separating overlapping parallel connections is a feature within the A* pathfinder. When you create a new instance of the A* pathfinder for your connections, simply pass in a number into the A* pathfinder constructor to be the desired separation distance between parallel connections. On a related note, it's best to use the same A* pathfinder instance for all of your connections. (A static instance perhaps). Let me know how it all goes for you. -Jason Fauchelle |
|
|
Hi Jason, thanks for the reply. I didn't notice the point that every connection get a new Pathfinder. Now every connection has the same pathfinder instance and it works really great. Thanks Patrick |
|