public final class PointRange extends Object
The minimum and maximum values of any point across the dimensions is always remembered.
Points can be dynamically added and the min/max is updated, as needed.
Constructor and Description |
---|
PointRange() |
Modifier and Type | Method and Description |
---|---|
void |
add(int x,
int y,
int z)
Adds a new point to be considered in the range.
|
void |
add(ReadableTuple3i point)
Adds a new point to be considered in the range.
|
boolean |
isEmpty()
Has a valid min and max defined?
|
BoundingBox |
toBoundingBox()
Creates a
BoundingBox to just cover the range of points that have been added. |
BoundingBox |
toBoundingBoxNoCheck()
Like
toBoundingBox() but if no points exist, an exception is not thrown. |
public void add(ReadableTuple3i point)
point
- the point to add.public void add(int x, int y, int z)
x
- the value along the X-axis for the point to add.y
- the value along the Y-axis for the point to add.z
- the value along the Z-axis for the point to add.public BoundingBox toBoundingBox() throws OperationFailedException
BoundingBox
to just cover the range of points that have been added.OperationFailedException
- if no point has been added yet.public BoundingBox toBoundingBoxNoCheck()
toBoundingBox()
but if no points exist, an exception is not thrown.
Consider calling isEmpty()
first to check.
public boolean isEmpty()
In other words, has at least one point been added?
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.