Package com.openinventor.inventor
Class SbBox2i32
- java.lang.Object
-
- com.openinventor.inventor.SbBasic
-
- com.openinventor.inventor.SbBox2i32
-
public class SbBox2i32 extends SbBasic
2D box class. 2D box which has planes parallel to the major axes and is specified by two points (specified with 32 bits integers) on a diagonal. This class is part of the standard Open Inventor datatype classes and is used as input and output to geometry operations.
-
-
Field Summary
Fields Modifier and Type Field Description int[]
array
-
Constructor Summary
Constructors Constructor Description SbBox2i32()
Constructor for a 2D integer box.SbBox2i32(int[] components)
SbBox2i32(int xmin, int ymin, int xmax, int ymax)
Constructor for a 2D integer box.SbBox2i32(SbBox2i32 copyFrom)
SbBox2i32(SbVec2i32 _min, SbVec2i32 _max)
Constructor for a 2D integer box.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
void
extendBy(SbBox2i32 r)
Extends this box (if necessary) to contain the specified box.void
extendBy(SbVec2i32 pt)
Extends this box (if necessary) to contain the specified point.float
getAspectRatio()
Returns aspect ratio (ratio of width to height) of box.int[]
getBounds()
Gets the corners of the box.SbVec2i32
getMax()
Returns the maximum point of the box.SbVec2i32
getMin()
Returns the minimum point of the box.SbVec2i32[]
getMinMax()
Gets the corners of the box.int[]
getOrigin()
Returns origin (minimum point) of box.int[]
getSize()
Returns box size.int[]
getValue()
boolean
intersect(SbBox2i32 bb)
Returns true if the specified box intersects this box.boolean
intersect(SbVec2i32 pt)
Returns true if the specified point intersects this box.SbBox2i32
intersection(SbBox2i32 box)
Returns the intersection of the specified box with this box.void
makeEmpty()
Makes an empty box.void
setBounds(int xmin, int ymin, int xmax, int ymax)
Sets the corners of the box.void
setBounds(SbVec2i32 _min, SbVec2i32 _max)
Sets the corners of the box.SbBox2i32
setValue(int[] components)
SbBox2i32
setValue(int[] components, int startIndex)
void
setValue(SbBox2i32 copyFrom)
static SbBox2i32[]
toArray(long nativeArray, long length)
-
-
-
Constructor Detail
-
SbBox2i32
public SbBox2i32(SbBox2i32 copyFrom)
-
SbBox2i32
public SbBox2i32(int[] components)
-
SbBox2i32
public SbBox2i32()
Constructor for a 2D integer box. The box is initially empty.
-
SbBox2i32
public SbBox2i32(int xmin, int ymin, int xmax, int ymax)
Constructor for a 2D integer box. xmin , ymin , xmax , and ymax are the bounds of the box.
-
-
Method Detail
-
getValue
public int[] getValue()
-
setValue
public SbBox2i32 setValue(int[] components)
-
setValue
public SbBox2i32 setValue(int[] components, int startIndex)
-
setValue
public void setValue(SbBox2i32 copyFrom)
-
getAspectRatio
public float getAspectRatio()
Returns aspect ratio (ratio of width to height) of box.
-
intersection
public SbBox2i32 intersection(SbBox2i32 box)
Returns the intersection of the specified box with this box. Returned box is empty if there is no intersection.
-
toArray
public static SbBox2i32[] toArray(long nativeArray, long length)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
makeEmpty
public void makeEmpty()
Makes an empty box.
-
getMax
public SbVec2i32 getMax()
Returns the maximum point of the box.
-
setBounds
public void setBounds(int xmin, int ymin, int xmax, int ymax)
Sets the corners of the box.
-
getMin
public SbVec2i32 getMin()
Returns the minimum point of the box.
-
extendBy
public void extendBy(SbVec2i32 pt)
Extends this box (if necessary) to contain the specified point.
-
intersect
public boolean intersect(SbVec2i32 pt)
Returns true if the specified point intersects this box.
-
intersect
public boolean intersect(SbBox2i32 bb)
Returns true if the specified box intersects this box.
-
extendBy
public void extendBy(SbBox2i32 r)
Extends this box (if necessary) to contain the specified box.
-
getOrigin
public int[] getOrigin()
Returns origin (minimum point) of box.
-
getSize
public int[] getSize()
Returns box size.
-
getBounds
public int[] getBounds()
Gets the corners of the box.
-
getMinMax
public SbVec2i32[] getMinMax()
Gets the corners of the box.
-
-