Package com.openinventor.inventor
Class SbXfBox3d
java.lang.Object
com.openinventor.inventor.SbBasic
com.openinventor.inventor.SbBox3d
com.openinventor.inventor.SbXfBox3d
3D box with an associated transformation matrix.
A 3D box with an arbitrary transformation applied. This class is useful when a box will be transformed frequently; if an
SbBox3f
is used for this purpose it will expand each time it is transformed in order to keep itself axis-aligned. Transformations can be accumulated on an SbXfBox3d
without expanding the box, and after all transformations have been done, the box can be expanded to an axis-aligned box if necessary.
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
void
Extends the box (if necessary) to contain the given box.void
Extends the box (if necessary) to contain the given 3D point.void
Extends the box (if necessary) to contain the given box.double[]
Gets the bounds of the box.Returns the center of the box.Gets the inverse of the transformation on the box.SbVec3d[]
Gets the bounds of the box.double[]
Returns origin (minimum point) of the box.double[]
getSize()
Returns size of the box.double[]
Finds the extent of the box along a particular direction.Gets the transformation on the box.double[]
getValue()
double
Gives the volume of the box (0 for an empty box).boolean
Checks if the box has volume; i.e., all three dimensions have positive size.boolean
Returns true if intersection of this XfBox3d and the given Box3d is not empty.boolean
Returns true if intersection of given point and this box is not empty.boolean
isEmpty()
Returns true if the box is empty, and false otherwise.void
Sets the box to contain nothing.project()
void
setBounds
(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) Sets the bounds of the box.void
Sets the bounds of the box.void
Sets the transformation on the box.setValue
(double[] components) setValue
(double[] components, int startIndex) void
Sets value of the box from a single precision box.static SbXfBox3d[]
toArray
(long nativeArray, long length) void
Transforms the box by the given matrix.Methods inherited from class com.openinventor.inventor.SbBox3d
contains, getClosestPoint, getMax, getMin, intersection, outside, setValue
-
Constructor Details
-
SbXfBox3d
-
SbXfBox3d
public SbXfBox3d(double[] components) -
SbXfBox3d
Constructor. -
SbXfBox3d
Constructor. -
SbXfBox3d
public SbXfBox3d()Constructor. The box is initially empty.
-
-
Method Details
-
getValue
public double[] getValue() -
setValue
-
setValue
-
setValue
-
equals
-
setTransform
Sets the transformation on the box. -
transform
Transforms the box by the given matrix. -
getInverse
Gets the inverse of the transformation on the box. -
project
-
getTransform
Gets the transformation on the box. -
toArray
-
setBounds
Sets the bounds of the box. -
getSize
public double[] getSize()Returns size of the box. -
setValue
Sets value of the box from a single precision box. -
getVolume
public double getVolume()Gives the volume of the box (0 for an empty box). -
intersect
Returns true if intersection of this XfBox3d and the given Box3d is not empty. -
getMinMax
Gets the bounds of the box. -
getBounds
public double[] getBounds()Gets the bounds of the box. -
getOrigin
public double[] getOrigin()Returns origin (minimum point) of the box. -
setBounds
public void setBounds(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax) Sets the bounds of the box. -
intersect
Returns true if intersection of given point and this box is not empty. -
extendBy
Extends the box (if necessary) to contain the given 3D point. If the box has had a non-identity transformation applied using thesetTransform()
method, the point is assumed to be in the transformed space. For example, the following code sequence:SbXfBox3d bbox = new SbXfBox3f(); bbox.extendBy(new SbVec3f(0, 0, 0)); SbMatrix trans = new SbMatrix(); trans.setTranslate(new SbVec3f(1, 1, 1)); bbox.setTransform(trans); bbox.extendBy(new SbVec3f(0, 0, 0)); -
hasVolume
public boolean hasVolume()Checks if the box has volume; i.e., all three dimensions have positive size. -
getCenter
Returns the center of the box. -
getSpan
Finds the extent of the box along a particular direction. -
extendBy
Extends the box (if necessary) to contain the given box. -
makeEmpty
public void makeEmpty()Sets the box to contain nothing. -
extendBy
Extends the box (if necessary) to contain the given box. -
isEmpty
public boolean isEmpty()Returns true if the box is empty, and false otherwise. Note: Setting the box to all zeros does not make it "empty". Use themakeEmpty()
method. (This method only returns true if the maximum X value is less than the minimum X value.)
-