Open Inventor Reference
SbBox2f Class Reference

2D box class. More...

#include <Inventor/SbBox.h>

List of all members.

Public Member Functions

 SbBox2f ()
 Constructs an empty box.
 SbBox2f (float xmin, float ymin, float xmax, float ymax)
 Constructor given bounds.
 SbBox2f (const SbVec2f &_min, const SbVec2f &_max)
 Constructor given minimum and maximum points.
 ~SbBox2f ()
 Destructor.
const SbVec2fgetMin () const
 Returns the minimum and maximum points of the box.
const SbVec2fgetMax () const
 Returns the minimum and maximum points of the box.
SbVec2f getCenter () const
 Returns the center of the box.
void extendBy (const SbVec2f &pt)
 Extends Box2f (if necessary) to contain given 2D point.
void extendBy (const SbBox2f &r)
 Extends Box2f (if necessary) to contain given Box2f.
SbBool intersect (const SbVec2f &pt) const
 Returns TRUE if intersection of given point and Box2f is not empty.
SbBool intersect (const SbBox2f &bb) const
 Returns TRUE if intersection of given Box2f and Box2f is not empty.
void setBounds (float xmin, float ymin, float xmax, float ymax)
 Sets the corners of the box.
void setBounds (const SbVec2f &_min, const SbVec2f &_max)
void getBounds (float &xmin, float &ymin, float &xmax, float &ymax) const
void getBounds (SbVec2f &_min, SbVec2f &_max) const
SbVec2f getClosestPoint (const SbVec2f &point)
 Returns the closest point on the box to the given point.
void getOrigin (float &originX, float &originY) const
 Gets box origin.
void getSize (float &sizeX, float &sizeY) const
 Gets box size.
float getAspectRatio () const
 Gets box aspect ratio.
void makeEmpty ()
 Makes an empty box.
SbBool isEmpty () const
 Returns TRUE if the box is empty, and FALSE otherwise.
SbBool hasArea () const
 Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.

Friends

INVENTOR_API int operator== (const SbBox2f &b1, const SbBox2f &b2)
 Equality comparisons.
INVENTOR_API int operator!= (const SbBox2f &b1, const SbBox2f &b2)

Detailed Description

2D box which has planes parallel to the major axes and is specified by two points (specified as floating point) on a diagonal. This class is part of the standard Inventor datatype classes and is used as input and output to geometry operations.

See Also
SbBox3f, SbXfBox3f, SbBox2s, SbVec3f, SbVec2f, SbVec2s, SbMatrix

Definition at line 366 of file SbBox.h.


Constructor & Destructor Documentation

SbBox2f::SbBox2f ( ) [inline]

Definition at line 370 of file SbBox.h.

SbBox2f::SbBox2f ( float  xmin,
float  ymin,
float  xmax,
float  ymax 
) [inline]

Definition at line 373 of file SbBox.h.

SbBox2f::SbBox2f ( const SbVec2f _min,
const SbVec2f _max 
) [inline]

Definition at line 377 of file SbBox.h.

SbBox2f::~SbBox2f ( ) [inline]

Definition at line 381 of file SbBox.h.


Member Function Documentation

void SbBox2f::extendBy ( const SbVec2f pt)
void SbBox2f::extendBy ( const SbBox2f r)
float SbBox2f::getAspectRatio ( ) const [inline]

Definition at line 430 of file SbBox.h.

void SbBox2f::getBounds ( float &  xmin,
float &  ymin,
float &  xmax,
float &  ymax 
) const [inline]

Definition at line 410 of file SbBox.h.

References SbVec2f::getValue().

void SbBox2f::getBounds ( SbVec2f _min,
SbVec2f _max 
) const [inline]

Definition at line 414 of file SbBox.h.

SbVec2f SbBox2f::getCenter ( ) const
SbVec2f SbBox2f::getClosestPoint ( const SbVec2f point)

(Returns the point on the center of the X side if passed the center.)

const SbVec2f& SbBox2f::getMax ( ) const [inline]

Definition at line 386 of file SbBox.h.

const SbVec2f& SbBox2f::getMin ( ) const [inline]

Definition at line 384 of file SbBox.h.

void SbBox2f::getOrigin ( float &  originX,
float &  originY 
) const [inline]

Definition at line 422 of file SbBox.h.

void SbBox2f::getSize ( float &  sizeX,
float &  sizeY 
) const [inline]

Definition at line 426 of file SbBox.h.

SbBool SbBox2f::hasArea ( ) const [inline]

Definition at line 441 of file SbBox.h.

SbBool SbBox2f::intersect ( const SbBox2f bb) const
SbBool SbBox2f::intersect ( const SbVec2f pt) const
SbBool SbBox2f::isEmpty ( ) const [inline]

Definition at line 437 of file SbBox.h.

void SbBox2f::makeEmpty ( )
void SbBox2f::setBounds ( const SbVec2f _min,
const SbVec2f _max 
) [inline]

Definition at line 407 of file SbBox.h.

void SbBox2f::setBounds ( float  xmin,
float  ymin,
float  xmax,
float  ymax 
) [inline]

Definition at line 404 of file SbBox.h.


Friends And Related Function Documentation

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

Definition at line 446 of file SbBox.h.

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

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