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);
78 bool isEqualTo(
const Shape& s,
double tolerance = WFMATH_EPSILON)
const;
190 #endif // WFMATH_SHAPE_H
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
bool isEqualTo(const Shape &s, double tolerance=WFMATH_EPSILON) const
generic: check if two classes are equal, up to a given tolerance
A dim dimensional rotation matrix. Technically, a member of the group O(dim).
Definition: const.h:53
Ball< dim > boundingSphereSloppy() const
Shape & shift(const Vector< dim > &v)
shape: move the shape by an amount given by the Vector v
Shape & rotateCorner(const RotMatrix< dim > &m, int corner)
shape: rotate the shape while holding the given corner fixed
Definition: shape.h:123
bool operator==(const Shape &s) const
generic: check if two classes are equal, up to tolerance WFMATH_EPSILON
Definition: shape.h:80
int numCorners() const
shape: return the number of corners in the shape.
A dim dimensional vector.
Definition: const.h:55
bool operator!=(const Shape &s) const
generic: check if two classes are not equal, up to tolerance WFMATH_EPSILON
Definition: shape.h:82
Ball< dim > boundingSphere() const
shape: return the minimal bounding sphere
Point< dim > getCenter() const
shape: return the position of the center of the shape
A fake class which documents the generic parts of the WFMath interface.
Definition: shape.h:56
Point< dim > getCorner(int i) const
shape: return the position of the i'th corner, where 0 <= i < numCorners()
AxisBox< dim > boundingBox() const
shape: return the minimal axis-aligned bounding box
Shape & moveCornerTo(const Point< dim > &p, int corner)
shape: move the shape, moving the given corner to the Point p
Definition: shape.h:109
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
bool isValid() const
generic: returns true if the class instance has been initialized
Definition: shape.h:85