Constructor and Description |
---|
SimpleMBR(double... values)
Create a new SimpleMBR using the given double values for max and min.
|
SimpleMBR(T t,
MBRConverter<T> converter)
Create a new SimpleMBR from a given object and a MBRConverter
|
Modifier and Type | Method and Description |
---|---|
int |
getDimensions() |
double |
getMax(int axis)
Get the maximum value for the given axis
|
double |
getMin(int axis)
Get the minimum value for the given axis
|
boolean |
intersects(MBR other)
Check if the other MBR intersects this one
|
<T> boolean |
intersects(T t,
MBRConverter<T> converter)
Check if this MBR intersects the rectangle given by the object
and the MBRConverter.
|
String |
toString() |
MBR |
union(MBR mbr)
Return a new MBR that is the union of this mbr and the other
|
public SimpleMBR(double... values)
values
- the min and max values for each dimension.public SimpleMBR(T t, MBRConverter<T> converter)
t
- the object to create the bounding box forconverter
- the actual MBRConverter to usepublic int getDimensions()
getDimensions
in interface MBR
public double getMin(int axis)
MBR
public double getMax(int axis)
MBR
public MBR union(MBR mbr)
MBR
public boolean intersects(MBR other)
MBR
intersects
in interface MBR
other
- the MBR to check againstpublic <T> boolean intersects(T t, MBRConverter<T> converter)
MBR
intersects
in interface MBR
T
- the object typet
- a rectangular objectconverter
- the MBRConverter