public class BoundingPolytope extends Bounds
Each plane in the BoundingPolytope specifies a half-space defined by the equation:
Constructor and Description |
---|
BoundingPolytope()
Constructs a BoundingPolytope and initializes it to a set of 6
planes that defines a cube such that -1 <= x,y,z <= 1.
|
BoundingPolytope(Bounds boundsObject)
Constructs a BoundingPolytope from the specified bounds object.
|
BoundingPolytope(Bounds[] boundsObjects)
Constructs a BoundingPolytope from the specified array of bounds
objects.
|
BoundingPolytope(Vector4d[] planes)
Constructs a BoundingPolytope using the specified planes.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a copy of a polytope.
|
Bounds |
closestIntersection(Bounds[] boundsObjects)
Finds closest bounding object that intersects this bounding polytope.
|
void |
combine(Bounds boundsObject)
Combines this bounding polytope with a bounding object so that the
resulting bounding polytope encloses the original bounding polytope and the
given bounds object.
|
void |
combine(Bounds[] boundsObjects)
Combines this bounding polytope with an array of bounding objects so that the
resulting bounding polytope encloses the original bounding polytope and the
given array of bounds object.
|
void |
combine(Point3d point)
Combines this bounding polytope with a point.
|
void |
combine(Point3d[] points)
Combines this bounding polytope with an array of points.
|
boolean |
equals(Object bounds)
Indicates whether the specified
bounds object is
equal to this BoundingPolytope object. |
void |
getCenter(Point3d center)
Gets the centroid of this bounding region.
|
int |
getNumPlanes() |
void |
getPlanes(Vector4d[] planes)
Returns the equations of the bounding planes for this bounding polytope.
|
int |
hashCode()
Returns a hash code value for this BoundingPolytope object
based on the data values in this object.
|
boolean |
intersect(Bounds boundsObject)
Test for intersection with another bounds object.
|
boolean |
intersect(Bounds[] boundsObjects)
Test for intersection with another bounds object.
|
boolean |
intersect(Bounds[] boundsObjects,
BoundingPolytope newBoundingPolytope)
Test for intersection with an array of bounds objects.
|
boolean |
intersect(Bounds boundsObject,
BoundingPolytope newBoundPolytope)
Test for intersection with another bounds object.
|
boolean |
intersect(Point3d point)
Test for intersection with a point.
|
boolean |
intersect(Point3d origin,
Vector3d direction)
Test for intersection with a ray.
|
boolean |
isEmpty()
Tests whether the bounding polytope is empty.
|
void |
set(Bounds boundsObject)
Sets the planes for this BoundingPolytope by keeping its current
number and position of planes and computing new planes positions
to enclose the given bounds object.
|
void |
setPlanes(Vector4d[] planes)
Sets the bounding planes for this polytope.
|
String |
toString()
Returns a string representation of this class
|
void |
transform(Bounds boundsObject,
Transform3D matrix)
Modifies the bounding polytope so that it bounds the volume
generated by transforming the given bounding object.
|
void |
transform(Transform3D matrix)
Transforms this bounding polytope by the given transformation matrix.
|
public BoundingPolytope(Vector4d[] planes)
planes
- a set of planes defining the polytope.IllegalArgumentException
- if the length of the
specified array of planes is less than 4.public BoundingPolytope()
public BoundingPolytope(Bounds boundsObject)
boundsObject
- the bounds object from which this polytope
is constructed.public BoundingPolytope(Bounds[] boundsObjects)
boundsObjects
- the array bounds objects from which this
polytope is constructed.public void setPlanes(Vector4d[] planes)
planes
- the new set of planes for this polytopeIllegalArgumentException
- if the length of the
specified array of planes is less than 4.public void getPlanes(Vector4d[] planes)
planes
- an array Vector4d to receive the bounding planespublic int getNumPlanes()
public void set(Bounds boundsObject)
public Object clone()
public boolean equals(Object bounds)
bounds
object is
equal to this BoundingPolytope object. They are equal if the
specified bounds
object is an instance of
BoundingPolytope and all of the data
members of bounds
are equal to the corresponding
data members in this BoundingPolytope.public int hashCode()
public void combine(Bounds boundsObject)
public void combine(Bounds[] boundsObjects)
public void combine(Point3d point)
public void combine(Point3d[] points)
public void transform(Bounds boundsObject, Transform3D matrix)
public void transform(Transform3D matrix)
public boolean intersect(Point3d origin, Vector3d direction)
public boolean isEmpty()
public boolean intersect(Point3d point)
public boolean intersect(Bounds boundsObject)
public boolean intersect(Bounds[] boundsObjects)
public boolean intersect(Bounds boundsObject, BoundingPolytope newBoundPolytope)
boundsObject
- another bounds objectnewBoundPolytope
- the new bounding polytope, which is the intersection of
the boundsObject and this BoundingPolytopepublic boolean intersect(Bounds[] boundsObjects, BoundingPolytope newBoundingPolytope)
boundsObjects
- an array of bounds objectsnewBoundingPolytope
- the new bounding polytope, which is the intersection of
the boundsObject and this BoundingPolytopepublic Bounds closestIntersection(Bounds[] boundsObjects)
closestIntersection
in class Bounds
boundsObjects
- is an array of bounds objectspublic String toString()
Copyright © 2016–2022 SciJava. All rights reserved.