Skip to content

RPainterPath

Class in Core Module
Header: #include <src/core/RPainterPath.h>
Inherits: QPainterPath

Extended painter path with a z-level and a pen.

Scriptable: This class is available in script environments.

Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.

enum Mode { NoModes, Selected, Highlighted, Invalid, FixedPenColor, FixedBrushColor, AutoRegen, AlwaysRegen, InheritPen, PixelUnit, NoClipping, PixelWidth, NoColorMode, SimplePointDisplay, PolylineGen, NoPattern, ScreenBasedLinetype, Wipeout, Frameless }
RPainterPath()
RPainterPath(const QPainterPath &path)
RPainterPath(const RPainterPath &other)
virtual ~RPainterPath()
void addArc(const RArc &arc)
void addBox(const RBox &box)
void addLine(const RLine &line)
void addOriginalShape(QSharedPointer< RShape > shape)
void addPath(const RPainterPath &path)
void addPoint(const RVector &position)
void addPolyline(const RPolyline &pl)
void addRect(const QRectF &rect)
Fixes crashing QPainterPath::addRect.
void addRect(double x1, double y1, double x2, double y2)
void addShape(QSharedPointer< RShape > shape)
void addSpline(const RSpline &spline)
void appendPath(const RPainterPath &path)
void closeSubpath()
bool containsPoint(const RVector &v) const
int countOriginalShapes() const
void cubicTo(const RVector &cp1, const RVector &cp2, const RVector &v)
void cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty)
bool getAlwaysRegen() const
bool getAutoRegen() const
RBox getBoundingBox() const
QBrush getBrush() const
RVector getCurrentPosition() const
double getDistanceTo(const RVector &point) const
int getElementCount() const
RVector getEndPoint() const
double getFeatureSize() const
bool getFrameless() const
bool getInheritPen() const
bool getMode(RPainterPath::Mode mode) const
bool getNoClipping() const
bool getNoColorMode() const
bool getNoPattern() const
QSharedPointer< RShape > getOriginalShape(int i) const
QPen getPen() const
double getPixelSizeHint() const
bool getPixelUnit() const
bool getPixelWidth() const
QList< RVector > getPoints() const
bool getPolylineGen() const
bool getScreenBasedLinetype() const
QList< QSharedPointer< RShape > > getShapes() const
bool getSimplePointDisplay() const
RVector getStartPoint() const
QPainterPath::ElementType getTypeAt(int i) const
bool getWipeout() const
double getXAt(int i) const
double getYAt(int i) const
int getZLevel() const
bool hasOriginalShapes() const
bool hasPoints() const
bool isAtPosition(const RVector &p, double tolerance=RS::PointTolerance) const
bool isEmpty() const
bool isFixedBrushColor() const
bool isFixedPenColor() const
bool isHighlighted() const
bool isSane() const
bool isSelected() const
bool isValid() const
void lineTo(const QPointF &p)
void lineTo(const RVector &v)
void lineTo(qreal x, qreal y)
void move(const RVector &offset)
void moveTo(const QPointF &p)
void moveTo(const RVector &v)
void moveTo(qreal x, qreal y)
void moveToOrNop(const RVector &v)
void quadTo(const RVector &cp, const RVector &v)
void quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)
void rotate(double angle)
void scale(double fx, double fy)
void setAlwaysRegen(bool on)
void setAutoRegen(bool on)
void setBrush(const QBrush &b)
void setFeatureSize(double s)
void setFixedBrushColor(bool on)
void setFixedPenColor(bool on)
void setFrameless(bool on)
void setHighlighted(bool on)
void setInheritPen(bool on)
void setMode(RPainterPath::Mode mode, bool on=true)
void setNoClipping(bool on)
void setNoColorMode(bool on)
void setNoPattern(bool on)
void setPath(const QPainterPath &path)
void setPen(const QPen &p)
Sets the pen of this painter path.
void setPixelSizeHint(double s)
void setPixelUnit(bool on)
void setPixelWidth(bool on)
void setPoints(const QList< RVector > &p)
void setPolylineGen(bool on)
void setScreenBasedLinetype(bool on)
void setSelected(bool on)
void setSimplePointDisplay(bool on)
void setValid(bool on)
void setWipeout(bool on)
void setZLevel(int zl)
Sets the z-level of the painter path.
void transform(const QTransform &t)
static RVector getMaxList(QList< RPainterPath > &pps)
static RVector getMinList(QList< RPainterPath > &pps)
static void rotateList(QList< RPainterPath > &pps, double angle)
static void scaleList(QList< RPainterPath > &pps, double fx, double fy)
static void translateList(QList< RPainterPath > &pps, const RVector &offset)
QBrush brush
double featureSize
Modes modes
QList< QSharedPointer< RShape > > originalShapes
QPen pen
double pixelSizeHint
QList< RVector > points
int zLevel

