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 Point3dconvertTo3d(Point2d point) static Point3iconvertTo3i(Point2i point) static Point3iconvertTo3i(Point2i point, int z) static Point3ddouble3DFromFloat(Point2f point) static Point2ddoubleFromFloat(Point2f point) static Point3ddoubleFromFloat(Point3f point) static Point3ddoubleFromInt(Point2i point) static Point3ddoubleFromInt(ReadableTuple3i point) Convert aReadableTuple3ito aPoint3d.static Point2ffloatFromDouble(Point2d point) static Point3ffloatFromDouble(Point3d point) static Point3ffloatFromInt(Point2i point) static Point3ffloatFromInt(ReadableTuple3i point) Convert aReadableTuple3ito aPoint3f.static Point3ffloatFromIntDropZ(ReadableTuple3i point) Creates aReadableTuple3ito aPoint3f, preserving X- and Y-components but set setting the Z-component to be0.static Point3iintFromDouble(Point3d point, boolean round) static Point3iintFromDoubleCeil(Point3d point) static Point2iintFromDoubleFloor(Point2d point) static Point3iintFromDoubleFloor(Point3d point) static Point3iintFromFloat(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 aReadableTuple3ito 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 aReadableTuple3ito aPoint3f.- Parameters:
point- the point to convert.- Returns:
- the newly-created converted point.
-
floatFromIntDropZ
Creates aReadableTuple3ito 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.
-