Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Orthogonal router (Read 8360 times)
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Orthogonal router
Sep 6th, 2016 at 1:39pm
Print Post  
Hello.
I get an exception when I try to modify my diagramLink.
The exception is attached.The scenario is next:
When I create a node and a link that goes from and to that same node.
Then I arrange the diagram via my orthogonal router.
When I try to pull(modify) the link down from the dot in the right upper corner, this exception happens.
Any help?
  

Exception.png ( 15 KB | 78 Downloads )
Exception.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Orthogonal router
Reply #1 - Sep 7th, 2016 at 6:41am
Print Post  
Hi,

Could you post the exception's stack trace?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Orthogonal router
Reply #2 - Sep 7th, 2016 at 7:03am
Print Post  
Hi.
The stack trace is in the attachment.
  

StackTrace.txt ( 7 KB | 88 Downloads )
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Orthogonal router
Reply #3 - Sep 7th, 2016 at 7:59am
Print Post  
Hi,

It does not show DiagramLink code unfortunately, but from what I can see in its measure method, it will return NaN values if point coordinates or stroke thickness are NaN. Could you attach file saved after arranging for our developer to inspect?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Orthogonal router
Reply #4 - Sep 9th, 2016 at 11:41am
Print Post  
The xml file as txt file is in the attachment
  

Diagram.txt ( 13 KB | 92 Downloads )
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Orthogonal router
Reply #5 - Sep 11th, 2016 at 7:40am
Print Post  
Hi,

I still couldn't reproduce this. Is it throwing exception immediately when you grab the handle, or while dragging it, or only when you drop it somewhere? Do you set any link properties from handlers of LinkModified or LinkModifying events? Also are you using the latest 3.4.1 version or an older one?

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Orthogonal router
Reply #6 - Sep 12th, 2016 at 7:13am
Print Post  
It throws this exception while i drag the link.
Both events LinkModified and LinkModifying are being used.
The latest version of wpf diagramming is being used.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Orthogonal router
Reply #7 - Sep 12th, 2016 at 11:15am
Print Post  
Could you post the event handlers' code? You mean you are dragging the third control point (on the bend), and not the last one at arrowhead, right?
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Orthogonal router
Reply #8 - Sep 12th, 2016 at 11:46am
Print Post  
private void DiagramLinkModified(object sender, LinkEventArgs e) {
                 var source = e.Link.Origin.Tag as ObservableState;
                 var target = e.Link.Destination.Tag as ObservableState;
                 var transition = e.Link.Tag as ObservableTransition;
                 transition.FromState = source;
                 transition.ToState = target;
                 IsDirty = true;
                 _diagramDrawing.ArrangeDiagram();
                 RaisePropertyChangedEvent(nameof(ComponentDiagram));
                 HandleLostFocus();
           }

private void DiagramLinkModifying(object sender, LinkValidationEventArgs e) {
                       if (e.Origin == null) {
                             e.Cancel = true;
                             return;
                       }
                       var source = e.Origin.Tag as ObservableState;
                       if (e.Destination != null) {
                             var destination = e.Destination.Tag as ObservableState;
                             if (destination == null) {
                                   e.Cancel = true;
                                   return;
                             }
                             var tmpSource = e.Link.Origin.Tag as ObservableState;
                             var tmpDestination = e.Link.Destination.Tag as ObservableState;
                             foreach (var transition in Transitions) {
                                   if (transition.FromState.Equals(tmpSource) && transition.ToState.Equals(tmpDestination) && transition.FunctionCode.Equals(e.Link.Text)) {
                                         continue;
                                   }
                                   if (transition.FromState.Equals(source) && transition.ToState.Equals(destination) && transition.FunctionCode.Equals(e.Link.Text)) {
                                         e.Cancel = true;
                                         return;
                                   }
                             }
                       }
           }

  

Sample.png ( 4 KB | 94 Downloads )
Sample.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Orthogonal router
Reply #9 - Sep 13th, 2016 at 7:53am
Print Post  
Could you add this to your event handlers and post the coordinates?

Code
Select All
private void OnLinkModifying(object sender, LinkValidationEventArgs e)
{
	var l = e.Link;
	l.Measure(diagram.Bounds.Size);
	if (double.IsNaN(l.DesiredSize.Width) || double.IsNaN(l.DesiredSize.Height))
	{
		for (int i = 0; i < l.ControlPoints.Count; i++)
		{
			Debug.WriteLine(
				string.Format("{0}: {1}", i, l.ControlPoints[i]));
		}
	}
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Orthogonal router
Reply #10 - Sep 13th, 2016 at 1:40pm
Print Post  
My desired width and height are not NaN, therefore it doesnt get in that if where i should get the coordinates.
I added an breakpoint into this function and the width and height are 39.5
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Orthogonal router
Reply #11 - Sep 13th, 2016 at 2:04pm
Print Post  
But it still throws the exception? Could you attach a screenshot of diagram.Links[0].ControlPoints expanded in debugger watch window when the exception happens?
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Orthogonal router
Reply #12 - Sep 14th, 2016 at 5:56am
Print Post  
The exception still happens.
The screenshot is in the attachment.
The exception is thrown in a viewModel that is initializing the viewModel where my diagram is.
  

ControlPoints.png ( 71 KB | 71 Downloads )
ControlPoints.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3154
Joined: Oct 19th, 2005
Re: Orthogonal router
Reply #13 - Sep 14th, 2016 at 8:59am
Print Post  
The only logical explanation is that link's StrokeThickness has a NaN value then, could you verify that? If you can't see NaNs anywhere, maybe give me control over Skype screen sharing or TeamViewer to check a few things - you can send me connection details as personal message.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
monkeydll
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 41
Joined: Jun 27th, 2016
Re: Orthogonal router
Reply #14 - Sep 14th, 2016 at 11:58am
Print Post  
The link strokeThickness is 1 but my e.link.Height and e.link.Width are NaN.
Regarding the control via TeamViewer and skype, it is not possible.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint