SPH
|
Helper object defining three-dimensional interval (box). More...
#include <Box.h>
Public Member Functions | |
INLINE | Box ()=default |
Constructs empty box with negative dimensions. More... | |
INLINE | Box (const Vector &minBound, const Vector &maxBound) |
Constructs a box given its 'corners'. More... | |
INLINE void | extend (const Vector &v) |
Enlarges the box to contain the vector. More... | |
INLINE void | extend (const Box &other) |
Enlarges the box to contain another box. More... | |
INLINE bool | contains (const Vector &v) const |
Checks if the vector lies inside the box. More... | |
INLINE Vector | clamp (const Vector &v) const |
Clamps all components of the vector to fit within the box. More... | |
INLINE const Vector & | lower () const |
Returns lower bounds of the box. More... | |
INLINE Vector & | lower () |
Returns lower bounds of the box. More... | |
INLINE const Vector & | upper () const |
Returns upper bounds of the box. More... | |
INLINE Vector & | upper () |
Returns upper bounds of the box. More... | |
INLINE Vector | size () const |
Returns box dimensions. More... | |
INLINE Vector | center () const |
Returns the center of the box. More... | |
INLINE Float | volume () const |
Returns the volume of the box. More... | |
INLINE bool | operator== (const Box &other) const |
Compares two boxes, return true if box lower and upper bounds are equal. More... | |
INLINE bool | operator!= (const Box &other) const |
Checks for inequality of boxes. More... | |
INLINE Box | translate (const Vector &offset) const |
Returns a box with specified offset. More... | |
INLINE Pair< Box > | split (const Size dim, const Float x) const |
Splits the box along given coordinate. More... | |
INLINE Box | intersect (const Box &other) const |
Computes the intersection of this box with another one. More... | |
template<typename TFunctor > | |
void | iterate (const Vector &step, TFunctor &&functor) const |
Execute functor for all possible values of vector (with constant stepping) More... | |
template<typename TFunctor > | |
void | iterateWithIndices (const Vector &step, TFunctor &&functor) const |
Execute functor for all possible values of vector (with constant stepping), passing auxiliary indices together with the vector. More... | |
Static Public Member Functions | |
static Box | EMPTY () |
Syntactic sugar, returns a default-constructed (empty) box. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &stream, const Box &box) |
Prints the bounds of the box into the stream. More... | |
Helper object defining three-dimensional interval (box).
Degenerated box (one or more dimensions equal to zero) is a valid state of the object.
|
default |
Constructs empty box with negative dimensions.
The box in this state will throw assert if member function are called. Function extend is an exception, it will simply move both lower and upper bound of the box to the position of new point, resulting in box of zero dimensions. Another exception is method contains, that simply returns false for all points.
|
inlinestatic |
|
inline |
|
inline |
|
friend |