Interface Shape1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Shape1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>

    • Method Detail

      • contains

        @Pure
        default boolean contains​(Point1D<?,​?,​?> pt)
        Description copied from interface: Shape1D
        Replies if the given point is inside this shape.
        Specified by:
        contains in interface Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Shape1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        pt - the point.
        Returns:
        true if the given shape is intersecting this shape, otherwise false.
      • contains

        @Pure
        default boolean contains​(Shape1D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape1D
        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 Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Shape1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        shape - the shape to compare to.
        Returns:
        true if the given shape is inside this shape; false otherwise.
      • contains

        @Pure
        boolean contains​(Rectangle1afp<?,​?,​?,​?,​?,​?> 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​(Segment1D<?,​?> segment,
                         double x,
                         double y)
        Replies if the given point is inside this shape.
        Parameters:
        segment - the segment to test.
        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​(Shape1D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape1D
        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 Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Shape1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​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​(Rectangle1afp<?,​?,​?,​?,​?,​?> 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.
      • getDistanceSquared

        @Pure
        default double getDistanceSquared​(Shape1D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape1D
        Replies the squared value of the minimal distance from this shape to the given shape.
        Specified by:
        getDistanceSquared in interface Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Shape1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        shape - the shape.
        Returns:
        squared value of the minimal distance between this shape and the given shape.
      • getDistanceSquared

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

        @Pure
        default P getClosestPointTo​(Shape1D<?,​?,​?,​?,​?,​?> shape)
        Description copied from interface: Shape1D
        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 Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends Shape1afp<?,​?,​P,​V,​S,​B>,​P extends Point1D<? super P,​? super V,​? super S>,​V extends Vector1D<? super V,​? super P,​? super S>,​S extends Segment1D<?,​?>,​B extends Rectangle1afp<?,​?,​P,​V,​S,​B>>
        Parameters:
        shape - the shape.
        Returns:
        the closest point on the shape.
      • getClosestPointTo

        @Pure
        P getClosestPointTo​(Rectangle1afp<?,​?,​?,​?,​?,​?> 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.