Documentation of 'math.geom2d.Shape2D' Java class
Shape2D
math.geom2d

Interface Shape2D

    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static double ACCURACY
      The constant used for testing results.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      Box2D boundingBox()
      Returns the bounding box of the shape.
      Shape2D clip(Box2D box)
      Clip the shape with the given box, and returns a new shape.
      boolean contains(double x, double y)
      Checks if the shape contains the planar point defined by (x,y).
      boolean contains(Point2D p)
      Checks if the shape contains the given point.
      double distance(double x, double y)
      Returns the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e.
      double distance(Point2D p)
      Returns the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.
      void draw(java.awt.Graphics2D g2)
      Draws the shape on the given graphics.
      boolean isBounded()
      Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape.
      boolean isEmpty()
      Returns true if the shape does not contain any point.
      Shape2D transform(AffineTransform2D trans)
      Transforms the shape by an affine transform.
    • Field Detail

      • ACCURACY

        static final double ACCURACY
        The constant used for testing results.
        See Also:
        Constant Field Values
    • Method Detail

      • contains

        boolean contains(double x,
                         double y)
        Checks if the shape contains the planar point defined by (x,y).
      • contains

        boolean contains(Point2D p)
        Checks if the shape contains the given point.
      • distance

        double distance(Point2D p)
        Returns the distance of the shape to the given point, or the distance of point to the frontier of the shape in the case of a plain shape.
      • distance

        double distance(double x,
                        double y)
        Returns the distance of the shape to the given point, specified by x and y, or the distance of point to the frontier of the shape in the case of a plain (i.e. fillable) shape.
      • isBounded

        boolean isBounded()
        Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape. For example, a straight line or a parabola are not bounded.
      • isEmpty

        boolean isEmpty()
        Returns true if the shape does not contain any point. This is the case for example for PointSet2D without any point.
        Returns:
        true if the shape does not contain any point.
      • boundingBox

        Box2D boundingBox()
        Returns the bounding box of the shape.
        Returns:
        the bounding box of the shape.
      • clip

        Shape2D clip(Box2D box)
        Clip the shape with the given box, and returns a new shape. The box must be bounded.
        Parameters:
        box - the clipping box
        Returns:
        the clipped shape
      • transform

        Shape2D transform(AffineTransform2D trans)
        Transforms the shape by an affine transform. Subclasses may override the type of returned shape.
        Parameters:
        trans - an affine transform
        Returns:
        the transformed shape
      • draw

        void draw(java.awt.Graphics2D g2)
        Draws the shape on the given graphics. If the shape is empty, nothing is drawn. If the shape is unbounded, an exception is thrown.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.