public interface IIntersectionCalculator
IIntersectionCalculator
is responsible for calculating the intersection point between an edge and the visual
representation of its source or target node.
This interface is especially useful in conjunction with PortCalculator
when adjusting the final port locations
after the layout is calculated.
PortCalculator
Modifier and Type | Method and Description |
---|---|
YPoint |
calculateIntersectionPoint(INodeLayout nodeLayout,
double xOffset,
double yOffset,
double dx,
double dy)
Calculates an intersection point between the edge and the given
INodeLayout . |
YPoint calculateIntersectionPoint(INodeLayout nodeLayout, double xOffset, double yOffset, double dx, double dy)
INodeLayout
.
Implementing classes use a point on the connecting edge segment (specified with an offset to the node's center) along with a direction pointing to the node and calculate the intersection between this line and the node.
nodeLayout
- the layout information of the nodexOffset
- the x-coordinate of a point on the last line segment relative to the node's centeryOffset
- the y-coordinate of a point on the last line segment relative to the node's centerdx
- the x-component of the normalized direction vector indicating the direction of the segment pointing towards the nodedy
- the y-component of the normalized direction vector indicating the direction of the segment pointing towards the nodenull
if no such intersection was found