enum Mode
Value Description
NoModes = 0x0000
Selected = 0x0001 show as selected
Highlighted = 0x0002 show as highlighted
Invalid = 0x0004
FixedPenColor = 0x0008
FixedBrushColor = 0x0010
AutoRegen = 0x0020 arcs (regen on zoom change)
AlwaysRegen = 0x0040
InheritPen = 0x0080 inherit pen from entity / context
PixelUnit = 0x0100 path displayed in pixel (not drawing units)
NoClipping = 0x0200 disable clipping for this path
PixelWidth = 0x0400 interpret width in pixels
NoColorMode = 0x0800 disable color mode
SimplePointDisplay = 0x1000 simple point mode (for points in hatch patterns)
PolylineGen = 0x2000 use polyline pattern along whole path (polyline)
NoPattern = 0x4000 no pattern (polyline with widths)
ScreenBasedLinetype = 0x8000 force screen-based linetypes for this path
Wipeout = 0x10000 path is a wipeout: render in background color
Frameless = 0x20000 path is frameless wipeout: show pseudo frame when selected, highlightes or preview

RPainterPath::RPainterPath()

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

RPainterPath::RPainterPath(const QPainterPath &path)

RPainterPath::RPainterPath(const RPainterPath &other)

virtual RPainterPath::~RPainterPath()

virtual

void RPainterPath::addArc(const RArc &arc)

void RPainterPath::addBox(const RBox &box)

void RPainterPath::addLine(const RLine &line)

void RPainterPath::addOriginalShape(QSharedPointer< RShape > shape)

void RPainterPath::addPath(const RPainterPath &path)

void RPainterPath::addPoint(const RVector &position)

void RPainterPath::addPolyline(const RPolyline &pl)

void RPainterPath::addRect(const QRectF &rect)

Fixes crashing QPainterPath::addRect.

void RPainterPath::addRect(double x1, double y1, double x2, double y2)

void RPainterPath::addShape(QSharedPointer< RShape > shape)

void RPainterPath::addSpline(const RSpline &spline)

void RPainterPath::appendPath(const RPainterPath &path)

void RPainterPath::closeSubpath()

inline

bool RPainterPath::containsPoint(const RVector &v) const

inline const

int RPainterPath::countOriginalShapes() const

const

void RPainterPath::cubicTo(const RVector &cp1, const RVector &cp2, const RVector &v)

inline

void RPainterPath::cubicTo(qreal ctrlPt1x, qreal ctrlPt1y, qreal ctrlPt2x, qreal ctrlPt2y, qreal endPtx, qreal endPty)

inline

bool RPainterPath::getAlwaysRegen() const

const

bool RPainterPath::getAutoRegen() const

const

RBox RPainterPath::getBoundingBox() const

const

QBrush RPainterPath::getBrush() const

const

RVector RPainterPath::getCurrentPosition() const

inline const

double RPainterPath::getDistanceTo(const RVector &point) const

const

Returns: Distance from this painter path to the given point.

This can be used for example to find out how close the visual representation of an entity is to the mouse cursor on the screen.

int RPainterPath::getElementCount() const

const

RVector RPainterPath::getEndPoint() const

const

double RPainterPath::getFeatureSize() const

const

bool RPainterPath::getFrameless() const

const

bool RPainterPath::getInheritPen() const

const

bool RPainterPath::getMode(RPainterPath::Mode mode) const

const

bool RPainterPath::getNoClipping() const

const

bool RPainterPath::getNoColorMode() const

const

bool RPainterPath::getNoPattern() const

const

QSharedPointer< RShape > RPainterPath::getOriginalShape(int i) const

const

QPen RPainterPath::getPen() const

const

Returns: Pen of this painter path.

double RPainterPath::getPixelSizeHint() const

const

bool RPainterPath::getPixelUnit() const

const

bool RPainterPath::getPixelWidth() const

const

QList< RVector > RPainterPath::getPoints() const

const

bool RPainterPath::getPolylineGen() const

const

bool RPainterPath::getScreenBasedLinetype() const

