Check the inresection of shapes


#1

Hi,

Can I check if a connector`s end point located on another connector or shape?
Or can I get GraphicsPath of a shape/connector for checking intersection with a point or another shape?
connector.zip (31.5 KB)


#2

@dmbk

Thanks for contacting support

Currently you can determine X and Y coordinates of Shapes in diagram using Aspose.Diagram. However, for your particular requirement, we have logged an investigation ticket as DIAGRAMNET-51571 in our issue tracking system. We will further check feasibility of your requirement and let you know in case of further updates. Please spare us little time.

We are sorry for the inconvenience.


#3

@dmbk

You may please try following code snippet to check if a connector end point is located on another connector or shape:

long[] In_connectedShapeIds = shape.ConnectedShapes(ConnectedShapesFlags.ConnectedShapesIncomingNodes, null);
long[] Out_connectedShapeIds = shape.ConnectedShapes(ConnectedShapesFlags.ConnectedShapesOutgoingNodes, null);

Also, you may try following:

diagram.Pages.GetPage("Page-1").Connects

In case of further assistance, please feel free to let us know.


#4

shape.ConnectedShapes doesn’t work if I call it to a connector’s shape. It throws Aspose.Diagram.DiagramException “The source object can’t be a 1-D shape.”.

diagram.Pages.GetPage("Page-1").Connects can return begin and end connector’s points for “connector1” but it can return only begin points for “connector2” and “connector3” from my example.
connectors.png (13.8 KB)


#5

@dmbk

Thanks for getting back to us.

We have logged this issue as DIAGRAMNET-51572 in our issue tracking system for the sake of further investigation.

We have also observed this behavior as shown in the attached screenshot and logged it under the ticket DIAGRAMNET-51573 for the sake of further investigation. We will further look into details of both logged tickets and let you know in case of additional updates. Please spare us little time.

We are sorry for the inconvenience.


#6

@dmbk

Thanks for your patience.

Please add following sample code because, when the shape is one d such as the shape with id 3 is a connector itself, so we could not get its connected shapes.

foreach (Aspose.Diagram.Shape s in page.Shapes)
{
 if (s.OneD)
    continue;
 long[] In_connectedShapeIds = s.ConnectedShapes(Aspose.Diagram.ConnectedShapesFlags.ConnectedShapesIncomingNodes, null);
 long[] Out_connectedShapeIds = s.ConnectedShapes(Aspose.Diagram.ConnectedShapesFlags.ConnectedShapesOutgoingNodes, null);
}

“connector2” is not connected to shape 1 and “connector3” is not connected to shape 8. If you move the shape 1 and shape 8, the two connector end points will not be moved and if you move shape 2 you will find the moving connectors. Please check the sample attached file.

connector1.zip (31.7 KB)


#7

I know the connector is not connected to the shape, but they have intersection.
I think if you use shape`s GraphicsPath in internal work of Aspose library and can make public GraphicsPath getter, it would be very useful. In this case, it is easy to find the intersection of two shapes.


#8

@dmbk

Thanks for writing back.

We have logged a feature request as DIAGRAMNET-51589 in our issue tracking system for your requirements. As soon as we have some definite updates regarding implementation of the feature, we will let you know. Please spare us little time.