Qt 4.8
Public Functions | List of all members
QOpenGLTessellator Class Reference
Inheritance diagram for QOpenGLTessellator:
QTessellator QOpenGLImmediateModeTessellator QOpenGLTrapezoidToArrayTessellator

Public Functions

 QOpenGLTessellator ()
 
QGLTrapezoid toGLTrapezoid (const Trapezoid &trap)
 
 ~QOpenGLTessellator ()
 
- Public Functions inherited from QTessellator
virtual void addTrap (const Trapezoid &trap)=0
 
 QTessellator ()
 
void setWinding (bool w)
 
QRectF tessellate (const QPointF *points, int nPoints)
 
void tessellateConvex (const QPointF *points, int nPoints)
 
void tessellateRect (const QPointF &a, const QPointF &b, qreal width)
 
virtual ~QTessellator ()
 

Detailed Description

Definition at line 1674 of file qpaintengine_opengl.cpp.

Constructors and Destructors

◆ QOpenGLTessellator()

QOpenGLTessellator::QOpenGLTessellator ( )
inline

Definition at line 1677 of file qpaintengine_opengl.cpp.

1677 {}

◆ ~QOpenGLTessellator()

QOpenGLTessellator::~QOpenGLTessellator ( )
inline

Definition at line 1678 of file qpaintengine_opengl.cpp.

1678 { }

Functions

◆ toGLTrapezoid()

QGLTrapezoid QOpenGLTessellator::toGLTrapezoid ( const Trapezoid trap)

Definition at line 1682 of file qpaintengine_opengl.cpp.

1683 {
1684  QGLTrapezoid t;
1685 
1686  t.top = Q27Dot5ToDouble(trap.top);
1687  t.bottom = Q27Dot5ToDouble(trap.bottom);
1688 
1689  Q27Dot5 y = trap.topLeft->y - trap.bottomLeft->y;
1690 
1691  qreal topLeftY = Q27Dot5ToDouble(trap.topLeft->y);
1692 
1693  qreal tx = Q27Dot5ToDouble(trap.topLeft->x);
1694  qreal m = (-tx + Q27Dot5ToDouble(trap.bottomLeft->x)) / Q27Dot5ToDouble(y);
1695  t.topLeftX = tx + m * (topLeftY - t.top);
1696  t.bottomLeftX = tx + m * (topLeftY - t.bottom);
1697 
1698  y = trap.topRight->y - trap.bottomRight->y;
1699 
1700  qreal topRightY = Q27Dot5ToDouble(trap.topRight->y);
1701 
1702  tx = Q27Dot5ToDouble(trap.topRight->x);
1703  m = (-tx + Q27Dot5ToDouble(trap.bottomRight->x)) / Q27Dot5ToDouble(y);
1704 
1705  t.topRightX = tx + m * (topRightY - Q27Dot5ToDouble(trap.top));
1706  t.bottomRightX = tx + m * (topRightY - Q27Dot5ToDouble(trap.bottom));
1707 
1708  return t;
1709 }
double qreal
Definition: qglobal.h:1193
#define Q27Dot5ToDouble(i)
int Q27Dot5

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