Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Overlapping Links mapping back to the same ShapeNode (Read 2755 times)
Viev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 15
Location: Australia
Joined: Jan 3rd, 2015
Overlapping Links mapping back to the same ShapeNode
Jul 2nd, 2018 at 2:20am
Print Post  
Hi team,

I can't solve this problem where two links have the same Origin and Destination and where both links overlap each other 100%, so on the screen it only looks as if there only one link (please see attached png file).

Diagram.RouteLinks is set to False, because the resulting beziers are not aesthetically pleasing, and it didn't resolve the issue anyway.

Attached also in the png is all the Diagram.Link... properties.

What I would like to do is move the anchor points of one or both of the overlapping links, so that two loops appear rather than just one.

Thanks in advance for any assistance with this issue.
  

OverlappingLinks.png ( 30 KB | 118 Downloads )
OverlappingLinks.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Overlapping Links mapping back to the same ShapeNode
Reply #1 - Jul 3rd, 2018 at 10:12am
Print Post  
Hi,

Try the code from https://mindfusion.eu/Forum/YaBB.pl?num=1227111424

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


I Love MindFusion!

Posts: 15
Location: Australia
Joined: Jan 3rd, 2015
Re: Overlapping Links mapping back to the same ShapeNode
Reply #2 - Jul 3rd, 2018 at 11:39pm
Print Post  
Hi Slavcho,

Thank you. Yes, I had tried that code, but it doesn't work.

It moves the controll points, but not the anchors. It also moves the control points of one of the links inside the node being linked to itself. Please see the attached.

What I feel is needed is some sort of algorithm that will move the anchor points of one of the links to another part of the node being linked to itself.

Any ideas most welcome.

kind regards,
Victor
  

OverlappingLinks2.png ( 12 KB | 118 Downloads )
OverlappingLinks2.png
Back to top
 
IP Logged
 
Viev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 15
Location: Australia
Joined: Jan 3rd, 2015
Re: Overlapping Links mapping back to the same ShapeNode
Reply #3 - Jul 4th, 2018 at 1:02am
Print Post  
Hi Slavcho,

Attached is the result I am after. What I can't figure out is how to move the anchor points of links joining a ShapeNode that is an ellipse without actually creating anchor points.

When I use  layout.Arrange(Diagram), and where more than one link has the same Origin/Destination ShapeNode and where Origin/Destination 'are' the same ShapeNode, the automatic arrangement overlaps the Links.

So what I am trying to achieve is where it is visible to the user that there are two separate links etc.

I hope this extra information is helpful.

kind regards,
Victor
  

OverlappingLinks3.png ( 12 KB | 125 Downloads )
OverlappingLinks3.png
Back to top
 
IP Logged
 
Viev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 15
Location: Australia
Joined: Jan 3rd, 2015
Re: Overlapping Links mapping back to the same ShapeNode
Reply #4 - Jul 4th, 2018 at 5:11am
Print Post  
Solved - by moving the ControlPoints of the Links joining back to the same ellipse, around ellipse itself.

Something like:

            For Each lrNode As ShapeNode In Me.Diagram.Nodes

                Dim commonLinks As DiagramLinkCollection = getOutgoingLinksWithSameOriginAndDestination(lrNode, lrNode)

                Dim liDegrees As Double = 10
                For Each lrLink As DiagramLink In commonLinks
                    Dim lrNewPointF As PointF

                    Dim liRadius As Integer = lrNode.Bounds.Width / 2
                    Dim liCircleCentreX, liCircleCentreY As Integer
                    liCircleCentreX = lrNode.Bounds.X + (lrNode.Bounds.Width / 2)
                    liCircleCentreY = lrNode.Bounds.Y + (lrNode.Bounds.Height / 2)

                    lrNewPointF = Me.getPointOnCircle(liCircleCentreX, liCircleCentreY, liRadius, liDegrees)

                    lrLink.ControlPoints(0) = lrNewPointF
                    lrLink.ControlPoints(1) = Me.getPointOnCircle(liCircleCentreX, liCircleCentreY, liRadius + 15, liDegrees - 0.3)
                    lrLink.ControlPoints(2) = Me.getPointOnCircle(liCircleCentreX, liCircleCentreY, liRadius + 15, liDegrees + 0.3)
                    lrLink.ControlPoints(lrLink.ControlPoints.Count - 1) = lrNewPointF

                    Call lrLink.UpdateFromPoints()

                    liDegrees += 20
                Next
            Next
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint