Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Get the attachment point (Read 3216 times)
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Get the attachment point
Jan 7th, 2010 at 12:41pm
Print Post  
Hi there!

I have a node attached to a link. The original attachment is done similar to how link text is displayed when using TextStyle.Center. After some changes I need to know the point on the link the node position is reported. Is this possible?

Regards,
Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get the attachment point
Reply #1 - Jan 7th, 2010 at 2:04pm
Print Post  
Hi,

Do you need to find which control point of the link is closest to the node?

Stoyan
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: Get the attachment point
Reply #2 - Jan 7th, 2010 at 2:12pm
Print Post  
Hi!

Not necessarily! In my application when I draw a link for the first time I attach the node to the middle of the link. The middle of the link depends of the number of control point the link has. For example: is the link has 5 ctrl. points then I attach the node to the link control point. If the link has 4 ctrl. points then I attach the node to the segment between ctrl. point with index ControlPoints.Count /2 -1 and ctrl. point with index ControlPoints.Count /2. If a routing is applied (the link is modified) I need to find out to what the node is attached? (point or segment). If the original attachment is to a point is easy, but if it is a segment I have no idea.

Best regards,
Dexter
  
Back to top
 
IP Logged
 
Dexter
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 62
Joined: Jun 25th, 2009
Re: Get the attachment point
Reply #3 - Jan 7th, 2010 at 2:32pm
Print Post  
I have another question. During this strange process on the complete modify of the link can I determine if a control point will disappear from the control points collection? (3 points will form a line and the 2 segments will become one).

Regards,
Dexter
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get the attachment point
Reply #4 - Jan 7th, 2010 at 3:22pm
Print Post  
You might Detach() and Attach() the node again to the new center of the link, if you want the node to always stick to it. Otherwise we can add some public method to return the original attachment type if that's what you need.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Get the attachment point
Reply #5 - Jan 7th, 2010 at 3:27pm
Print Post  
If you mean merging the segments when AllowSplit is enabled, it's not easy to determine from outside when it will happen. We could add some events raised when users insert or merge segments.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint