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 52 of file const.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

◆ 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().

◆ 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.

◆ 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.


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