Qt 4.8
Public Types | Public Functions | Protected Functions | Static Protected Functions | Protected Variables | List of all members
QStroker Class Reference

#include <qstroker_p.h>

Inheritance diagram for QStroker:
QStrokerOps

Public Types

enum  LineJoinMode {
  FlatJoin, SquareJoin, MiterJoin, RoundJoin,
  RoundCap, SvgMiterJoin
}
 

Public Functions

Qt::PenCapStyle capStyle () const
 
LineJoinMode capStyleMode () const
 
void emitCubicTo (qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey)
 
void emitLineTo (qfixed x, qfixed y)
 
void emitMoveTo (qfixed x, qfixed y)
 
void joinPoints (qfixed x, qfixed y, const QLineF &nextLine, LineJoinMode join)
 
Qt::PenJoinStyle joinStyle () const
 
LineJoinMode joinStyleMode () const
 
qfixed miterLimit () const
 
 QStroker ()
 
void setCapStyle (Qt::PenCapStyle capStyle)
 
void setJoinStyle (Qt::PenJoinStyle style)
 
void setMiterLimit (qfixed length)
 
void setStrokeWidth (qfixed width)
 
qfixed strokeWidth () const
 
 ~QStroker ()
 
- Public Functions inherited from QStrokerOps
virtual void begin (void *customData)
 Prepares the stroker. More...
 
QRectF clipRect () const
 
void cubicTo (qfixed x1, qfixed y1, qfixed x2, qfixed y2, qfixed ex, qfixed ey)
 
qfixed curveThreshold () const
 
virtual void end ()
 Finishes the stroke. More...
 
void lineTo (qfixed x, qfixed y)
 
void moveTo (qfixed x, qfixed y)
 
 QStrokerOps ()
 
void setClipRect (const QRectF &clip)
 
void setCubicToHook (qStrokerCubicToHook cubicToHook)
 
void setCurveThreshold (qfixed threshold)
 
void setCurveThresholdFromTransform (const QTransform &transform)
 
void setLineToHook (qStrokerLineToHook lineToHook)
 
void setMoveToHook (qStrokerMoveToHook moveToHook)
 
void strokeEllipse (const QRectF &ellipse, void *data, const QTransform &matrix)
 Convenience function for stroking an ellipse with bounding rect rect. More...
 
void strokePath (const QPainterPath &path, void *data, const QTransform &matrix)
 Convenience function that decomposes path into begin(), moveTo(), lineTo(), curevTo() and end() calls. More...
 
void strokePolygon (const QPointF *points, int pointCount, bool implicit_close, void *data, const QTransform &matrix)
 Convenience function for stroking a polygon of the pointCount first points in points. More...
 
virtual ~QStrokerOps ()
 

Protected Functions

virtual void processCurrentSubpath ()
 This function is called to stroke the currently built up subpath. More...
 
- Protected Functions inherited from QStrokerOps
void emitCubicTo (qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey)
 
void emitLineTo (qfixed x, qfixed y)
 
void emitMoveTo (qfixed x, qfixed y)
 

Static Protected Functions

static Qt::PenCapStyle capForJoinMode (LineJoinMode mode)
 
static Qt::PenJoinStyle joinForJoinMode (LineJoinMode mode)
 
static LineJoinMode joinModeForCap (Qt::PenCapStyle)
 
static LineJoinMode joinModeForJoin (Qt::PenJoinStyle joinStyle)
 

Protected Variables

qfixed m_back1X
 
qfixed m_back1Y
 
qfixed m_back2X
 
qfixed m_back2Y
 
LineJoinMode m_capStyle
 
LineJoinMode m_joinStyle
 
qfixed m_miterLimit
 
qfixed m_strokeWidth
 
- Protected Variables inherited from QStrokerOps
QRectF m_clip_rect
 
qStrokerCubicToHook m_cubicTo
 
qfixed m_curveThreshold
 
void * m_customData
 
qfixed m_dashThreshold
 
