Class Bounds3D.Builder
java.lang.Object
org.apache.commons.geometry.euclidean.threed.Bounds3D.Builder
- Enclosing class:
Bounds3D
Class used to construct
Bounds3D
instances.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Builder()
Private constructor; instantiate through factory method. -
Method Summary
Modifier and TypeMethodDescriptionAdd the min and max points from the given bounds to this instance.Add a point to this instance.Add a collection of points to this instance.build()
Create a newBounds3D
instance from the values in this builder.boolean
Return true if this builder contains valid min and max coordinate values.
-
Field Details
-
minX
private double minXMinimum x coordinate. -
minY
private double minYMinimum y coordinate. -
minZ
private double minZMinimum z coordinate. -
maxX
private double maxXMaximum x coordinate. -
maxY
private double maxYMaximum y coordinate. -
maxZ
private double maxZMaximum z coordinate.
-
-
Constructor Details
-
Builder
private Builder()Private constructor; instantiate through factory method.
-
-
Method Details
-
add
Add a point to this instance.- Parameters:
pt
- point to add- Returns:
- this instance
-
addAll
Add a collection of points to this instance.- Parameters:
pts
- points to add- Returns:
- this instance
-
add
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
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:
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:
-