C
PathDataStroker Class
class Qul::PlatformInterface::PathDataStrokerThe PathDataStroker generates stroke representation for a shape. More...
Header: | #include <platforminterface/pathdatastroker.h> |
Since: | Qt Quick Ultralite (Platform) 1.8 |
Inherited By: |
Public Functions
PathDataStroker(const Qul::PlatformInterface::PathData *data) | |
void | setStrokeProperties(const Qul::PlatformInterface::StrokeProperties &properties) |
void | stroke() |
Protected Functions
virtual void | arcTo(float x, float y, float rx, float ry, float rotation, bool largeArc, bool clockwise) = 0 |
virtual void | beginStroke() = 0 |
virtual void | cubicTo(float c1x, float c1y, float c2x, float c2y, float ex, float ey) = 0 |
virtual void | endStroke() = 0 |
virtual void | lineTo(float x, float y) = 0 |
virtual void | moveTo(float x, float y) = 0 |
Detailed Description
Some of the platforms are not able to stroke vector shapes. This class traverses the shape path and generates separate shape path for the stroke itself.
See also Qul::PlatformInterface::DefaultPathDataStroker.
Member Function Documentation
PathDataStroker::PathDataStroker(const Qul::PlatformInterface::PathData *data)
Constructs a stroker instance for the shape defined in data.
See also setStrokeProperties().
[pure virtual protected]
void PathDataStroker::arcTo(float x, float y, float rx, float ry, float rotation, bool largeArc, bool clockwise)
Adds a arc segment to the end of current path. Arc must be drawn at the x and y origin, with the rx and ry size, and rotation as its radii. The largeArc and clockwise arguments define how the arc is drawn.
Note: This method is called by stroke().
See also stroke().
[pure virtual protected]
void PathDataStroker::beginStroke()
Notifies when the stroke generation process begins.
Note: This method is called by stroke().
See also stroke().
[pure virtual protected]
void PathDataStroker::cubicTo(float c1x, float c1y, float c2x, float c2y, float ex, float ey)
Adds a cubic curve segment to the end of current path. Curve must be drawn to the ex and ey coordinates using c1x and c1y as the first control point, and c2x and c2y) as the second control point.
Note: This method is called by stroke().
See also stroke().
[pure virtual protected]
void PathDataStroker::endStroke()
Notifies when the stroke generation process ends.
Note: This method is called by stroke().
See also stroke().
[pure virtual protected]
void PathDataStroker::lineTo(float x, float y)
Adds a line segment (containing the x and y coordinates) to the end of current path.
Note: This method is called by stroke().
See also stroke().
[pure virtual protected]
void PathDataStroker::moveTo(float x, float y)
Adds a move segment (containing the x and y coordinates) to the end of current path.
Note: This method is called by stroke().
See also stroke().
void PathDataStroker::setStrokeProperties(const Qul::PlatformInterface::StrokeProperties &properties)
Sets properties of the stroke. This function can be called before every call to stroke(), to change generated stroke appearance.
See also stroke().
void PathDataStroker::stroke()
Starts generating the stroke. Before calculating the first segment for the stroke, the beginStroke() virtual function is called. Once the stroke path is calculated: moveTo(), lineTo(), cubicTo(), or arcTo() virtual functions are called respectively. After generating the stroke, the endStroke() virtual function is called.
Note: The PathDataStroker subclasses must allocate sufficient memory required for a new path.
See also beginStroke(), endStroke(), moveTo(), lineTo(), cubicTo(), and arcTo().
Available under certain Qt licenses.
Find out more.