/** * Utility method to determine within which segment the specified rectangle * intersects the specified curve * * @param index the curve index specifying the curve to analyse * @param rect the whose boundary is to be tested for intersection * with this curve * @return the point at which this curve intersects the boundary of * the given rectangle, if it does so. If it does not intersect, * -1 is returned */ protected int intersectRectPerimeterSeg(String index, mxRectangle rect) { return intersectRectPerimeterSeg(index, rect, 1); }
/** * Utility method to determine within which segment the specified rectangle * intersects the specified curve * * @param index the curve index specifying the curve to analyse * @param rect the whose boundary is to be tested for intersection * with this curve * @return the point at which this curve intersects the boundary of * the given rectangle, if it does so. If it does not intersect, * -1 is returned */ protected int intersectRectPerimeterSeg(String index, mxRectangle rect) { return intersectRectPerimeterSeg(index, rect, 1); }
/** * Returns the point at which this curve intersects the boundary of * the given rectangle, if it does so. If it does not intersect, * null is returned. If it intersects multiple times, the first * intersection from the start end of the curve is returned. * * @param index the curve index specifying the curve to analyse * @param rect the whose boundary is to be tested for intersection * with this curve * @return the point at which this curve intersects the boundary of * the given rectangle, if it does so. If it does not intersect, * null is returned. */ public mxPoint intersectsRectPerimeter(String index, mxRectangle rect) { mxPoint result = null; mxPoint[] pointsCurve = getCurvePoints(index); if (pointsCurve != null && pointsCurve.length > 1) { int crossingSeg = intersectRectPerimeterSeg(index, rect); if (crossingSeg != -1) { result = intersectRectPerimeterPoint(index, rect, crossingSeg); } } return result; }
/** * Returns the point at which this curve intersects the boundary of * the given rectangle, if it does so. If it does not intersect, * null is returned. If it intersects multiple times, the first * intersection from the start end of the curve is returned. * * @param index the curve index specifying the curve to analyse * @param rect the whose boundary is to be tested for intersection * with this curve * @return the point at which this curve intersects the boundary of * the given rectangle, if it does so. If it does not intersect, * null is returned. */ public mxPoint intersectsRectPerimeter(String index, mxRectangle rect) { mxPoint result = null; mxPoint[] pointsCurve = getCurvePoints(index); if (pointsCurve != null && pointsCurve.length > 1) { int crossingSeg = intersectRectPerimeterSeg(index, rect); if (crossingSeg != -1) { result = intersectRectPerimeterPoint(index, rect, crossingSeg); } } return result; }
int segIndex = intersectRectPerimeterSeg(index, rect); mxPoint intersectPoint = null;
int segIndex = intersectRectPerimeterSeg(index, rect); mxPoint intersectPoint = null;
int hitSeg = intersectRectPerimeterSeg(index, rect);
int hitSeg = intersectRectPerimeterSeg(index, rect);