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
QStrokerOps Class Referenceabstract

#include <qstroker_p.h>

+ Inheritance diagram for QStrokerOps:
+ Collaboration diagram for QStrokerOps:

Classes

struct  Element
 

Public Member Functions

 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 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)
 
virtual void processCurrentSubpath ()=0
 

Protected Attributes

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 94 of file qstroker_p.h.

Constructor & Destructor Documentation

◆ QStrokerOps()

QStrokerOps::QStrokerOps ( )

Definition at line 148 of file qstroker.cpp.

◆ ~QStrokerOps()

QStrokerOps::~QStrokerOps ( )
virtual

Definition at line 159 of file qstroker.cpp.

Member Function Documentation

◆ begin()

void QStrokerOps::begin ( void * customData)
virtual

Prepares the stroker.

Call this function once before starting a stroke by calling moveTo, lineTo or cubicTo.

The customData is passed back through that callback functions and can be used by the user to for instance maintain state information.

Reimplemented in QDashStroker.

Definition at line 171 of file qstroker.cpp.

References m_customData, and m_elements.

Referenced by QDashStroker::begin(), strokeEllipse(), strokePath(), and strokePolygon().

+ Here is the caller graph for this function:

◆ clipRect()

QRectF QStrokerOps::clipRect ( ) const
inline

Definition at line 128 of file qstroker_p.h.

◆ cubicTo()

void QStrokerOps::cubicTo ( qfixed x1,
qfixed y1,
qfixed x2,
qfixed y2,
qfixed ex,
qfixed ey )
inline

Definition at line 298 of file qstroker_p.h.

References c2, QPainterPath::CurveToDataElement, QPainterPath::CurveToElement, and m_elements.

Referenced by strokeEllipse(), and strokePath().

+ Here is the caller graph for this function:

◆ curveThreshold()

qfixed QStrokerOps::curveThreshold ( ) const
inline

Definition at line 139 of file qstroker_p.h.

Referenced by qt_stroke_side().

+ Here is the caller graph for this function:

◆ emitCubicTo()

void QStrokerOps::emitCubicTo ( qfixed c1x,
qfixed c1y,
qfixed c2x,
qfixed c2y,
qfixed ex,
qfixed ey )
inlineprotected

Definition at line 277 of file qstroker_p.h.

References m_cubicTo, m_customData, and Q_ASSERT.

Referenced by QStroker::emitCubicTo().

+ Here is the caller graph for this function:

◆ emitLineTo()

void QStrokerOps::emitLineTo ( qfixed x,
qfixed y )
inlineprotected

Definition at line 271 of file qstroker_p.h.

References m_customData, m_lineTo, and Q_ASSERT.

Referenced by QStroker::emitLineTo(), and QDashStroker::processCurrentSubpath().

+ Here is the caller graph for this function:

◆ emitMoveTo()

void QStrokerOps::emitMoveTo ( qfixed x,
qfixed y )
inlineprotected

Definition at line 265 of file qstroker_p.h.

References m_customData, m_moveTo, and Q_ASSERT.

Referenced by QStroker::emitMoveTo(), and QDashStroker::processCurrentSubpath().

+ Here is the caller graph for this function:

◆ end()

void QStrokerOps::end ( )
virtual

Finishes the stroke.

Call this function once when an entire primitive has been stroked.

Reimplemented in QDashStroker.

Definition at line 182 of file qstroker.cpp.

References m_customData, m_elements, and processCurrentSubpath().

Referenced by QDashStroker::end(), strokeEllipse(), strokePath(), and strokePolygon().

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

◆ lineTo()

void QStrokerOps::lineTo ( qfixed x,
qfixed y )
inline

Definition at line 292 of file qstroker_p.h.

References QPainterPath::LineToElement, and m_elements.

Referenced by QDashedStrokeProcessor::process(), strokePath(), and strokePolygon().

+ Here is the caller graph for this function:

◆ moveTo()

void QStrokerOps::moveTo ( qfixed x,
qfixed y )
inline

Definition at line 283 of file qstroker_p.h.

References m_elements, QPainterPath::MoveToElement, and processCurrentSubpath().

Referenced by QDashedStrokeProcessor::process(), strokeEllipse(), strokePath(), and strokePolygon().

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

◆ processCurrentSubpath()

virtual void QStrokerOps::processCurrentSubpath ( )
protectedpure virtual

Implemented in QStroker, and QDashStroker.

Referenced by end(), and moveTo().

+ Here is the caller graph for this function:

◆ setClipRect()

void QStrokerOps::setClipRect ( const QRectF & clip)
inline

Definition at line 129 of file qstroker_p.h.

Referenced by QPainterPathStroker::createStroke(), QX11PaintEngine::drawPath(), and QDashedStrokeProcessor::process().

+ Here is the caller graph for this function:

◆ setCubicToHook()

