Interface Shape2ai<ST extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​IE,​P,​V,​B>>

    • Method Detail

      • getPointIterator

        @Pure
        Iterator<P> getPointIterator()
        Replies an iterator on the points covered by the perimeter of this shape.

        The implementation of the iterator depends on the shape type. There is no warranty about the order of the points.

        Returns:
        an iterator on the points that are located at the perimeter of the shape.
      • 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 Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​IE,​P,​V,​B>>
        Parameters:
        pt - the point.
        Returns:
        true if the given shape is intersecting this shape, otherwise false.
      • contains

        @Pure
        boolean contains​(int x,
                         int 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.
      • contains

        @Pure
        boolean contains​(Rectangle2ai<?,​?,​?,​?,​?,​?> box)
        Replies if the given rectangle is inside this shape.
        Parameters:
        box - the rectangle to test.
        Returns:
        true if the given box is inside the shape.
      • 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 Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape to compare to.
        Returns:
        true if the given shape is inside this shape; false otherwise.
      • translate

        void translate​(int dx,
                       int 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 Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​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​(Rectangle2ai<?,​?,​?,​?,​?,​?> 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​(Circle2ai<?,​?,​?,​?,​?,​?> 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​(Segment2ai<?,​?,​?,​?,​?,​?> segment)
        Replies if this shape is intersecting the given segment.
        Parameters:
        segment - the segment.
        Returns:
        true if this shape is intersecting the given shape; false if there is no intersection.
      • intersects

        @Pure
        boolean intersects​(MultiShape2ai<?,​?,​?,​?,​?,​?,​?> 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.
      • intersects

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

        @Pure
        boolean intersects​(PathIterator2ai<?> iterator)
        Replies if this shape is intersecting the path described by the given iterator.
        Parameters:
        iterator - the path iterator.
        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 Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​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​(Rectangle2ai<?,​?,​?,​?,​?,​?> 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​(Circle2ai<?,​?,​?,​?,​?,​?> 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​(Segment2ai<?,​?,​?,​?,​?,​?> 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​(MultiShape2ai<?,​?,​?,​?,​?,​?,​?> multishape)
        Replies the minimum distance between this shape and the given multishape.
        Parameters:
        multishape - the multishape.
        Returns:
        the minimum distance between the two shapes.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Path2ai<?,​?,​?,​?,​?,​?> path)
        Replies the minimum distance between this shape and the given path.
        Parameters:
        path - the path.
        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 Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​IE,​P,​V,​B>>
        Parameters:
        shape - the shape.
        Returns:
        the closest point on the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Rectangle2ai<?,​?,​?,​?,​?,​?> rectangle)
        Replies the closest point on this shape to the given rectangle.
        Parameters:
        rectangle - the rectangle.
        Returns:
        the closest point on this shape to the given shape; or the point if the point is in this shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Circle2ai<?,​?,​?,​?,​?,​?> circle)
        Replies the closest point on this shape to the given rectangle.
        Parameters:
        circle - the circle.
        Returns:
        the closest point on this shape to the given shape; or the point if the point is in this shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Segment2ai<?,​?,​?,​?,​?,​?> segment)
        Replies the closest point on this shape to the given rectangle.
        Parameters:
        segment - the segment.
        Returns:
        the closest point on this shape to the given shape; or the point if the point is in this shape.
      • getClosestPointTo

        @Pure
        default P getClosestPointTo​(MultiShape2ai<?,​?,​?,​?,​?,​?,​?> multishape)
        Replies the closest point on this shape to the given rectangle.
        Parameters:
        multishape - the multishape.
        Returns:
        the closest point on this shape to the given shape; or the point if the point is in this shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Path2ai<?,​?,​?,​?,​?,​?> path)
        Replies the closest point on this shape to the given rectangle.
        Parameters:
        path - the path.
        Returns:
        the closest point on this shape to the given shape; or the point if the point is in this 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 Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​IE,​P,​V,​B>>
        Parameters:
        transform - is the transformation to apply to the shape.
        Returns:
        the result of the transformation.