Package com.solibri.geometry.primitive2d
Interface MAABB2d
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static MAABB2d
create(Vector2d lowerBound, Vector2d upperBound)
Returns a bounding box with the given bounds.static MAABB2d
create(AABB2d boundingBox)
Returns a bounding box with the same bounds as in the given bounding box.static MAABB2d
create(Collection<Vector2d> points)
Returns the minimum area axis-aligned bounding box for the given collection of points.void
extend(Vector2d point)
Extends this axis-aligned bounding box to contain the given point.void
extend(Collection<Vector2d> points)
Extends this axis-aligned bounding box to contain the given points.void
resize(double resizeValue)
Resizes this bounding box by the given value.void
set(Vector2d lowerBound, Vector2d upperBound)
Sets the given bounds to this bounding box.void
setLowerBound(Vector2d lowerBound)
Sets the lower bound of this bounding box to the given value.void
setUpperBound(Vector2d upperBound)
Sets the upper bound of this bounding box to the given value.void
translate(Vector2d translator)
Translates this bounding box by the given vector.-
Methods inherited from interface com.solibri.geometry.primitive2d.AABB2d
contains, contains, getArea, getCentroid, getEdges, getLowerBound, getSizeX, getSizeY, getUpperBound, getVertices, intersects, isDegenerate
-
-
-
-
Method Detail
-
create
static MAABB2d create(AABB2d boundingBox)
Returns a bounding box with the same bounds as in the given bounding box.- Parameters:
boundingBox
- the bounding box whose bounds are set to the returned box- Returns:
- a new bounding box with the same bounds as in the given bounding box
- Throws:
IllegalArgumentException
- if given bounding box is not valid, meaning that lowerBound is greater than upperBound in any dimension- Since:
- 9.10.2
-
create
static MAABB2d create(Collection<Vector2d> points)
Returns the minimum area axis-aligned bounding box for the given collection of points.- Parameters:
points
- the points for which the minimum area axis-aligned bounding box is computed- Returns:
- the minimum area axis-aligned bounding box for the given collection of points
- Since:
- 9.10.2
-
create
static MAABB2d create(Vector2d lowerBound, Vector2d upperBound)
Returns a bounding box with the given bounds. If lowerBound is greater than upperBound in either dimension, IllegalArgumentException is thrown.- Parameters:
lowerBound
- the lower bound for the bounding boxupperBound
- the upper bound for the bounding box- Returns:
- a bounding box with the given bounds
- Throws:
IllegalArgumentException
- if lowerBound is greater than upperBound in either dimension- Since:
- 9.10.2
-
extend
void extend(Vector2d point)
Extends this axis-aligned bounding box to contain the given point. If the point is already inside this box, then this method has no effect.- Parameters:
point
- the point that this box is extended to include- Since:
- 9.10.2
-
extend
void extend(Collection<Vector2d> points)
Extends this axis-aligned bounding box to contain the given points. If all of the points are already inside this box, then this method has no effect.- Parameters:
points
- the points that this box is extended to include- Since:
- 9.10.2
-
resize
void resize(double resizeValue)
Resizes this bounding box by the given value. If the value is positive, then both bounds of the box are extended by that amount in both dimensions. If the value is negative, then the bounds are decreased by that amount.- Parameters:
resizeValue
- the value by which this bounding box is resized- Since:
- 9.10.2
-
set
void set(Vector2d lowerBound, Vector2d upperBound)
Sets the given bounds to this bounding box.- Parameters:
lowerBound
- the lower bound that is set to this boxupperBound
- the upper bound that is set to this box- Since:
- 9.10.2
-
setUpperBound
void setUpperBound(Vector2d upperBound)
Sets the upper bound of this bounding box to the given value.- Parameters:
upperBound
- the upper bound that is set to this bounding box- Since:
- 9.10.2
-
setLowerBound
void setLowerBound(Vector2d lowerBound)
Sets the lower bound of this bounding box to the given value.- Parameters:
lowerBound
- the lower bound that is set to this bounding box- Since:
- 9.10.2
-
translate
void translate(Vector2d translator)
Translates this bounding box by the given vector.- Parameters:
translator
- the vector by which this bounding box is translated- Since:
- 9.10.2
-
-