Interface ShapeProducer

All Known Subinterfaces:
Pnt2d, Triangle
All Known Implementing Classes:
AlgebraicLine, AxisAlignedBoundingBox, ConvexHull, Corner, GeometricCircle, GeometricEllipse, HessianLine, HoughLine, LineSegment2d, LocalMinMaxFinder.ExtremalPoint, PixelMap.Pixel, Pnt2d.PntDouble, Pnt2d.PntInt, SiftDescriptor, SlopeInterceptLine, Triangle2D

public interface ShapeProducer
Implementing classes know how to create an AWT Shape.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Shape
    Returns a Shape for this object at the default scale (1).
    getShape(double scale)
    Returns a scaled Shape for this object (default scale is 1).
    static Pnt2d[]
     
    default Shape[]
     
    default Shape[]
    getShapes(double scale)
    Returns a fixed sequence of Shape items for drawing this object, which must contain at least one item.
  • Method Details

    • getShape

      Shape getShape(double scale)
      Returns a scaled Shape for this object (default scale is 1). Must be defined by implementing classes. The interpretation of the scale factor is left to the implementing class. For example, for Pnt2d it specifies the size of the marker (see Pnt2d.getShape(double).
      Parameters:
      scale - the scale of the shape
      Returns:
      a Shape instance
    • getShape

      default Shape getShape()
      Returns a Shape for this object at the default scale (1).
      Returns:
      a Shape instance
    • getShapes

      default Shape[] getShapes(double scale)
      Returns a fixed sequence of Shape items for drawing this object, which must contain at least one item. This is to produce graphic representations that are too complex for a single Shape item. The returned shapes may also be displayed with different strokes or colors.

      By default, this method returns a single item which is the primary shape (obtained by getShape(double)). Implementing classes should override this method if more than one shape must be returned For example, a GeometricEllipse returns three shape items: (a) the ellipse curve, (b) the center mark, (c) the major axes (see GeometricEllipse.getShapes(double)).

      Parameters:
      scale - a scale factor (may be used or ignored)
      Returns:
      sequence of Shape items
    • getShapes

      default Shape[] getShapes()
    • getShapePoints

      static Pnt2d[] getShapePoints(Shape shape)