SbBox2s Class Reference
[Basics]

2D box class. More...

#include <Inventor/SbBox.h>

List of all members.

Public Member Functions

 SbBox2s ()
 SbBox2s (short xmin, short ymin, short xmax, short ymax)
 SbBox2s (const SbVec2s &_min, const SbVec2s &_max)
 ~SbBox2s ()
const SbVec2sgetMin () const
const SbVec2sgetMax () const
void extendBy (const SbVec2s &pt)
void extendBy (const SbBox2s &r)
SbBool intersect (const SbVec2s &pt) const
SbBool intersect (const SbBox2s &bb) const
SbBox2s intersection (const SbBox2s &box) const
void setBounds (short xmin, short ymin, short xmax, short ymax)
void setBounds (const SbVec2s &_min, const SbVec2s &_max)
void getBounds (short &xmin, short &ymin, short &xmax, short &ymax) const
void getBounds (SbVec2s &_min, SbVec2s &_max) const
void getOrigin (short &originX, short &originY) const
void getSize (short &sizeX, short &sizeY) const
SbVec2s getSize () const
float getAspectRatio () const
void makeEmpty ()
SbBool isEmpty () const
SbBool hasArea () const

Friends

int operator== (const SbBox2s &b1, const SbBox2s &b2)
int operator!= (const SbBox2s &b1, const SbBox2s &b2)

Detailed Description

2D box class.

2D box which has planes parallel to the major axes and is specified by two points (specified with short 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, SbVec3f, SbVec2f, SbVec2s, SbMatrix


Constructor & Destructor Documentation

SbBox2s::SbBox2s (  )  [inline]

Constructor for a 2D integer box.

The box is initially empty.

SbBox2s::SbBox2s ( short  xmin,
short  ymin,
short  xmax,
short  ymax 
) [inline]

Constructor for a 2D integer box.

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

SbBox2s::SbBox2s ( const SbVec2s _min,
const SbVec2s _max 
) [inline]

Constructor for a 2D integer box.

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

SbBox2s::~SbBox2s (  )  [inline]

Destructor.


Member Function Documentation

void SbBox2s::extendBy ( const SbBox2s r  ) 

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

void SbBox2s::extendBy ( const SbVec2s pt  ) 

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

float SbBox2s::getAspectRatio (  )  const [inline]

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

void SbBox2s::getBounds ( SbVec2s _min,
SbVec2s _max 
) const [inline]

Gets the corners of the box.

void SbBox2s::getBounds ( short &  xmin,
short &  ymin,
short &  xmax,
short &  ymax 
) const [inline]

Gets the corners of the box.

const SbVec2s& SbBox2s::getMax (  )  const [inline]

Returns the maximum point of the box.

const SbVec2s& SbBox2s::getMin (  )  const [inline]

Returns the minimum point of the box.

void SbBox2s::getOrigin ( short &  originX,
short &  originY 
) const [inline]

Returns origin (minimum point) of box.

SbVec2s SbBox2s::getSize (  )  const [inline]

Return box size.

void SbBox2s::getSize ( short &  sizeX,
short &  sizeY 
) const [inline]

Returns box size.

SbBool SbBox2s::hasArea (  )  const [inline]

Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.

SbBool SbBox2s::intersect ( const SbBox2s bb  )  const

Returns TRUE if the specified box intersects this box.

SbBool SbBox2s::intersect ( const SbVec2s pt  )  const

Returns TRUE if the specified point intersects this box.

SbBox2s SbBox2s::intersection ( const SbBox2s box  )  const

Returns the intersection of the specified box with this box.

Returned box is empty if there is no intersection.

SbBool SbBox2s::isEmpty (  )  const [inline]

Returns TRUE if the box is empty, and FALSE otherwise. Note: Setting the box to all zeros does not make it "empty". Use the makeEmpty() method. (This method only returns true if the maximum X value is less than the minimum X value.)

void SbBox2s::makeEmpty (  ) 

Makes an empty box.

void SbBox2s::setBounds ( const SbVec2s _min,
const SbVec2s _max 
) [inline]

Sets the corners of the box.

void SbBox2s::setBounds ( short  xmin,
short  ymin,
short  xmax,
short  ymax 
) [inline]

Sets the corners of the box.


Friends And Related Function Documentation

int operator!= ( const SbBox2s b1,
const SbBox2s b2 
) [friend]

Inequality comparison.

int operator== ( const SbBox2s b1,
const SbBox2s b2 
) [friend]

Equality comparison.


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

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/