Open Inventor Reference
SbBox2f Class Reference

2D box class. More...

#include <Inventor/SbBox.h>

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.
 
bool intersect (const SbVec2f &pt) const
 Returns TRUE if intersection of given point and Box2f is not empty.
 
bool 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.
 
bool isEmpty () const
 Returns TRUE if the box is empty, and FALSE otherwise.
 
bool hasArea () const
 Returns TRUE if both dimensions of the box have positive size, and FALSE otherwise.
 

Friends

INVENTOR_API bool operator== (const SbBox2f &b1, const SbBox2f &b2)
 Equality comparisons.
 
INVENTOR_API bool 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 372 of file SbBox.h.

Constructor & Destructor Documentation

◆ SbBox2f() [1/3]

SbBox2f::SbBox2f ( )
inline

Definition at line 376 of file SbBox.h.

◆ SbBox2f() [2/3]

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

Definition at line 379 of file SbBox.h.

◆ SbBox2f() [3/3]

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

Definition at line 383 of file SbBox.h.

◆ ~SbBox2f()

SbBox2f::~SbBox2f ( )
inline

Definition at line 387 of file SbBox.h.

Member Function Documentation

◆ extendBy() [1/2]

void SbBox2f::extendBy ( const SbBox2f r)

◆ extendBy() [2/2]

void SbBox2f::extendBy ( const SbVec2f pt)

◆ getAspectRatio()

float SbBox2f::getAspectRatio ( ) const
inline

Definition at line 436 of file SbBox.h.

◆ getBounds() [1/2]

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

Definition at line 416 of file SbBox.h.

◆ getBounds() [2/2]

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

Definition at line 420 of file SbBox.h.

◆ getCenter()

SbVec2f SbBox2f::getCenter ( ) const

◆ getClosestPoint()

SbVec2f SbBox2f::getClosestPoint ( const SbVec2f point)

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

◆ getMax()

const SbVec2f & SbBox2f::getMax ( ) const
inline

Definition at line 392 of file SbBox.h.

◆ getMin()

const SbVec2f & SbBox2f::getMin ( ) const
inline

Definition at line 390 of file SbBox.h.

◆ getOrigin()

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

Definition at line 428 of file SbBox.h.

◆ getSize()

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

Definition at line 432 of file SbBox.h.

◆ hasArea()

bool SbBox2f::hasArea ( ) const
inline

Definition at line 447 of file SbBox.h.

◆ intersect() [1/2]

bool SbBox2f::intersect ( const SbBox2f bb) const

◆ intersect() [2/2]

bool SbBox2f::intersect ( const SbVec2f pt) const

◆ isEmpty()

bool SbBox2f::isEmpty ( ) const
inline

Definition at line 443 of file SbBox.h.

◆ makeEmpty()

void SbBox2f::makeEmpty ( )

◆ setBounds() [1/2]

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

Definition at line 413 of file SbBox.h.

◆ setBounds() [2/2]

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

Definition at line 410 of file SbBox.h.

Friends And Related Symbol Documentation

◆ operator!=

INVENTOR_API bool operator!= ( const SbBox2f b1,
const SbBox2f b2 
)
friend

Definition at line 460 of file SbBox.h.

◆ operator==

INVENTOR_API bool operator== ( const SbBox2f b1,
const SbBox2f b2 
)
friend

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