wfmath
1.0.3
A math library for the Worldforge system.
|
A line segment embedded in dim dimensions. More...
#include <segment.h>
Public Member Functions | |
Segment () | |
construct an uninitialized segment More... | |
Segment (const Point< dim > &p1, const Point< dim > &p2) | |
construct a segment with endpoints p1 and p2 More... | |
Segment (const Segment &s)=default | |
construct a copy of a segment More... | |
Segment & | operator= (const Segment &s)=default |
bool | isEqualTo (const Segment &s, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const |
bool | operator== (const Segment &b) const |
bool | operator!= (const Segment &b) const |
bool | isValid () const |
size_t | numCorners () const |
Point< dim > | getCorner (size_t i) const |
Point< dim > | getCenter () const |
const Point< dim > & | endpoint (const int i) const |
get one end of the segment More... | |
Point< dim > & | endpoint (const int i) |
get one end of the segment More... | |
Segment & | shift (const Vector< dim > &v) |
Segment & | moveCornerTo (const Point< dim > &p, size_t corner) |
Segment & | moveCenterTo (const Point< dim > &p) |
Segment & | rotateCorner (const RotMatrix< dim > &m, size_t corner) |
Segment & | rotateCenter (const RotMatrix< dim > &m) |
Segment< dim > & | rotatePoint (const RotMatrix< dim > &m, const Point< dim > &p) |
Segment & | rotateCorner (const Quaternion &q, size_t corner) |
Segment & | rotateCenter (const Quaternion &q) |
Segment & | rotatePoint (const Quaternion &q, const Point< dim > &p) |
AxisBox< dim > | boundingBox () const |
Ball< dim > | boundingSphere () const |
Ball< dim > | boundingSphereSloppy () const |
Segment | toParentCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const |
Segment | toParentCoords (const AxisBox< dim > &coords) const |
Segment | toParentCoords (const RotBox< dim > &coords) const |
Segment | toLocalCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const |
Segment | toLocalCoords (const AxisBox< dim > &coords) const |
Segment | toLocalCoords (const RotBox< dim > &coords) const |
Segment | toParentCoords (const Point< dim > &origin, const Quaternion &rotation) const |
Segment | toLocalCoords (const Point< dim > &origin, const Quaternion &rotation) const |
template<> | |
Segment< 3 > & | rotatePoint (const Quaternion &q, const Point< 3 > &p) |
template<> | |
Segment< 3 > & | rotateCenter (const Quaternion &q) |
template<> | |
Segment< 3 > | toParentCoords (const Point< 3 > &origin, const Quaternion &rotation) const |
template<> | |
Segment< 3 > | toLocalCoords (const Point< 3 > &origin, const Quaternion &rotation) const |
template<> | |
Segment< 3 > & | rotateCorner (const Quaternion &q, size_t corner) |
Friends | |
std::ostream & | operator (std::ostream &os, const Segment &s) |
std::istream & | operator>> (std::istream &is, Segment &s) |
bool | Intersect (const Segment &s, const Point< dim > &p, bool proper) |
bool | Contains (const Point< dim > &p, const Segment &s, bool proper) |
bool | Intersect (const Segment &s, const AxisBox< dim > &b, bool proper) |
bool | Contains (const AxisBox< dim > &b, const Segment &s, bool proper) |
bool | Intersect (const Segment &s, const Ball< dim > &b, bool proper) |
bool | Contains (const Ball< dim > &b, const Segment &s, bool proper) |
bool | Intersect (const Segment &s1, const Segment &s2, bool proper) |
bool | Contains (const Segment &s1, const Segment &s2, bool proper) |
bool | Intersect (const RotBox< dim > &r, const Segment &s, bool proper) |
bool | Contains (const RotBox< dim > &r, const Segment &s, bool proper) |
bool | Contains (const Segment &s, const RotBox< dim > &r, bool proper) |
bool | Intersect (const Polygon< dim > &r, const Segment &s, bool proper) |
bool | Contains (const Polygon< dim > &p, const Segment &s, bool proper) |
bool | Contains (const Segment &s, const Polygon< dim > &p, bool proper) |
A line segment embedded in dim dimensions.
This class implements the full shape interface, as described in the fake class Shape.
|
inline |
construct an uninitialized segment
Definition at line 49 of file segment.h.
Referenced by WFMath::Segment< dim >::endpoint(), and WFMath::Segment< dim >::Segment().
|
inline |
construct a segment with endpoints p1 and p2
Definition at line 51 of file segment.h.
References WFMath::Midpoint(), and WFMath::Segment< dim >::Segment().
|
default |
construct a copy of a segment
|
inline |
|
inline |
get one end of the segment
Definition at line 78 of file segment.h.
References WFMath::Segment< dim >::Segment().