Class MapPolygon

    • Constructor Detail

      • MapPolygon

        public MapPolygon()
        Create a new map element.
      • MapPolygon

        public MapPolygon​(AttributeCollection attributeSource)
        Create a new map element.
        Parameters:
        attributeSource - is the source of the attributes for this map element.
      • MapPolygon

        public MapPolygon​(UUID id)
        Create a new map element.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        Since:
        4.0
      • MapPolygon

        public MapPolygon​(UUID id,
                          AttributeCollection attributeSource)
        Create a new map element.
        Parameters:
        id - is the unique identifier of this element, or null if unknown.
        attributeSource - is the source of the attributes for this map element.
        Since:
        4.0
    • Method Detail

      • getDistance

        @Pure
        public final double getDistance​(Point2D<?,​?> point)
        Replies the distance between this MapElement and point.
        Specified by:
        getDistance in class MapElement
        Parameters:
        point - the point to compute the distance to.
        Returns:
        the distance. Should be negative depending of the MapElement type.
      • distance

        @Pure
        public double distance​(Point2D<?,​?> point,
                               double width)
        Replies the distance between this figure and the specified point.
        Parameters:
        point - is the x-coordinate of the point.
        width - is the width of the polygon.
        Returns:
        the computed distance
      • intersects

        @Pure
        public boolean intersects​(Shape2D<?,​?,​?,​?,​?,​? extends Rectangle2afp<?,​?,​?,​?,​?,​?>> rectangle)
        Replies if this element has an intersection with the specified rectangle.
        Specified by:
        intersects in class MapElement
        Parameters:
        rectangle - the rectangle
        Returns:
        true if this MapElement is intersecting the specified area, otherwise false
      • toPath2D

        @Pure
        public final Path2d toPath2D()
        Replies the Path2D that corresponds to this polygon.
        Returns:
        true if this MapElement is intersecting the specified area, otherwise false