RLinetypePattern
Class in Core Module
Header: #include <src/core/RLinetypePattern.h>
Description
Section titled “Description”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. Represents a linetype pattern which can be used to draw dashed graphical elements.
Scriptable: This class is available in script environments.
Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.
Public Functions
Section titled “Public Functions”RLinetypePattern() |
|
RLinetypePattern(bool metric, const QString &name, const QString &description) |
|
RLinetypePattern(bool metric, const QString &name, const QString &description, const QList< double > &dashes) |
|
RLinetypePattern(bool metric, const QString &name, const QString &description, int num…) |
|
RLinetypePattern(const RLinetypePattern &other) |
|
~RLinetypePattern() |
|
| double | getDashLengthAt(int i) const |
| double | getDashOffsetAt(const QList< double > &dashes, int i) const |
| double | getDelta(double pos) const |
| QString | getDescription() const |
| QString | getLabel() const |
| double | getLargestGap() const |
| QString | getName() const |
| bool | getNoOffset() const |
| int | getNumDashes() const |
| QList< double > | getPattern() const |
| double | getPatternLength() const |
| double | getPatternOffset(double length) |
| double | getPatternOffsetAt(double length, double symmetryPos, double *gap=NULL, bool end=false) |
| QString | getPatternString() const |
| QVector< qreal > | getScreenBasedLinetype() |
| double | getScreenScale() const |
| QList< RPainterPath > | getShapeAt(int i) const |
| QList< int > | getShapeIndices() const |
| int | getShapeNumberAt(int i) const |
| RVector | getShapeOffsetAt(int i) const |
| double | getShapeRotationAt(int i) const |
| double | getShapeScaleAt(int i) const |
| QString | getShapeTextAt(int i) const |
| QString | getShapeTextStyleAt(int i) const |
| QList< double > | getSymmetries() const |
| bool | hasDashAt(double pos) const |
| bool | hasShapeAt(int i) const |
| bool | hasShapeNumberAt(int i) const |
| bool | hasShapeOffsetAt(int i) const |
| bool | hasShapeRotationAt(int i) const |
| bool | hasShapes() const |
| bool | hasShapeScaleAt(int i) const |
| bool | hasShapeTextAt(int i) const |
| bool | hasShapeTextStyleAt(int i) const |
| bool | isLoaded() |
| bool | isMetric() const |
| bool | isValid() const |
| void | load() |
| bool | operator<(const RLinetypePattern &other) const |
| RLinetypePattern & | operator=(const RLinetypePattern &other) |
| bool | operator==(const RLinetypePattern &other) const |
| void | scale(double factor) |
| void | set(const QList< double > &dashes) |
| void | setDescription(const QString &d) |
| void | setMetric(bool on) |
| void | setName(const QString &n) |
| void | setNoOffset(bool n) |
| bool | setPatternString(const QString &patternString)Set pattern based on .lin formatted string. |
| void | setScreenScale(double s) |
| void | setShapeNumberAt(int i, int num) |
| void | setShapeOffsetAt(int i, const RVector &offset) |
| void | setShapeRotationAt(int i, double r) |
| void | setShapeScaleAt(int i, double s) |
| void | setShapeTextAt(int i, const QString &s) |
| void | setShapeTextStyleAt(int i, const QString &s) |
| void | updateShapes()Updates the painter paths for the shapes in this pattern. |
Static Public Functions
Section titled “Static Public Functions”| static void | initNameMap() |
| static QList< QPair< QString, RLinetypePattern * > > | loadAllFrom(bool metric, const QString &fileName)Loads all linetype patterns in the given file into memory. |
Private Attributes
Section titled “Private Attributes”| QString | description |
| bool | metric |
| QString | name |
| bool | noOffset |
| QList< double > | pattern |
| QString | patternString |
| double | screenScale |
| QMap< int, int > | shapeNumbers |
| QMap< int, RVector > | shapeOffsets |
| QMap< int, double > | shapeRotations |
| QMap< int, QList< RPainterPath > > | shapes |
| QMap< int, double > | shapeScales |
| QMap< int, QString > | shapeTexts |
| QMap< int, QString > | shapeTextStyles |
| QList< double > | symmetries |
Static Private Attributes
Section titled “Static Private Attributes”| static QMap< QString, QString > | nameMap |
Friends
Section titled “Friends”| class | RLinetype |
Member Documentation
Section titled “Member Documentation”RLinetypePattern
Section titled “RLinetypePattern”RLinetypePattern::RLinetypePattern()RLinetypePattern
Section titled “RLinetypePattern”RLinetypePattern::RLinetypePattern(bool metric, const QString &name, const QString &description)RLinetypePattern
Section titled “RLinetypePattern”RLinetypePattern::RLinetypePattern(bool metric, const QString &name, const QString &description, const QList< double > &dashes)RLinetypePattern
Section titled “RLinetypePattern”RLinetypePattern::RLinetypePattern(bool metric, const QString &name, const QString &description, int num...)Non-Scriptable: This function is not available in script environments.
RLinetypePattern
Section titled “RLinetypePattern”RLinetypePattern::RLinetypePattern(const RLinetypePattern &other)~RLinetypePattern
Section titled “~RLinetypePattern”RLinetypePattern::~RLinetypePattern()getDashLengthAt
Section titled “getDashLengthAt”double RLinetypePattern::getDashLengthAt(int i) constconst
getDashOffsetAt
Section titled “getDashOffsetAt”double RLinetypePattern::getDashOffsetAt(const QList< double > &dashes, int i) constconst
getDelta
Section titled “getDelta”double RLinetypePattern::getDelta(double pos) constconst
Returns: Distance from start of pattern to
getDescription
Section titled “getDescription”QString RLinetypePattern::getDescription() constconst
getLabel
Section titled “getLabel”QString RLinetypePattern::getLabel() constconst
getLargestGap
Section titled “getLargestGap”double RLinetypePattern::getLargestGap() constconst
getName
Section titled “getName”QString RLinetypePattern::getName() constconst
getNoOffset
Section titled “getNoOffset”bool RLinetypePattern::getNoOffset() constconst
getNumDashes
Section titled “getNumDashes”int RLinetypePattern::getNumDashes() constconst
getPattern
Section titled “getPattern”QList< double > RLinetypePattern::getPattern() constconst
getPatternLength
Section titled “getPatternLength”double RLinetypePattern::getPatternLength() constconst
getPatternOffset
Section titled “getPatternOffset”double RLinetypePattern::getPatternOffset(double length)Returns: Offset to use to apply the given pattern to an entity of the given length that the pattern is symmetrical.
getPatternOffsetAt
Section titled “getPatternOffsetAt”double RLinetypePattern::getPatternOffsetAt(double length, double symmetryPos, double *gap=NULL, bool end=false)Non-Scriptable: This function is not available in script environments.
Returns: Offset to use for an entity with the given length, so that the given dash (index) is in the middle of the entity.
getPatternString
Section titled “getPatternString”QString RLinetypePattern::getPatternString() constconst
getScreenBasedLinetype
Section titled “getScreenBasedLinetype”QVector< qreal > RLinetypePattern::getScreenBasedLinetype()Returns: Line pattern that can be used for a QPen to render screen optimized patterns. Empty vector for continuous.
getScreenScale
Section titled “getScreenScale”double RLinetypePattern::getScreenScale() constconst
getShapeAt
Section titled “getShapeAt”QList< RPainterPath > RLinetypePattern::getShapeAt(int i) constconst
getShapeIndices
Section titled “getShapeIndices”QList< int > RLinetypePattern::getShapeIndices() constconst
getShapeNumberAt
Section titled “getShapeNumberAt”int RLinetypePattern::getShapeNumberAt(int i) constconst
getShapeOffsetAt
Section titled “getShapeOffsetAt”RVector RLinetypePattern::getShapeOffsetAt(int i) constconst
getShapeRotationAt
Section titled “getShapeRotationAt”double RLinetypePattern::getShapeRotationAt(int i) constconst
getShapeScaleAt
Section titled “getShapeScaleAt”double RLinetypePattern::getShapeScaleAt(int i) constconst
getShapeTextAt
Section titled “getShapeTextAt”QString RLinetypePattern::getShapeTextAt(int i) constconst
getShapeTextStyleAt
Section titled “getShapeTextStyleAt”QString RLinetypePattern::getShapeTextStyleAt(int i) constconst
getSymmetries
Section titled “getSymmetries”QList< double > RLinetypePattern::getSymmetries() constinline const
hasDashAt
Section titled “hasDashAt”bool RLinetypePattern::hasDashAt(double pos) constconst
hasShapeAt
Section titled “hasShapeAt”bool RLinetypePattern::hasShapeAt(int i) constconst
hasShapeNumberAt
Section titled “hasShapeNumberAt”bool RLinetypePattern::hasShapeNumberAt(int i) constconst
hasShapeOffsetAt
Section titled “hasShapeOffsetAt”bool RLinetypePattern::hasShapeOffsetAt(int i) constconst
hasShapeRotationAt
Section titled “hasShapeRotationAt”bool RLinetypePattern::hasShapeRotationAt(int i) constconst
hasShapes
Section titled “hasShapes”bool RLinetypePattern::hasShapes() constconst
hasShapeScaleAt
Section titled “hasShapeScaleAt”bool RLinetypePattern::hasShapeScaleAt(int i) constconst
hasShapeTextAt
Section titled “hasShapeTextAt”bool RLinetypePattern::hasShapeTextAt(int i) constconst
hasShapeTextStyleAt
Section titled “hasShapeTextStyleAt”bool RLinetypePattern::hasShapeTextStyleAt(int i) constconst
isLoaded
Section titled “isLoaded”bool RLinetypePattern::isLoaded()inline
isMetric
Section titled “isMetric”bool RLinetypePattern::isMetric() constinline const
isValid
Section titled “isValid”bool RLinetypePattern::isValid() constconst
void RLinetypePattern::load()inline
operator<
Section titled “operator<”bool RLinetypePattern::operator<(const RLinetypePattern &other) constconst
operator=
Section titled “operator=”RLinetypePattern & RLinetypePattern::operator=(const RLinetypePattern &other)operator==
Section titled “operator==”bool RLinetypePattern::operator==(const RLinetypePattern &other) constconst
void RLinetypePattern::scale(double factor)void RLinetypePattern::set(const QList< double > &dashes)setDescription
Section titled “setDescription”void RLinetypePattern::setDescription(const QString &d)setMetric
Section titled “setMetric”void RLinetypePattern::setMetric(bool on)inline
setName
Section titled “setName”void RLinetypePattern::setName(const QString &n)setNoOffset
Section titled “setNoOffset”void RLinetypePattern::setNoOffset(bool n)setPatternString
Section titled “setPatternString”bool RLinetypePattern::setPatternString(const QString &patternString)Set pattern based on .lin formatted string.
e.g. “A,3.81,[TRACK1,ltypeshp.shx,S=6.35],3.81”
setScreenScale
Section titled “setScreenScale”void RLinetypePattern::setScreenScale(double s)setShapeNumberAt
Section titled “setShapeNumberAt”void RLinetypePattern::setShapeNumberAt(int i, int num)setShapeOffsetAt
Section titled “setShapeOffsetAt”void RLinetypePattern::setShapeOffsetAt(int i, const RVector &offset)setShapeRotationAt
Section titled “setShapeRotationAt”void RLinetypePattern::setShapeRotationAt(int i, double r)setShapeScaleAt
Section titled “setShapeScaleAt”void RLinetypePattern::setShapeScaleAt(int i, double s)setShapeTextAt
Section titled “setShapeTextAt”void RLinetypePattern::setShapeTextAt(int i, const QString &s)setShapeTextStyleAt
Section titled “setShapeTextStyleAt”void RLinetypePattern::setShapeTextStyleAt(int i, const QString &s)updateShapes
Section titled “updateShapes”void RLinetypePattern::updateShapes()Updates the painter paths for the shapes in this pattern.
initNameMap
Section titled “initNameMap”static void RLinetypePattern::initNameMap()static
loadAllFrom
Section titled “loadAllFrom”static QList< QPair< QString, RLinetypePattern * > > RLinetypePattern::loadAllFrom(bool metric, const QString &fileName)static
Loads all linetype patterns in the given file into memory.
description
Section titled “description”QString RLinetypePattern::descriptionprivate
metric
Section titled “metric”bool RLinetypePattern::metricprivate
QString RLinetypePattern::nameprivate
noOffset
Section titled “noOffset”bool RLinetypePattern::noOffsetprivate
pattern
Section titled “pattern”QList<double> RLinetypePattern::patternprivate
patternString
Section titled “patternString”QString RLinetypePattern::patternStringprivate
screenScale
Section titled “screenScale”double RLinetypePattern::screenScaleprivate
shapeNumbers
Section titled “shapeNumbers”QMap<int, int> RLinetypePattern::shapeNumbersprivate
shapeOffsets
Section titled “shapeOffsets”QMap<int, RVector> RLinetypePattern::shapeOffsetsprivate
shapeRotations
Section titled “shapeRotations”QMap<int, double> RLinetypePattern::shapeRotationsprivate
shapes
Section titled “shapes”QMap<int, QList<RPainterPath> > RLinetypePattern::shapesprivate
shapeScales
Section titled “shapeScales”QMap<int, double> RLinetypePattern::shapeScalesprivate
shapeTexts
Section titled “shapeTexts”QMap<int, QString> RLinetypePattern::shapeTextsprivate
shapeTextStyles
Section titled “shapeTextStyles”QMap<int, QString> RLinetypePattern::shapeTextStylesprivate
symmetries
Section titled “symmetries”QList<double> RLinetypePattern::symmetriesprivate
nameMap
Section titled “nameMap”static QMap< QString, QString > RLinetypePattern::nameMapstatic private
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.
RLinetype
Section titled “RLinetype”friend class RLinetypeprivate