QDataBuffer< Elementm_elements
 
qStrokerLineToHook m_lineTo
 
qStrokerMoveToHook m_moveTo
 

Detailed Description

Definition at line 196 of file qstroker_p.h.

Enumerations

◆ LineJoinMode

Enumerator
FlatJoin 
SquareJoin 
MiterJoin 
RoundJoin 
RoundCap 
SvgMiterJoin 

Definition at line 200 of file qstroker_p.h.

Constructors and Destructors

◆ QStroker()

QStroker::QStroker ( )

Definition at line 372 of file qstroker.cpp.

374  m_back1X(0), m_back1Y(0),
375  m_back2X(0), m_back2Y(0)
376 {
379 }
qfixed m_back1Y
Definition: qstroker_p.h:247
#define qt_real_to_fixed(real)
Definition: qstroker_p.h:101
qfixed m_back2Y
Definition: qstroker_p.h:250
LineJoinMode m_joinStyle
Definition: qstroker_p.h:244
qfixed m_strokeWidth
Definition: qstroker_p.h:240
qfixed m_miterLimit
Definition: qstroker_p.h:241
qfixed m_back1X
Definition: qstroker_p.h:246
qfixed m_back2X
Definition: qstroker_p.h:249
LineJoinMode m_capStyle
Definition: qstroker_p.h:243

◆ ~QStroker()

QStroker::~QStroker ( )

Definition at line 381 of file qstroker.cpp.

382 {
383 }

Functions

◆ capForJoinMode()

Qt::PenCapStyle QStroker::capForJoinMode ( LineJoinMode  mode)
staticprotected

Definition at line 385 of file qstroker.cpp.

386 {
387  if (mode == FlatJoin) return Qt::FlatCap;
388  else if (mode == SquareJoin) return Qt::SquareCap;
389  else return Qt::RoundCap;
390 }

◆ capStyle()

Qt::PenCapStyle QStroker::capStyle ( ) const
inline

Definition at line 216 of file qstroker_p.h.

216 { return capForJoinMode(m_capStyle); }
static Qt::PenCapStyle capForJoinMode(LineJoinMode mode)
Definition: qstroker.cpp:385
LineJoinMode m_capStyle
Definition: qstroker_p.h:243

◆ capStyleMode()

LineJoinMode QStroker::capStyleMode ( ) const
inline

Definition at line 217 of file qstroker_p.h.

Referenced by qt_stroke_side().

217 { return m_capStyle; }
LineJoinMode m_capStyle
Definition: qstroker_p.h:243

◆ emitCubicTo()

void QStroker::emitCubicTo ( qfixed  c1x,
qfixed  c1y,
qfixed  c2x,
qfixed  c2y,
qfixed  ex,
qfixed  ey 
)
inline

Definition at line 354 of file qstroker_p.h.

Referenced by joinPoints(), and qt_stroke_side().

357 {
358  if (c2x == ex && c2y == ey) {
359  if (c1x == ex && c1y == ey) {
360  m_back2X = m_back1X;
361  m_back2Y = m_back1Y;
362  } else {
363  m_back2X = c1x;
364  m_back2Y = c1y;
365  }
366  } else {
367  m_back2X = c2x;
368  m_back2Y = c2y;
369  }
370  m_back1X = ex;
371  m_back1Y = ey;
372  QStrokerOps::emitCubicTo(c1x, c1y, c2x, c2y, ex, ey);
373 }
qfixed m_back1Y
Definition: qstroker_p.h:247
void emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey)
Definition: qstroker_p.h:302
qfixed m_back2Y
Definition: qstroker_p.h:250
qfixed m_back1X
Definition: qstroker_p.h:246
qfixed m_back2X
Definition: qstroker_p.h:249

◆ emitLineTo()

void QStroker::emitLineTo ( qfixed  x,
qfixed  y 
)
inline

Definition at line 345 of file qstroker_p.h.

Referenced by joinPoints(), and qt_stroke_side().

