29 #include <wfmath/const.h> 30 #include <wfmath/point.h> 46 Line() : m_points() {}
50 explicit Line(
const AtlasInType& a);
70 bool isValid()
const {
return m_points.size() > 1;}
87 bool addCorner(
size_t i,
const Point<dim>& p,
CoordType = numeric_constants<CoordType>::epsilon())
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,
95 CoordType = numeric_constants<CoordType>::epsilon())
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 m_points = rhs.m_points;
156 #endif // WFMATH_LINE_H Line & rotatePoint(const RotMatrix< dim > &m, const Point< dim > &p)
shape: rotate the shape while holding the Point p fixed.
Definition: line_funcs.h:61
Generic library namespace.
Definition: atlasconv.h:45
Line & moveCornerTo(const Point< dim > &p, size_t corner)
shape: move the shape, moving the given corner to the Point p
Definition: line.h:106
bool operator!=(const Line &s) const
generic: check if two classes are not equal, up to tolerance WFMATH_EPSILON
Definition: line.h:67
bool isEqualTo(const Line &s, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const
generic: check if two classes are equal, up to a given tolerance
Definition: line_funcs.h:34
AtlasOutType toAtlas() const
Create an Atlas object from the line.
Definition: atlasconv.h:391
A dim dimensional axis-aligned box.
Definition: axisbox.h:62
bool operator==(const Line &s) const
generic: check if two classes are equal, up to tolerance WFMATH_EPSILON
Definition: line.h:65
Line & rotateCorner(const RotMatrix< dim > &m, size_t corner)
shape: rotate the shape while holding the given corner fixed
Definition: line.h:120
Line & shift(const Vector< dim > &v)
shape: move the shape by an amount given by the Vector v
Definition: line_funcs.h:51
A dim dimensional rotation matrix. Technically, a member of the group O(dim).
Definition: const.h:53
Ball< dim > BoundingSphereSloppy(const container< Point< dim >, std::allocator< Point< dim > > > &c)
get a bounding sphere for a set of points
Definition: ball_funcs.h:92
Point< dim > getCenter() const
shape: return the position of the center of the shape
Definition: line.h:84
Line & rotateCenter(const RotMatrix< dim > &m)
shape: rotate the shape while holding the center fixed
Definition: line.h:126
bool isValid() const
generic: returns true if the class instance has been initialized
Definition: line.h:70
A dim dimensional vector.
Definition: const.h:55
A dim dimensional line.
Definition: line.h:42
size_t numCorners() const
shape: return the number of corners in the shape.
Definition: line.h:80
float CoordType
Basic floating point type.
Definition: const.h:140
void fromAtlas(const AtlasInType &a)
Set the line's value to that given by an Atlas object.
Definition: atlasconv.h:369
Line & moveCenterTo(const Point< dim > &p)
shape: move the shape, moving the center to the Point p
Definition: line.h:112
Ball< dim > BoundingSphere(const container< Point< dim >, std::allocator< Point< dim > > > &c)
get the minimal bounding sphere for a set of points
Definition: ball_funcs.h:57
A dim dimensional point.
Definition: const.h:50
Point< dim > Barycenter(const container< Point< dim >, std::allocator< Point< dim > > > &c)
Find the center of a set of points, all weighted equally.
Definition: point_funcs.h:207
Point< dim > getCorner(size_t i) const
shape: return the position of the i'th corner, where 0 <= i < numCorners()
Definition: line.h:82
A dim dimensional ball.
Definition: ball.h:34
AxisBox< dim > BoundingBox(const container< AxisBox< dim >, std::allocator< AxisBox< dim > > > &c)
Get the axis-aligned bounding box for a set of boxes.
Definition: axisbox_funcs.h:130