Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QStroker Class Reference

#include <qstroker_p.h>

+ Inheritance diagram for QStroker:
+ Collaboration diagram for QStroker:

Public Types

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

Public Member Functions

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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

qfixed m_strokeWidth
 
qfixed m_miterLimit
 
LineJoinMode m_capStyle
 
LineJoinMode m_joinStyle
 
qfixed m_back1X
 
qfixed m_back1Y
 
qfixed m_back2X
 
qfixed m_back2Y
 
bool m_forceOpen
 
- Protected Attributes inherited from QStrokerOps
QDataBuffer< Elementm_elements
 
QRectF m_clip_rect
 
qfixed m_curveThreshold
 
qfixed m_dashThreshold
 
voidm_customData
 
qStrokerMoveToHook m_moveTo
 
qStrokerLineToHook m_lineTo
 
qStrokerCubicToHook m_cubicTo
 

Detailed Description

Definition at line 160 of file qstroker_p.h.

Member Enumeration Documentation

◆ LineJoinMode

Enumerator
FlatJoin 
SquareJoin 
MiterJoin 
RoundJoin 
RoundCap 
SvgMiterJoin 

Definition at line 164 of file qstroker_p.h.

Constructor & Destructor Documentation

◆ QStroker()

QStroker::QStroker ( )

Definition at line 330 of file qstroker.cpp.

References m_miterLimit, m_strokeWidth, and qt_real_to_fixed.

◆ ~QStroker()

QStroker::~QStroker ( )

Definition at line 340 of file qstroker.cpp.

Member Function Documentation

◆ capForJoinMode()

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

Definition at line 344 of file qstroker.cpp.

References Qt::FlatCap, FlatJoin, Qt::RoundCap, Qt::SquareCap, and SquareJoin.

◆ capStyle()

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

Definition at line 184 of file qstroker_p.h.

◆ capStyleMode()

LineJoinMode QStroker::capStyleMode ( ) const
inline

Definition at line 185 of file qstroker_p.h.

Referenced by qt_stroke_side().

+ Here is the caller graph for this function:

◆ emitCubicTo()

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

Definition at line 329 of file qstroker_p.h.

References QStrokerOps::emitCubicTo(), m_back1X, m_back1Y, m_back2X, and m_back2Y.

Referenced by joinPoints(), and qt_stroke_side().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emitLineTo()

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

Definition at line 320 of file qstroker_p.h.

References QStrokerOps::emitLineTo(), m_back1X, m_back1Y, m_back2X, and m_back2Y.

Referenced by joinPoints(), and qt_stroke_side().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ emitMoveTo()

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

Definition at line 311 of file qstroker_p.h.

References QStrokerOps::emitMoveTo(), m_back1X, m_back1Y, m_back2X, and m_back2Y.

Referenced by qt_stroke_side().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forceOpen()

bool QStroker::forceOpen ( ) const
inline

Definition at line 195 of file qstroker_p.h.

Referenced by qt_stroke_side().

+ Here is the caller graph for this function:

◆ joinForJoinMode()

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

◆ joinModeForCap()

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

Definition at line 351 of file qstroker.cpp.

References Qt::FlatCap, FlatJoin, RoundCap, Qt::SquareCap, and SquareJoin.

◆ joinModeForJoin()

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

Definition at line 366 of file qstroker.cpp.

References Qt::BevelJoin, FlatJoin, joinStyle(), Qt::MiterJoin, MiterJoin, RoundJoin, Qt::SvgMiterJoin, and SvgMiterJoin.

+ Here is the call graph for this function:

◆ joinPoints()

void QStroker::joinPoints ( qfixed focal_x,
qfixed focal_y,
const QLineF & nextLine,
LineJoinMode join )

Definition at line 401 of file qstroker.cpp.

