wfmath 1.0.3
A math library for the Worldforge system.
WFMath::RotBox< dim > Class Template Reference

A dim dimensional box, lying at an arbitrary angle. More...

#include <rotbox.h>

Public Member Functions

 RotBox ()
 construct an uninitialized box More...
 
 RotBox (const Point< dim > &p, const Vector< dim > &size, const RotMatrix< dim > &orientation)
 construct a box from the given parameters More...
 
 RotBox (const RotBox &b)=default
 construct a copy of the box More...
 
 RotBox (const AtlasInType &a)
 Construct a rotbox 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...
 
RotBoxoperator= (const RotBox &s)=default
 
bool isEqualTo (const RotBox &b, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const
 
bool operator== (const RotBox &b) const
 
bool operator!= (const RotBox &b) const
 
bool isValid () const
 
size_t numCorners () const
 
Point< dim > getCorner (size_t i) const
 
Point< dim > getCenter () const
 
const Point< dim > & corner0 () const
 returns the base corner of the box More...
 
Point< dim > & corner0 ()
 returns the base corner of the box More...
 
const Vector< dim > & size () const
 returns the size of the box More...
 
Vector< dim > & size ()
 returns the size of the box More...
 
const RotMatrix< dim > & orientation () const
 returns the orientation of the box More...
 
RotMatrix< dim > & orientation ()
 returns the orientation of the box More...
 
RotBoxshift (const Vector< dim > &v)
 
RotBoxmoveCornerTo (const Point< dim > &p, size_t corner)
 
RotBoxmoveCenterTo (const Point< dim > &p)
 
RotBoxrotateCorner (const RotMatrix< dim > &m, size_t corner)
 
RotBoxrotateCenter (const RotMatrix< dim > &m)
 
RotBoxrotatePoint (const RotMatrix< dim > &m, const Point< dim > &p)
 
RotBoxrotateCorner (const Quaternion &q, size_t corner)
 
RotBoxrotateCenter (const Quaternion &q)
 
RotBoxrotatePoint (const Quaternion &q, const Point< dim > &p)
 
AxisBox< dim > boundingBox () const
 
Ball< dim > boundingSphere () const
 
Ball< dim > boundingSphereSloppy () const
 
RotBox toParentCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const
 
RotBox toParentCoords (const AxisBox< dim > &coords) const
 
RotBox toParentCoords (const RotBox< dim > &coords) const
 
RotBox toLocalCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const
 
RotBox toLocalCoords (const AxisBox< dim > &coords) const
 
RotBox toLocalCoords (const RotBox< dim > &coords) const
 
RotBox toParentCoords (const Point< dim > &origin, const Quaternion &rotation) const
 
RotBox toLocalCoords (const Point< dim > &origin, const Quaternion &rotation) const
 
RotBox< 3 > & rotatePoint (const Quaternion &q, const Point< 3 > &p)
 
RotBox< 3 > & rotateCorner (const Quaternion &q, size_t corner)
 
RotBox< 3 > & rotateCenter (const Quaternion &q)
 
RotBox< 3 > toParentCoords (const Point< 3 > &origin, const Quaternion &rotation) const
 
RotBox< 3 > toLocalCoords (const Point< 3 > &origin, const Quaternion &rotation) const
 

Friends

std::ostream & operator (std::ostream &os, const RotBox &r)
 
std::istream & operator>> (std::istream &is, RotBox &r)
 
bool Intersect (const RotBox &r, const Point< dim > &p, bool proper)
 
bool Contains (const Point< dim > &p, const RotBox &r, bool proper)
 
bool Intersect (const RotBox &r, const AxisBox< dim > &b, bool proper)
 
bool Contains (const RotBox &r, const AxisBox< dim > &b, bool proper)
 
bool Contains (const AxisBox< dim > &b, const RotBox &r, bool proper)
 
bool Intersect (const RotBox &r, const Ball< dim > &b, bool proper)
 
bool Contains (const RotBox &r, const Ball< dim > &b, bool proper)
 
bool Contains (const Ball< dim > &b, const RotBox &r, bool proper)
 
bool Intersect (const RotBox &r, const Segment< dim > &s, bool proper)
 
bool Contains (const RotBox &r, const Segment< dim > &s, bool proper)
 
bool Contains (const Segment< dim > &s, const RotBox &r, bool proper)
 
bool Intersect (const RotBox &r1, const RotBox &r2, bool proper)
 
bool Contains (const RotBox &outer, const RotBox &inner, bool proper)
 
bool Intersect (const Polygon< dim > &p, const RotBox &r, bool proper)
 
bool Contains (const Polygon< dim > &p, const RotBox &r, bool proper)
 
bool Contains (const RotBox &r, const Polygon< dim > &p, bool proper)
 

Detailed Description

template<int dim = 3>
class WFMath::RotBox< dim >

A dim dimensional box, lying at an arbitrary angle.

This class implements the full shape interface, as described in the fake class Shape.

Definition at line 46 of file rotbox.h.

Constructor & Destructor Documentation

◆ RotBox() [1/4]

template<int dim = 3>
WFMath::RotBox< dim >::RotBox ( )
inline

construct an uninitialized box

Definition at line 50 of file rotbox.h.

◆ RotBox() [2/4]

template<int dim = 3>
WFMath::RotBox< dim >::RotBox ( const Point< dim > &  p,
const Vector< dim > &  size,
const RotMatrix< dim > &  orientation 
)
inline

construct a box from the given parameters

p gives corner 0 of the box, size gives the offset from corner 0 to the opposite corner (corner 2^dim - 1), orientation gives the rotation of the box relative to the coordinate axes

Definition at line 57 of file rotbox.h.

◆ RotBox() [3/4]

template<int dim = 3>
WFMath::RotBox< dim >::RotBox ( const RotBox< dim > &  b)
default

construct a copy of the box

◆ RotBox() [4/4]

template<int dim>
WFMath::RotBox< dim >::RotBox ( const AtlasInType a)
inlineexplicit

Construct a rotbox from an object passed by Atlas.

Definition at line 490 of file atlasconv.h.

Member Function Documentation

◆ boundingBox()

template<int dim>
AxisBox< dim > WFMath::RotBox< dim >::boundingBox

Definition at line 59 of file rotbox_funcs.h.

◆ boundingSphere()

template<int dim = 3>
Ball< dim > WFMath::RotBox< dim >::boundingSphere ( ) const
inline

Definition at line 128 of file rotbox.h.

◆ boundingSphereSloppy()

template<int dim = 3>
Ball< dim > WFMath::RotBox< dim >::boundingSphereSloppy ( ) const
inline

Definition at line 130 of file rotbox.h.

◆ corner0() [1/2]

template<int dim = 3>
Point< dim > & WFMath::RotBox< dim >::corner0 ( )
inline

returns the base corner of the box

Definition at line 94 of file rotbox.h.

◆ corner0() [2/2]

template<int dim = 3>
const Point< dim > & WFMath::RotBox< dim >::corner0 ( ) const
inline

returns the base corner of the box

Definition at line 92 of file rotbox.h.

◆ fromAtlas()

template<int dim>
void WFMath::RotBox< dim >::fromAtlas ( const AtlasInType a)
inline

Set the box's value to that given by an Atlas object.

Definition at line 452 of file atlasconv.h.

References WFMath::Point< dim >::fromAtlas(), WFMath::Vector< dim >::fromAtlas(), and WFMath::RotMatrix< dim >::identity().

◆ getCenter()

template<int dim = 3>
Point< dim > WFMath::RotBox< dim >::getCenter ( ) const
inline

Definition at line 89 of file rotbox.h.

◆ getCorner()

template<int dim>
Point< dim > WFMath::RotBox< dim >::getCorner ( size_t  i) const
inline

Definition at line 41 of file rotbox_funcs.h.

◆ isEqualTo()

template<int dim>
bool WFMath::RotBox< dim >::isEqualTo ( const RotBox< dim > &  b,
CoordType  epsilon = numeric_constants<CoordType>::epsilon() 
) const
inline

Definition at line 191 of file rotbox.h.

◆ isValid()

template<int dim = 3>
bool WFMath::RotBox< dim >::isValid ( ) const
inline

Definition at line 82 of file rotbox.h.

◆ moveCenterTo()

template<int dim = 3>
RotBox & WFMath::RotBox< dim >::moveCenterTo ( const Point< dim > &  p)
inline

Definition at line 110 of file rotbox.h.

◆ moveCornerTo()

template<int dim = 3>
RotBox & WFMath::RotBox< dim >::moveCornerTo ( const Point< dim > &  p,
size_t  corner 
)
inline

Definition at line 108 of file rotbox.h.

◆ numCorners()

template<int dim = 3>
size_t WFMath::RotBox< dim >::numCorners ( ) const
inline

Definition at line 87 of file rotbox.h.

◆ operator!=()

template<int dim = 3>
bool WFMath::RotBox< dim >::operator!= ( const RotBox< dim > &  b) const
inline

Definition at line 80 of file rotbox.h.

◆ operator==()

template<int dim = 3>
bool WFMath::RotBox< dim >::operator== ( const RotBox< dim > &  b) const
inline

Definition at line 79 of file rotbox.h.

◆ orientation() [1/2]

template<int dim = 3>
RotMatrix< dim > & WFMath::RotBox< dim >::orientation ( )
inline

returns the orientation of the box

Definition at line 102 of file rotbox.h.

◆ orientation() [2/2]

template<int dim = 3>
const RotMatrix< dim > & WFMath::RotBox< dim >::orientation ( ) const
inline

returns the orientation of the box

Definition at line 100 of file rotbox.h.

◆ rotateCenter() [1/2]

RotBox< 3 > & WFMath::RotBox< 3 >::rotateCenter ( const Quaternion q)

Definition at line 48 of file rotbox.cpp.

◆ rotateCenter() [2/2]

template<int dim = 3>
RotBox & WFMath::RotBox< dim >::rotateCenter ( const RotMatrix< dim > &  m)
inline

Definition at line 115 of file rotbox.h.

◆ rotateCorner() [1/2]

RotBox< 3 > & WFMath::RotBox< 3 >::rotateCorner ( const Quaternion q,
size_t  corner 
)

Definition at line 43 of file rotbox.cpp.

◆ rotateCorner() [2/2]

template<int dim = 3>
RotBox & WFMath::RotBox< dim >::rotateCorner ( const RotMatrix< dim > &  m,
size_t  corner 
)
inline

Definition at line 113 of file rotbox.h.

◆ rotatePoint() [1/2]

RotBox< 3 > & WFMath::RotBox< 3 >::rotatePoint ( const Quaternion q,
const Point< 3 > &  p 
)

Definition at line 38 of file rotbox.cpp.

◆ rotatePoint() [2/2]

template<int dim = 3>
RotBox & WFMath::RotBox< dim >::rotatePoint ( const RotMatrix< dim > &  m,
const Point< dim > &  p 
)
inline

Definition at line 117 of file rotbox.h.

◆ shift()

template<int dim = 3>
RotBox & WFMath::RotBox< dim >::shift ( const Vector< dim > &  v)
inline

Definition at line 106 of file rotbox.h.

◆ size() [1/2]

template<int dim = 3>
Vector< dim > & WFMath::RotBox< dim >::size ( )
inline

returns the size of the box

Definition at line 98 of file rotbox.h.

◆ size() [2/2]

template<int dim = 3>
const Vector< dim > & WFMath::RotBox< dim >::size ( ) const
inline

returns the size of the box

Definition at line 96 of file rotbox.h.

◆ toAtlas()

template<int dim>
AtlasOutType WFMath::RotBox< dim >::toAtlas
inline

Create an Atlas object from the box.

Definition at line 480 of file atlasconv.h.

◆ toLocalCoords() [1/4]

template<int dim = 3>
RotBox WFMath::RotBox< dim >::toLocalCoords ( const AxisBox< dim > &  coords) const
inline

Definition at line 151 of file rotbox.h.

◆ toLocalCoords() [2/4]

RotBox< 3 > WFMath::RotBox< 3 >::toLocalCoords ( const Point< 3 > &  origin,
const Quaternion rotation 
) const

Definition at line 60 of file rotbox.cpp.

◆ toLocalCoords() [3/4]

template<int dim = 3>
RotBox WFMath::RotBox< dim >::toLocalCoords ( const Point< dim > &  origin,
const RotMatrix< dim > &  rotation = RotMatrix<dim>().identity() 
) const
inline

Definition at line 147 of file rotbox.h.

◆ toLocalCoords() [4/4]

template<int dim = 3>
RotBox WFMath::RotBox< dim >::toLocalCoords ( const RotBox< dim > &  coords) const
inline

Definition at line 153 of file rotbox.h.

◆ toParentCoords() [1/4]

template<int dim = 3>
RotBox WFMath::RotBox< dim >::toParentCoords ( const AxisBox< dim > &  coords) const
inline

Definition at line 137 of file rotbox.h.

◆ toParentCoords() [2/4]

RotBox< 3 > WFMath::RotBox< 3 >::toParentCoords ( const Point< 3 > &  origin,
const Quaternion rotation 
) const

Definition at line 53 of file rotbox.cpp.

◆ toParentCoords() [3/4]

template<int dim = 3>
RotBox WFMath::RotBox< dim >::toParentCoords ( const Point< dim > &  origin,
const RotMatrix< dim > &  rotation = RotMatrix<dim>().identity() 
) const
inline

Definition at line 133 of file rotbox.h.

◆ toParentCoords() [4/4]

template<int dim = 3>
RotBox WFMath::RotBox< dim >::toParentCoords ( const RotBox< dim > &  coords) const
inline

Definition at line 139 of file rotbox.h.

Friends And Related Function Documentation

◆ Contains [1/10]

template<int dim = 3>
bool Contains ( const AxisBox< dim > &  b,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 416 of file intersect.h.

◆ Contains [2/10]

template<int dim = 3>
bool Contains ( const Ball< dim > &  b,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 438 of file intersect.h.

◆ Contains [3/10]

template<int dim = 3>
bool Contains ( const Point< dim > &  p,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 390 of file intersect.h.

◆ Contains [4/10]

template<int dim = 3>
bool Contains ( const Polygon< dim > &  p,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 623 of file polygon_intersect.cpp.

◆ Contains [5/10]

template<int dim = 3>
bool Contains ( const RotBox< dim > &  outer,
const RotBox< dim > &  inner,
bool  proper 
)
friend

Definition at line 484 of file intersect.h.

◆ Contains [6/10]

template<int dim = 3>
bool Contains ( const RotBox< dim > &  r,
const AxisBox< dim > &  b,
bool  proper 
)
friend

Definition at line 406 of file intersect.h.

◆ Contains [7/10]

template<int dim = 3>
bool Contains ( const RotBox< dim > &  r,
const Ball< dim > &  b,
bool  proper 
)
friend

Definition at line 430 of file intersect.h.

◆ Contains [8/10]

template<int dim = 3>
bool Contains ( const RotBox< dim > &  r,
const Polygon< dim > &  p,
bool  proper 
)
friend

Definition at line 632 of file polygon_intersect.cpp.

◆ Contains [9/10]

template<int dim = 3>
bool Contains ( const RotBox< dim > &  r,
const Segment< dim > &  s,
bool  proper 
)
friend

Definition at line 456 of file intersect.h.

◆ Contains [10/10]

template<int dim = 3>
bool Contains ( const Segment< dim > &  s,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 466 of file intersect.h.

◆ Intersect [1/5]

template<int dim = 3>
bool Intersect ( const Polygon< dim > &  p,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 590 of file polygon_intersect.cpp.

◆ Intersect [2/5]

template<int dim = 3>
bool Intersect ( const RotBox< dim > &  r,
const Ball< dim > &  b,
bool  proper 
)
friend

Definition at line 422 of file intersect.h.

◆ Intersect [3/5]

template<int dim = 3>
bool Intersect ( const RotBox< dim > &  r,
const Point< dim > &  p,
bool  proper 
)
friend

Definition at line 369 of file intersect.h.

◆ Intersect [4/5]

template<int dim = 3>
bool Intersect ( const RotBox< dim > &  r,
const Segment< dim > &  s,
bool  proper 
)
friend

Definition at line 446 of file intersect.h.

◆ Intersect [5/5]

template<int dim = 3>
bool Intersect ( const RotBox< dim > &  r1,
const RotBox< dim > &  r2,
bool  proper 
)
friend

Definition at line 476 of file intersect.h.

◆ operator>>

template<int dim = 3>
std::istream & operator>> ( std::istream &  is,
RotBox< dim > &  r 
)
friend

Definition at line 275 of file stream.h.


The documentation for this class was generated from the following files: