Qt 4.8
Public Functions | Public Variables | List of all members
QIntersectionPoint Struct Reference

Public Functions

bool isAccurate () const
 
bool isOnLine (const QPodPoint &u, const QPodPoint &v) const
 
bool isValid () const
 
bool operator!= (const QIntersectionPoint &other) const
 
bool operator< (const QIntersectionPoint &other) const
 
bool operator<= (const QIntersectionPoint &other) const
 
bool operator== (const QIntersectionPoint &other) const
 
bool operator> (const QIntersectionPoint &other) const
 
bool operator>= (const QIntersectionPoint &other) const
 
QPodPoint round () const
 

Public Variables

QPodPoint upperLeft
 
QFraction xOffset
 
QFraction yOffset
 

Detailed Description

Definition at line 366 of file qtriangulator.cpp.

Functions

◆ isAccurate()

bool QIntersectionPoint::isAccurate ( ) const
inline

◆ isOnLine()

bool QIntersectionPoint::isOnLine ( const QPodPoint u,
const QPodPoint v 
) const

Definition at line 490 of file qtriangulator.cpp.

Referenced by QTriangulator< T >::ComplexToSimple::calculateIntersection(), QTriangulator< T >::ComplexToSimple::sortEdgeList(), and QTriangulator< T >::ComplexToSimple::splitEdgeListRange().

491 {
492  // TODO: Make code path for coordinates with more than 21 bits.
493  const QPodPoint p = upperLeft - u;
494  const QPodPoint q = v - u;
495  bool isHorizontal = p.y == 0 && yOffset.numerator == 0;
496  bool isVertical = p.x == 0 && xOffset.numerator == 0;
497  if (isHorizontal && isVertical)
498  return true;
499  if (isHorizontal)
500  return q.y == 0;
501  if (q.y == 0)
502  return false;
503  if (isVertical)
504  return q.x == 0;
505  if (q.x == 0)
506  return false;
507 
508  // At this point, 'p+offset' and 'q' cannot lie on the x or y axis.
509 
510  if (((q.x < 0) == (q.y < 0)) != ((p.x < 0) == (p.y < 0)))
511  return false; // 'p + offset' and 'q' pass through different quadrants.
512 
513  // Move all coordinates into the first quadrant.
514  quint64 nx, ny;
515  if (p.x < 0)
517  else
519  if (p.y < 0)
521  else
523 
525 }
quint64 denominator
quint16 u
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
unsigned __int64 quint64
Definition: qglobal.h:943
quint64 numerator
static QFraction qFraction(quint64 n, quint64 d)

◆ isValid()

bool QIntersectionPoint::isValid ( ) const
inline

Definition at line 368 of file qtriangulator.cpp.

Referenced by QTriangulator< T >::ComplexToSimple::calculateIntersection().

368 {return xOffset.isValid() && yOffset.isValid();}
bool isValid() const

◆ operator!=()

bool QIntersectionPoint::operator!= ( const QIntersectionPoint other) const
inline

Definition at line 373 of file qtriangulator.cpp.

373 {return !(*this == other);}

◆ operator<()

bool QIntersectionPoint::operator< ( const QIntersectionPoint other) const

Definition at line 473 of file qtriangulator.cpp.

474 {
475  if (upperLeft.y != other.upperLeft.y)
476  return upperLeft.y < other.upperLeft.y;
477  if (yOffset != other.yOffset)
478  return yOffset < other.yOffset;
479  if (upperLeft.x != other.upperLeft.x)
480  return upperLeft.x < other.upperLeft.x;
481  return xOffset < other.xOffset;
482 }

◆ operator<=()

bool QIntersectionPoint::operator<= ( const QIntersectionPoint other) const
inline

Definition at line 376 of file qtriangulator.cpp.

376 {return !(*this > other);}

◆ operator==()

bool QIntersectionPoint::operator== ( const QIntersectionPoint other) const

Definition at line 484 of file qtriangulator.cpp.

485 {
486  return upperLeft == other.upperLeft && xOffset == other.xOffset && yOffset == other.yOffset;
487 }

◆ operator>()

bool QIntersectionPoint::operator> ( const QIntersectionPoint other) const
inline

Definition at line 374 of file qtriangulator.cpp.

374 {return other < *this;}

◆ operator>=()

bool QIntersectionPoint::operator>= ( const QIntersectionPoint other) const
inline

Definition at line 375 of file qtriangulator.cpp.

375 {return !(*this < other);}

◆ round()

QPodPoint QIntersectionPoint::round ( ) const

Definition at line 463 of file qtriangulator.cpp.

Referenced by QTriangulator< T >::ComplexToSimple::calculateIntersection().

464 {
465  QPodPoint result = upperLeft;
467  ++result.x;
469  ++result.y;
470  return result;
471 }
quint64 denominator
quint64 numerator

Properties

◆ upperLeft

QPodPoint QIntersectionPoint::upperLeft

◆ xOffset

QFraction QIntersectionPoint::xOffset

◆ yOffset

QFraction QIntersectionPoint::yOffset

The documentation for this struct was generated from the following file: