tCoord::GrahamComparator Class Reference

Collaboration diagram for tCoord::GrahamComparator:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 GrahamComparator (tCoord const &reference)
bool operator() (tCoord const &a, tCoord const &b)

Private Attributes

tCoord const & m_reference


Detailed Description

Definition at line 85 of file tCoord.h.


Constructor & Destructor Documentation

tCoord::GrahamComparator::GrahamComparator ( tCoord const &  reference  )  [inline]

Definition at line 88 of file tCoord.h.

00088 : m_reference(reference) {}


Member Function Documentation

bool tCoord::GrahamComparator::operator() ( tCoord const &  a,
tCoord const &  b 
) [inline]

Definition at line 89 of file tCoord.h.

References EPS, m_reference, tCoord::NormSquared(), REAL, and tCoord::Tangent().

00089                                                           {
00090             REAL ta = Tangent(m_reference, a), tb = Tangent(m_reference, b);
00091 
00092             //check for 90 degree angles...
00093             if(ta == NAN && tb == NAN) return fabs((m_reference-a).NormSquared()) < fabs((m_reference-b).NormSquared());
00094             if(ta == NAN) return tb<0;
00095             if(tb == NAN) return ta>0;
00096 
00097             //check for opposite sides
00098             if(ta>0 && tb<0) return true;
00099             if(tb>0 && ta<0) return false;
00100 
00101             return (ta<tb-EPS) || ((fabs(ta-tb)<EPS) && fabs((m_reference-a).NormSquared()) < fabs((m_reference-b).NormSquared()));
00102         }

Here is the call graph for this function:


Member Data Documentation

tCoord const& tCoord::GrahamComparator::m_reference [private]

Definition at line 86 of file tCoord.h.

Referenced by operator()().


The documentation for this class was generated from the following file:
Generated on Sat Mar 15 23:55:58 2008 for Armagetron Advanced by  doxygen 1.5.4