#include <HxBoundingBox.h>
Public Methods | |
HxBoundingBox (HxPointZ b, HxPointZ e) | |
Constructor, begin and end point are included. More... | |
HxBoundingBox (HxSizes s) | |
Constructor. More... | |
HxPointZ | begin () const |
Begin point. More... | |
HxPointZ | end () const |
End point. More... | |
HxSizes | size () const |
Sizes. More... | |
bool | isEmpty () const |
Check validity. More... | |
HxBoundingBox | unite (const HxBoundingBox &arg) const |
Union of this and arg. More... | |
HxBoundingBox | intersect (const HxBoundingBox &arg) const |
Intersection of this and arg. More... | |
HxBoundingBox | extend (HxPointZ p) const |
Extension of the box. More... | |
HxBoundingBox | translate (HxPointZ p) const |
Move the box. More... | |
bool | includes (HxPointZ p) const |
Check whether p is in the box. More... | |
std::ostream & | put (std::ostream &) const |
Put the box on the given stream. More... |
Begin and end point are included in the box.
|
Constructor, begin and end point are included.
|
|
Constructor.
|
|
Begin point.
00068 { 00069 return _begin; 00070 } |
|
End point.
00074 { 00075 return _end; 00076 } |
|
Sizes.
|
|
Check validity.
00080 { 00081 return _isEmpty; 00082 } |
|
Union of this and arg.
00041 { 00042 return HxBoundingBox(_begin.inf(arg._begin), _end.sup(arg._end)); 00043 } |
|
Intersection of this and arg.
00047 { 00048 HxPointZ b = _begin.sup(arg._begin); 00049 HxPointZ e = _end.inf(arg._end); 00050 if (b.inf(e) == b) 00051 return HxBoundingBox(b, e); 00052 return HxBoundingBox(HxSizes(0, 0, 0)); 00053 } |
|
Extension of the box.
00057 { 00058 return HxBoundingBox(_begin.inf(p), _end.sup(p)); 00059 } |
|
Move the box.
00063 { 00064 return HxBoundingBox(_begin + p, _end + p); 00065 } |
|
Check whether p is in the box.
|
|
Put the box on the given stream.
00080 { 00081 if (_isEmpty) 00082 { 00083 return os << "empty"; 00084 } 00085 else 00086 { 00087 return os << "{ " << _begin << ", " << _end << " }"; 00088 } 00089 } |