Package com.openinventor.inventor
Class SbXfBox3f
- java.lang.Object
-
- com.openinventor.inventor.SbBasic
-
- com.openinventor.inventor.SbBox3f
-
- com.openinventor.inventor.SbXfBox3f
-
public class SbXfBox3f extends SbBox3f
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 anSbXfBox3f
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(SbBox3f bb)
Extends the box (if necessary) to contain the given box.void
extendBy(SbVec3f pt)
Extends the box (if necessary) to contain the given 3D point.void
extendBy(SbXfBox3f bb)
Extends the box (if necessary) to contain the given box.float[]
getBounds()
Gets the bounds of the box.SbVec3f
getCenter()
Returns the center of the box.SbMatrix
getInverse()
Gets the inverse of the transformation on the box.SbVec3f[]
getMinMax()
Gets the bounds of the box.float[]
getOrigin()
Returns origin (minimum point) of the box.float[]
getSpan(SbVec3f direction)
Finds the extent of the box along a particular direction.SbMatrix
getTransform()
Gets the transformation on the box.float[]
getValue()
float
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(SbBox3f bb)
Returns true if intersection of given box and this box is not empty.boolean
intersect(SbVec3f 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.SbBox3f
project()
void
setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Sets the bounds of the box.void
setBounds(SbVec3f _min, SbVec3f _max)
Sets the bounds of the box.void
setTransform(SbMatrix m)
Sets the transformation on the box.SbXfBox3f
setValue(float[] components)
SbXfBox3f
setValue(float[] components, int startIndex)
SbXfBox3f
setValue(SbXfBox3d xfbox3d)
Sets value of the box from a double precision box.void
setValue(SbXfBox3f copyFrom)
static SbXfBox3f[]
toArray(long nativeArray, long length)
void
transform(SbMatrix m)
Transforms the box by the given matrix.-
Methods inherited from class com.openinventor.inventor.SbBox3f
computeMaxDistance2, contains, getClosestPoint, getMax, getMin, getSize, intersection, outside, setValue, triangleBoxOverlap
-
-
-
-
Method Detail
-
setValue
public SbXfBox3f setValue(float[] components, int startIndex)
-
setValue
public void setValue(SbXfBox3f copyFrom)
-
getSpan
public float[] getSpan(SbVec3f direction)
Finds the extent of the box along a particular direction.
-
toArray
public static SbXfBox3f[] toArray(long nativeArray, long length)
-
transform
public void transform(SbMatrix m)
Transforms the box by the given matrix.
-
project
public SbBox3f project()
-
extendBy
public void extendBy(SbVec3f 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:SbXfBox3f 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));
-
setValue
public SbXfBox3f setValue(SbXfBox3d xfbox3d)
Sets value of the box from a double precision box.
-
getInverse
public SbMatrix getInverse()
Gets the inverse of the transformation on the box.
-
setBounds
public void setBounds(float xmin, float ymin, float zmin, float xmax, float ymax, float zmax)
Sets the bounds of the box.
-
getTransform
public SbMatrix getTransform()
Gets the transformation on the box.
-
extendBy
public void extendBy(SbXfBox3f bb)
Extends the box (if necessary) to contain the given box.
-
extendBy
public void extendBy(SbBox3f bb)
Extends the box (if necessary) to contain the given box. If the box has had a non-identity transformation applied using thesetTransform()
method, the givenSbBox3f
is assumed to be in the transformed space.
-
getCenter
public SbVec3f getCenter()
Returns the center of the box.
-
intersect
public boolean intersect(SbBox3f bb)
Returns true if intersection of given box and this box is not empty.
-
intersect
public boolean intersect(SbVec3f pt)
Returns true if intersection of given point and this box is not empty.
-
makeEmpty
public void makeEmpty()
Sets the box to contain nothing.
-
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.)
-
hasVolume
public boolean hasVolume()
Checks if the box has volume; i.e., all three dimensions have positive size.
-
setTransform
public void setTransform(SbMatrix m)
Sets the transformation on the box.
-
getBounds
public float[] getBounds()
Gets the bounds of the box.
-
getMinMax
public SbVec3f[] getMinMax()
Gets the bounds of the box.
-
getVolume
public float getVolume()
Gives the volume of the box (0 for an empty box).
-
-