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
|
Hello :) Im looking though the pattern of how the connection builder and the path finder are implemented and having problems seeing where the pathfinder is referenced by the connection builder :| Is this implementation exposed? I would like to know if it is possible to override the current path finder/connection builder so that it can do a little more than the SimplePathfinder and avoid taking paths that lay across existing nodes :) Thanks in advance, Kyryll
|
|
|
Hello Kyryll Indeed we have provided a way to implement your own path finder. Firstly, you don't need to worry about connection builders. They are just for creating instances of of connection objects at the data level. Path finders work at the graphical level, here is how to implement one and apply it to a diagram: You probably already know of the IPathFinder interface. Implement this interface to create your path finder. There is only one method here called CreatePath. It takes in a DiagramConnectionElement and the DiagramSurface. The connection element is useful for getting the start and end positions of the connection. The DiagramSurface of course can be used to get all the other elements in the diagram which will be useful for the type of path finder your building. Once you have your path finder implementation, here is how to get the diagram to use it: I suggest you start by making a very simple path finder implementation so that you can focus on getting the diagram to use it first. For example, you could make a path finder that just creates straight lines. Once you see its all working, then you'll only need to focus on advancing the path finder implementation. Creating a path finder can turn out to be a lot of work. Let me know if you need more details on this such as what exactly the CreatePath method should return, or how to get various pieces of information that you need from the parameters. I'm looking forward to seeing how this works out. Before I made the SimplePathFinder, I had started out by experimenting with one called CollisionPathFinder. This was to work exactly the way you have described the one you are making now. I never finished implementing it, and it isn't likely to work any more. However I have attached it to this forum post for you to have a look at. It may take a bit to understand it, but it may be useful to see how I attempted it. Feel free to ask any questions about it, although You may already have a plan for implementing your one. Hope this all helps. - Jason |
|
|
Hi Jason, Thank you for such a detailed answer! You definetily pointed me in the right direction :) Im going to have a look at what you were trying to do in your CollisionPathFinder and see if it triggers some ideas. Im wondering if you could make the PathFinder property settable so that I dont have to recreate the whole formatter class :) Thanks! Kyryll
|
|
|
Hi again! Sorry just looked a bit closer and realised that the FlowDiagramFormatter implementation of the IDiagramFormatter has that property as settable :) Watch this space.. Thanks, Kyryll |
|
|
Excellent, hope the CollisionPathFinder helps out. Good to hear you found that setter, I was just about to reply. I'm looking forward to seeing how this turns out. - Jason |
|