wfmath 1.0.3
A math library for the Worldforge system.
WFMath::Polygon< dim > Class Template Reference

A polygon, all of whose points lie in a plane, embedded in dim dimensions. More...

#include <polygon.h>

Public Member Functions

 Polygon (const Polygon &p)
 
Polygonoperator= (const Polygon &p)
 
bool isEqualTo (const Polygon &p2, CoordType epsilon=numeric_constants< CoordType >::epsilon()) const
 
bool operator== (const Polygon &p) const
 
bool operator!= (const Polygon &p) const
 
bool isValid () const
 
size_t numCorners () const
 
Point< dim > getCorner (size_t i) const
 
Point< dim > getCenter () const
 
bool addCorner (size_t i, const Point< dim > &p, CoordType epsilon=numeric_constants< CoordType >::epsilon())
 
void removeCorner (size_t i)
 
bool moveCorner (size_t i, const Point< dim > &p, CoordType epsilon=numeric_constants< CoordType >::epsilon())
 
void clear ()
 
Polygonshift (const Vector< dim > &v)
 
PolygonmoveCornerTo (const Point< dim > &p, size_t corner)
 
PolygonmoveCenterTo (const Point< dim > &p)
 
PolygonrotateCorner (const RotMatrix< dim > &m, size_t corner)
 
PolygonrotateCenter (const RotMatrix< dim > &m)
 
PolygonrotatePoint (const RotMatrix< dim > &m, const Point< dim > &p)
 
Polygon< 3 > & rotateCorner (const Quaternion &q, size_t corner)
 
Polygon< 3 > & rotateCenter (const Quaternion &q)
 
Polygon< 3 > & rotatePoint (const Quaternion &q, const Point< 3 > &p)
 
AxisBox< dim > boundingBox () const
 
Ball< dim > boundingSphere () const
 
Ball< dim > boundingSphereSloppy () const
 
Polygon toParentCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const
 
Polygon toParentCoords (const AxisBox< dim > &coords) const
 
Polygon toParentCoords (const RotBox< dim > &coords) const
 
Polygon toLocalCoords (const Point< dim > &origin, const RotMatrix< dim > &rotation=RotMatrix< dim >().identity()) const
 
Polygon toLocalCoords (const AxisBox< dim > &coords) const
 
Polygon toLocalCoords (const RotBox< dim > &coords) const
 
Polygon< 3 > toParentCoords (const Point< 3 > &origin, const Quaternion &rotation) const
 
Polygon< 3 > toLocalCoords (const Point< 3 > &origin, const Quaternion &rotation) const
 

Friends

std::ostream & operator (std::ostream &os, const Polygon &p)
 
std::istream & operator>> (std::istream &is, Polygon &p)
 
bool Intersect (const Polygon &r, const Point< dim > &p, bool proper)
 
bool Contains (const Point< dim > &p, const Polygon &r, bool proper)
 
bool Intersect (const Polygon &p, const AxisBox< dim > &b, bool proper)
 
bool Contains (const Polygon &p, const AxisBox< dim > &b, bool proper)
 
bool Contains (const AxisBox< dim > &b, const Polygon &p, bool proper)
 
bool Intersect (const Polygon &p, const Ball< dim > &b, bool proper)
 
bool Contains (const Polygon &p, const Ball< dim > &b, bool proper)
 
bool Contains (const Ball< dim > &b, const Polygon &p, bool proper)
 
bool Intersect (const Polygon &p, const Segment< dim > &s, bool proper)
 
bool Contains (const Polygon &p, const Segment< dim > &s, bool proper)
 
bool Contains (const Segment< dim > &s, const Polygon &p, bool proper)
 
bool Intersect (const Polygon &p, const RotBox< dim > &r, bool proper)
 
bool Contains (const Polygon &p, const RotBox< dim > &r, bool proper)
 
bool Contains (const RotBox< dim > &r, const Polygon &p, bool proper)
 
bool Intersect (const Polygon &p1, const Polygon &p2, bool proper)
 
bool Contains (const Polygon &outer, const Polygon &inner, bool proper)
 

Detailed Description

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

A polygon, all of whose points lie in a plane, embedded in dim dimensions.

Definition at line 305 of file polygon.h.

Constructor & Destructor Documentation

◆ Polygon() [1/2]

template<int dim = 3>
WFMath::Polygon< dim >::Polygon ( )
inline

Definition at line 308 of file polygon.h.

◆ Polygon() [2/2]

template<int dim = 3>
WFMath::Polygon< dim >::Polygon ( const Polygon< dim > &  p)
inline

Definition at line 309 of file polygon.h.

Member Function Documentation

◆ addCorner()

template<int dim>
bool WFMath::Polygon< dim >::addCorner ( size_t  i,
const Point< dim > &  p,
CoordType  epsilon = numeric_constants<CoordType>::epsilon() 
)
inline

Definition at line 440 of file polygon.h.

◆ boundingBox()

template<int dim>
AxisBox< dim > WFMath::Polygon< dim >::boundingBox

Definition at line 313 of file polygon_funcs.h.

◆ boundingSphere()

