Interface RoundRectangle2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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>>

  • Type Parameters:
    ST - is the type of the general implementation.
    IT - is the type of the implementation of this shape.
    IE - is the type of the path elements.
    P - is the type of the points.
    V - is the type of the vectors.
    B - is the type of the bounding boxes.
    All Superinterfaces:
    Cloneable, JsonableObject, RectangularShape2afp<ST,​IT,​IE,​P,​V,​B>, Serializable, Shape2afp<ST,​IT,​IE,​P,​V,​B>, Shape2D<ST,​IT,​PathIterator2afp<IE>,​P,​V,​B>
    All Known Implementing Classes:
    RoundRectangle2d, RoundRectangle2dfx

    public interface RoundRectangle2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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>>
    extends RectangularShape2afp<ST,​IT,​IE,​P,​V,​B>
    Fonctional interface that represented a 2D round rectangle on a plane.
    Version:
    17.0 2020-01-04 14:41:43
    Author:
    Stéphane GALLAND, Hamza JAFFALI
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathgeom
    • Method Detail

      • containsRoundRectangleRectangle

        @Pure
        static boolean containsRoundRectangleRectangle​(double rx1,
                                                       double ry1,
                                                       double rwidth1,
                                                       double rheight1,
                                                       double awidth,
                                                       double aheight,
                                                       double rx2,
                                                       double ry2,
                                                       double rwidth2,
                                                       double rheight2)
        Replies if a rectangle is inside in the round rectangle.
        Parameters:
        rx1 - is the lowest corner of the round rectangle.
        ry1 - is the lowest corner of the round rectangle.
        rwidth1 - is the width of the round rectangle.
        rheight1 - is the height of the round rectangle.
        awidth - is the width of the arc of the round rectangle.
        aheight - is the height of the arc of the round rectangle.
        rx2 - is the lowest corner of the inner-candidate rectangle.
        ry2 - is the lowest corner of the inner-candidate rectangle.
        rwidth2 - is the width of the inner-candidate rectangle.
        rheight2 - is the height of the inner-candidate rectangle.
        Returns:
        true if the given rectangle is inside the ellipse; otherwise false.
      • containsRoundRectanglePoint

        @Pure
        static boolean containsRoundRectanglePoint​(double rx,
                                                   double ry,
                                                   double rwidth,
                                                   double rheight,
                                                   double awidth,
                                                   double aheight,
                                                   double px,
                                                   double py)
        Replies if a point is inside in the round rectangle.
        Parameters:
        rx - is the lowest corner of the round rectangle.
        ry - is the lowest corner of the round rectangle.
        rwidth - is the width of the round rectangle.
        rheight - is the height of the round rectangle.
        awidth - is the width of the arc of the round rectangle.
        aheight - is the height of the arc of the round rectangle.
        px - is the point.
        py - is the point.
        Returns:
        true if the given rectangle is inside the ellipse; otherwise false.
      • intersectsRoundRectangleSegment

        @Pure
        static boolean intersectsRoundRectangleSegment​(double rx1,
                                                       double ry1,
                                                       double rx2,
                                                       double ry2,
                                                       double aw,
                                                       double ah,
                                                       double sx1,
                                                       double sy1,
                                                       double sx2,
                                                       double sy2)
        Replies if the round rectangle is intersecting the segment.
        Parameters:
        rx1 - is the first corner of the rectangle.
        ry1 - is the first corner of the rectangle.
        rx2 - is the second corner of the rectangle.
        ry2 - is the second corner of the rectangle.
        aw - is the width of the arcs of the rectangle.
        ah - is the height of the arcs of the rectangle.
        sx1 - is the first point of the segment.
        sy1 - is the first point of the segment.
        sx2 - is the second point of the segment.
        sy2 - is the second point of the segment.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsRoundRectangleRoundRectangle

        @Pure
        static boolean intersectsRoundRectangleRoundRectangle​(double r1x1,
                                                              double r1y1,
                                                              double r1x2,
                                                              double r1y2,
                                                              double r1aw,
                                                              double r1ah,
                                                              double r2x1,
                                                              double r2y1,
                                                              double r2x2,
                                                              double r2y2,
                                                              double r2aw,
                                                              double r2ah)
        Replies if two round rectangles are intersecting.
        Parameters:
        r1x1 - is the first corner of the first rectangle.
        r1y1 - is the first corner of the first rectangle.
        r1x2 - is the second corner of the first rectangle.
        r1y2 - is the second corner of the first rectangle.
        r1aw - is the width of the arcs of the first rectangle.
        r1ah - is the height of the arcs of the first rectangle.
        r2x1 - is the first corner of the second rectangle.
        r2y1 - is the first corner of the second rectangle.
        r2x2 - is the second corner of the second rectangle.
        r2y2 - is the second corner of the second rectangle.
        r2aw - is the width of the arcs of the second rectangle.
        r2ah - is the height of the arcs of the second rectangle.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsRoundRectangleCircle

        @Pure
        static boolean intersectsRoundRectangleCircle​(double rx1,
                                                      double ry1,
                                                      double rx2,
                                                      double ry2,
                                                      double aw,
                                                      double ah,
                                                      double cx,
                                                      double cy,
                                                      double radius)
        Replies if a round rectangle and a circle are intersecting.
        Parameters:
        rx1 - is the first corner of the rectangle.
        ry1 - is the first corner of the rectangle.
        rx2 - is the second corner of the rectangle.
        ry2 - is the second corner of the rectangle.
        aw - is the width of the arcs of the rectangle.
        ah - is the height of the arcs of the rectangle.
        cx - is the center of the circle.
        cy - is the center of the circle.
        radius - is the radius of the circle.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsRoundRectangleRectangle

        @Pure
        static boolean intersectsRoundRectangleRectangle​(double r1x1,
                                                         double r1y1,
                                                         double r1x2,
                                                         double r1y2,
                                                         double r1aw,
                                                         double r1ah,
                                                         double r2x1,
                                                         double r2y1,
                                                         double r2x2,
                                                         double r2y2)
        Replies if a round rectangle and a rectangle are intersecting.
        Parameters:
        r1x1 - is the first corner of the first rectangle.
        r1y1 - is the first corner of the first rectangle.
        r1x2 - is the second corner of the first rectangle.
        r1y2 - is the second corner of the first rectangle.
        r1aw - is the width of the arcs of the first rectangle.
        r1ah - is the height of the arcs of the first rectangle.
        r2x1 - is the first corner of the second rectangle.
        r2y1 - is the first corner of the second rectangle.
        r2x2 - is the second corner of the second rectangle.
        r2y2 - is the second corner of the second rectangle.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • intersectsRoundRectangleEllipse

        @Pure
        static boolean intersectsRoundRectangleEllipse​(double rx1,
                                                       double ry1,
                                                       double rx2,
                                                       double ry2,
                                                       double aw,
                                                       double ah,
                                                       double ex,
                                                       double ey,
                                                       double ew,
                                                       double eh)
        Replies if a round rectangle and an ellipse are intersecting.
        Parameters:
        rx1 - is the first corner of the rectangle.
        ry1 - is the first corner of the rectangle.
        rx2 - is the second corner of the rectangle.
        ry2 - is the second corner of the rectangle.
        aw - is the width of the arcs of the rectangle.
        ah - is the height of the arcs of the rectangle.
        ex - is the coordinate of the ellipse corner.
        ey - is the coordinate of the ellipse corner.
        ew - is the width of the ellipse.
        eh - is the height of the ellipse.
        Returns:
        true if the two shapes are intersecting; otherwise false
      • getArcWidth

        @Pure
        double getArcWidth()
        Gets the width of the arc that rounds off the corners.
        Returns:
        the width of the arc that rounds off the corners of this RoundRectangle2afp.
      • getArcHeight

        @Pure
        double getArcHeight()
        Gets the height of the arc that rounds off the corners.
        Returns:
        the height of the arc that rounds off the corners of this RoundRectangle2afp.
      • setArcWidth

        void setArcWidth​(double arcWidth)
        Set the width of the arc that rounds off the corners.
        Parameters:
        arcWidth - is the width of the arc that rounds off the corners of this RoundRectangle2afp.
      • setArcHeight

        void setArcHeight​(double arcHeight)
        Set the height of the arc that rounds off the corners.
        Parameters:
        arcHeight - is the height of the arc that rounds off the corners of this RoundRectangle2afp.
      • set

        default void set​(double x,
                         double y,
                         double width,
                         double height,
                         double arcWidth,
                         double arcHeight)
        Change the frame of the rectangle.
        Parameters:
        x - new x coordinate of the minimum corner.
        y - new y coordinate of the minimum corner.
        width - new width of the rectangle.
        height - new height of the rectangle.
        arcWidth - is the width of the arc that rounds off the corners of this RoundRectangle2afp.
        arcHeight - is the height of the arc that rounds off the corners of this RoundRectangle2afp.
      • setFromCorners

        void setFromCorners​(double x1,
                            double y1,
                            double x2,
                            double y2,
                            double arcWidth,
                            double arcHeight)
        Change the frame of the rectangle.
        Parameters:
        x1 - is the coordinate of the first corner.
        y1 - is the coordinate of the first corner.
        x2 - is the coordinate of the second corner.
        y2 - is the coordinate of the second corner.
        arcWidth - is the width of the arc that rounds off the corners of this RoundRectangle2afp.
        arcHeight - is the height of the arc that rounds off the corners of this RoundRectangle2afp.
      • contains

        default boolean contains​(double x,
                                 double y)
        Description copied from interface: Shape2afp
        Replies if the given point is inside this shape.
        Specified by:
        contains in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        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.
      • getClosestPointTo

        default P getClosestPointTo​(Circle2afp<?,​?,​?,​?,​?,​?> circle)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        circle - the circle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Ellipse2afp<?,​?,​?,​?,​?,​?> ellipse)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        ellipse - the ellipse.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Rectangle2afp<?,​?,​?,​?,​?,​?> rectangle)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        rectangle - the rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Segment2afp<?,​?,​?,​?,​?,​?> segment)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        segment - the segment.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Triangle2afp<?,​?,​?,​?,​?,​?> triangle)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        triangle - the triangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(OrientedRectangle2afp<?,​?,​?,​?,​?,​?> orientedRectangle)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        orientedRectangle - the oriented rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Parallelogram2afp<?,​?,​?,​?,​?,​?> parallelogram)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        parallelogram - the parallelogram.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(RoundRectangle2afp<?,​?,​?,​?,​?,​?> roundRectangle)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        roundRectangle - the round rectangle.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.
      • getClosestPointTo

        default P getClosestPointTo​(Path2afp<?,​?,​?,​?,​?,​?> path)
        Description copied from interface: Shape2afp
        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.

        Specified by:
        getClosestPointTo in interface Shape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RoundRectangle2afp<?,​?,​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:
        path - the path.
        Returns:
        the closest point on the shape; or the point itself if it is inside the shape.