This is a migrated thread and some comments may be shown as answers.

Custom snapping & rotation stepping

2 Answers 118 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Jaroslav
Top achievements
Rank 1
Jaroslav asked on 09 Oct 2012, 07:05 AM
Hi,

In the diagraming component - is there a way how to do custom snapping? E.g. I have several components that can be joint together (say pipes) and if they are close enough with their correct edges they will snap. Something like the existing functionality IsSnapToItemsEnabled but not to edges but to custom points on an item...

Also - I would like to enable rotation only by steps of 90 degrees... Is there an easy way to achieve this?

Thanks,
Jarda

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 10 Oct 2012, 01:40 PM
Hello,

Currently we do not provide such an extensibility mechanism for the snapping but we have planned it for 2013 Q1 release. The only option is to implement the desired snapping from scratch.
Regarding the rotation - it is also not supported to have rotation in steps of 90 degrees. I'm going to log a feature request for it, but can not give you a time schedule for its implementation.

Greetings,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hristo
Telerik team
answered on 14 Feb 2013, 11:45 AM
Hello Jaroslav,

I have prepared a sample project demonstrating the snapping extensibility in RadDiagram that will be release with the upcoming 2013 Q1 official release.
First the snapping service is retrieved (you could retrieve other services the same way too).
Then the custom snapping logic is injected through the ISnappingService SetSnappingEngine method.
Finally the custom snapping is implemented in class derived from SnappingEngine (overriding the GetVertical/horizontalMatchingOverride methods). GetVerticalMatchingOverride method, for example, takes two parameters - the item to snap, and the static (not moved) item that is used as the basis for the snapping. In case of multy-itemsnapping these two overrides are called for every item pair.

Finally, I would like to mention again that this will be coming with the Q1 2013 release. I have included the binaries however, so you could play with it.
We have not documented this feature yet, hope the help is coming soon.

Hope this is what you are looking for. Please do not hesitate to contact us if you need more info or have any feedback.

Greetings,
Hristo
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Diagram
Asked by
Jaroslav
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or