template<int dim>
Ball< dim > WFMath::Polygon< dim >::boundingSphere
inline

Definition at line 338 of file polygon_funcs.h.

◆ boundingSphereSloppy()

template<int dim>
Ball< dim > WFMath::Polygon< dim >::boundingSphereSloppy
inline

Definition at line 346 of file polygon_funcs.h.

◆ clear()

template<int dim = 3>
void WFMath::Polygon< dim >::clear ( )
inline

Definition at line 349 of file polygon.h.

◆ getCenter()

template<int dim = 3>
Point< dim > WFMath::Polygon< dim >::getCenter ( ) const
inline

Definition at line 330 of file polygon.h.

◆ getCorner()

template<int dim = 3>
Point< dim > WFMath::Polygon< dim >::getCorner ( size_t  i) const
inline

Definition at line 329 of file polygon.h.

◆ isEqualTo()

template<int dim>
bool WFMath::Polygon< dim >::isEqualTo ( const Polygon< dim > &  p2,
CoordType  epsilon = numeric_constants<CoordType>::epsilon() 
) const
inline

Definition at line 43 of file polygon_funcs.h.

◆ isValid()

template<int dim = 3>
bool WFMath::Polygon< dim >::isValid ( ) const
inline

Definition at line 324 of file polygon.h.

◆ moveCenterTo()

template<int dim = 3>
Polygon & WFMath::Polygon< dim >::moveCenterTo ( const Point< dim > &  p)
inline

Definition at line 357 of file polygon.h.

◆ moveCorner()

template<int dim>
bool WFMath::Polygon< dim >::moveCorner ( size_t  i,
const Point< dim > &  p,
CoordType  epsilon = numeric_constants<CoordType>::epsilon() 
)
inline

Definition at line 458 of file polygon.h.

◆ moveCornerTo()

template<int dim = 3>
Polygon & WFMath::Polygon< dim >::moveCornerTo ( const Point< dim > &  p,
size_t  corner 
)
inline

Definition at line 355 of file polygon.h.

◆ numCorners()

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

Definition at line 328 of file polygon.h.

◆ operator!=()

template<int dim = 3>
bool WFMath::Polygon< dim >::operator!= ( const Polygon< dim > &  p) const
inline

Definition at line 322 of file polygon.h.

◆ operator=()

template<int dim = 3>
Polygon & WFMath::Polygon< dim >::operator= ( const Polygon< dim > &  p)
inline

Definition at line 316 of file polygon.h.

◆ operator==()

template<int dim = 3>
bool WFMath::Polygon< dim >::operator== ( const Polygon< dim > &  p) const
inline

Definition at line 321 of file polygon.h.

◆ removeCorner()

template<int dim>
void WFMath::Polygon< dim >::removeCorner ( size_t  i)
inline

Definition at line 450 of file polygon.h.

◆ rotateCenter() [1/2]

template<int dim = 3>
Polygon< 3 > & WFMath::Polygon< dim >::rotateCenter ( const Quaternion q)
inline

Definition at line 372 of file polygon.h.

◆ rotateCenter() [2/2]

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

Definition at line 362 of file polygon.h.

◆ rotateCorner() [1/2]

template<int dim = 3>
Polygon< 3 > & WFMath::Polygon< dim >::rotateCorner ( const Quaternion q,
size_t  corner 
)
inline

Definition at line 370 of file polygon.h.

◆ rotateCorner() [2/2]

template<int dim = 3>
Polygon & WFMath::Polygon< dim >::rotateCorner ( const RotMatrix< dim > &  m,
size_t  corner 
)
inline

Definition at line 360 of file polygon.h.

◆ rotatePoint() [1/2]

template<int dim = 3>
Polygon< 3 > & WFMath::Polygon< dim >::rotatePoint ( const Quaternion q,
const Point< 3 > &  p 
)
inline

Definition at line 376 of file polygon.h.

◆ rotatePoint() [2/2]

template<int dim = 3>
Polygon & WFMath::Polygon< dim >::rotatePoint ( const RotMatrix< dim > &  m,
const Point< dim > &  p 
)
inline

Definition at line 366 of file polygon.h.

◆ shift()

template<int dim = 3>
Polygon & WFMath::Polygon< dim >::shift ( const Vector< dim > &  v)
inline

Definition at line 353 of file polygon.h.

◆ toLocalCoords() [1/4]

template<int dim = 3>
Polygon WFMath::Polygon< dim >::toLocalCoords ( const AxisBox< dim > &  coords) const
inline

Definition at line 400 of file polygon.h.

◆ toLocalCoords() [2/4]

template<int dim = 3>
Polygon< 3 > WFMath::Polygon< dim >::toLocalCoords ( const Point< 3 > &  origin,
const Quaternion rotation 
) const
inline

Definition at line 408 of file polygon.h.

◆ toLocalCoords() [3/4]

template<int dim = 3>
Polygon WFMath::Polygon< dim >::toLocalCoords ( const Point< dim > &  origin,
const RotMatrix< dim > &  rotation = RotMatrix<dim>().identity() 
) const
inline

Definition at line 397 of file polygon.h.

