math.geom3d
Class PointSet3D
- java.lang.Object
-
- math.geom3d.PointSet3D
-
-
Constructor Summary
Constructors Constructor and Description PointSet3D()PointSet3D(java.util.Collection<? extends Point3D> points)Points must be a collection of java.awt.Point.PointSet3D(int n)Creates a new point set and allocate memory for storing the points.PointSet3D(Point3D[] points)Instances of Point3D are directly added, other Point are converted to Point3D with the same location.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddPoint(Point3D point)Adds a new point to the set of point.voidaddPoints(java.util.Collection<Point3D> points)voidaddPoints(Point3D[] points)Add a series of pointsBox3DboundingBox()voidclearPoints()Removes all points of the set.Shape3Dclip(Box3D box)booleancontains(Point3D point)doubledistance(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.java.util.Iterator<Point3D>getPoints()Returns an iterator on the internal point collection.booleanisBounded()Returns true if the shape is bounded, that is if we can draw a finite rectangle enclosing the shape.booleanisEmpty()java.util.Iterator<Point3D>iterator()intpointNumber()Returns the number of points in the set.Shape3Dtransform(AffineTransform3D trans)
-
-
-
Constructor Detail
-
PointSet3D
public PointSet3D()
-
PointSet3D
public PointSet3D(int n)
Creates a new point set and allocate memory for storing the points.- Parameters:
n- the number of points to store
-
PointSet3D
public PointSet3D(Point3D[] points)
Instances of Point3D are directly added, other Point are converted to Point3D with the same location.
-
PointSet3D
public PointSet3D(java.util.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-
-
addPoints
public void addPoints(Point3D[] points)
Add a series of points- Parameters:
points- an array of points
-
addPoints
public void addPoints(java.util.Collection<Point3D> points)
-
getPoints
public java.util.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.
-
pointNumber
public int pointNumber()
Returns the number of points in the set.- Returns:
- the number of points
-
boundingBox
public Box3D boundingBox()
- Specified by:
boundingBoxin interfaceShape3D
-
distance
public double distance(Point3D p)
Description copied from interface:Shape3DGets 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.
-
isBounded
public boolean isBounded()
Description copied from interface:Shape3DReturns 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.
-
transform
public Shape3D transform(AffineTransform3D trans)
-
-
DMelt 3.0 © DataMelt by jWork.ORG