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

Public Functions

bool hasNext () const
 
QStrokerOps::Element next ()
 
 QSubpathFlatIterator (const QDataBuffer< QStrokerOps::Element > *path, qreal threshold)
 

Properties

QPolygonF m_curve
 
int m_curve_index
 
qreal m_curve_threshold
 
const QDataBuffer< QStrokerOps::Element > * m_path
 
int m_pos
 

Detailed Description

Definition at line 120 of file qstroker.cpp.

Constructors and Destructors

◆ QSubpathFlatIterator()

QSubpathFlatIterator::QSubpathFlatIterator ( const QDataBuffer< QStrokerOps::Element > *  path,
qreal  threshold 
)
inline

Definition at line 123 of file qstroker.cpp.

124  : m_path(path), m_pos(0), m_curve_index(-1), m_curve_threshold(threshold) { }
const QDataBuffer< QStrokerOps::Element > * m_path
Definition: qstroker.cpp:168

Functions

◆ hasNext()

bool QSubpathFlatIterator::hasNext ( ) const
inline

Definition at line 126 of file qstroker.cpp.

Referenced by QDashStroker::processCurrentSubpath().

126 { return m_curve_index >= 0 || m_pos < m_path->size(); }
const QDataBuffer< QStrokerOps::Element > * m_path
Definition: qstroker.cpp:168
int size() const
Definition: qdatabuffer_p.h:83

◆ next()

QStrokerOps::Element QSubpathFlatIterator::next ( )
inline

Definition at line 128 of file qstroker.cpp.

Referenced by QDashStroker::processCurrentSubpath().

129  {
130  Q_ASSERT(hasNext());
131 
132  if (m_curve_index >= 0) {
136  };
137  ++m_curve_index;
138  if (m_curve_index >= m_curve.size())
139  m_curve_index = -1;
140  return e;
141  }
142 
144  if (e.isCurveTo()) {
145  Q_ASSERT(m_pos > 0);
146  Q_ASSERT(m_pos < m_path->size());
147 
151  qt_fixed_to_real(e.y)),
156  m_curve_index = 1;
158  e.x = m_curve.at(0).x();
159  e.y = m_curve.at(0).y();
160  m_pos += 2;
161  }
162  Q_ASSERT(e.isLineTo() || e.isMoveTo());
163  ++m_pos;
164  return e;
165  }
#define qt_real_to_fixed(real)
Definition: qstroker_p.h:101
bool isMoveTo() const
Definition: qstroker_p.h:138
QPainterPath::ElementType type
Definition: qstroker_p.h:134
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
bool isLineTo() const
Definition: qstroker_p.h:139
static QBezier fromPoints(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4)
Definition: qbezier.cpp:71
Type & at(int i)
Definition: qdatabuffer_p.h:86
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
#define qt_fixed_to_real(fixed)
Definition: qstroker_p.h:102
bool hasNext() const
Definition: qstroker.cpp:126
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
const QDataBuffer< QStrokerOps::Element > * m_path
Definition: qstroker.cpp:168
bool isCurveTo() const
Definition: qstroker_p.h:140
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137

Properties

◆ m_curve

QPolygonF QSubpathFlatIterator::m_curve
private

Definition at line 170 of file qstroker.cpp.

◆ m_curve_index

int QSubpathFlatIterator::m_curve_index
private

Definition at line 171 of file qstroker.cpp.

◆ m_curve_threshold

qreal QSubpathFlatIterator::m_curve_threshold
private

Definition at line 172 of file qstroker.cpp.

◆ m_path

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

Definition at line 168 of file qstroker.cpp.

◆ m_pos

int QSubpathFlatIterator::m_pos
private

Definition at line 169 of file qstroker.cpp.


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