WFMath
1.0.1
|
A dim dimensional line. More...
#include <line.h>
Public Member Functions | |
AtlasOutType | toAtlas () const |
Create an Atlas object from the line. | |
void | fromAtlas (const AtlasInType &a) |
Set the line's value to that given by an Atlas object. | |
bool | isEqualTo (const Line &s, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const |
generic: check if two classes are equal, up to a given tolerance | |
bool | operator== (const Line &s) const |
generic: check if two classes are equal, up to tolerance WFMATH_EPSILON | |
bool | operator!= (const Line &s) const |
generic: check if two classes are not equal, up to tolerance WFMATH_EPSILON | |
bool | isValid () const |
generic: returns true if the class instance has been initialized | |
size_t | numCorners () const |
shape: return the number of corners in the shape. | |
Point< dim > | getCorner (size_t i) const |
shape: return the position of the i'th corner, where 0 <= i < numCorners() | |
Point< dim > | getCenter () const |
shape: return the position of the center of the shape | |
Line & | shift (const Vector< dim > &v) |
shape: move the shape by an amount given by the Vector v | |
Line & | moveCornerTo (const Point< dim > &p, size_t corner) |
shape: move the shape, moving the given corner to the Point p | |
Line & | moveCenterTo (const Point< dim > &p) |
shape: move the shape, moving the center to the Point p | |
Line & | rotateCorner (const RotMatrix< dim > &m, size_t corner) |
shape: rotate the shape while holding the given corner fixed | |
Line & | rotateCenter (const RotMatrix< dim > &m) |
shape: rotate the shape while holding the center fixed | |
Line & | rotatePoint (const RotMatrix< dim > &m, const Point< dim > &p) |
shape: rotate the shape while holding the Point p fixed. |
A dim dimensional line.
This class implements the full shape interface, as described in the fake class Shape.
|
inline |
shape: move the shape, moving the center to the Point p
The center is defined by getCenter()
References WFMath::Line< dim >::getCenter(), and WFMath::Line< dim >::shift().
|
inline |
shape: move the shape, moving the given corner to the Point p
The corner in question is getCorner(corner).
References WFMath::Line< dim >::getCorner(), and WFMath::Line< dim >::shift().
|
inline |
shape: return the number of corners in the shape.
For many shape classes, this is a fixed constant
|
inline |
shape: rotate the shape while holding the center fixed
The center is defined by getCenter()
References WFMath::Line< dim >::getCenter(), and WFMath::Line< dim >::rotatePoint().
|
inline |
shape: rotate the shape while holding the given corner fixed
The corner in question is getCorner(corner).
References WFMath::Line< dim >::getCorner(), and WFMath::Line< dim >::rotatePoint().
|
inline |
shape: rotate the shape while holding the Point p fixed.
Note that p can be any Point, it does not have to lie within the shape.
Referenced by WFMath::Line< dim >::rotateCenter(), and WFMath::Line< dim >::rotateCorner().