Skip to content

RLinetypePattern

Class in Core Module
Header: #include <src/core/RLinetypePattern.h>

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.

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 void initNameMap()
static QList< QPair< QString, RLinetypePattern * > > loadAllFrom(bool metric, const QString &fileName)
Loads all linetype patterns in the given file into memory.
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 QMap< QString, QString > nameMap
class RLinetype

RLinetypePattern::RLinetypePattern()

RLinetypePattern::RLinetypePattern(bool metric, const QString &name, const QString &description)

RLinetypePattern::RLinetypePattern(bool metric, const QString &name, const QString &description, const QList< double > &dashes)

RLinetypePattern::RLinetypePattern(bool metric, const QString &name, const QString &description, int num...)

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

RLinetypePattern::RLinetypePattern(const RLinetypePattern &other)

RLinetypePattern::~RLinetypePattern()

double RLinetypePattern::getDashLengthAt(int i) const

const

double RLinetypePattern::getDashOffsetAt(const QList< double > &dashes, int i) const

const

double RLinetypePattern::getDelta(double pos) const

const

Returns: Distance from start of pattern to

QString RLinetypePattern::getDescription() const

const

QString RLinetypePattern::getLabel() const

const

double RLinetypePattern::getLargestGap() const

const

QString RLinetypePattern::getName() const

const

bool RLinetypePattern::getNoOffset() const

const

int RLinetypePattern::getNumDashes() const

const

QList< double > RLinetypePattern::getPattern() const

const

double RLinetypePattern::getPatternLength() const

const

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.

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.

QString RLinetypePattern::getPatternString() const

const

QVector< qreal > RLinetypePattern::getScreenBasedLinetype()

Returns: Line pattern that can be used for a QPen to render screen optimized patterns. Empty vector for continuous.

double RLinetypePattern::getScreenScale() const

const

QList< RPainterPath > RLinetypePattern::getShapeAt(int i) const

const

QList< int > RLinetypePattern::getShapeIndices() const

const

int RLinetypePattern::getShapeNumberAt(int i) const

const

RVector RLinetypePattern::getShapeOffsetAt(int i) const

const

double RLinetypePattern::getShapeRotationAt(int i) const

const

double RLinetypePattern::getShapeScaleAt(int i) const

const

QString RLinetypePattern::getShapeTextAt(int i) const

const

QString RLinetypePattern::getShapeTextStyleAt(int i) const

const

QList< double > RLinetypePattern::getSymmetries() const

inline const

bool RLinetypePattern::hasDashAt(double pos) const

const

bool RLinetypePattern::hasShapeAt(int i) const

const

bool RLinetypePattern::hasShapeNumberAt(int i) const

const

bool RLinetypePattern::hasShapeOffsetAt(int i) const

const

bool RLinetypePattern::hasShapeRotationAt(int i) const

const

bool RLinetypePattern::hasShapes() const

const

bool RLinetypePattern::hasShapeScaleAt(int i) const

const

bool RLinetypePattern::hasShapeTextAt(int i) const

const

bool RLinetypePattern::hasShapeTextStyleAt(int i) const

const

bool RLinetypePattern::isLoaded()

inline

bool RLinetypePattern::isMetric() const

inline const

bool RLinetypePattern::isValid() const

const

void RLinetypePattern::load()

inline

bool RLinetypePattern::operator<(const RLinetypePattern &other) const

const

RLinetypePattern & RLinetypePattern::operator=(const RLinetypePattern &other)

bool RLinetypePattern::operator==(const RLinetypePattern &other) const

const

void RLinetypePattern::scale(double factor)

void RLinetypePattern::set(const QList< double > &dashes)

void RLinetypePattern::setDescription(const QString &d)

void RLinetypePattern::setMetric(bool on)

inline

void RLinetypePattern::setName(const QString &n)

void RLinetypePattern::setNoOffset(bool n)

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”

void RLinetypePattern::setScreenScale(double s)

void RLinetypePattern::setShapeNumberAt(int i, int num)

void RLinetypePattern::setShapeOffsetAt(int i, const RVector &offset)

void RLinetypePattern::setShapeRotationAt(int i, double r)

void RLinetypePattern::setShapeScaleAt(int i, double s)

void RLinetypePattern::setShapeTextAt(int i, const QString &s)

void RLinetypePattern::setShapeTextStyleAt(int i, const QString &s)

void RLinetypePattern::updateShapes()

Updates the painter paths for the shapes in this pattern.

static void RLinetypePattern::initNameMap()

static

static QList< QPair< QString, RLinetypePattern * > > RLinetypePattern::loadAllFrom(bool metric, const QString &fileName)

static

Loads all linetype patterns in the given file into memory.

QString RLinetypePattern::description

private

bool RLinetypePattern::metric

private

QString RLinetypePattern::name

private

bool RLinetypePattern::noOffset

private

QList<double> RLinetypePattern::pattern

private

QString RLinetypePattern::patternString

private

double RLinetypePattern::screenScale

private

QMap<int, int> RLinetypePattern::shapeNumbers

private

QMap<int, RVector> RLinetypePattern::shapeOffsets

private

QMap<int, double> RLinetypePattern::shapeRotations

private

QMap<int, QList<RPainterPath> > RLinetypePattern::shapes

private

QMap<int, double> RLinetypePattern::shapeScales

private

QMap<int, QString> RLinetypePattern::shapeTexts

private

QMap<int, QString> RLinetypePattern::shapeTextStyles

private

QList<double> RLinetypePattern::symmetries

private

static QMap< QString, QString > RLinetypePattern::nameMap

static 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.

friend class RLinetype

private