WFMath_Shape man page

WFMath::Shape< dim > — A fake class which documents the generic parts of the WFMath interface.

Synopsis

#include <shape.h>

Public Member Functions

bool isEqualTo (const Shape &s, CoordType tolerance=numeric_constants< CoordType >::epsilon()) const
generic: check if two classes are equal, up to a given tolerance
bool operator== (const Shape &s) const
generic: check if two classes are equal, up to tolerance WFMATH_EPSILON
bool operator!= (const Shape &s) const
generic: check if two classes are not equal, up to tolerance WFMATH_EPSILON
bool isValid () const
generic: returns true if the class instance has been initialized
size_t numCorners () const
shape: return the number of corners in the shape.
Point< dim > getCorner (size_t i) const
shape: return the position of the i'th corner, where 0 <= i < numCorners()
Point< dim > getCenter () const
shape: return the position of the center of the shape
Shape & shift (const Vector< dim > &v)
shape: move the shape by an amount given by the Vector v
Shape & moveCornerTo (const Point< dim > &p, size_t corner)
shape: move the shape, moving the given corner to the Point p
Shape & moveCenterTo (const Point< dim > &p)
shape: move the shape, moving the center to the Point p
Shape & rotateCorner (const RotMatrix< dim > &m, size_t corner)
shape: rotate the shape while holding the given corner fixed
Shape & rotateCenter (const RotMatrix< dim > &m)
shape: rotate the shape while holding the center fixed
Shape & rotatePoint (const RotMatrix< dim > &m, const Point< dim > &p)
shape: rotate the shape while holding the Point p fixed.
AxisBox< dim > boundingBox () const
shape: return the minimal axis-aligned bounding box
Ball< dim > boundingSphere () const
shape: return the minimal bounding sphere
Ball< dim > boundingSphereSloppy () const

Friends

std::ostream & operator (std::ostream &os, const Shape &s)
generic: Print an instance to a stream
std::istream & operator>> (std::istream &is, Shape &s)
generic: Parse an instance from a stream
bool Intersect (Shape< dim > &s1, Shape< dim > &s2, bool proper)
shape: Returns true if the two shapes intersect.
bool Contains (Shape< dim > &s1, Shape< dim > &s2, bool proper)
shape: Returns true if the first shape contains the second.

Detailed Description

template<const int dim>

class WFMath::Shape< dim >" A fake class which documents the generic parts of the WFMath interface.

This fake class documents two parts of the WFMath generic class interface. With a few exceptions (e.g. classes derived from std::exception), every class in WFMath implements the part of the interface labeled as 'generic'. The 'shape' interface is implemented by several classes, which identify themselves in their own documentation. Every class which implements the 'shape' interface also implements the 'generic' interface. Classes will not generally document their generic and shape interface functions.

Member Function Documentation

template<const int dim> Ball<dim> WFMath::Shape< dim >::boundingSphereSloppy () const

shape: return an approximate bounding sphere, guaranteed to contain the minimal bounding sphere boundingSphereSloppy() uses SloppyDistance() instead of Distance() to calculate it's radius, except in cases like Point<> and Ball<> where it would be silly. Thus, the result of boundingSphereSloppy() is guaranteed to contain the result of boundingSphere().

Referenced by WFMath::Shape< dim >::rotateCenter().

template<const int dim> Shape& WFMath::Shape< dim >::moveCenterTo (const Point< dim > & p) [inline]

shape: move the shape, moving the center to the Point p The center is defined by getCenter()

References WFMath::Shape< dim >::getCenter(), and WFMath::Shape< dim >::shift().

template<const int dim> Shape& WFMath::Shape< dim >::moveCornerTo (const Point< dim > & p, size_t corner) [inline]

shape: move the shape, moving the given corner to the Point p The corner in question is getCorner(corner).

References WFMath::Shape< dim >::getCorner(), and WFMath::Shape< dim >::shift().

template<const int dim> size_t WFMath::Shape< dim >::numCorners () const

shape: return the number of corners in the shape. For many shape classes, this is a fixed constant

Referenced by WFMath::Shape< dim >::isValid().

template<const int dim> Shape& WFMath::Shape< dim >::rotateCenter (const RotMatrix< dim > & m) [inline]

shape: rotate the shape while holding the center fixed The center is defined by getCenter()

References WFMath::Shape< dim >::boundingBox(), WFMath::Shape< dim >::boundingSphere(), WFMath::Shape< dim >::boundingSphereSloppy(), WFMath::Shape< dim >::getCenter(), and WFMath::Shape< dim >::rotatePoint().

template<const int dim> Shape& WFMath::Shape< dim >::rotateCorner (const RotMatrix< dim > & m, size_t corner) [inline]

shape: rotate the shape while holding the given corner fixed The corner in question is getCorner(corner).

References WFMath::Shape< dim >::getCorner(), and WFMath::Shape< dim >::rotatePoint().

template<const int dim> Shape& WFMath::Shape< dim >::rotatePoint (const RotMatrix< dim > & m, const Point< dim > & p)

shape: rotate the shape while holding the Point p fixed. Note that p can be any Point, it does not have to lie within the shape.

Referenced by WFMath::Shape< dim >::rotateCenter(), and WFMath::Shape< dim >::rotateCorner().

Author

Generated automatically by Doxygen for WFMath from the source code.

Info

Fri Feb 5 2016 Version 1.0.2 WFMath