Documentation of 'math.geom2d.point.PointArray2D' Java class
PointArray2D
math.geom2d.point

Class PointArray2D

    • Constructor Summary

      Constructors 
      Constructor and Description
      PointArray2D()
      Creates a new PointArray2D without any points.
      PointArray2D(java.util.Collection<? extends Point2D> points)
      Points must be a collection of java.awt.Point.
      PointArray2D(int n)
      Creates a new empty PointArray2D, but preallocates the memory for storing a given amount of points.
      PointArray2D(Point2D... points)
      Instances of Point2D are directly added, other Point are converted to Point2D with the same location.
      PointArray2D(PointSet2D set)
      Copy constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      void add(int index, Point2D point)
      Inserts the specified shape at the specified position in this set (optional operation).
      boolean add(Point2D point)
      Add a new point to the set of point.
      void addAll(java.util.Collection<? extends Point2D> points)
      Add a series of points
      void addAll(Point2D[] points)
      Add a series of points
      boolean almostEquals(GeometricObject2D obj, double eps)
      Checks if the two objects are similar up to a given threshold value.
      Box2D boundingBox()
      Returns the bounding box of the shape.
      CirculinearDomain2D buffer(double dist)
      Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d.
      void clear()
      remove all points of the set.
      PointArray2D clip(Box2D box)
      Returns a new point set containing only points located within the box.
      PointArray2D clone()
      Deprecated. 
      use copy constructor instead (0.11.2)
      boolean contains(double x, double y)
      Checks if the shape contains the planar point defined by (x,y).
      boolean contains(Point2D point)
      Checks if the shape contains the given point.
      static <T extends Point2D>
      PointArray2D
      create(java.util.Collection<T> points) 
      static PointArray2D create(int size)
      Allocate memory for the specified number of points.
      static <T extends Point2D>
      PointArray2D
      create(T... points) 
      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)
      Return distance to the closest point of the collection
      void draw(java.awt.Graphics2D g2)
      Draws the point set on the specified Graphics2D, using default radius equal to 1.
      void draw(java.awt.Graphics2D g2, double r)
      Draws the point set on the specified Graphics2D, by filling a disc with a given radius.
      boolean equals(java.lang.Object obj)
      Returns true if the given object is an instance of PointSet2D that contains the same number of points, such that iteration on each set returns equal points.
      Point2D get(int index)
      Returns the shape at a given position.
      int indexOf(Point2D point)
      Returns the index of the shape in this set.
      boolean isBounded()
      Always return true.
      boolean isEmpty()
      Returns true if the point set is empty, i.e.
      java.util.Iterator<Point2D> iterator() 
      java.util.Collection<Point2D> points()
      return an iterator on the internal point collection.
      Point2D remove(int index)
      Removes the shape at the specified position in this set (optional operation).
      boolean remove(Point2D point)
      Removes the first occurrence of the specified element from this list, if it is present.
      int size()
      Returns the number of points in the set.
      PointArray2D transform(AffineTransform2D trans)
      Transforms the point set by returning a new point set containing each transformed point.
      PointArray2D transform(CircleInversion2D inv)
      Transforms the shape by a circle inversion.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • PointArray2D

        public PointArray2D()
        Creates a new PointArray2D without any points.
      • PointArray2D

        public PointArray2D(int n)
        Creates a new empty PointArray2D, but preallocates the memory for storing a given amount of points.
        Parameters:
        n - the expected number of points in the PointArray2D.
      • PointArray2D

        public PointArray2D(Point2D... points)
        Instances of Point2D are directly added, other Point are converted to Point2D with the same location.
      • PointArray2D

        public PointArray2D(PointSet2D set)
        Copy constructor
      • PointArray2D

        public PointArray2D(java.util.Collection<? extends Point2D> points)
        Points must be a collection of java.awt.Point. Instances of Point2D are directly added, other Point are converted to Point2D with the same location.
        Parameters:
        points -
    • Method Detail

      • create

        public static <T extends Point2DPointArray2D create(java.util.Collection<T> points)
      • create

        public static PointArray2D create(int size)
        Allocate memory for the specified number of points.
      • add

        public boolean add(Point2D point)
        Add a new point to the set of point. If point is not an instance of Point2D, a Point2D with same location is added instead of point.
        Specified by:
        add in interface PointSet2D
        Specified by:
        add in interface ShapeSet2D<Point2D>
        Parameters:
        point -
      • add

        public void add(int index,
                        Point2D point)
        Description copied from interface: ShapeSet2D
        Inserts the specified shape at the specified position in this set (optional operation).
        Specified by:
        add in interface ShapeSet2D<Point2D>
      • addAll

        public void addAll(Point2D[] points)
        Add a series of points
        Parameters:
        points - an array of points
      • addAll

        public void addAll(java.util.Collection<? extends Point2D> points)
        Description copied from interface: PointSet2D
        Add a series of points
        Specified by:
        addAll in interface PointSet2D
        Parameters:
        points - an array of points
      • get

        public Point2D get(int index)
        Description copied from interface: ShapeSet2D
        Returns the shape at a given position.
        Specified by:
        get in interface ShapeSet2D<Point2D>
        Parameters:
        index - the position of the shape
        Returns:
        the shape at the given position
      • remove

        public boolean remove(Point2D point)
        Description copied from interface: ShapeSet2D
        Removes the first occurrence of the specified element from this list, if it is present. If the list does not contain the element, it is unchanged. Returns true if this list contained the specified element (or equivalently, if this list changed as a result of the call).
        Specified by:
        remove in interface ShapeSet2D<Point2D>
      • remove

        public Point2D remove(int index)
        Description copied from interface: ShapeSet2D
        Removes the shape at the specified position in this set (optional operation).
        Specified by:
        remove in interface ShapeSet2D<Point2D>
      • points

        public java.util.Collection<Point2D> points()
        return an iterator on the internal point collection.
        Specified by:
        points in interface PointSet2D
        Specified by:
        points in interface PointShape2D
        Returns:
        the collection of points
      • clear

        public void clear()
        remove all points of the set.
        Specified by:
        clear in interface ShapeSet2D<Point2D>
      • buffer

        public CirculinearDomain2D buffer(double dist)
        Description copied from interface: CirculinearShape2D
        Computes the buffer of the shape, formed by the set of points located at a distance from the shape that is lower or equal to d.
        Specified by:
        buffer in interface CirculinearShape2D
        Parameters:
        dist - the maximal distance between a point of the buffer and the shape
        Returns:
        the buffer of the shape
      • distance

        public double distance(Point2D p)
        Return distance to the closest point of the collection
        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()
        Always return true.
        Specified by:
        isBounded in interface Shape2D
      • isEmpty

        public boolean isEmpty()
        Returns true if the point set is empty, i.e. the number of points is 0.
        Specified by:
        isEmpty in interface Shape2D
        Returns:
        true if the shape does not contain any point.
      • clip

        public PointArray2D clip(Box2D box)
        Description copied from interface: PointSet2D
        Returns a new point set containing only points located within the box.
        Specified by:
        clip in interface PointSet2D
        Specified by:
        clip in interface PointShape2D
        Specified by:
        clip in interface Shape2D
        Parameters:
        box - the clipping box
        Returns:
        the clipped shape
      • boundingBox

        public Box2D boundingBox()
        Description copied from interface: Shape2D
        Returns the bounding box of the shape.
        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
      • draw

        public void draw(java.awt.Graphics2D g2)
        Draws the point set on the specified Graphics2D, using default radius equal to 1.
        Specified by:
        draw in interface Shape2D
        Parameters:
        g2 - the graphics to draw the point set
      • draw

        public void draw(java.awt.Graphics2D g2,
                         double r)
        Draws the point set on the specified Graphics2D, by filling a disc with a given radius.
        Parameters:
        g2 - the graphics to draw the point set
      • iterator

        public java.util.Iterator<Point2D> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<Point2D>
      • 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
      • equals

        public boolean equals(java.lang.Object obj)
        Returns true if the given object is an instance of PointSet2D that contains the same number of points, such that iteration on each set returns equal points.
        Overrides:
        equals in class java.lang.Object
      • clone

        @Deprecated
        public PointArray2D clone()
        Deprecated. use copy constructor instead (0.11.2)
        Overrides:
        clone in class java.lang.Object

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.