WFMath  1.0.2
Public Member Functions | List of all members
WFMath::Line< dim > Class Template Reference

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. More...
 
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
 
Lineshift (const Vector< dim > &v)
 shape: move the shape by an amount given by the Vector v
 
LinemoveCornerTo (const Point< dim > &p, size_t corner)
 shape: move the shape, moving the given corner to the Point p More...
 
LinemoveCenterTo (const Point< dim > &p)
 shape: move the shape, moving the center to the Point p More...
 
LinerotateCorner (const RotMatrix< dim > &m, size_t corner)
 shape: rotate the shape while holding the given corner fixed More...
 
LinerotateCenter (const RotMatrix< dim > &m)
 shape: rotate the shape while holding the center fixed More...
 
LinerotatePoint (const RotMatrix< dim > &m, const Point< dim > &p)
 shape: rotate the shape while holding the Point p fixed. More...
 

Detailed Description

template<int dim = 3>
class WFMath::Line< dim >

A dim dimensional line.

This class implements the full shape interface, as described in the fake class Shape.

Member Function Documentation

◆ moveCenterTo()

template<int dim = 3>
Line& WFMath::Line< dim >::moveCenterTo ( const Point< dim > &  p)
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().

◆ moveCornerTo()

template<int dim = 3>
Line& WFMath::Line< dim >::moveCornerTo ( const Point< dim > &  p,
size_t  corner 
)
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().

◆ numCorners()

template<int dim = 3>
size_t WFMath::Line< dim >::numCorners ( ) const
inline

shape: return the number of corners in the shape.

For many shape classes, this is a fixed constant

◆ rotateCenter()

template<int dim = 3>
Line& WFMath::Line< dim >::rotateCenter ( const RotMatrix< dim > &  m)
inline

shape: rotate the shape while holding the center fixed

The center is defined by getCenter()

References WFMath::BoundingBox(), WFMath::BoundingSphere(), WFMath::BoundingSphereSloppy(), WFMath::Line< dim >::getCenter(), and WFMath::Line< dim >::rotatePoint().

◆ rotateCorner()

template<int dim = 3>
Line& WFMath::Line< dim >::rotateCorner ( const RotMatrix< dim > &  m,
size_t  corner 
)
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().

◆ rotatePoint()

template<int dim>
Line< dim > & WFMath::Line< dim >::rotatePoint ( const RotMatrix< dim > &  m,
const Point< dim > &  p 
)
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().


The documentation for this class was generated from the following files: