Class Bounds3D.Builder
- java.lang.Object
-
- org.apache.commons.geometry.euclidean.threed.Bounds3D.Builder
-
-
Field Summary
Fields Modifier and Type Field Description private double
maxX
Maximum x coordinate.private double
maxY
Maximum y coordinate.private double
maxZ
Maximum z coordinate.private double
minX
Minimum x coordinate.private double
minY
Minimum y coordinate.private double
minZ
Minimum z coordinate.
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
Private constructor; instantiate through factory method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bounds3D.Builder
add(Bounds3D bounds)
Add the min and max points from the given bounds to this instance.Bounds3D.Builder
add(Vector3D pt)
Add a point to this instance.Bounds3D.Builder
addAll(java.lang.Iterable<? extends Vector3D> pts)
Add a collection of points to this instance.Bounds3D
build()
Create a newBounds3D
instance from the values in this builder.boolean
hasBounds()
Return true if this builder contains valid min and max coordinate values.
-
-
-
Method Detail
-
add
public Bounds3D.Builder add(Vector3D pt)
Add a point to this instance.- Parameters:
pt
- point to add- Returns:
- this instance
-
addAll
public Bounds3D.Builder addAll(java.lang.Iterable<? extends Vector3D> pts)
Add a collection of points to this instance.- Parameters:
pts
- points to add- Returns:
- this instance
-
add
public Bounds3D.Builder add(Bounds3D bounds)
Add the min and max points from the given bounds to this instance.- Parameters:
bounds
- bounds containing the min and max points to add- Returns:
- this instance
-
hasBounds
public boolean hasBounds()
Return true if this builder contains valid min and max coordinate values.- Returns:
- true if this builder contains valid min and max coordinate values
-
build
public Bounds3D build()
Create a newBounds3D
instance from the values in this builder. The builder can continue to be used to create other instances.- Returns:
- a new bounds instance
- Throws:
java.lang.IllegalStateException
- if no points were given to the builder or any of the computed min and max coordinate values are NaN or infinite- See Also:
hasBounds()
-
-