Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Isometric diagramming summary (Read 2298 times)
Alexey Kiselev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 5
Joined: Oct 15th, 2012
Isometric diagramming summary
Oct 22nd, 2012 at 2:52pm
Print Post  
Hi, there!

I'm going to develop isometric pipeline diagram designer. For all primitives including pipes I need to develop custom node library. Let's assume that pipe will be implemented as custom node.
Is it possible to snap one custom node to another without using a link?
It is possible to customize snapping to grid? I need to have an isometric (non-rectangular) grid. I understand that I have to draw it by myself on a DiagramView.
In ShapeDesigner sample snapping is done on mouse_up but not on mouse_move. Is it possible to change that behavior?

WBR, Alexey
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Isometric diagramming summary
Reply #1 - Oct 23rd, 2012 at 6:01am
Print Post  
Hi,

You can implement any kind of snapping be overriding node's *Modify and *Create methods as in http://mindfusion.eu/Forum/YaBB.pl?num=1350308635.

However, I think you will get most out of the control's built-in features by modeling the pipes using DiagramLinks. E.g. you could automatically create intermediate "joint" nodes between links as shown in the SiteMap sample project: if a link is drawn unconnected, there is a new node added automatically and set as its destination; if a link is drawn to an existing node (joint), that node remains link's destination. Then moving a joint node would also automatically update its related links / pipes, which you would have to implement yourself if using only nodes.

I don't know what your requirements are, but using links might have additional benefits, such as modeling pipe flow direction, and built-in path finding.

Regarding isometric grid, our developer thinks it will be easiest to apply a skew transform on the standard grid's Visual, and overriding the Diagram.AlignPointToGrid method, which is used internally when aligning items to the grid. We'll try to make the respective members public / virtual in the next few days to let you do that.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Isometric diagramming summary
Reply #2 - Nov 5th, 2012 at 4:56pm
Print Post  
Hi,

This version makes the DrawGrid and AlignPointToGrid methods virtual:
https://mindfusion.eu/_beta/wpfdiag3.zip

You should be able to override them to implement your custom grid drawing and alignment from the ground up, or delegate to the base methods:

Code
Select All
protected override void DrawGrid(DrawingContext graphics)
{
    graphics.PushTransform(new SkewTransform(...));
    base.DrawGrid(graphics);
    graphics.Pop();
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint