Open Inventor Reference
SbBox2d Class Reference

2D box class. More...

#include <Inventor/SbBoxd.h>

Public Member Functions

 SbBox2d ()
 Constructs an empty box.
 
 SbBox2d (double xmin, double ymin, double xmax, double ymax)
 Constructor given bounds.
 
 SbBox2d (const SbVec2d &_min, const SbVec2d &_max)
 Constructor given minimum and maximum points.
 
 ~SbBox2d ()
 Destructor.
 
const SbVec2dgetMin () const
 Returns the minimum and maximum points of the box.
 
const SbVec2dgetMax () const
 Returns the minimum and maximum points of the box.
 
SbVec2d getCenter () const
 Returns the center of the box.
 
void extendBy (const SbVec2d &pt)
 Extends Box2d (if necessary) to contain given 2D point.
 
void extendBy (const SbBox2d &r)
 Extends Box2d (if necessary) to contain given Box2d.
 
bool intersect (const SbVec2d &pt) const
 Returns TRUE if intersection of given point and Box2d is not empty.
 
bool intersect (const SbBox2d &bb) const
 Returns TRUE if intersection of given Box2d and Box2d is not empty.
 
void setBounds (double xmin, double ymin, double xmax, double ymax)
 Sets the corners of the box.
 
void setBounds (const SbVec2d &_min, const SbVec2d &_max)
 
void getBounds (double &xmin, double &ymin, double &xmax, double &ymax) const
 
void getBounds (SbVec2d &_min, SbVec2d &_max) const
 
SbVec2d getClosestPoint (const SbVec2d &point)
 Returns the closest point on the box to the given point.
 
void getOrigin (double &originX, double &originY) const
 Gets box origin.
 
void getSize (double &sizeX, double &sizeY) const
 Gets box size.
 
double 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 SbBox2d &b1, const SbBox2d &b2)
 Equality comparisons.
 
INVENTOR_API bool operator!= (const SbBox2d &b1, const SbBox2d &b2)
 

Detailed Description

2D box which has planes parallel to the major axes and is specified by two points (specified as floating point doubles) 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, SbBox2f, SbBox3d, SbXfBox3d, SbVec3d, SbVec2d, SbMatrixd

Definition at line 373 of file SbBoxd.h.

Constructor & Destructor Documentation

◆ SbBox2d() [1/3]

SbBox2d::SbBox2d ( )
inline

Definition at line 377 of file SbBoxd.h.

◆ SbBox2d() [2/3]

SbBox2d::SbBox2d ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
)
inline

Definition at line 380 of file SbBoxd.h.

◆ SbBox2d() [3/3]

SbBox2d::SbBox2d ( const SbVec2d _min,
const SbVec2d _max 
)
inline

Definition at line 384 of file SbBoxd.h.

◆ ~SbBox2d()

SbBox2d::~SbBox2d ( )
inline

Definition at line 388 of file SbBoxd.h.

Member Function Documentation

◆ extendBy() [1/2]

void SbBox2d::extendBy ( const SbBox2d r)

◆ extendBy() [2/2]

void SbBox2d::extendBy ( const SbVec2d pt)

◆ getAspectRatio()

double SbBox2d::getAspectRatio ( ) const
inline

Definition at line 437 of file SbBoxd.h.

◆ getBounds() [1/2]

void SbBox2d::getBounds ( double &  xmin,
double &  ymin,
double &  xmax,
double &  ymax 
) const
inline

Definition at line 417 of file SbBoxd.h.

◆ getBounds() [2/2]

void SbBox2d::getBounds ( SbVec2d _min,
SbVec2d _max 
) const
inline

Definition at line 421 of file SbBoxd.h.

◆ getCenter()

SbVec2d SbBox2d::getCenter ( ) const

◆ getClosestPoint()

SbVec2d SbBox2d::getClosestPoint ( const SbVec2d point)

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

◆ getMax()

const SbVec2d & SbBox2d::getMax ( ) const
inline

Definition at line 393 of file SbBoxd.h.

◆ getMin()

const SbVec2d & SbBox2d::getMin ( ) const
inline

Definition at line 391 of file SbBoxd.h.

◆ getOrigin()

void SbBox2d::getOrigin ( double &  originX,
double &  originY 
) const
inline

Definition at line 429 of file SbBoxd.h.

◆ getSize()

void SbBox2d::getSize ( double &  sizeX,
double &  sizeY 
) const
inline

Definition at line 433 of file SbBoxd.h.

◆ hasArea()

bool SbBox2d::hasArea ( ) const
inline

Definition at line 448 of file SbBoxd.h.

◆ intersect() [1/2]

bool SbBox2d::intersect ( const SbBox2d bb) const

◆ intersect() [2/2]

bool SbBox2d::intersect ( const SbVec2d pt) const

◆ isEmpty()

bool SbBox2d::isEmpty ( ) const
inline

Definition at line 444 of file SbBoxd.h.

◆ makeEmpty()

void SbBox2d::makeEmpty ( )

◆ setBounds() [1/2]

void SbBox2d::setBounds ( const SbVec2d _min,
const SbVec2d _max 
)
inline

Definition at line 414 of file SbBoxd.h.

◆ setBounds() [2/2]

void SbBox2d::setBounds ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
)
inline

Definition at line 411 of file SbBoxd.h.

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 461 of file SbBoxd.h.

◆ operator==

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

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