Documentation of 'math.geom2d.domain.GenericDomain2D' Java class
GenericDomain2D
math.geom2d.domain

Class GenericDomain2D

  • All Implemented Interfaces:
    Domain2D, GeometricObject2D, Shape2D
    Direct Known Subclasses:
    GenericCirculinearDomain2D


    public class GenericDomain2D
    extends java.lang.Object
    implements Domain2D
    A domain defined from its boundary. The boundary curve must be correctly oriented, non self intersecting, and clearly separating interior and exterior.

    All contains and intersect tests are computed from the signed distance of the boundary curve.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean almostEquals(GeometricObject2D obj, double eps)
      Checks if the two objects are similar up to a given threshold value.
      Polygon2D asPolygon(int n)
      Returns an approximation of the domain as a polygon, or a MultiPolygon.
      Boundary2D boundary()
      Returns the boundary of the set.
      Box2D boundingBox()
      If the domain is bounded, returns the bounding box of its boundary, otherwise returns an infinite bounding box.
      Domain2D clip(Box2D box)
      Clip the shape with the given box, and returns a new shape.
      Domain2D complement()
      Returns the domain which complements this domain in the plane.
      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.
      java.util.Collection<? extends Contour2D> contours()
      Returns the set of contours that enclose this domain.
      static GenericDomain2D create(Boundary2D boundary) 
      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 boundary of the domain, using current Stroke and color.
      boolean equals(java.lang.Object obj) 
      void fill(java.awt.Graphics2D g2)
      Fills the interior of the domain, using the Graphics current Paint.
      boolean isBounded()
      Returns true if the domain is bounded.
      boolean isEmpty()
      Returns true if the shape does not contain any point.
      java.lang.String toString() 
      GenericDomain2D transform(AffineTransform2D trans)
      Returns a new domain which is created from the transformed domain of this boundary.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GenericDomain2D

        public GenericDomain2D(Boundary2D boundary)
    • Method Detail

      • asPolygon

        public Polygon2D asPolygon(int n)
        Description copied from interface: Domain2D
        Returns an approximation of the domain as a polygon, or a MultiPolygon.
        Specified by:
        asPolygon in interface Domain2D
        Returns:
        a polygon
      • boundary

        public Boundary2D boundary()
        Description copied from interface: Domain2D
        Returns the boundary of the set. This boundary is either a continuous non intersecting curve (connected domain), or a set of non intersecting continuous curve (one continuous non-intersection for each connected part of the domain).

        The returned curve is oriented, with an interior and an exterior.

        Specified by:
        boundary in interface Domain2D
        Returns:
        the boundary of the domain
      • contours

        public java.util.Collection<? extends Contour2D> contours()
        Description copied from interface: Domain2D
        Returns the set of contours that enclose this domain. The result is a collection of shapes that implement the Contour2D interface.
        Specified by:
        contours in interface Domain2D
        See Also:
        Contour2D
      • complement

        public Domain2D complement()
        Description copied from interface: Domain2D
        Returns the domain which complements this domain in the plane.
        Specified by:
        complement in interface Domain2D
        Returns:
        the complement of this domain.
      • distance

        public double distance(Point2D p)
        Description copied from interface: Shape2D
        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.
        Specified by:
        distance in interface Shape2D
      • distance

        public double distance(double x,
                               double y)
        Description copied from interface: Shape2D
        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.
        Specified by:
        distance in interface Shape2D
      • isBounded

        public boolean isBounded()
        Returns true if the domain is bounded. The domain is unbounded if either its boundary is unbounded, or a point located outside of the boundary bounding box is located inside of the domain.
        Specified by:
        isBounded in interface Shape2D
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: Shape2D
        Returns true if the shape does not contain any point. This is the case for example for PointSet2D without any point.
        Specified by:
        isEmpty in interface Shape2D
        Returns:
        true if the shape does not contain any point.
      • clip

        public Domain2D clip(Box2D box)
        Description copied from interface: Shape2D
        Clip the shape with the given box, and returns a new shape. The box must be bounded.
        Specified by:
        clip in interface Domain2D
        Specified by:
        clip in interface Shape2D
        Parameters:
        box - the clipping box
        Returns:
        the clipped shape
      • boundingBox

        public Box2D boundingBox()
        If the domain is bounded, returns the bounding box of its boundary, otherwise returns an infinite bounding box.
        Specified by:
        boundingBox in interface Shape2D
        Returns:
        the bounding box of the shape.
      • contains

        public boolean contains(double x,
                                double y)
        Description copied from interface: Shape2D
        Checks if the shape contains the planar point defined by (x,y).
        Specified by:
        contains in interface Shape2D
      • contains

        public boolean contains(Point2D p)
        Description copied from interface: Shape2D
        Checks if the shape contains the given point.
        Specified by:
        contains in interface Shape2D
      • draw

        public void draw(java.awt.Graphics2D g2)
        Description copied from interface: Domain2D
        Draws the boundary of the domain, using current Stroke and color.
        Specified by:
        draw in interface Domain2D
        Specified by:
        draw in interface Shape2D
        Parameters:
        g2 - the Graphics to draw on
      • fill

        public void fill(java.awt.Graphics2D g2)
        Description copied from interface: Domain2D
        Fills the interior of the domain, using the Graphics current Paint.
        Specified by:
        fill in interface Domain2D
        Parameters:
        g2 - the Graphics to fill on
      • almostEquals

        public boolean almostEquals(GeometricObject2D obj,
                                    double eps)
        Description copied from interface: GeometricObject2D
        Checks if the two objects are similar up to a given threshold value. This method can be used to compare the results of geometric computations, that introduce errors due to numerical computations.
        Specified by:
        almostEquals in interface GeometricObject2D
        Parameters:
        obj - the object to compare
        eps - a threshold value, for example the minimal coordinate difference
        Returns:
        true if both object have the same value up to the threshold
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.