|
wfmath
1.0.3
A math library for the Worldforge system.
|
A dim dimensional axis-aligned box. More...
#include <axisbox.h>
Public Member Functions | |
| AxisBox ()=default | |
| Construct an uninitialized box. More... | |
| AxisBox (const Point< dim > &p1, const Point< dim > &p2, bool ordered=false) | |
| Construct a box with opposite corners p1 and p2. More... | |
| AxisBox (const AxisBox &a)=default | |
| Construct a copy of a box. More... | |
| AxisBox (const AtlasInType &a) | |
| Construct a box from an object passed by Atlas. More... | |
| AtlasOutType | toAtlas () const |
| Create an Atlas object from the box. More... | |
| void | fromAtlas (const AtlasInType &a) |
| Set the box's value to that given by an Atlas object. More... | |
| AxisBox & | operator= (const AxisBox &a)=default |
| bool | isEqualTo (const AxisBox &b, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const |
| bool | operator== (const AxisBox &a) const |
| bool | operator!= (const AxisBox &a) const |
| bool | isValid () const |
| size_t | numCorners () const |
| Point< dim > | getCorner (size_t i) const |
| Point< dim > | getCenter () const |
| const Point< dim > & | lowCorner () const |
| Get a reference to corner 0. More... | |
| Point< dim > & | lowCorner () |
| const Point< dim > & | highCorner () const |
| Get a reference to corner (2^dim)-1. More... | |
| Point< dim > & | highCorner () |
| CoordType | lowerBound (const int axis) const |
| Get the lower bound of the box on the i'th axis. More... | |
| CoordType | upperBound (const int axis) const |
| Get the upper bound of the box on the i'th axis. More... | |
| AxisBox & | setCorners (const Point< dim > &p1, const Point< dim > &p2, bool ordered=false) |
| Set the box to have opposite corners p1 and p2. More... | |
| AxisBox & | shift (const Vector< dim > &v) |
| AxisBox & | moveCornerTo (const Point< dim > &p, size_t corner) |
| AxisBox & | moveCenterTo (const Point< dim > &p) |
| AxisBox | boundingBox () const |
| Ball< dim > | boundingSphere () const |
| Ball< dim > | boundingSphereSloppy () const |
| AxisBox | toParentCoords (const Point< dim > &origin) const |
| AxisBox | toParentCoords (const AxisBox< dim > &coords) const |
| AxisBox | toLocalCoords (const Point< dim > &origin) const |
| AxisBox | toLocalCoords (const AxisBox< dim > &coords) const |
Friends | |
| std::ostream & | operator (std::ostream &os, const AxisBox &a) |
| std::istream & | operator>> (std::istream &is, AxisBox &a) |
| bool | Intersection (const AxisBox &a1, const AxisBox &a2, AxisBox &out) |
| Return true if the boxes intersect, and set 'out' to their intersection. More... | |
| AxisBox | Union (const AxisBox &a1, const AxisBox &a2) |
| Get the minimal box that contains a1 and a2. More... | |
| bool | Intersect (const AxisBox &b, const Point< dim > &p, bool proper) |
| bool | Contains (const Point< dim > &p, const AxisBox &b, bool proper) |
| bool | Intersect (const AxisBox &b1, const AxisBox &b2, bool proper) |
| bool | Contains (const AxisBox &outer, const AxisBox &inner, bool proper) |
| bool | Intersect (const Ball< dim > &b, const AxisBox &a, bool proper) |
| bool | Contains (const Ball< dim > &b, const AxisBox &a, bool proper) |
| bool | Contains (const AxisBox &a, const Ball< dim > &b, bool proper) |
| bool | Intersect (const Segment< dim > &s, const AxisBox &b, bool proper) |
| bool | Contains (const Segment< dim > &s, const AxisBox &b, bool proper) |
| bool | Intersect (const RotBox< dim > &r, const AxisBox &b, bool proper) |
| bool | Contains (const RotBox< dim > &r, const AxisBox &b, bool proper) |
| bool | Contains (const AxisBox &b, const RotBox< dim > &r, bool proper) |
| bool | Intersect (const Polygon< dim > &p, const AxisBox &b, bool proper) |
| bool | Contains (const Polygon< dim > &p, const AxisBox &b, bool proper) |
| bool | Contains (const AxisBox &b, const Polygon< dim > &p, bool proper) |
A dim dimensional axis-aligned box.
This class implements the full shape interface, as described in the fake class Shape, with the exception of the rotation functions.
|
default |
Construct an uninitialized box.
|
inline |
Construct a box with opposite corners p1 and p2.
Definition at line 67 of file axisbox.h.
References WFMath::AxisBox< dim >::setCorners().
|
default |
Construct a copy of a box.
|
inlineexplicit |
Construct a box from an object passed by Atlas.
Definition at line 209 of file atlasconv.h.
|
inline |
Set the box's value to that given by an Atlas object.
Definition at line 215 of file atlasconv.h.
|
inline |
|
inline |
|
inline |
| AxisBox< dim > & WFMath::AxisBox< dim >::setCorners | ( | const Point< dim > & | p1, |
| const Point< dim > & | p2, | ||
| bool | ordered = false |
||
| ) |
Set the box to have opposite corners p1 and p2.
The 'ordered' variable may be set to true if p1[i] <= p2[i] for all i. It is always safe to leave 'ordered' as false, it is a speed optimization primarily intended for use inside the library.
Definition at line 72 of file axisbox_funcs.h.
References WFMath::Point< dim >::setValid().
Referenced by WFMath::AxisBox< dim >::AxisBox().
|
inline |
Create an Atlas object from the box.
Definition at line 257 of file atlasconv.h.
References WFMath::AxisBox< dim >::toAtlas().
Referenced by WFMath::AxisBox< dim >::toAtlas().
|
inline |
|
friend |
Return true if the boxes intersect, and set 'out' to their intersection.
Definition at line 40 of file axisbox_funcs.h.
Get the minimal box that contains a1 and a2.
Definition at line 56 of file axisbox_funcs.h.