346 {
347  m_back2X = m_back1X;
348  m_back2Y = m_back1Y;
349  m_back1X = x;
350  m_back1Y = y;
352 }
qfixed m_back1Y
Definition: qstroker_p.h:247
void emitLineTo(qfixed x, qfixed y)
Definition: qstroker_p.h:296
qfixed m_back2Y
Definition: qstroker_p.h:250
qfixed m_back1X
Definition: qstroker_p.h:246
qfixed m_back2X
Definition: qstroker_p.h:249

◆ emitMoveTo()

void QStroker::emitMoveTo ( qfixed  x,
qfixed  y 
)
inline

Definition at line 336 of file qstroker_p.h.

Referenced by qt_stroke_side().

337 {
338  m_back2X = m_back1X;
339  m_back2Y = m_back1Y;
340  m_back1X = x;
341  m_back1Y = y;
343 }
qfixed m_back1Y
Definition: qstroker_p.h:247
qfixed m_back2Y
Definition: qstroker_p.h:250
void emitMoveTo(qfixed x, qfixed y)
Definition: qstroker_p.h:290
qfixed m_back1X
Definition: qstroker_p.h:246
qfixed m_back2X
Definition: qstroker_p.h:249

◆ joinForJoinMode()

Qt::PenJoinStyle QStroker::joinForJoinMode ( LineJoinMode  mode)
staticprotected

Definition at line 399 of file qstroker.cpp.

400 {
401  if (mode == FlatJoin) return Qt::BevelJoin;
402  else if (mode == MiterJoin) return Qt::MiterJoin;
403  else if (mode == SvgMiterJoin) return Qt::SvgMiterJoin;
404  else return Qt::RoundJoin;
405 }

◆ joinModeForCap()

QStroker::LineJoinMode QStroker::joinModeForCap ( Qt::PenCapStyle  style)
staticprotected

Definition at line 392 of file qstroker.cpp.

393 {
394  if (style == Qt::FlatCap) return FlatJoin;
395  else if (style == Qt::SquareCap) return SquareJoin;
396  else return RoundCap;
397 }

◆ joinModeForJoin()

QStroker::LineJoinMode QStroker::joinModeForJoin ( Qt::PenJoinStyle  joinStyle)
staticprotected

Definition at line 407 of file qstroker.cpp.

408 {
409  if (joinStyle == Qt::BevelJoin) return FlatJoin;
410  else if (joinStyle == Qt::MiterJoin) return MiterJoin;
411  else if (joinStyle == Qt::SvgMiterJoin) return SvgMiterJoin;
412  else return RoundJoin;
413 }
Qt::PenJoinStyle joinStyle() const
Definition: qstroker_p.h:220

◆ joinPoints()

void QStroker::joinPoints ( qfixed  focal_x,
qfixed  focal_y,
const QLineF nextLine,
LineJoinMode  join 
)
Warning
This function is not part of the public interface.

Definition at line 442 of file qstroker.cpp.

Referenced by processCurrentSubpath(), and qt_stroke_side().