const

QList< QSharedPointer< RShape > > RPainterPath::getShapes() const

const

bool RPainterPath::getSimplePointDisplay() const

const

RVector RPainterPath::getStartPoint() const

const

QPainterPath::ElementType RPainterPath::getTypeAt(int i) const

const

bool RPainterPath::getWipeout() const

const

double RPainterPath::getXAt(int i) const

const

double RPainterPath::getYAt(int i) const

const

int RPainterPath::getZLevel() const

const

Returns: Z-level of the painter path.

bool RPainterPath::hasOriginalShapes() const

const

bool RPainterPath::hasPoints() const

const

bool RPainterPath::isAtPosition(const RVector &p, double tolerance=RS::PointTolerance) const

const

bool RPainterPath::isEmpty() const

const

bool RPainterPath::isFixedBrushColor() const

const

bool RPainterPath::isFixedPenColor() const

const

bool RPainterPath::isHighlighted() const

const

bool RPainterPath::isSane() const

const

bool RPainterPath::isSelected() const

const

bool RPainterPath::isValid() const

const

void RPainterPath::lineTo(const QPointF &p)

inline

Non-Scriptable: This function is not available in script environments.

void RPainterPath::lineTo(const RVector &v)

inline

void RPainterPath::lineTo(qreal x, qreal y)

inline

void RPainterPath::move(const RVector &offset)

void RPainterPath::moveTo(const QPointF &p)

inline

Non-Scriptable: This function is not available in script environments.

void RPainterPath::moveTo(const RVector &v)

inline

void RPainterPath::moveTo(qreal x, qreal y)

inline

void RPainterPath::moveToOrNop(const RVector &v)

inline

void RPainterPath::quadTo(const RVector &cp, const RVector &v)

inline

void RPainterPath::quadTo(qreal ctrlPtx, qreal ctrlPty, qreal endPtx, qreal endPty)

inline

void RPainterPath::rotate(double angle)

void RPainterPath::scale(double fx, double fy)

void RPainterPath::setAlwaysRegen(bool on)

void RPainterPath::setAutoRegen(bool on)

void RPainterPath::setBrush(const QBrush &b)

void RPainterPath::setFeatureSize(double s)

void RPainterPath::setFixedBrushColor(bool on)

void RPainterPath::setFixedPenColor(bool on)

void RPainterPath::setFrameless(bool on)

void RPainterPath::setHighlighted(bool on)

void RPainterPath::setInheritPen(bool on)

void RPainterPath::setMode(RPainterPath::Mode mode, bool on=true)

void RPainterPath::setNoClipping(bool on)

void RPainterPath::setNoColorMode(bool on)

void RPainterPath::setNoPattern(bool on)

void RPainterPath::setPath(const QPainterPath &path)

void RPainterPath::setPen(const QPen &p)

Sets the pen of this painter path.

The pen may be set before painting the path but this is up to the caller.

void RPainterPath::setPixelSizeHint(double s)

void RPainterPath::setPixelUnit(bool on)

void RPainterPath::setPixelWidth(bool on)

void RPainterPath::setPoints(const QList< RVector > &p)

void RPainterPath::setPolylineGen(bool on)

void RPainterPath::setScreenBasedLinetype(bool on)

void RPainterPath::setSelected(bool on)

void RPainterPath::setSimplePointDisplay(bool on)

void RPainterPath::setValid(bool on)

void RPainterPath::setWipeout(bool on)

void RPainterPath::setZLevel(int zl)

Sets the z-level of the painter path.

Painter paths may be ordered by z-level when drawn.

void RPainterPath::transform(const QTransform &t)

static RVector RPainterPath::getMaxList(QList< RPainterPath > &pps)

static

static RVector RPainterPath::getMinList(QList< RPainterPath > &pps)

static

static void RPainterPath::rotateList(QList< RPainterPath > &pps, double angle)

static

static void RPainterPath::scaleList(QList< RPainterPath > &pps, double fx, double fy)

static

static void RPainterPath::translateList(QList< RPainterPath > &pps, const RVector &offset)

static

QBrush RPainterPath::brush

private

double RPainterPath::featureSize

private

Modes RPainterPath::modes

private

QList<QSharedPointer<RShape> > RPainterPath::originalShapes

private

QPen RPainterPath::pen

private

double RPainterPath::pixelSizeHint

private

QList<RVector> RPainterPath::points

private

int RPainterPath::zLevel

private