Skip to content

RPattern

Class in Core Module
Header: #include <src/core/RPattern.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 hatch pattern.

Scriptable: This class is available in script environments.

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

Stream Operator: Object has a stream operator to present itself as string, for example when using toString() in a script.

RPattern()
Default constructor.
RPattern(const QString &name, const QString &description)
Constructor.
~RPattern()
void addPatternLine(const RPatternLine &patternLine)
void clear()
const QString getDescription() const
QString getFileName() const
const QString getName() const
QList< RPatternLine > getPatternLines() const
bool hasDots() const
bool isLoaded() const
bool isValid() const
void load() const
void rotate(double a)
Rotates the pattern by the given factor.
void scale(double f)
Scales the pattern by the given factor.
static QList< QPair< QString, RPattern * > > loadAllFrom(const QString &fileName)
QString description
Pattern description.
QString fileName
Pattern file name.
QString name
Pattern name.
QList< RPatternLine > patternLines
List of pattern line definitions.

RPattern::RPattern()

Default constructor.

RPattern::RPattern(const QString &name, const QString &description)

Constructor.

RPattern::~RPattern()

void RPattern::addPatternLine(const RPatternLine &patternLine)

inline

void RPattern::clear()

inline

const QString RPattern::getDescription() const

inline const

Returns: the description of this pattern.

QString RPattern::getFileName() const

inline const

Returns: the fileName of this pattern.

const QString RPattern::getName() const

inline const

Returns: the name of this pattern.

QList< RPatternLine > RPattern::getPatternLines() const

inline const

bool RPattern::hasDots() const

const

bool RPattern::isLoaded() const

inline const

Returns: True if this pattern is already loaded.

bool RPattern::isValid() const

inline const

void RPattern::load() const

inline const

void RPattern::rotate(double a)

Rotates the pattern by the given factor.

void RPattern::scale(double f)

Scales the pattern by the given factor.

static QList< QPair< QString, RPattern * > > RPattern::loadAllFrom(const QString &fileName)

static

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. Loads all patterns in the given file into memory.

QString RPattern::description

private

Pattern description.

QString RPattern::fileName

private

Pattern file name.

QString RPattern::name

private

Pattern name.

QList<RPatternLine> RPattern::patternLines

private

List of pattern line definitions.