În data de Sîm 01 Oct 2011 14:22:35 Hans-Jürgen Hay a scris:
The main idea was to have two types of connection points: some default connection points (as currently only the center is) and user defined connection points. There would be 9 default connection points: the center (the only one available now) and other 8 connection points that you get when you draw 8 imaginary lines that connect the center to the corners of the object's bounding box and the midpoints of the edges of the object's bounding box and intersect these imaginary lines with the object's edge.
just as an idea, I would suggest to handle connections more generic. Instead of using default and configurable fixed connection points it would be better to attach directly to the objects outer shape using generic connection points. In this case no predefined connection points need to be shown as the shape is shown in any case. When a handle gets near the shape the shape itself might get highlighted to indicate it will catch the handle when dropped.
Actually, the idea of the default connection points was to address these „generic” connection points. The question of their visibility is only a secondary one. The main question was: how would these generic connection points be defined?
My idea was to compute a number (8) of points on the outer shape of the object that would correspond to vertices and midpoints for a rectangle, and to north, east, south, west along with north-east, east-south, south-west and west-north directions in the case of a circle or an ellipse.
For a more complex shape the idea was to compute the points which lie along these directions on the outer boundary of the shape. Another idea that appeared on the list was to place a number of equidistant points along the outer boundary of the shape.
These are some ideas to implement generic connection points (as opposed to user defined connection points) that wouldn't be fixed (as maybe you got the impression), any other ideas are welcome.
Regards, Arcadie
When the handle gets dropped near the shape it should connect to the shapes outer sub element (e.g. the nearest line of an rectangle) at an offset from its center calculated from the point of dropping the handle using a calculated normal. The Object would store the connection by adding an additional connection object to its connection list. Each connection object would at least need:
- a reference to the attached handle,
- a reference to the shapes sub element, to which the handle is attached
- a relative offset from the shapes sub elements center point.
- the normal vector to be optionally used for connecting attached line
with an angle normal to the outer shape ( eg. for round objects)
- sharp edges and the center of an sub element could be made prefered
relative positions to snap to
This could allow:
- to delete connections when getting disconnected.
- no need to handling additional default points
- scaling of objects without disturbing the arrangement of the attached
handles
- allow attachments without code to display additional
points/crosses/circles to show the user where he can attach the handle
- no need decide in advance on the placement of the default connection
point
- individual placement by dropping the handle where it should stay
- grabbing and moving the handle to a different location along the outer
shape
I don't know anything of the code base nor do I have any time to work on this in any capacity but envision the idea could lead to better diagram layout and improved usability.
Hans