math.geom3d
Class PointSet3D

Package class diagram package PointSet3D
java.lang.Object
  extended by math.geom3d.PointSet3D
All Implemented Interfaces:
Serializable, Iterable<Point3D>, Shape3D

public class PointSet3D
extends Object
implements Shape3D, Iterable<Point3D>

Author:
dlegland
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface math.geom3d.Shape3D
Shape3D.EmptySet3D
 
Field Summary
protected  Collection<Point3D> points
           
 
Fields inherited from interface math.geom3d.Shape3D
ACCURACY, EMPTY_SET
 
Constructor Summary
PointSet3D()
           
PointSet3D(Collection<? extends Point3D> points)
          Points must be a collection of java.awt.Point.
PointSet3D(Point3D[] points)
          Instances of Point3D are directly added, other Point are converted to Point3D with the same location.
PointSet3D(javax.vecmath.Tuple3d[] points)
          Instances of Point3D are directly added, other Point are converted to Point3D with the same location.
 
Method Summary
 void addPoint(Point3D point)
          Adds a new point to the set of point.
 void addPoint(javax.vecmath.Tuple3d point)
          Adds a new point to the set of point.
 void addPoints(Collection<Point3D> points)
           
 void addPoints(Point3D[] points)
          Add a series of points
 void clearPoints()
          Removes all points of the set.
 Shape3D clip(Box3D box)
           
 boolean contains(Point3D point)
           
 Box3D getBoundingBox()
           
 double getDistance(Point3D p)
          Gets 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.
 Iterator<Point3D> getPoints()
          Returns an iterator on the internal point collection.
 int getPointsNumber()
          Returns the number of points in the set.
 boolean isBounded()
          Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape.
 boolean isEmpty()
           
 Iterator<Point3D> iterator()
           
 Shape3D transform(AffineTransform3D trans)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

protected Collection<Point3D> points
Constructor Detail

PointSet3D

public PointSet3D()

PointSet3D

public PointSet3D(Point3D[] points)
Instances of Point3D are directly added, other Point are converted to Point3D with the same location.


PointSet3D

public PointSet3D(javax.vecmath.Tuple3d[] points)
Instances of Point3D are directly added, other Point are converted to Point3D with the same location.


PointSet3D

public PointSet3D(Collection<? extends Point3D> points)
Points must be a collection of java.awt.Point. Instances of Point3D are directly added, other Point are converted to Point3D with the same location.

Parameters:
points -
Method Detail

addPoint

public void addPoint(Point3D point)
Adds a new point to the set of point. If point is not an instance of Point3D, a Point3D with same location is added instead of point.

Parameters:
point -

addPoint

public void addPoint(javax.vecmath.Tuple3d point)
Adds a new point to the set of point. If point is not an instance of Point3D, a Point3D with same location is added instead of point.

Parameters:
point -

addPoints

public void addPoints(Point3D[] points)
Add a series of points

Parameters:
points - an array of points

addPoints

public void addPoints(Collection<Point3D> points)

getPoints

public Iterator<Point3D> getPoints()
Returns an iterator on the internal point collection.

Returns:
the collection of points

clearPoints

public void clearPoints()
Removes all points of the set.


getPointsNumber

public int getPointsNumber()
Returns the number of points in the set.

Returns:
the number of points

clip

public Shape3D clip(Box3D box)
Specified by:
clip in interface Shape3D

getBoundingBox

public Box3D getBoundingBox()
Specified by:
getBoundingBox in interface Shape3D

getDistance

public double getDistance(Point3D p)
Description copied from interface: Shape3D
Gets 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:
getDistance in interface Shape3D

contains

public boolean contains(Point3D point)
Specified by:
contains in interface Shape3D

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Shape3D

isBounded

public boolean isBounded()
Description copied from interface: Shape3D
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.

Specified by:
isBounded in interface Shape3D

transform

public Shape3D transform(AffineTransform3D trans)
Specified by:
transform in interface Shape3D

iterator

public Iterator<Point3D> iterator()
Specified by:
iterator in interface Iterable<Point3D>


Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.