29 #include <wfmath/const.h> 30 #include <wfmath/point.h> 60 Line& operator=(
const Line& a) =
default;
70 bool isValid()
const {
return m_points.size() > 1;}
88 {m_points.insert(m_points.begin() + i, p);
return true;}
91 void removeCorner(
size_t i) {m_points.erase(m_points.begin() + i);}
93 bool moveCorner(
size_t i,
96 {m_points[i] = p;
return true;}
140 std::vector<Point<dim> > m_points;
141 typedef typename std::vector<Point<dim> >::iterator iterator;
142 typedef typename std::vector<Point<dim> >::const_iterator const_iterator;
143 typedef typename std::vector<Point<dim> >::size_type size_type;
149 #endif // WFMATH_LINE_H Line & rotatePoint(const RotMatrix< dim > &m, const Point< dim > &p)
shape: rotate the shape while holding the Point p fixed.
Generic library namespace.
Line & moveCornerTo(const Point< dim > &p, size_t corner)
shape: move the shape, moving the given corner to the Point p
bool operator!=(const Line &s) const
generic: check if two classes are not equal, up to tolerance WFMATH_EPSILON
bool isEqualTo(const Line &s, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const
generic: check if two classes are equal, up to a given tolerance
AtlasOutType toAtlas() const
Create an Atlas object from the line.
A dim dimensional axis-aligned box.
bool operator==(const Line &s) const
generic: check if two classes are equal, up to tolerance WFMATH_EPSILON
Line & rotateCorner(const RotMatrix< dim > &m, size_t corner)
shape: rotate the shape while holding the given corner fixed
Line & shift(const Vector< dim > &v)
shape: move the shape by an amount given by the Vector v
A dim dimensional rotation matrix. Technically, a member of the group O(dim).
double CoordType
Basic floating point type.
Ball< dim > BoundingSphereSloppy(const container< Point< dim >, std::allocator< Point< dim > > > &c)
get a bounding sphere for a set of points
Point< dim > getCenter() const
shape: return the position of the center of the shape
Line & rotateCenter(const RotMatrix< dim > &m)
shape: rotate the shape while holding the center fixed
bool isValid() const
generic: returns true if the class instance has been initialized
A dim dimensional vector.
size_t numCorners() const
shape: return the number of corners in the shape.
void fromAtlas(const AtlasInType &a)
Set the line's value to that given by an Atlas object.
Line & moveCenterTo(const Point< dim > &p)
shape: move the shape, moving the center to the Point p
Ball< dim > BoundingSphere(const container< Point< dim >, std::allocator< Point< dim > > > &c)
get the minimal bounding sphere for a set of points
Point< dim > Barycenter(const container< Point< dim >, std::allocator< Point< dim > > > &c)
Find the center of a set of points, all weighted equally.
Point< dim > getCorner(size_t i) const
shape: return the position of the i'th corner, where 0 <= i < numCorners()
AxisBox< dim > BoundingBox(const container< AxisBox< dim >, std::allocator< AxisBox< dim > > > &c)
Get the axis-aligned bounding box for a set of boxes.