◆ toLocalCoords() [4/4]

template<int dim = 3>
Polygon WFMath::Polygon< dim >::toLocalCoords ( const RotBox< dim > &  coords) const
inline

Definition at line 402 of file polygon.h.

◆ toParentCoords() [1/4]

template<int dim = 3>
Polygon WFMath::Polygon< dim >::toParentCoords ( const AxisBox< dim > &  coords) const
inline

Definition at line 388 of file polygon.h.

◆ toParentCoords() [2/4]

template<int dim = 3>
Polygon< 3 > WFMath::Polygon< dim >::toParentCoords ( const Point< 3 > &  origin,
const Quaternion rotation 
) const
inline

Definition at line 406 of file polygon.h.

◆ toParentCoords() [3/4]

template<int dim = 3>
Polygon WFMath::Polygon< dim >::toParentCoords ( const Point< dim > &  origin,
const RotMatrix< dim > &  rotation = RotMatrix<dim>().identity() 
) const
inline

Definition at line 385 of file polygon.h.

◆ toParentCoords() [4/4]

template<int dim = 3>
Polygon WFMath::Polygon< dim >::toParentCoords ( const RotBox< dim > &  coords) const
inline

Definition at line 390 of file polygon.h.

Friends And Related Function Documentation

◆ Contains [1/10]

template<int dim = 3>
bool Contains ( const AxisBox< dim > &  b,
const Polygon< dim > &  p,
bool  proper 
)
friend

Definition at line 461 of file polygon_intersect.cpp.

◆ Contains [2/10]

template<int dim = 3>
bool Contains ( const Ball< dim > &  b,
const Polygon< dim > &  p,
bool  proper 
)
friend

Definition at line 505 of file polygon_intersect.cpp.

◆ Contains [3/10]

template<int dim = 3>
bool Contains ( const Point< dim > &  p,
const Polygon< dim > &  r,
bool  proper 
)
friend

Definition at line 353 of file polygon_intersect.cpp.

◆ Contains [4/10]

template<int dim = 3>
bool Contains ( const Polygon< dim > &  outer,
const Polygon< dim > &  inner,
bool  proper 
)
friend

Definition at line 668 of file polygon_intersect.cpp.

◆ Contains [5/10]

template<int dim = 3>
bool Contains ( const Polygon< dim > &  p,
const AxisBox< dim > &  b,
bool  proper 
)
friend

Definition at line 455 of file polygon_intersect.cpp.

◆ Contains [6/10]

template<int dim = 3>
bool Contains ( const Polygon< dim > &  p,
const Ball< dim > &  b,
bool  proper 
)
friend

Definition at line 488 of file polygon_intersect.cpp.

◆ Contains [7/10]

template<int dim = 3>
bool Contains ( const Polygon< dim > &  p,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 623 of file polygon_intersect.cpp.

◆ Contains [8/10]

template<int dim = 3>
bool Contains ( const Polygon< dim > &  p,
const Segment< dim > &  s,
bool  proper 
)
friend

Definition at line 555 of file polygon_intersect.cpp.

◆ Contains [9/10]

template<int dim = 3>
bool Contains ( const RotBox< dim > &  r,
const Polygon< dim > &  p,
bool  proper 
)
friend

Definition at line 632 of file polygon_intersect.cpp.

◆ Contains [10/10]

template<int dim = 3>
bool Contains ( const Segment< dim > &  s,
const Polygon< dim > &  p,
bool  proper 
)
friend

Definition at line 571 of file polygon_intersect.cpp.

◆ Intersect [1/6]

template<int dim = 3>
bool Intersect ( const Polygon< dim > &  p,
const AxisBox< dim > &  b,
bool  proper 
)
friend

Definition at line 371 of file polygon_intersect.cpp.

◆ Intersect [2/6]

template<int dim = 3>
bool Intersect ( const Polygon< dim > &  p,
const Ball< dim > &  b,
bool  proper 
)
friend

Definition at line 471 of file polygon_intersect.cpp.

◆ Intersect [3/6]

template<int dim = 3>
bool Intersect ( const Polygon< dim > &  p,
const RotBox< dim > &  r,
bool  proper 
)
friend

Definition at line 590 of file polygon_intersect.cpp.

◆ Intersect [4/6]

template<int dim = 3>
bool Intersect ( const Polygon< dim > &  p,
const Segment< dim > &  s,
bool  proper 
)
friend

Definition at line 526 of file polygon_intersect.cpp.

◆ Intersect [5/6]

template<int dim = 3>
bool Intersect ( const Polygon< dim > &  p1,
const Polygon< dim > &  p2,
bool  proper 
)
friend

Definition at line 654 of file polygon_intersect.cpp.

◆ Intersect [6/6]

template<int dim = 3>
bool Intersect ( const Polygon< dim > &  r,
const Point< dim > &  p,
bool  proper 
)
friend

Definition at line 344 of file polygon_intersect.cpp.

◆ operator>>

template<int dim = 3>
std::istream & operator>> ( std::istream &  is,
Polygon< dim > &  p 
)
friend

Definition at line 68 of file stream.cpp.


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