Open Inventor Release 2024.1.2
 
Loading...
Searching...
No Matches
SbBox2i32 Class Reference

2D box class. More...

#include <Inventor/SbBox.h>

Public Member Functions

 SbBox2i32 ()
 Constructor for a 2D integer box.
 
 SbBox2i32 (int xmin, int ymin, int xmax, int ymax)
 Constructor for a 2D integer box.
 
 SbBox2i32 (const SbVec2i32 &_min, const SbVec2i32 &_max)
 Constructor for a 2D integer box.
 
 ~SbBox2i32 ()
 Destructor.
 
const SbVec2i32getMin () const
 Returns the minimum point of the box.
 
const SbVec2i32getMax () const
 Returns the maximum point of the box.
 
void extendBy (const SbVec2i32 &pt)
 Extends this box (if necessary) to contain the specified point.
 
void extendBy (const SbBox2i32 &r)
 Extends this box (if necessary) to contain the specified box.
 
SbBool intersect (const SbVec2i32 &pt) const
 Returns TRUE if the specified point intersects this box.
 
SbBool intersect (const SbBox2i32 &bb) const
 Returns TRUE if the specified box intersects this box.
 
SbBox2i32 intersection (const SbBox2i32 &box) const
 Returns the intersection of the specified box with this box.
 
void setBounds (int xmin, int ymin, int xmax, int ymax)
 Sets the corners of the box.
 
void setBounds (const SbVec2i32 &_min, const SbVec2i32 &_max)
 Sets the corners of the box.
 
void getBounds (int &xmin, int &ymin, int &xmax, int &ymax) const
 Gets the corners of the box.
 
void getBounds (SbVec2i32 &_min, SbVec2i32 &_max) const
 Gets the corners of the box.
 
void getOrigin (int &originX, int &originY) const
 Returns origin (minimum point) of box.
 
void getSize (int &sizeX, int &sizeY) const
 Returns box size.
 
SbVec2i32 getSize () const
 Return box size.
 
float getAspectRatio () const
 Returns aspect ratio (ratio of width to height) of box.
 
void makeEmpty ()
 Makes an empty box.
 

Friends

int operator== (const SbBox2i32 &b1, const SbBox2i32 &b2)
 Equality comparison.
 
int operator!= (const SbBox2i32 &b1, const SbBox2i32 &b2)
 Inequality comparison.
 

Detailed Description

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.

SEE ALSO

SbBox3f, SbXfBox3f, SbBox2f, SbBox2s, SbVec3f, SbVec2f, SbVec2i32, SbMatrix

Definition at line 2383 of file SbBox.h.

Constructor & Destructor Documentation

◆ SbBox2i32() [1/3]

SbBox2i32::SbBox2i32 ( )
inline

Constructor for a 2D integer box.

The box is initially empty.

Definition at line 2389 of file SbBox.h.

◆ SbBox2i32() [2/3]

SbBox2i32::SbBox2i32 ( int  xmin,
int  ymin,
int  xmax,
int  ymax 
)
inline

Constructor for a 2D integer box.

xmin , ymin , xmax , and ymax are the bounds of the box.

Definition at line 2396 of file SbBox.h.

◆ SbBox2i32() [3/3]

SbBox2i32::SbBox2i32 ( const SbVec2i32 _min,
const SbVec2i32 _max 
)
inline

Constructor for a 2D integer box.

m_min and m_max are the corners of the diagonal that defines the box.

Definition at line 2403 of file SbBox.h.

◆ ~SbBox2i32()

SbBox2i32::~SbBox2i32 ( )
inline

Destructor.

Definition at line 2409 of file SbBox.h.

Member Function Documentation

◆ extendBy() [1/2]

void SbBox2i32::extendBy ( const SbBox2i32 r)

Extends this box (if necessary) to contain the specified box.

◆ extendBy() [2/2]

void SbBox2i32::extendBy ( const SbVec2i32 pt)

Extends this box (if necessary) to contain the specified point.

◆ getAspectRatio()

float SbBox2i32::getAspectRatio ( ) const
inline

Returns aspect ratio (ratio of width to height) of box.

Definition at line 2512 of file SbBox.h.

◆ getBounds() [1/2]

void SbBox2i32::getBounds ( int &  xmin,
int &  ymin,
int &  xmax,
int &  ymax 
) const
inline

Gets the corners of the box.

Definition at line 2465 of file SbBox.h.

◆ getBounds() [2/2]

void SbBox2i32::getBounds ( SbVec2i32 _min,
SbVec2i32 _max 
) const
inline

Gets the corners of the box.

Definition at line 2473 of file SbBox.h.

◆ getMax()

const SbVec2i32 & SbBox2i32::getMax ( ) const
inline

Returns the maximum point of the box.

Definition at line 2421 of file SbBox.h.

◆ getMin()

const SbVec2i32 & SbBox2i32::getMin ( ) const
inline

Returns the minimum point of the box.

Definition at line 2415 of file SbBox.h.

◆ getOrigin()

void SbBox2i32::getOrigin ( int &  originX,
int &  originY 
) const
inline

Returns origin (minimum point) of box.

Definition at line 2479 of file SbBox.h.

◆ getSize() [1/2]

SbVec2i32 SbBox2i32::getSize ( ) const
inline

Return box size.

Definition at line 2501 of file SbBox.h.

◆ getSize() [2/2]

void SbBox2i32::getSize ( int &  sizeX,
int &  sizeY 
) const
inline

Returns box size.

Definition at line 2485 of file SbBox.h.

◆ intersect() [1/2]

SbBool SbBox2i32::intersect ( const SbBox2i32 bb) const

Returns TRUE if the specified box intersects this box.

◆ intersect() [2/2]

SbBool SbBox2i32::intersect ( const SbVec2i32 pt) const

Returns TRUE if the specified point intersects this box.

◆ intersection()

SbBox2i32 SbBox2i32::intersection ( const SbBox2i32 box) const

Returns the intersection of the specified box with this box.

Returned box is empty if there is no intersection.

◆ makeEmpty()

void SbBox2i32::makeEmpty ( )

Makes an empty box.

◆ setBounds() [1/2]

void SbBox2i32::setBounds ( const SbVec2i32 _min,
const SbVec2i32 _max 
)
inline

Sets the corners of the box.

Definition at line 2459 of file SbBox.h.

◆ setBounds() [2/2]

void SbBox2i32::setBounds ( int  xmin,
int  ymin,
int  xmax,
int  ymax 
)
inline

Sets the corners of the box.

Definition at line 2453 of file SbBox.h.

Friends And Related Symbol Documentation

◆ operator!=

int operator!= ( const SbBox2i32 b1,
const SbBox2i32 b2 
)
friend

Inequality comparison.

Definition at line 2528 of file SbBox.h.

◆ operator==

int operator== ( const SbBox2i32 b1,
const SbBox2i32 b2 
)
friend

Equality comparison.


The documentation for this class was generated from the following file: