SbBox2f Class Reference
[Basics]

2D box class. More...

#include <Inventor/SbBox.h>

List of all members.

Public Member Functions

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

Friends

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

Detailed Description

2D box class.

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 Open Inventor datatype classes and is used as input and output to geometry operations.

SEE ALSO

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


Constructor & Destructor Documentation

SbBox2f::SbBox2f (  )  [inline]

Constructor for a 2D float box.

The box is initially empty.

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

Constructor for a 2D float box.

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

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

Constructor for a 2D float box.

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

SbBox2f::~SbBox2f (  )  [inline]

Destructor.


Member Function Documentation

void SbBox2f::extendBy ( const SbBox2f r  ) 

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

void SbBox2f::extendBy ( const SbVec2f pt  ) 

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

float SbBox2f::getAspectRatio (  )  const [inline]

Gets box aspect ratio.

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

Gets the corners of the box.

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

Gets the corners of the box.

SbVec2f SbBox2f::getCenter (  )  const

Returns the center of the box.

SbVec2f SbBox2f::getClosestPoint ( const SbVec2f 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 SbVec2f& SbBox2f::getMax (  )  const [inline]

Returns the maximum point of the box.

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

Returns the minimum point of the box.

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

Gets box origin.

SbVec2f SbBox2f::getSize ( void   )  const [inline]

Return box size.

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

Gets box size.

SbBool SbBox2f::hasArea (  )  const [inline]

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

SbBool SbBox2f::intersect ( const SbBox2f bb  )  const

Returns TRUE if the specified box intersects this box.

SbBool SbBox2f::intersect ( const SbVec2f pt  )  const

Returns TRUE if the specified point intersects this box.

SbBox2f SbBox2f::intersection ( const SbBox2f box  )  const

Returns the intersection of the specified box with this box.

Returned box is empty if there is no intersection.

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

Makes an empty box.

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

Sets the corners of the box.

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

Sets the corners of the box.


Friends And Related Function Documentation

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

Inequality comparison.

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

Equality comparison.


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

Open Inventor Toolkit reference manual, generated on 12 Feb 2024
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/