
Definition at line 45 of file qstroker.cpp.
Public Member Functions | |
| QSubpathBackwardIterator (const QDataBuffer< QStrokerOps::Element > *path) | |
| int | position () const |
| bool | hasNext () const |
| QStrokerOps::Element | next () |
Private Attributes | |
| const QDataBuffer< QStrokerOps::Element > * | m_path |
| int | m_pos |
| QSubpathBackwardIterator::QSubpathBackwardIterator | ( | const QDataBuffer< QStrokerOps::Element > * | path | ) | [inline] |
| int QSubpathBackwardIterator::position | ( | ) | const [inline] |
| bool QSubpathBackwardIterator::hasNext | ( | ) | const [inline] |
Definition at line 53 of file qstroker.cpp.
References m_pos.
Referenced by next().
00053 { return m_pos >= 0; }
| QStrokerOps::Element QSubpathBackwardIterator::next | ( | ) | [inline] |
Definition at line 55 of file qstroker.cpp.
References QDataBuffer< Type >::at(), QPainterPath::CurveToDataElement, QPainterPath::CurveToElement, hasNext(), QPainterPath::LineToElement, m_path, m_pos, QPainterPath::MoveToElement, qWarning(), QDataBuffer< Type >::size(), and QStrokerOps::Element::type.
00056 { 00057 Q_ASSERT(hasNext()); 00058 00059 QStrokerOps::Element ce = m_path->at(m_pos); // current element 00060 00061 if (m_pos == m_path->size() - 1) { 00062 --m_pos; 00063 ce.type = QPainterPath::MoveToElement; 00064 return ce; 00065 } 00066 00067 const QStrokerOps::Element &pe = m_path->at(m_pos + 1); // previous element 00068 00069 switch (pe.type) { 00070 case QPainterPath::LineToElement: 00071 ce.type = QPainterPath::LineToElement; 00072 break; 00073 case QPainterPath::CurveToDataElement: 00074 // First control point? 00075 if (ce.type == QPainterPath::CurveToElement) { 00076 ce.type = QPainterPath::CurveToDataElement; 00077 } else { // Second control point then 00078 ce.type = QPainterPath::CurveToElement; 00079 } 00080 break; 00081 case QPainterPath::CurveToElement: 00082 ce.type = QPainterPath::CurveToDataElement; 00083 break; 00084 default: 00085 qWarning("QSubpathReverseIterator::next: Case %d unhandled", ce.type); 00086 break; 00087 } 00088 --m_pos; 00089 00090 return ce; 00091 }
Here is the call graph for this function:

const QDataBuffer<QStrokerOps::Element>* QSubpathBackwardIterator::m_path [private] |
int QSubpathBackwardIterator::m_pos [private] |
1.5.1