Package org.anchoranalysis.spatial.point
Class PointConverter
Object
PointConverter
Conversion utilities between points with different types and dimensionalities.
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionconvert2iTo3d
(List<Point2i> points) convert2iTo3f
(List<Point2i> points) convert3dTo3f
(List<Point3d> points) convert3fTo3d
(List<Point3f> points) convert3iTo3f
(List<Point3i> points) static Point3d
convertTo3d
(Point2d point) static Point3i
convertTo3i
(Point2i point) static Point3i
convertTo3i
(Point2i point, int z) static Point3d
double3DFromFloat
(Point2f point) static Point2d
doubleFromFloat
(Point2f point) static Point3d
doubleFromFloat
(Point3f point) static Point3d
doubleFromInt
(Point2i point) static Point3d
doubleFromInt
(ReadableTuple3i point) Convert aReadableTuple3i
to aPoint3d
.static Point2f
floatFromDouble
(Point2d point) static Point3f
floatFromDouble
(Point3d point) static Point3f
floatFromInt
(Point2i point) static Point3f
floatFromInt
(ReadableTuple3i point) Convert aReadableTuple3i
to aPoint3f
.static Point3f
floatFromIntDropZ
(ReadableTuple3i point) Creates aReadableTuple3i
to aPoint3f
, preserving X- and Y-components but set setting the Z-component to be0
.static Point3i
intFromDouble
(Point3d point, boolean round) static Point3i
intFromDoubleCeil
(Point3d point) static Point2i
intFromDoubleFloor
(Point2d point) static Point3i
intFromDoubleFloor
(Point3d point) static Point3i
intFromFloat
(Point3f point, boolean round)
-
Method Details
-
intFromDoubleFloor
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
intFromDoubleFloor
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
intFromDoubleCeil
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
convertTo3i
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
convertTo3i
- Parameters:
point
- the point to convert.z
- the value for the Z-axis component in the newly created point.- Returns:
- the newly-created converted point.
-
convertTo3d
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
doubleFromFloat
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
double3DFromFloat
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
doubleFromFloat
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
doubleFromInt
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
doubleFromInt
Convert aReadableTuple3i
to aPoint3d
.- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
floatFromInt
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
floatFromDouble
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
floatFromDouble
- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
floatFromInt
Convert aReadableTuple3i
to aPoint3f
.- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
floatFromIntDropZ
Creates aReadableTuple3i
to aPoint3f
, preserving X- and Y-components but set setting the Z-component to be0
.- Parameters:
point
- the point to convert.- Returns:
- the newly-created converted point.
-
intFromFloat
- Parameters:
point
- the point to convert.round
- if true, each component's value is rounded to the nearest integer, otherwise the ceiling operation is used.- Returns:
- the newly-created converted point.
-
intFromDouble
- Parameters:
point
- the point to convert.round
- if true, each component's value is rounded to the nearest integer, otherwise the ceiling operation is used.- Returns:
- the newly-created converted point.
-
convert3iTo3f
- Parameters:
points
- the list of points to convert.- Returns:
- a newly-created list of converted points.
-
convert3dTo3f
- Parameters:
points
- the list of points to convert.- Returns:
- a newly-created list of converted points.
-
convert2iTo3f
- Parameters:
points
- the list of points to convert.- Returns:
- a newly-created list of converted points.
-
convert2iTo3d
- Parameters:
points
- the list of points to convert.- Returns:
- a newly-created list of converted points.
-
convert3fTo3d
- Parameters:
points
- the list of points to convert.- Returns:
- a newly-created list of converted points.
-
convert3i
- Parameters:
points
- the list of points to convert.round
- if true, each component's value is rounded to the nearest integer, otherwise the ceiling operation is used.- Returns:
- a newly-created list of converted points.
-
convert3i
- Parameters:
points
- the list of points to convert.- Returns:
- a newly-created list of converted points.
-