Interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>

    • Method Detail

      • contains

        @Pure
        default boolean contains​(Point2D<?,​?> pt)
        Description copied from interface: Shape2D
        Replies if the given point is inside this shape.
        Specified by:
        contains in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        pt - the point.
        Returns:
        true if the given shape is intersecting this shape, otherwise false.
      • contains

        @Pure
        default boolean contains​(Shape2D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape2D
        Replies if this shape is inside the given shape.

        You must use the containing functions with a specific parameter type in place of this general function. Indeed, the implementation of this function is unefficient due to the tests against the types of the given shape, and the cast operators.

        Specified by:
        contains in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape to compare to.
        Returns:
        true if the given shape is inside this shape; false otherwise.
      • contains

        @Pure
        boolean contains​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Replies if the given rectangle is inside this shape.
        Parameters:
        rectangle - the rectangle.
        Returns:
        true if the given rectangle is inside this shape, otherwise false.
      • contains

        @Pure
        boolean contains​(double x,
                         double y)
        Replies if the given point is inside this shape.
        Parameters:
        x - x coordinate of the point to test.
        y - y coordinate of the point to test.
        Returns:
        true if the given point is inside this shape, otherwise false.
      • translate

        void translate​(double dx,
                       double dy)
        Translate the shape.
        Parameters:
        dx - x translation.
        dy - y translation.
      • intersects

        @Pure
        default boolean intersects​(Shape2D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape2D
        Replies if this shape is intersecting the given shape.

        You must use the intersection functions with a specific parameter type in place of this general function. Indeed, the implementation of this function is unefficient due to the tests against the types of the given shape, and the cast operators.

        Specified by:
        intersects in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape to compare to.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Replies if this shape is intersecting the given ellipse.
        Parameters:
        ellipse - the ellipse.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Replies if this shape is intersecting the given circle.
        Parameters:
        circle - the circle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Replies if this shape is intersecting the given rectangle.
        Parameters:
        rectangle - the rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Replies if this shape is intersecting the given line.
        Parameters:
        segment - the segment.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Replies if this shape is intersecting the given triangle.
        Parameters:
        triangle - the triangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        default boolean intersects​(Path2afp<?,​?,​?,​?,​?,​?> path)
        Replies if this shape is intersecting the given path.
        Parameters:
        path - the other path.
        Returns:
        true if this shape is intersecting the given path; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(PathIterator2afp<?> iterator)
        Replies if this shape is intersecting the shape representing the given path iterator.
        Parameters:
        iterator - the path iterator.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
        Replies if this shape is intersecting the given rectangle.
        Parameters:
        orientedRectangle - the oriented rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Replies if this shape is intersecting the given parallelogram.
        Parameters:
        parallelogram - the parallelogram.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Replies if this shape is intersecting the given rectangle.
        Parameters:
        roundRectangle - the round rectangle.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(MultiShape2afp<?,​?,​?,​?,​?,​?,​?> multishape)
        Replies if this shape is intersecting the given multishape.
        Parameters:
        multishape - the multishape.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Shape2D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape2D
        Replies the squared value of the minimal distance from this shape to the given shape.
        Specified by:
        getDistanceSquared in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape.
        Returns:
        squared value of the minimal distance between this shape and the given shape.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Replies the minimum distance between this shape and the given ellipse.
        Parameters:
        ellipse - the ellipse.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Replies the minimum distance between this shape and the given circle.
        Parameters:
        circle - the circle.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Replies the minimum distance between this shape and the given rectangle.
        Parameters:
        rectangle - the rectangle.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Replies the minimum distance between this shape and the given segment.
        Parameters:
        segment - the segment.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Replies the minimum distance between this shape and the given triangle.
        Parameters:
        triangle - the triangle.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Path2afp<?,​?,​?,​?,​?,​?> path)
        Replies the minimum distance between this shape and the given path.
        Parameters:
        path - the path.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
        Replies the minimum distance between this shape and the given oriented rectangle.
        Parameters:
        orientedRectangle - the oriented rectangle.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Replies the minimum distance between this shape and the given parallelogram.
        Parameters:
        parallelogram - the parallelogram.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Replies the minimum distance between this shape and the given round rectangle.
        Parameters:
        roundRectangle - the round rectangle.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(MultiShape2afp<?,​?,​?,​?,​?,​?,​?> multishape)
        Replies the minimum distance between this shape and the given multishape.
        Parameters:
        multishape - the multishape.
        Returns:
        the minimum distance between the two shapes.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(Shape2D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape2D
        Replies the point on the shape that is closest to the given shape.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Specified by:
        getClosestPointTo in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape.
        Returns:
        the closest point on the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Replies the closest point on this shape to the given ellipse.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        ellipse - the ellipse.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Replies the closest point on this shape to the given circle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        circle - the circle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Replies the closest point on this shape to the given rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        rectangle - the rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Replies the closest point on this shape to the given segment.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        segment - the segment.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Replies the closest point on this shape to the given triangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        triangle - the triangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
        Replies the closest point on this shape to the given oriented rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        orientedRectangle - the oriented rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Replies the closest point on this shape to the given parallelogram.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        parallelogram - the parallelogram.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Replies the closest point on this shape to the given round rectangle.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        roundRectangle - the round rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Path2afp<?,​?,​?,​?,​?,​?> path)
        Replies the closest point on this shape to the given path.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        path - the path.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(MultiShape2afp<?,​?,​?,​?,​?,​?,​?> multishape)
        Replies the closest point on this shape to the given multishape.

        If the two shapes are intersecting, the replied point is always at the intersection of the two shapes. This function does not enforce the meaning of the replied point in the case of shape intersection. In other words, this function is warranting that the reply point is the either the penetration point, nor a perimeter point, nor any point with a specific meaning.

        Parameters:
        multishape - the multishape.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • createTransformedShape

        @Pure
        default ST createTransformedShape​(Transform2D transform)
        Description copied from interface: Shape2D
        Apply the transformation to the shape and reply the result. This function does not change the current shape.
        Specified by:
        createTransformedShape in interface Shape2D<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Parameters:
        transform - is the transformation to apply to the shape.
        Returns:
        the result of the transformation.