void QStrokerOps::setCubicToHook ( qStrokerCubicToHook cubicToHook)
inline

Definition at line 114 of file qstroker_p.h.

References cubicToHook().

Referenced by QDashedStrokeProcessor::QDashedStrokeProcessor(), QDashStroker::QDashStroker(), QPainterPathStrokerPrivate::QPainterPathStrokerPrivate(), and QPdf::Stroker::Stroker().

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

◆ setCurveThreshold()

void QStrokerOps::setCurveThreshold ( qfixed threshold)
inline

Definition at line 138 of file qstroker_p.h.

◆ setCurveThresholdFromTransform()

void QStrokerOps::setCurveThresholdFromTransform ( const QTransform & transform)
inline

Definition at line 131 of file qstroker_p.h.

References qt_scaleForTransform().

Referenced by strokeEllipse(), strokePath(), and strokePolygon().

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

◆ setLineToHook()

void QStrokerOps::setLineToHook ( qStrokerLineToHook lineToHook)
inline

Definition at line 113 of file qstroker_p.h.

References lineToHook().

Referenced by QDashedStrokeProcessor::QDashedStrokeProcessor(), QDashStroker::QDashStroker(), QPainterPathStrokerPrivate::QPainterPathStrokerPrivate(), and QPdf::Stroker::Stroker().

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

◆ setMoveToHook()

void QStrokerOps::setMoveToHook ( qStrokerMoveToHook moveToHook)
inline

Definition at line 112 of file qstroker_p.h.

References moveToHook().

Referenced by QDashedStrokeProcessor::QDashedStrokeProcessor(), QDashStroker::QDashStroker(), QPainterPathStrokerPrivate::QPainterPathStrokerPrivate(), and QPdf::Stroker::Stroker().

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

◆ strokeEllipse()

void QStrokerOps::strokeEllipse ( const QRectF & rect,
void * data,
const QTransform & matrix )

Convenience function for stroking an ellipse with bounding rect rect.

The matrix is used to transform the coordinates before they enter the stroker.

Definition at line 304 of file qstroker.cpp.

References begin(), cubicTo(), end(), i, moveTo(), Q_ASSERT, qt_curves_for_arc(), qt_real_to_fixed, rect, and setCurveThresholdFromTransform().

+ Here is the call graph for this function:

◆ strokePath()

void QStrokerOps::strokePath ( const QPainterPath & path,
void * customData,
const QTransform & matrix )

Convenience function that decomposes path into begin(), moveTo(), lineTo(), curevTo() and end() calls.

The customData parameter is used in the callback functions

The matrix is used to transform the points before input to the stroker.

See also
begin()

Definition at line 200 of file qstroker.cpp.

References begin(), cubicTo(), QPainterPath::CurveToElement, end(), i, lineTo(), QPainterPath::LineToElement, moveTo(), QPainterPath::MoveToElement, qt_real_to_fixed, setCurveThresholdFromTransform(), QPainterPath::Element::type, QPointF::x(), QPainterPath::Element::x, QPointF::y(), and QPainterPath::Element::y.

Referenced by QPainterPathStroker::createStroke().

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

◆ strokePolygon()

void QStrokerOps::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.

If implicit_close is set to true a line is implicitly drawn between the first and last point in the polygon. Typically true for polygons and false for polylines.

The matrix is used to transform the points before they enter the stroker.

See also
begin()

Definition at line 271 of file qstroker.cpp.

References begin(), end(), i, lineTo(), moveTo(), qt_real_to_fixed, setCurveThresholdFromTransform(), QPointF::x(), and QPointF::y().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_clip_rect

QRectF QStrokerOps::m_clip_rect
protected

Definition at line 149 of file qstroker_p.h.

Referenced by QDashStroker::processCurrentSubpath().

◆ m_cubicTo

qStrokerCubicToHook QStrokerOps::m_cubicTo
protected

Definition at line 156 of file qstroker_p.h.

Referenced by emitCubicTo().

◆ m_curveThreshold

qfixed QStrokerOps::m_curveThreshold
protected

Definition at line 150 of file qstroker_p.h.

◆ m_customData

void* QStrokerOps::m_customData
protected

◆ m_dashThreshold

qfixed QStrokerOps::m_dashThreshold
protected

Definition at line 151 of file qstroker_p.h.

Referenced by QDashStroker::processCurrentSubpath().

◆ m_elements

QDataBuffer<Element> QStrokerOps::m_elements
protected

◆ m_lineTo

qStrokerLineToHook QStrokerOps::m_lineTo
protected

Definition at line 155 of file qstroker_p.h.

Referenced by emitLineTo().

◆ m_moveTo

qStrokerMoveToHook QStrokerOps::m_moveTo
protected

Definition at line 154 of file qstroker_p.h.

Referenced by emitMoveTo().


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