References adapted_angle_on_x(), QLineF::BoundedIntersection, QPointF::dotProduct(), emitCubicTo(), emitLineTo(), FlatJoin, i, m_back1X, m_back1Y, m_back2X, m_back2Y, m_miterLimit, m_strokeWidth, MiterJoin, QLineF::NoIntersection, Q_ASSERT, Q_UNUSED, qAbs(), qfixed, qFuzzyCompare(), qt_curves_for_arc(), qt_fixed_to_real, QT_PATH_KAPPA, qt_real_to_fixed, RoundCap, RoundJoin, SquareJoin, and SvgMiterJoin.

Referenced by processCurrentSubpath(), and qt_stroke_side().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ joinStyle()

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

Definition at line 188 of file qstroker_p.h.

Referenced by joinModeForJoin().

+ Here is the caller graph for this function:

◆ joinStyleMode()

LineJoinMode QStroker::joinStyleMode ( ) const
inline

Definition at line 189 of file qstroker_p.h.

Referenced by qt_stroke_side().

+ Here is the caller graph for this function:

◆ miterLimit()

qfixed QStroker::miterLimit ( ) const
inline

Definition at line 192 of file qstroker_p.h.

Referenced by QDashStroker::processCurrentSubpath().

+ Here is the caller graph for this function:

◆ processCurrentSubpath()

void QStroker::processCurrentSubpath ( )
overrideprotectedvirtual

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

The subpath is cleared when the function completes.

Implements QStrokerOps.

Definition at line 379 of file qstroker.cpp.

References joinPoints(), m_capStyle, QStrokerOps::m_elements, QPainterPath::MoveToElement, Q_ASSERT, and qt_stroke_side().

+ Here is the call graph for this function:

◆ setCapStyle()

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

Definition at line 183 of file qstroker_p.h.

◆ setForceOpen()

void QStroker::setForceOpen ( bool state)
inline

Definition at line 194 of file qstroker_p.h.

References state.

◆ setJoinStyle()

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

Definition at line 187 of file qstroker_p.h.

◆ setMiterLimit()

void QStroker::setMiterLimit ( qfixed length)
inline

Definition at line 191 of file qstroker_p.h.

◆ setStrokeWidth()

void QStroker::setStrokeWidth ( qfixed width)
inline

Definition at line 176 of file qstroker_p.h.

References qBound(), qt_fixed_to_real, and qt_real_to_fixed.

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ strokeWidth()

qfixed QStroker::strokeWidth ( ) const
inline

Definition at line 181 of file qstroker_p.h.

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_back1X

qfixed QStroker::m_back1X
protected

Definition at line 217 of file qstroker_p.h.

Referenced by emitCubicTo(), emitLineTo(), emitMoveTo(), and joinPoints().

◆ m_back1Y

qfixed QStroker::m_back1Y
protected

Definition at line 218 of file qstroker_p.h.

Referenced by emitCubicTo(), emitLineTo(), emitMoveTo(), and joinPoints().

◆ m_back2X

qfixed QStroker::m_back2X
protected

Definition at line 220 of file qstroker_p.h.

Referenced by emitCubicTo(), emitLineTo(), emitMoveTo(), and joinPoints().

◆ m_back2Y

qfixed QStroker::m_back2Y
protected

Definition at line 221 of file qstroker_p.h.

Referenced by emitCubicTo(), emitLineTo(), emitMoveTo(), and joinPoints().

◆ m_capStyle

LineJoinMode QStroker::m_capStyle
protected

Definition at line 214 of file qstroker_p.h.

Referenced by processCurrentSubpath().

◆ m_forceOpen

bool QStroker::m_forceOpen
protected

Definition at line 223 of file qstroker_p.h.

◆ m_joinStyle

LineJoinMode QStroker::m_joinStyle
protected

Definition at line 215 of file qstroker_p.h.

◆ m_miterLimit

qfixed QStroker::m_miterLimit
protected

Definition at line 212 of file qstroker_p.h.

Referenced by QStroker(), and joinPoints().

◆ m_strokeWidth

qfixed QStroker::m_strokeWidth
protected

Definition at line 211 of file qstroker_p.h.

Referenced by QStroker(), and joinPoints().


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