3ds Max C++ API Reference
|
#include <dbox2.h>
Public Member Functions | |
DBox2 ()=default | |
Constructor. More... | |
DBox2 (const DBox2 &)=default | |
DBox2 (DBox2 &&)=default | |
DBox2 & | operator= (const DBox2 &)=default |
DBox2 & | operator= (DBox2 &&)=default |
DBox2 (const DPoint2 &p, const DPoint2 &q) | |
Constructor. More... | |
void | Init () |
Initializes this box such that pmin is a very large value while pmax is a small value. More... | |
DPoint2 | Min () const |
Returns the minimum corner value. More... | |
DPoint2 | Max () const |
Returns the maximum corner value. More... | |
DPoint2 | Center () const |
Returns the center of this DBox2 as a DPoint2. More... | |
DPoint2 | Width () const |
Returns the width of the box as a DPoint2. More... | |
DBox2 & | operator+= (const DPoint2 &p) |
Expands this DBox2 to include the DPoint2 p. More... | |
DBox2 & | operator+= (const DBox2 &b) |
Expands this DBox2 to include the specified DBox2. More... | |
void | Scale (double s) |
Scales this box about its center by the specified scale. More... | |
void | Translate (const DPoint2 &p) |
Translates this box by the distance specified. More... | |
void | EnlargeBy (double s) |
Enlarges this box. More... | |
int | IsEmpty () const |
Determines if the box is empty. More... | |
int | Contains (const DPoint2 &p) const |
Determines if the specified point p is contained in this box. More... | |
int | Contains (const DBox2 &b) const |
Determines if the specified DBox2 is contained totally within this box. More... | |
int | Overlaps (const DBox2 &b) const |
Determines if the specified DBox2 overlaps this box. More... | |
Public Attributes | |
DPoint2 | pmin { DBL_MAX, DBL_MAX } |
The minimum 2D point in this box. More... | |
DPoint2 | pmax { DBL_MIN, DBL_MIN } |
The maximum 2D point in this box. More... | |
This class represents a 2D box described by two double-precision 2D corner coordinates. DBox2 provides methods that return individual coordinates of the box, scale and translate it, retrieve its center, modify its size, expand it to include points or other boxes, and determine if points are inside the box. All methods are implemented by the system.
|
default |
Constructor.
The corners of the box are initialized such that the box is 'empty'. See
Constructor.
The corners of the box are initialized to the points passed.
p | The first corner of the box |
q | The second corner of the box |
void Init | ( | ) |
Initializes this box such that pmin is a very large value while pmax is a small value.
Thus the box is 'empty'. See
|
inline |
|
inline |
|
inline |
|
inline |
void Scale | ( | double | s | ) |
Scales this box about its center by the specified scale.
s | Specifies the scale factor for this DBox2. |
Translates this box by the distance specified.
The point is added to each corner.
p | Specifies the distance to translate the box. |
void EnlargeBy | ( | double | s | ) |
Enlarges this box.
A DPoint2 is created from s as DPoint2(s,s) and added to pmax and subtracted from pmin. If the box is 'empty', the box is centered at (0,0) and then enlarged.
s | the amount to enlarge the box on all sides |
int IsEmpty | ( | ) | const |
Determines if the box is empty.
This indicates the box has not had specific values set by the developer.
Determines if the specified point p is contained in this box.
p | Specifies the point to check. |
Determines if the specified DBox2 is contained totally within this box.
b | Specifies the box to check. |
Determines if the specified DBox2 overlaps this box.
b | Specifies the box to check. |
DPoint2 pmin { DBL_MAX, DBL_MAX } |
The minimum 2D point in this box.
DPoint2 pmax { DBL_MIN, DBL_MIN } |
The maximum 2D point in this box.