30 #ifndef WFMATH_SHAPE_H 31 #define WFMATH_SHAPE_H 33 #include <wfmath/vector.h> 34 #include <wfmath/point.h> 35 #include <wfmath/const.h> 36 #include <wfmath/rotmatrix.h> 37 #include <wfmath/axisbox.h> 38 #include <wfmath/ball.h> 39 #include <wfmath/intersect_decls.h> 55 template<const
int dim>
70 friend std::ostream& operator<< <dim>(std::ostream& os,
const Shape& s);
72 friend std::istream&
operator>> <dim>(std::istream& is,
Shape& s);
190 #endif // WFMATH_SHAPE_H Generic library namespace.
Definition: atlasconv.h:45
Point< dim > getCenter() const
shape: return the position of the center of the shape
Shape & moveCenterTo(const Point< dim > &p)
shape: move the shape, moving the center to the Point p
Definition: shape.h:115
A dim dimensional axis-aligned box.
Definition: axisbox.h:62
AxisBox< dim > boundingBox() const
shape: return the minimal axis-aligned bounding box
A dim dimensional rotation matrix. Technically, a member of the group O(dim).
Definition: const.h:53
Ball< dim > boundingSphere() const
shape: return the minimal bounding sphere
Shape & rotateCorner(const RotMatrix< dim > &m, size_t corner)
shape: rotate the shape while holding the given corner fixed
Definition: shape.h:123
Shape & shift(const Vector< dim > &v)
shape: move the shape by an amount given by the Vector v
A dim dimensional vector.
Definition: const.h:55
float CoordType
Basic floating point type.
Definition: const.h:140
Point< dim > getCorner(size_t i) const
shape: return the position of the i'th corner, where 0 <= i < numCorners()
bool operator!=(const Shape &s) const
generic: check if two classes are not equal, up to tolerance WFMATH_EPSILON
Definition: shape.h:82
size_t numCorners() const
shape: return the number of corners in the shape.
A fake class which documents the generic parts of the WFMath interface.
Definition: shape.h:56
bool operator==(const Shape &s) const
generic: check if two classes are equal, up to tolerance WFMATH_EPSILON
Definition: shape.h:80
Ball< dim > boundingSphereSloppy() const
bool isEqualTo(const Shape &s, CoordType tolerance=numeric_constants< CoordType >::epsilon()) const
generic: check if two classes are equal, up to a given tolerance
Shape & moveCornerTo(const Point< dim > &p, size_t corner)
shape: move the shape, moving the given corner to the Point p
Definition: shape.h:109
bool isValid() const
generic: returns true if the class instance has been initialized
Definition: shape.h:85
A dim dimensional point.
Definition: const.h:50
Shape & rotateCenter(const RotMatrix< dim > &m)
shape: rotate the shape while holding the center fixed
Definition: shape.h:129
Shape & rotatePoint(const RotMatrix< dim > &m, const Point< dim > &p)
shape: rotate the shape while holding the Point p fixed.
A dim dimensional ball.
Definition: ball.h:34