MIRA
|
Specialization for 3D. More...
#include <geometry/Rect.h>
Public Types | |
typedef RectBase< T, 3, Rect< T, 3 > > | Base |
typedef Base::PointType | PointType |
typedef Base::SizeType | SizeType |
typedef Base::BoxType | BoxType |
Public Member Functions | |
void | reflect (Reflector &reflector) |
the method to serialize this object More... | |
SizeType | size () const |
return the size of the multidimensional rect More... | |
const Rect< T, 3 > & | operator+= (const PointType &displacement) |
Moves the rect (the minCorner and the maxCorner) by the specified displacement. More... | |
Rect< T, 3 > | operator+ (const PointType &displacement) const |
Returns a rect that is moved by the specified displacement. More... | |
Constructors | |
Rect () | |
the default constructor More... | |
Rect (T x, T y, T z, T width, T height, T depth) | |
a constructor to create a 3D rect More... | |
Rect (const PointType &pos, T width, T height, T depth) | |
a constructor to create a 3D rect More... | |
Rect (const PointType &pos, const SizeType &s) | |
a constructor to create a 3D rect More... | |
Rect (const BoxType &box) | |
copy constructor from boost::BoxType More... | |
Rect (const PointType &p1, const PointType &p2, bool makeValid=true) | |
a constructor to create a 3D rect More... | |
Access to corner elements and size | |
T & | x0 () |
Returns the x-coordinate of the lower corner. More... | |
T | x0 () const |
Returns the x-coordinate of the lower corner. More... | |
T & | y0 () |
Returns the y-coordinate of the lower corner. More... | |
T | y0 () const |
Returns the y-coordinate of the lower corner. More... | |
T & | z0 () |
Returns the z-coordinate of the lower corner. More... | |
T | z0 () const |
Returns the z-coordinate of the lower corner. More... | |
T & | x1 () |
Returns the x-coordinate of the upper corner. More... | |
T | x1 () const |
Returns the x-coordinate of the upper corner. More... | |
T & | y1 () |
Returns the y-coordinate of the upper corner. More... | |
T | y1 () const |
Returns the y-coordinate of the upper corner. More... | |
T & | z1 () |
Returns the z-coordinate of the upper corner. More... | |
T | z1 () const |
Returns the z-coordinate of the upper corner. More... | |
T | width () const |
Returns the width. More... | |
T | height () const |
Returns the height. More... | |
T | depth () const |
Returns the depth. More... | |
Implicit conversion operators | |
operator BoxType () const | |
converts to boost::geometry::box More... | |
Comparison Operators | |
bool | operator== (const RectBase< T, D, OtherDerived > &other) const |
bool | operator!= (const RectBase< T, D, OtherDerived > &other) const |
Intersection tests | |
bool | contains (const OtherGeometry &otherGeometry) const |
this method checks if a given geometry is enclosed by this box More... | |
bool | intersects (const OtherGeometry &otherGeometry) const |
this method checks for intersections with other geometry More... | |
bool | disjoint (const OtherGeometry &otherGeometry) const |
this method checks for non-intersections with other geometry More... | |
Geometric Operators | |
Rect< T, 3 > | operator| (const Rect< T, 3 > &other) const |
Returns the bounding rectangle of this rectangle and the given rectangle. More... | |
const Rect< T, 3 > & | operator|= (const Rect< T, 3 > &other) |
Unites this rectangle with the given rectangle. More... | |
const Rect< T, 3 > & | operator|= (const PointType &p) |
Unites this rectangle with the given point. More... | |
Rect< T, 3 > | operator& (const Rect< T, 3 > &other) const |
Returns the intersection of this rectangle and the given rectangle. More... | |
const Rect< T, 3 > & | operator&= (const Rect< T, 3 > &other) |
Intersects the rectangle with the given rectangle. More... | |
Static Public Member Functions | |
static Rect< T, 3 > | convertFrom (const RectBase< U, D, OtherDerived > &other) |
Converts from a Rect of a different type. More... | |
Public Attributes | |
PointType | minCorner |
PointType | maxCorner |
Invalid and null Rects | |
bool | isValid () const |
Returns true if this is a valid Rect where the maxCorner's components are not smaller than the minCorner, i.e. More... | |
Rect< T, 3 > | normalized () const |
Returns the normalized Rect, where the maxCorner and minCorner components are swapped if necessary to produce a valid Rect, where all maxCorner's components are larger than the minCorner. More... | |
bool | isNull () const |
Returns true, if all extends (i.e. More... | |
static Rect< T, 3 > | invalid () |
Returns an invalid rect with negative extends. More... | |
static Rect< T, 3 > | null () |
Returns a null-Rect which extends are null (minCorner and maxCorner) are set to 0. More... | |
static Rect< T, 3 > | zero () |
Same as null(). More... | |
Specialization for 3D.
typedef Base::PointType PointType |
typedef Base::SizeType SizeType |
typedef Base::BoxType BoxType |
|
inline |
the default constructor
|
inline |
a constructor to create a 3D rect
x | the min corner x-coordinate |
y | the min corner y-coordinate |
z | the min corner z-coordinate |
width | the rect width |
height | the rect height |
depth | the rect depth |
a constructor to create a 3D rect
pos | the min corner |
width | the rect width |
height | the rect height |
depth | the rect depth |
a constructor to create a 3D rect
pos | the min corner |
s | the rect size |
a constructor to create a 3D rect
[in] | p1 | the lower corner of the rect |
[in] | p2 | the upper corner of the rect |
|
inline |
Returns the x-coordinate of the lower corner.
|
inline |
Returns the x-coordinate of the lower corner.
|
inline |
Returns the y-coordinate of the lower corner.
|
inline |
Returns the y-coordinate of the lower corner.
|
inline |
Returns the z-coordinate of the lower corner.
|
inline |
Returns the z-coordinate of the lower corner.
|
inline |
Returns the x-coordinate of the upper corner.
|
inline |
Returns the x-coordinate of the upper corner.
|
inline |
Returns the y-coordinate of the upper corner.
|
inline |
Returns the y-coordinate of the upper corner.
|
inline |
Returns the z-coordinate of the upper corner.
|
inline |
Returns the z-coordinate of the upper corner.
|
inline |
Returns the width.
|
inline |
Returns the height.
|
inline |
Returns the depth.
|
inlineinherited |
the method to serialize this object
|
inlineinherited |
converts to boost::geometry::box
|
inlineinherited |
return the size of the multidimensional rect
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
this method checks if a given geometry is enclosed by this box
|
inlineinherited |
this method checks for intersections with other geometry
|
inlineinherited |
this method checks for non-intersections with other geometry
|
inlineinherited |
Returns true if this is a valid Rect where the maxCorner's components are not smaller than the minCorner, i.e.
the width and height is not negative. Note: a null-Rect is valid.
|
inlinestaticinherited |
Returns an invalid rect with negative extends.
Provided for backward compatibility (the default constructor does exactly this).
|
inlineinherited |
|
inlineinherited |
Returns true, if all extends (i.e.
width, height, etc) of this Rect are null.
|
inlinestaticinherited |
Returns a null-Rect which extends are null (minCorner and maxCorner) are set to 0.
|
inlinestaticinherited |
Returns the bounding rectangle of this rectangle and the given rectangle.
Moreover: a | invalid = a invalid | b = b invalid | invalid = invalid
Unites this rectangle with the given rectangle.
Moreover: a |= invalid, leaves a unchanged invalid |= b, previous null becomes b
Unites this rectangle with the given point.
Using this operator bounding boxes around single points can be created:
Moreover:
invalid |= point
creates an empty rect as bounding box at the position of the single point
Returns the intersection of this rectangle and the given rectangle.
Returns an invalid rectangle if there is no intersection.
Moreover: a & invalid = invalid invalid & b = invalid invalid & invalid = invalid a & b = invalid, only if a and b do not intersect at all.
Intersects the rectangle with the given rectangle.
Returns an invalid rectangle if there is no intersection.
|
inlinestaticinherited |
Converts from a Rect of a different type.
Moves the rect (the minCorner and the maxCorner) by the specified displacement.
Returns a rect that is moved by the specified displacement.
|
inherited |
|
inherited |