Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) Minimum number of lines in cascading line (Read 9788 times)
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Minimum number of lines in cascading line
Reply #15 - Nov 18th, 2010 at 9:33am
Print Post  
Quote:
The problem with this is that, to assing correct patern one need to know what type of shape is assinged. In my app, I am allowing user for custom shapes creation and use that. With that i need to ask user anchor patten for each shape also ( i think this should not do it that way )


There's no built-in function available to select middle points for arbitrary shapes. We could add one for the next release. Until then you could try using the node.GetIntersection method with points lying at the horizontal/vertical lines passing through the node center to find the middle points of the shape's outline. The "cross" pattern above should work for most of the shapes anyway.
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Minimum number of lines in cascading line
Reply #16 - Nov 18th, 2010 at 10:02am
Print Post  
Hi Stoyo

Thanks for all your reply so far. With you last 3 reply, I am getting what I am expect.

Now, I am able to explicitly change the anchor point even it is auto routed first time. 

If user assing explicitly one of the anchor point out of 4 anchor point and then re-position the node then it set anchor point again.

With your suggestion, I am almost there to my requirements.

What I need now is , if user assigns anchor points explicitly then that should be preserved.
And if user sets links anchor point (by adding one more point in anchor patten in the center)  to center then it should auto detect new anchor point (edge of the shape dynamically).

I guess this can also be done with some property for node which causes to auto detect anchor point for link end automatically.
With this, I can have a link whose one end get anchor point dynamic according to other nodes position and one node gets fixed anchor point.

Let me know your suggestion or alternative which can be done over here. Also is this all possible with new release of silverlight control ?

-Rajesh

Regards
Rajesh



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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Minimum number of lines in cascading line
Reply #17 - Nov 19th, 2010 at 7:48am
Print Post  
Hi Rajesh,

At this time links cannot be auto-routed with one fixed end point and one chosen dynamically. I will add this to our feature-request list for next release.

It could be possible for you to implement it by adding two new fields to a custom link class (or keep them in the link's Tag) that store if the user has explicitly set any of the link ends, and then instead of calling ReassignAnchorPoints, set the link's OriginAnchor and/or DestinationAnchor properties according to the fields. Handle LinkModified to detect when the user changes the link's anchor point.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Re: Minimum number of lines in cascading line
Reply #18 - Jan 25th, 2011 at 8:53am
Print Post  
Hi Stoyo

The ReassingAnchorPoints function is missing for the link in diagramlite silverlight version.

The functionality described in above questions works as expected in WPF version where links "ReassingAnchorPoint" function is used.

The behavior I get with following function is different

Following code works properly as expected in WPF but cannot be written in silverlight since the function is missing.
Code
Select All
foreach (DiagramLink link in e.Node.GetAllLinks())
   link.ReassignAnchorPoints();
diagram1.LinkRouter.RouteLinks(e.Node.GetAllLinks());
 



Following code doesn't work as expected in WPF but can be written in silverlight also.
Code
Select All
foreach (var link in e.Node.GetAllLinks())
{
   DiagramLink link1 = link as DiagramLink;
   link1.Origin.ReassignAnchorPoints();
   link1.Destination.ReassignAnchorPoints();
}
diagram1.LinkRouter.RouteLinks(e.Node.GetAllLinks());
 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Minimum number of lines in cascading line
Reply #19 - Jan 26th, 2011 at 9:51am
Print Post  
Hi Rajesh,

Check the PM page. The new version there adds the link.reassign method.

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