Package com.openinventor.inventor
Class SbXfBox3d
- java.lang.Object
-
- com.openinventor.inventor.SbBasic
-
- com.openinventor.inventor.SbBox3d
-
- com.openinventor.inventor.SbXfBox3d
-
public class SbXfBox3d extends SbBox3d
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 anSbBox3f
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 anSbXfBox3d
without expanding the box, and after all transformations have been done, the box can be expanded to an axis-aligned box if necessary.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
void
extendBy(SbBox3d bb)
Extends the box (if necessary) to contain the given box.void
extendBy(SbVec3d pt)
Extends the box (if necessary) to contain the given 3D point.void
extendBy(SbXfBox3d bb)
Extends the box (if necessary) to contain the given box.double[]
getBounds()
Gets the bounds of the box.SbVec3d
getCenter()
Returns the center of the box.SbMatrixd
getInverse()
Gets the inverse of the transformation on the box.SbVec3d[]
getMinMax()
Gets the bounds of the box.double[]
getOrigin()
Returns origin (minimum point) of the box.double[]
getSize()
Returns size of the box.double[]
getSpan(SbVec3d direction)
Finds the extent of the box along a particular direction.SbMatrixd
getTransform()
Gets the transformation on the box.double[]
getValue()
double
getVolume()
Gives the volume of the box (0 for an empty box).boolean
hasVolume()
Checks if the box has volume; i.e., all three dimensions have positive size.boolean
intersect(SbBox3d bb)
Returns true if intersection of this XfBox3d and the given Box3d is not empty.boolean
intersect(SbVec3d pt)
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
makeEmpty()
Sets the box to contain nothing.SbBox3d
project()
void
setBounds(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax)
Sets the bounds of the box.void
setBounds(SbVec3d _min, SbVec3d _max)
Sets the bounds of the box.void
setTransform(SbMatrixd m)
Sets the transformation on the box.SbXfBox3d
setValue(double[] components)
SbXfBox3d
setValue(double[] components, int startIndex)
void
setValue(SbXfBox3d copyFrom)
SbXfBox3d
setValue(SbXfBox3f xfbox3f)
Sets value of the box from a single precision box.static SbXfBox3d[]
toArray(long nativeArray, long length)
void
transform(SbMatrixd m)
Transforms the box by the given matrix.-
Methods inherited from class com.openinventor.inventor.SbBox3d
contains, getClosestPoint, getMax, getMin, intersection, outside, setValue
-
-
-
-
Method Detail
-
setValue
public SbXfBox3d setValue(double[] components, int startIndex)
-
setValue
public void setValue(SbXfBox3d copyFrom)
-
setTransform
public void setTransform(SbMatrixd m)
Sets the transformation on the box.
-
transform
public void transform(SbMatrixd m)
Transforms the box by the given matrix.
-
getInverse
public SbMatrixd getInverse()
Gets the inverse of the transformation on the box.
-
project
public SbBox3d project()
-
getTransform
public SbMatrixd getTransform()
Gets the transformation on the box.
-
toArray
public static SbXfBox3d[] toArray(long nativeArray, long length)
-
setValue
public SbXfBox3d setValue(SbXfBox3f xfbox3f)
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
public boolean intersect(SbBox3d bb)
Returns true if intersection of this XfBox3d and the given Box3d is not empty.
-
getMinMax
public SbVec3d[] 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
public boolean intersect(SbVec3d pt)
Returns true if intersection of given point and this box is not empty.
-
extendBy
public void extendBy(SbVec3d pt)
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
public SbVec3d getCenter()
Returns the center of the box.
-
getSpan
public double[] getSpan(SbVec3d direction)
Finds the extent of the box along a particular direction.
-
extendBy
public void extendBy(SbXfBox3d bb)
Extends the box (if necessary) to contain the given box.
-
makeEmpty
public void makeEmpty()
Sets the box to contain nothing.
-
extendBy
public void extendBy(SbBox3d bb)
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.)
-
-