Qt 4.8
Public Functions | Properties | List of all members
QSubpathBackwardIterator Class Reference

Public Functions

bool hasNext () const
 
QStrokerOps::Element next ()
 
int position () const
 
 QSubpathBackwardIterator (const QDataBuffer< QStrokerOps::Element > *path)
 

Properties

const QDataBuffer< QStrokerOps::Element > * m_path
 
int m_pos
 

Detailed Description

Definition at line 67 of file qstroker.cpp.

Constructors and Destructors

◆ QSubpathBackwardIterator()

QSubpathBackwardIterator::QSubpathBackwardIterator ( const QDataBuffer< QStrokerOps::Element > *  path)
inline

Definition at line 70 of file qstroker.cpp.

71  : m_path(path), m_pos(path->size() - 1) { }
const QDataBuffer< QStrokerOps::Element > * m_path
Definition: qstroker.cpp:116
int size() const
Definition: qdatabuffer_p.h:83

Functions

◆ hasNext()

bool QSubpathBackwardIterator::hasNext ( ) const
inline

Definition at line 75 of file qstroker.cpp.

75 { return m_pos >= 0; }

◆ next()

QStrokerOps::Element QSubpathBackwardIterator::next ( )
inline

Definition at line 77 of file qstroker.cpp.

78  {
79  Q_ASSERT(hasNext());
80 
81  QStrokerOps::Element ce = m_path->at(m_pos); // current element
82 
83  if (m_pos == m_path->size() - 1) {
84  --m_pos;
86  return ce;
87  }
88 
89  const QStrokerOps::Element &pe = m_path->at(m_pos + 1); // previous element
90 
91  switch (pe.type) {
94  break;
96  // First control point?
99  } else { // Second control point then
101  }
102  break;
105  break;
106  default:
107  qWarning("QSubpathReverseIterator::next: Case %d unhandled", ce.type);
108  break;
109  }
110  --m_pos;
111 
112  return ce;
113  }
QPainterPath::ElementType type
Definition: qstroker_p.h:134
bool hasNext() const
Definition: qstroker.cpp:75
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_CORE_EXPORT void qWarning(const char *,...)
Type & at(int i)
Definition: qdatabuffer_p.h:86
const QDataBuffer< QStrokerOps::Element > * m_path
Definition: qstroker.cpp:116
int size() const
Definition: qdatabuffer_p.h:83

◆ position()

int QSubpathBackwardIterator::position ( ) const
inline

Definition at line 73 of file qstroker.cpp.

73 { return m_pos; }

Properties

◆ m_path

const QDataBuffer<QStrokerOps::Element>* QSubpathBackwardIterator::m_path
private

Definition at line 116 of file qstroker.cpp.

◆ m_pos

int QSubpathBackwardIterator::m_pos
private

Definition at line 117 of file qstroker.cpp.


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