Qt 4.8
Public Functions | Public Variables | Properties | List of all members
QPdf::Stroker Struct Reference

#include <qpdf_p.h>

Public Functions

void setPen (const QPen &pen)
 
void strokePath (const QPainterPath &path)
 
 Stroker ()
 

Public Variables

bool cosmeticPen
 
bool first
 
QTransform matrix
 
ByteStreamstream
 

Properties

QStroker basicStroker
 
QDashStroker dashStroker
 
QStrokerOpsstroker
 

Detailed Description

Definition at line 133 of file qpdf_p.h.

Constructors and Destructors

◆ Stroker()

QPdf::Stroker::Stroker ( )

Definition at line 752 of file qpdf.cpp.

753  : stream(0),
754  first(true),
756 {
761  cosmeticPen = true;
763 }
void setStrokeWidth(qfixed width)
Definition: qstroker_p.h:212
void setCubicToHook(qStrokerCubicToHook cubicToHook)
Definition: qstroker_p.h:150
QStroker basicStroker
Definition: qpdf_p.h:142
static void moveToHook(qfixed x, qfixed y, void *data)
Definition: qpdf.cpp:716
bool first
Definition: qpdf_p.h:138
static void cubicToHook(qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data)
Definition: qpdf.cpp:735
static void lineToHook(qfixed x, qfixed y, void *data)
Definition: qpdf.cpp:727
void setLineToHook(qStrokerLineToHook lineToHook)
Definition: qstroker_p.h:149
bool cosmeticPen
Definition: qpdf_p.h:140
void setMoveToHook(qStrokerMoveToHook moveToHook)
Definition: qstroker_p.h:148
QStrokerOps * stroker
Definition: qpdf_p.h:144
ByteStream * stream
Definition: qpdf_p.h:137
QDashStroker dashStroker
Definition: qpdf_p.h:143

Functions

◆ setPen()

void QPdf::Stroker::setPen ( const QPen pen)

Definition at line 765 of file qpdf.cpp.

766 {
767  if (pen.style() == Qt::NoPen) {
768  stroker = 0;
769  return;
770  }
771  qreal w = pen.widthF();
772  bool zeroWidth = w < 0.0001;
773  cosmeticPen = pen.isCosmetic();
774  if (zeroWidth)
775  w = .1;
776 
781 
782  QVector<qreal> dashpattern = pen.dashPattern();
783  if (zeroWidth) {
784  for (int i = 0; i < dashpattern.size(); ++i)
785  dashpattern[i] *= 10.;
786  }
787  if (!dashpattern.isEmpty()) {
788  dashStroker.setDashPattern(dashpattern);
790  stroker = &dashStroker;
791  } else {
793  }
794 }
double qreal
Definition: qglobal.h:1193
void setDashOffset(qreal offset)
Definition: qstroker_p.h:265
Qt::PenStyle style() const
Returns the pen style.
Definition: qpen.cpp:428
void setStrokeWidth(qfixed width)
Definition: qstroker_p.h:212
void setJoinStyle(Qt::PenJoinStyle style)
Definition: qstroker_p.h:219
void setDashPattern(const QVector< qfixed > &dashPattern)
Definition: qstroker_p.h:262
QVector< qreal > dashPattern() const
Returns the dash pattern of this pen.
Definition: qpen.cpp:466
QStroker basicStroker
Definition: qpdf_p.h:142
bool isCosmetic() const
Returns true if the pen is cosmetic; otherwise returns false.
Definition: qpen.cpp:840
Qt::PenJoinStyle joinStyle() const
Returns the pen&#39;s join style.
Definition: qpen.cpp:736
void setCapStyle(Qt::PenCapStyle capStyle)
Definition: qstroker_p.h:215
qreal miterLimit() const
Returns the miter limit of the pen.
Definition: qpen.cpp:589
void setMiterLimit(qfixed length)
Definition: qstroker_p.h:223
qreal widthF() const
Returns the pen width with floating point precision.
Definition: qpen.cpp:645
qreal dashOffset() const
Returns the dash offset for the pen.
Definition: qpen.cpp:547
bool cosmeticPen
Definition: qpdf_p.h:140
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
Definition: qvector.h:139
Qt::PenCapStyle capStyle() const
Returns the pen&#39;s cap style.
Definition: qpen.cpp:706
QStrokerOps * stroker
Definition: qpdf_p.h:144
int size() const
Returns the number of items in the vector.
Definition: qvector.h:137
QDashStroker dashStroker
Definition: qpdf_p.h:143

◆ strokePath()

void QPdf::Stroker::strokePath ( const QPainterPath path)

Definition at line 796 of file qpdf.cpp.

797 {
798  if (!stroker)
799  return;
800  first = true;
801 
802  stroker->strokePath(path, this, cosmeticPen ? matrix : QTransform());
803  *stream << "h f\n";
804 }
QTransform matrix
Definition: qpdf_p.h:139
void strokePath(const QPainterPath &path, void *data, const QTransform &matrix)
Convenience function that decomposes path into begin(), moveTo(), lineTo(), curevTo() and end() calls...
Definition: qstroker.cpp:242
bool first
Definition: qpdf_p.h:138
bool cosmeticPen
Definition: qpdf_p.h:140
QStrokerOps * stroker
Definition: qpdf_p.h:144
ByteStream * stream
Definition: qpdf_p.h:137
The QTransform class specifies 2D transformations of a coordinate system.
Definition: qtransform.h:65

Properties

◆ basicStroker

QStroker QPdf::Stroker::basicStroker
private

Definition at line 142 of file qpdf_p.h.

Referenced by setPen(), and Stroker().

◆ cosmeticPen

bool QPdf::Stroker::cosmeticPen

Definition at line 140 of file qpdf_p.h.

Referenced by cubicToHook(), lineToHook(), moveToHook(), setPen(), strokePath(), and Stroker().

◆ dashStroker

QDashStroker QPdf::Stroker::dashStroker
private

Definition at line 143 of file qpdf_p.h.

Referenced by setPen().

◆ first

bool QPdf::Stroker::first

Definition at line 138 of file qpdf_p.h.

Referenced by moveToHook(), and strokePath().

◆ matrix

QTransform QPdf::Stroker::matrix

◆ stream

ByteStream* QPdf::Stroker::stream

◆ stroker

QStrokerOps* QPdf::Stroker::stroker
private

Definition at line 144 of file qpdf_p.h.

Referenced by setPen(), strokePath(), and Stroker().


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