443 {
444 #ifdef QPP_STROKE_DEBUG
445  printf(" -----> joinPoints: around=(%.0f, %.0f), next_p1=(%.0f, %.f) next_p2=(%.0f, %.f)\n",
446  qt_fixed_to_real(focal_x),
447  qt_fixed_to_real(focal_y),
448  nextLine.x1(), nextLine.y1(), nextLine.x2(), nextLine.y2());
449 #endif
450  // points connected already, don't join
451 
452 #if !defined (QFIXED_26_6) && !defined (Q_FIXED_32_32)
453  if (qFuzzyCompare(m_back1X, nextLine.x1()) && qFuzzyCompare(m_back1Y, nextLine.y1()))
454  return;
455 #else
456  if (m_back1X == qt_real_to_fixed(nextLine.x1())
457  && m_back1Y == qt_real_to_fixed(nextLine.y1())) {
458  return;
459  }
460 #endif
461 
462  if (join == FlatJoin) {
465  QPointF isect;
466  QLineF::IntersectType type = prevLine.intersect(nextLine, &isect);
467  QLineF shortCut(prevLine.p2(), nextLine.p1());
468  qreal angle = shortCut.angleTo(prevLine);
469  if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) {
470  emitLineTo(focal_x, focal_y);
471  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
472  return;
473  }
474  emitLineTo(qt_real_to_fixed(nextLine.x1()),
475  qt_real_to_fixed(nextLine.y1()));
476 
477  } else {
480 
481  QPointF isect;
482  QLineF::IntersectType type = prevLine.intersect(nextLine, &isect);
483 
484  if (join == MiterJoin) {
485  qreal appliedMiterLimit = qt_fixed_to_real(m_strokeWidth * m_miterLimit);
486 
487  // If we are on the inside, do the short cut...
488  QLineF shortCut(prevLine.p2(), nextLine.p1());
489  qreal angle = shortCut.angleTo(prevLine);
490  if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) {
491  emitLineTo(focal_x, focal_y);
492  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
493  return;
494  }
496  qt_fixed_to_real(m_back1Y)), isect);
497  if (type == QLineF::NoIntersection || miterLine.length() > appliedMiterLimit) {
498  QLineF l1(prevLine);
499  l1.setLength(appliedMiterLimit);
500  l1.translate(prevLine.dx(), prevLine.dy());
501 
502  QLineF l2(nextLine);
503  l2.setLength(appliedMiterLimit);
504  l2.translate(-l2.dx(), -l2.dy());
505 
506  emitLineTo(qt_real_to_fixed(l1.x2()), qt_real_to_fixed(l1.y2()));
507  emitLineTo(qt_real_to_fixed(l2.x1()), qt_real_to_fixed(l2.y1()));
508  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
509  } else {
510  emitLineTo(qt_real_to_fixed(isect.x()), qt_real_to_fixed(isect.y()));
511  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
512  }
513 
514  } else if (join == SquareJoin) {
515  qfixed offset = m_strokeWidth / 2;
516 
517  QLineF l1(prevLine);
518  l1.translate(l1.dx(), l1.dy());
519  l1.setLength(qt_fixed_to_real(offset));
520  QLineF l2(nextLine.p2(), nextLine.p1());
521  l2.translate(l2.dx(), l2.dy());
522  l2.setLength(qt_fixed_to_real(offset));
523  emitLineTo(qt_real_to_fixed(l1.x2()), qt_real_to_fixed(l1.y2()));
524  emitLineTo(qt_real_to_fixed(l2.x2()), qt_real_to_fixed(l2.y2()));
525  emitLineTo(qt_real_to_fixed(l2.x1()), qt_real_to_fixed(l2.y1()));
526 
527  } else if (join == RoundJoin) {
528  qfixed offset = m_strokeWidth / 2;
529 
530  QLineF shortCut(prevLine.p2(), nextLine.p1());
531  qreal angle = shortCut.angleTo(prevLine);
532  if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) {
533  emitLineTo(focal_x, focal_y);
534  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
535  return;
536  }
537  qreal l1_on_x = adapted_angle_on_x(prevLine);
538  qreal l2_on_x = adapted_angle_on_x(nextLine);
539 
540  qreal sweepLength = qAbs(l2_on_x - l1_on_x);
541 
542  int point_count;
543  QPointF curves[15];
544 
545  QPointF curve_start =
546  qt_curves_for_arc(QRectF(qt_fixed_to_real(focal_x - offset),
547  qt_fixed_to_real(focal_y - offset),
548  qt_fixed_to_real(offset * 2),
549  qt_fixed_to_real(offset * 2)),
550  l1_on_x + 90, -sweepLength,
551  curves, &point_count);
552 
553 // // line to the beginning of the arc segment, (should not be needed).
554 // emitLineTo(qt_real_to_fixed(curve_start.x()), qt_real_to_fixed(curve_start.y()));
555  Q_UNUSED(curve_start);
556 
557  for (int i=0; i<point_count; i+=3) {
558  emitCubicTo(qt_real_to_fixed(curves[i].x()),
559  qt_real_to_fixed(curves[i].y()),
560  qt_real_to_fixed(curves[i+1].x()),
561  qt_real_to_fixed(curves[i+1].y()),
562  qt_real_to_fixed(curves[i+2].x()),
563  qt_real_to_fixed(curves[i+2].y()));
564  }
565 
566  // line to the end of the arc segment, (should also not be needed).
567  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
568 
569  // Same as round join except we know its 180 degrees. Can also optimize this
570  // later based on the addEllipse logic
571  } else if (join == RoundCap) {
572  qfixed offset = m_strokeWidth / 2;
573 
574  // first control line
575  QLineF l1 = prevLine;
576  l1.translate(l1.dx(), l1.dy());
577  l1.setLength(QT_PATH_KAPPA * offset);
578 
579  // second control line, find through normal between prevLine and focal.
580  QLineF l2(qt_fixed_to_real(focal_x), qt_fixed_to_real(focal_y),
581  prevLine.x2(), prevLine.y2());
582  l2.translate(-l2.dy(), l2.dx());
583  l2.setLength(QT_PATH_KAPPA * offset);
584 
586  qt_real_to_fixed(l1.y2()),
587  qt_real_to_fixed(l2.x2()),
588  qt_real_to_fixed(l2.y2()),
589  qt_real_to_fixed(l2.x1()),
590  qt_real_to_fixed(l2.y1()));
591 
592  // move so that it matches
593  l2 = QLineF(l2.x1(), l2.y1(), l2.x1()-l2.dx(), l2.y1()-l2.dy());
594 
595  // last line is parallel to l1 so just shift it down.
596  l1.translate(nextLine.x1() - l1.x1(), nextLine.y1() - l1.y1());
597 
598  emitCubicTo(qt_real_to_fixed(l2.x2()),
599  qt_real_to_fixed(l2.y2()),
600  qt_real_to_fixed(l1.x2()),
601  qt_real_to_fixed(l1.y2()),
602  qt_real_to_fixed(l1.x1()),
603  qt_real_to_fixed(l1.y1()));
604  } else if (join == SvgMiterJoin) {
605  QLineF shortCut(prevLine.p2(), nextLine.p1());
606  qreal angle = shortCut.angleTo(prevLine);
607  if (type == QLineF::BoundedIntersection || (angle > 90 && !qFuzzyCompare(angle, (qreal)90))) {
608  emitLineTo(focal_x, focal_y);
609  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
610  return;
611  }
612  QLineF miterLine(QPointF(qt_fixed_to_real(focal_x),
613  qt_fixed_to_real(focal_y)), isect);
614  if (type == QLineF::NoIntersection || miterLine.length() > qt_fixed_to_real(m_strokeWidth * m_miterLimit) / 2) {
615  emitLineTo(qt_real_to_fixed(nextLine.x1()),
616  qt_real_to_fixed(nextLine.y1()));
617  } else {
618  emitLineTo(qt_real_to_fixed(isect.x()), qt_real_to_fixed(isect.y()));
619  emitLineTo(qt_real_to_fixed(nextLine.x1()), qt_real_to_fixed(nextLine.y1()));
620  }
621  } else {
622  Q_ASSERT(!"QStroker::joinPoints(), bad join style...");
623  }
624  }
625 }
qfixed m_back1Y
Definition: qstroker_p.h:247
#define qt_real_to_fixed(real)
Definition: qstroker_p.h:101
int type
Definition: qmetatype.cpp:239
double qreal
Definition: qglobal.h:1193
void emitCubicTo(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey)
Definition: qstroker_p.h:354
qreal x2() const
Returns the x-coordinate of the line&#39;s end point.
Definition: qline.h:304
QPointF p1() const
Returns the line&#39;s start point.
Definition: qline.h:314
qreal y2() const
Returns the y-coordinate of the line&#39;s end point.
Definition: qline.h:309
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
static Q_DECL_CONSTEXPR bool qFuzzyCompare(double p1, double p2)
Definition: qglobal.h:2030
#define QT_PATH_KAPPA
Definition: qstroker_p.h:113
qreal dy() const
Returns the vertical component of the line&#39;s vector.
Definition: qline.h:329
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
qreal angleTo(const QLineF &l) const
Returns the angle (in positive degrees) from this line to the given line, taking the direction of the...
Definition: qline.cpp:951
qreal x() const
Returns the x-coordinate of this point.
Definition: qpoint.h:282
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
qfixed m_back2Y
Definition: qstroker_p.h:250
void translate(const QPointF &p)
Translates this line by the given offset.
Definition: qline.h:339
The QRectF class defines a rectangle in the plane using floating point precision. ...
Definition: qrect.h:511
static qreal adapted_angle_on_x(const QLineF &line)
Definition: qstroker.cpp:182
IntersectType
Describes the intersection between two lines.
Definition: qline.h:215
qreal y1() const
Returns the y-coordinate of the line&#39;s start point.
Definition: qline.h:299
void setLength(qreal len)
Sets the length of the line to the given length.
Definition: qline.h:360
qfixed m_strokeWidth
Definition: qstroker_p.h:240
qfixed m_miterLimit
Definition: qstroker_p.h:241
qreal dx() const
Returns the horizontal component of the line&#39;s vector.
Definition: qline.h:324
#define qt_fixed_to_real(fixed)
Definition: qstroker_p.h:102
qreal angle(const QPointF &p1, const QPointF &p2)
QPointF p2() const
Returns the line&#39;s end point.
Definition: qline.h:319
qfixed m_back1X
Definition: qstroker_p.h:246
qfixed m_back2X
Definition: qstroker_p.h:249
qreal y() const
Returns the y-coordinate of this point.
Definition: qpoint.h:287
QPointF qt_curves_for_arc(const QRectF &rect, qreal startAngle, qreal sweepLength, QPointF *curves, int *point_count)
Creates a number of curves for a given arc definition.
Definition: qstroker.cpp:859
qreal x1() const
Returns the x-coordinate of the line&#39;s start point.
Definition: qline.h:294
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
void emitLineTo(qfixed x, qfixed y)
Definition: qstroker_p.h:345
qreal qfixed
Definition: qstroker_p.h:100

◆ joinStyle()

Qt::PenJoinStyle QStroker::joinStyle ( ) const
inline

Definition at line 220 of file qstroker_p.h.

220 { return joinForJoinMode(m_joinStyle); }
static Qt::PenJoinStyle joinForJoinMode(LineJoinMode mode)
Definition: qstroker.cpp:399
LineJoinMode m_joinStyle
Definition: qstroker_p.h:244

◆ joinStyleMode()

LineJoinMode QStroker::joinStyleMode ( ) const
inline

Definition at line 221 of file qstroker_p.h.

Referenced by qt_stroke_side().

221 { return m_joinStyle; }
LineJoinMode m_joinStyle
Definition: qstroker_p.h:244

◆ miterLimit()

qfixed QStroker::miterLimit ( ) const
inline

Definition at line 224 of file qstroker_p.h.

Referenced by QDashStroker::processCurrentSubpath().

224 { return m_miterLimit; }
qfixed m_miterLimit
Definition: qstroker_p.h:241

◆ processCurrentSubpath()

void QStroker::processCurrentSubpath ( )
protectedvirtual

This function is called to stroke the currently built up subpath.

The subpath is cleared when the function completes.

Implements QStrokerOps.

Definition at line 420 of file qstroker.cpp.

421 {
422  Q_ASSERT(!m_elements.isEmpty());
424  Q_ASSERT(m_elements.size() > 1);
425 
428 
429  QLineF fwStartTangent, bwStartTangent;
430 
431  bool fwclosed = qt_stroke_side(&fwit, this, false, &fwStartTangent);
432  bool bwclosed = qt_stroke_side(&bwit, this, !fwclosed, &bwStartTangent);
433 
434  if (!bwclosed)
435  joinPoints(m_elements.at(0).x, m_elements.at(0).y, fwStartTangent, m_capStyle);
436 }
QDataBuffer< Element > m_elements
Definition: qstroker_p.h:183
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QLineF class provides a two-dimensional vector using floating point precision.
Definition: qline.h:212
bool qt_stroke_side(Iterator *it, QStroker *stroker, bool capFirst, QLineF *startTangent)
Definition: qstroker.cpp:635
void joinPoints(qfixed x, qfixed y, const QLineF &nextLine, LineJoinMode join)
Definition: qstroker.cpp:442
LineJoinMode m_capStyle
Definition: qstroker_p.h:243

◆ setCapStyle()

void QStroker::setCapStyle ( Qt::PenCapStyle  capStyle)
inline

Definition at line 215 of file qstroker_p.h.

Referenced by QPdf::Stroker::setPen().

static LineJoinMode joinModeForCap(Qt::PenCapStyle)
Definition: qstroker.cpp:392
Qt::PenCapStyle capStyle() const
Definition: qstroker_p.h:216
LineJoinMode m_capStyle
Definition: qstroker_p.h:243

◆ setJoinStyle()

void QStroker::setJoinStyle ( Qt::PenJoinStyle  style)
inline

Definition at line 219 of file qstroker_p.h.

Referenced by QPdf::Stroker::setPen().

219 { m_joinStyle = joinModeForJoin(style); }
static LineJoinMode joinModeForJoin(Qt::PenJoinStyle joinStyle)
Definition: qstroker.cpp:407
LineJoinMode m_joinStyle
Definition: qstroker_p.h:244

◆ setMiterLimit()

void QStroker::setMiterLimit ( qfixed  length)
inline

Definition at line 223 of file qstroker_p.h.

Referenced by QPdf::Stroker::setPen().

223 { m_miterLimit = length; }
qfixed m_miterLimit
Definition: qstroker_p.h:241

◆ setStrokeWidth()

void QStroker::setStrokeWidth ( qfixed  width)
inline

Definition at line 212 of file qstroker_p.h.

Referenced by QPdf::Stroker::setPen(), and QPdf::Stroker::Stroker().

212 { m_strokeWidth = width; }
qfixed m_strokeWidth
Definition: qstroker_p.h:240

◆ strokeWidth()

qfixed QStroker::strokeWidth ( ) const
inline

Definition at line 213 of file qstroker_p.h.

Referenced by QDashStroker::processCurrentSubpath(), and qt_stroke_side().

213 { return m_strokeWidth; }
qfixed m_strokeWidth
Definition: qstroker_p.h:240

Properties

◆ m_back1X

qfixed QStroker::m_back1X
protected

Definition at line 246 of file qstroker_p.h.

Referenced by joinPoints().

◆ m_back1Y

qfixed QStroker::m_back1Y
protected

Definition at line 247 of file qstroker_p.h.

Referenced by joinPoints().

◆ m_back2X

qfixed QStroker::m_back2X
protected

Definition at line 249 of file qstroker_p.h.

Referenced by joinPoints().

◆ m_back2Y

qfixed QStroker::m_back2Y
protected

Definition at line 250 of file qstroker_p.h.

Referenced by joinPoints().

◆ m_capStyle

LineJoinMode QStroker::m_capStyle
protected

Definition at line 243 of file qstroker_p.h.

Referenced by processCurrentSubpath().

◆ m_joinStyle

LineJoinMode QStroker::m_joinStyle
protected

Definition at line 244 of file qstroker_p.h.

◆ m_miterLimit

qfixed QStroker::m_miterLimit
protected

Definition at line 241 of file qstroker_p.h.

Referenced by joinPoints(), and QStroker().

◆ m_strokeWidth

qfixed QStroker::m_strokeWidth
protected

Definition at line 240 of file qstroker_p.h.

Referenced by joinPoints(), and QStroker().


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