SbBox2d Class Reference
[Basics]

VSG extension 2D box class. More...

#include <Inventor/SbBox.h>

List of all members.

Public Member Functions

 SbBox2d ()
 SbBox2d (double xmin, double ymin, double xmax, double ymax)
 SbBox2d (const SbVec2d &_min, const SbVec2d &_max)
 ~SbBox2d ()
const SbVec2dgetMin () const
const SbVec2dgetMax () const
SbVec2d getCenter () const
void extendBy (const SbVec2d &pt)
void extendBy (const SbBox2d &r)
SbBool intersect (const SbVec2d &pt) const
SbBool intersect (const SbBox2d &bb) const
SbBox2d intersection (const SbBox2d &box) const
void setBounds (double xmin, double ymin, double xmax, double ymax)
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) const
void getOrigin (double &originX, double &originY) const
void getSize (double &sizeX, double &sizeY) const
SbVec2d getSize () const
double getAspectRatio () const
void makeEmpty ()
SbBool isEmpty () const
SbBool hasArea () const

Friends

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

Detailed Description

VSG extension 2D box class.

2D box which has planes parallel to the major axes and is specified by two points (specified in double precision) 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, SbBox2s, SbVec3f, SbVec2d, SbVec2s, SbMatrix


Constructor & Destructor Documentation

SbBox2d::SbBox2d (  )  [inline]

Constructor for a 2D double box.

The box is initially empty.

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

Constructor for a 2D double box.

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

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

Constructor for a 2D double box.

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

SbBox2d::~SbBox2d (  )  [inline]

Destructor.


Member Function Documentation

void SbBox2d::extendBy ( const SbBox2d r  ) 

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

void SbBox2d::extendBy ( const SbVec2d pt  ) 

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

double SbBox2d::getAspectRatio (  )  const [inline]

Gets box aspect ratio.

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

Gets the corners of the box.

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

Gets the corners of the box.

SbVec2d SbBox2d::getCenter (  )  const

Returns the center of the box.

SbVec2d SbBox2d::getClosestPoint ( const SbVec2d point  )  const

Returns the closest point on the box to the given point.

(Returns the point on the center of the Z face if passed the center.)

const SbVec2d& SbBox2d::getMax (  )  const [inline]

Returns the maximum point of the box.

const SbVec2d& SbBox2d::getMin (  )  const [inline]

Returns the minimum point of the box.

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

Gets box origin.

SbVec2d SbBox2d::getSize (  )  const [inline]

Return box size.

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

Gets box size.

SbBool SbBox2d::hasArea (  )  const [inline]

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

SbBool SbBox2d::intersect ( const SbBox2d bb  )  const

Returns TRUE if the specified box intersects this box.

SbBool SbBox2d::intersect ( const SbVec2d pt  )  const

Returns TRUE if the specified point intersects this box.

SbBox2d SbBox2d::intersection ( const SbBox2d box  )  const

Returns the intersection of the specified box with this box.

Returned box is empty if there is no intersection.

SbBool SbBox2d::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 SbBox2d::makeEmpty (  ) 

Makes an empty box.

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

Sets the corners of the box.

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

Sets the corners of the box.


Friends And Related Function Documentation

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

Inequality comparison.

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

Equality comparison.


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

Open Inventor Toolkit reference manual, generated on 15 Mar 2023
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/