Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic A question about LinkCrossings! (Read 2552 times)
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
A question about LinkCrossings!
Mar 29th, 2018 at 8:16am
Print Post  
I now need to convert the link to a straight line. But link is set to LinkCrossings.Arcs. How do I get all the arcs on this link?
Thanks!
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3448
Joined: Oct 19th, 2005
Re: A question about LinkCrossings!
Reply #1 - Mar 29th, 2018 at 4:24pm
Print Post  
What do you mean by converting to straight lines, you want to remove the crossing arcs? Or are you looking for the positions / coordinates of these arcs?
  
Back to top
 
IP Logged
 
chowy
Junior Member
**
Offline


I Love MindFusion!

Posts: 72
Joined: May 8th, 2017
Re: A question about LinkCrossings!
Reply #2 - Mar 30th, 2018 at 2:04am
Print Post  
Slavcho wrote on Mar 29th, 2018 at 4:24pm:
What do you mean by converting to straight lines, you want to remove the crossing arcs? Or are you looking for the positions / coordinates of these arcs?

I‘m looking for the positions / coordinates of these arcs.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Online


tech.support

Posts: 3448
Joined: Oct 19th, 2005
Re: A question about LinkCrossings!
Reply #3 - Mar 30th, 2018 at 8:29am
Print Post  
They are not accessible through public API at this time. You might try getting arc positions through WPF's visual tree helper -

Code
Select All
IEnumerable<ArcSegment> EnumArcs(DiagramLink link)
{
	return VisualTreeHelper.GetDrawing(link).
		Children.OfType<DrawingGroup>().
		SelectMany(g => g.Children).
		OfType<GeometryDrawing>().
		Select(gd => gd.Geometry).
		OfType<PathGeometry>().
		SelectMany(p => p.Figures).
		SelectMany(f => f.Segments).
		OfType<ArcSegment>();
}

private void OnLinkCreated(object sender, LinkEventArgs e)
{
	foreach (var arc in EnumArcs(e.Link))
		Debug.WriteLine(arc.Point);
} 



Regards,
Slavcho
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint