We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

handle drawing around the nodes

Thread ID:

Created:

Updated:

Platform:

Replies:

78107 Nov 28,2008 07:02 AM Dec 3,2008 07:50 AM Windows Forms 4
loading
Tags: Diagram
MagicXtr
Asked On November 28, 2008 07:02 AM


I would like to accomplish the following:

User selects polyline and draw line arround several nodes. After user releases the mouse button - polygon should appear in drawn area, it should be sent to back (behind the nodes) so that all nodes within drawn area (how to get all these nodes?) and certain polygon are groupped in one shape. Is that possible?

Thanks a lot,
Bork


Administrator [Syncfusion]
Replied On December 1, 2008 09:57 AM

Hi Bork,

I wanted to know, whether Grouping the nodes inside the Polygon and Polygon was sufficient or you also want their location to be intact after grouping?

- Ajeet [ Syncfusion ]


MagicXtr
Replied On December 2, 2008 04:18 AM

Actually when user releases mouse button, system creates new polygon (polyline points are served as polygon points). However I do not know how to get the nodes which are located within that polygon or inside the polyline. If I will be able to get these nodes I will group them together with a polygon or whatever and accomplish what I wanted

Attached you will find a few screenshots which demonstrate what exactly I wanted



CustomArea_208d280c.zip

Administrator [Syncfusion]
Replied On December 2, 2008 09:07 AM

Hi Bork,

The following Code snippet will help you in getting the nodes inside the "Defined Polygon" to be at front and the Polygon will be set back.

Inside the NodeCollectionChanged event handler, please type the below code snippet:

******

void EventSink_NodeCollectionChanged(CollectionExEventArgs evtArgs)
{
if (evtArgs.ChangeType == CollectionExChangeType.Insert)
{
if (evtArgs.Element is Polygon)
{
Polygon t_polygon = (Polygon)evtArgs.Element;
this.diagramComponent.Model.SendToBack(t_polygon);
this.diagramComponent.Controller.SelectionList.Add(t_polygon);
foreach (Node node in this.diagramComponent.Model.Nodes)
{
if ((node.BoundingRectangle.X >= t_polygon.BoundingRectangle.X) && (t_polygon.BoundingRectangle.Bottom >= node.BoundingRectangle.Bottom))
{
this.diagramComponent.Model.BringForward(node);
this.diagramComponent.Controller.SelectionList.Add(node);
}
}
}
this.diagramComponent.Refresh();
}
}

******

Let me know if you shall need any further clarifications in this regard.

Happy Coding!

- Ajeet




>Actually when user releases mouse button, system creates new polygon (polyline points are served as polygon points). However I do not know how to get the nodes which are located within that polygon or inside the polyline. If I will be able to get these nodes I will group them together with a polygon or whatever and accomplish what I wanted

Attached you will find a few screenshots which demonstrate what exactly I wanted



CustomArea_208d280c.zip


MagicXtr
Replied On December 3, 2008 07:50 AM

Thank you for your reply. As far as I understand there is no capability to get such nodes. The solution which you provide is not comprehensive. Say all nodes whith coordinate x >= Polygon.BoundingRectangle.X will be treated as selected. However it is not true

In any case, thanks for your response and your help

Kind regards,
Bork


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;