Interface RectangularShape1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends RectangularShape1afp<?,​?,​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>>

  • Type Parameters:
    ST - is the type of the general implementation.
    IT - is the type of the implementation of this shape.
    P - is the type of the points.
    V - is the type of the vectors.
    S - is the type of the segment.
    B - is the type of the bounding boxes.
    All Superinterfaces:
    Cloneable, JsonableObject, Serializable, Shape1afp<ST,​IT,​P,​V,​S,​B>, Shape1D<ST,​IT,​P,​V,​S,​B>
    All Known Subinterfaces:
    Rectangle1afp<ST,​IT,​P,​V,​S,​B>
    All Known Implementing Classes:
    AbstractRectangularShape1d, AbstractRectangularShape1dfx, Rectangle1d, Rectangle1dfx

    public interface RectangularShape1afp<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends RectangularShape1afp<?,​?,​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>>
    extends Shape1afp<ST,​IT,​P,​V,​S,​B>
    Fonctional interface that represented a rectangular shape on a plane.
    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:43
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    mathgeom
    • Method Detail

      • set

        default void set​(double x,
                         double y,
                         double width,
                         double height)
        Change the frame of the rectangle.
        Parameters:
        x - x coordinate of the lower corner of the rectangular shape.
        y - y coordinate of the lower corner of the rectangular shape.
        width - width of the rectangular shape.
        height - height of the rectangular shape.
      • set

        default void set​(Point2D<?,​?> min,
                         Point2D<?,​?> max)
        Change the frame of the rectangle.
        Parameters:
        min - is the min corner of the rectangle.
        max - is the max corner of the rectangle.
      • setWidth

        default void setWidth​(double width)
        Change the width of the rectangle, not the min corner.
        Parameters:
        width - width of the rectangular shape.
      • setHeight

        default void setHeight​(double height)
        Change the height of the rectangle, not the min corner.
        Parameters:
        height - height of the rectangular shape.
      • setFromCorners

        void setFromCorners​(double x1,
                            double y1,
                            double x2,
                            double y2)
        Change the frame of the rectangle conserving previous min and max if needed.
        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.
      • setFromCorners

        default void setFromCorners​(Point2D<?,​?> p1,
                                    Point2D<?,​?> p2)
        Change the frame of the rectangle conserving previous min and max if needed.
        Parameters:
        p1 - the first corner.
        p2 - the second corner.
      • setFromCenter

        default void setFromCenter​(double centerX,
                                   double centerY,
                                   double cornerX,
                                   double cornerY)
        Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
        Parameters:
        centerX - the X coordinate of the specified center point
        centerY - the Y coordinate of the specified center point
        cornerX - the X coordinate of the specified corner point
        cornerY - the Y coordinate of the specified corner point
      • setFromCenter

        default void setFromCenter​(Point2D<?,​?> center,
                                   Point2D<?,​?> corner)
        Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
        Parameters:
        center - the specified center point
        corner - the specified corner point
      • getMinX

        @Pure
        double getMinX()
        Replies the min X.
        Returns:
        the min x.
      • setMinX

        void setMinX​(double x)
        Set the min X conserving previous min if needed.
        Parameters:
        x - the min x.
      • getCenter

        @Pure
        default P getCenter()
        Replies the center.
        Returns:
        the center.
      • getCenterX

        @Pure
        default double getCenterX()
        Replies the center x.
        Returns:
        the center x.
      • getMaxX

        @Pure
        double getMaxX()
        Replies the max x.
        Returns:
        the max x.
      • setMaxX

        void setMaxX​(double x)
        Set the max X conserving previous max if needed.
        Parameters:
        x - the max x.
      • getMinY

        @Pure
        double getMinY()
        Replies the min y.
        Returns:
        the min y.
      • setMinY

        void setMinY​(double y)
        Set the min Y conserving previous min if needed.
        Parameters:
        y - the min y.
      • getCenterY

        @Pure
        default double getCenterY()
        Replies the center y.
        Returns:
        the center y.
      • getMaxY

        @Pure
        double getMaxY()
        Replies the max y.
        Returns:
        the max y.
      • setMaxY

        void setMaxY​(double y)
        Set the max Y conserving previous max if needed.
        Parameters:
        y - the max y.
      • getWidth

        @Pure
        default double getWidth()
        Replies the width.
        Returns:
        the width.
      • getHeight

        @Pure
        default double getHeight()
        Replies the height.
        Returns:
        the height.
      • isEmpty

        @Pure
        default boolean isEmpty()
        Description copied from interface: Shape1D
        Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.
        Specified by:
        isEmpty in interface Shape1D<ST extends Shape1afp<?,​?,​P,​V,​S,​B>,​IT extends RectangularShape1afp<?,​?,​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>>
        Returns:
        true if the shape is empty; false otherwise.
      • inflate

        default void inflate​(double minXBorder,
                             double minYBorder,
                             double maxXBorder,
                             double maxYBorder)
        Inflate this rectangle with the given amounts.

        The four borders may be inflated. If the value associated to a border is positive, the border is moved outside the current rectangle. If the value is negative, the border is moved inside the rectangle.

        Parameters:
        minXBorder - the value to substract to the minimum x.
        minYBorder - the value to substract to the minimum y.
        maxXBorder - the value to add to the maximum x.
        maxYBorder - the value to add to the maximum y.