public DirectionalLine(final Point2D start, final Point2D end) { this(new Point2DArray(start, end)); }
public Point2DArray(final Point2D point) { this(); push(point); }
public void correctHeadWithOffset(Point2DArray points, double offset, Direction direction) { int size = points.size(); Point2D p0 = points.get(size - 2); Point2D p1 = points.get(size - 1); Point2D p = correctEndWithOffset(offset, direction, p0, p1, true); m_headOffsetPoint = p; points.set(size - 1, p); }
/** * Gets the end point of this arrow. * * @return Point2D */ public Point2D getEnd() { return getPoints().get(1); }
private Point2DArray getControlPointsArray() { final Point2DArray result = new Point2DArray(); for (int i = 0; i < POINTS_SIZE; i++) { final IPrimitive<?> control = m_ctrls.getHandle(i).getControl(); result.push(new Point2D(control.getX(), control.getY())); } return result; }
public Point2DArray(final Point2DArray points) { this(points.getJSO().copy()); }
@Override public final boolean isEmpty() { return (size() > 0); }
public Polygon(final double... array) { this(Point2DArray.fromArrayOfDouble(array)); }
public final BoundingBox getBoundingBox() { return m_array.getBoundingBox(); }
@Override public boolean equals(Object other) { if ((other == null) || (false == (other instanceof BoundingPoints))) { return false; } if (this == other) { return true; } return ((BoundingPoints) other).getArray().equals(getArray()); }
public static BoundingBox getBoundingBoxOfArcTo(final Point2D p0, final Point2D p1, final Point2D p2, final double r) { final Point2DArray arcPoints = getCanvasArcToPoints(p0, p1, p2, r); final BoundingBox box = getBoundingBoxOfArc(arcPoints.get(0), arcPoints.get(1), arcPoints.get(2), r); if (!arcPoints.get(0).equals(p0)) { box.add(p0);//p0 is always the start point of the path, but not necessary of the arc - depending on the radius } return box; }
private Point2DArray getControlPointsArray() { final Point2DArray result = new Point2DArray(); for (int i = 0; i < POINTS_SIZE; i++) { final IPrimitive<?> control = m_ctrls.getHandle(i).getControl(); result.push(new Point2D(control.getX(), control.getY())); } return result; }
public Point2DArray(final Point2DArray points) { this(points.getJSO().copy()); }
public static Set<Point2D>[] getCardinalIntersects(final AbstractMultiPathPartShape<?> shape, final Point2DArray cardinals) { @SuppressWarnings("unchecked") final Set<Point2D>[] intersections = new Set[cardinals.size()]; final NFastArrayList<PathPartList> paths = shape.getActualPathPartListArray(); final int size = paths.size(); for (int i = 0; i < size; i++) { getCardinalIntersects(paths.get(i), cardinals, intersections, true); } return intersections; }
public PolyLine(final double... array) { this(Point2DArray.fromArrayOfDouble(array)); }
public final BoundingBox getBoundingBox() { return m_array.getBoundingBox(); }
@Override public boolean equals(final Object other) { if ((other == null) || (false == (other instanceof BoundingPoints))) { return false; } if (this == other) { return true; } return ((BoundingPoints) other).getArray().equals(getArray()); }