Skip to content

RLayer

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

Represents a layer in a drawing.

Scriptable: This class is available in script environments.

Shared Pointer Support: Objects can be used in QSharedPointer.

enum LayerFlag { Off, Frozen, Locked, Collapsed, Plottable, Snappable, OffIsFreeze }
RLayer()
RLayer(const RLayer &other)
RLayer(RDocument *document, const QString &name, bool frozen=false, bool locked=false, const RColor &color=Qt::black, RObject::Id linetypeId=RObject::INVALID_ID, RLineweight::Lineweight lineweight=RLineweight::Weight000, bool off=false)
virtual ~RLayer()
virtual QSharedPointer< RObject > clone() const
QSharedPointer< RLayer > cloneToLayer() const
QList< QString > getChildLayerNames(bool recursive=true) const
RColor getColor() const
QList< QString > getLayerNameHierarchy() const
RObject::Id getLinetypeId() const
RLineweight::Lineweight getLineweight() const
QString getName() const
RObject::Id getParentLayerId() const
QString getParentLayerName() const
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
QString getShortLayerName() const
virtual RS::EntityType getType() const
bool hasChildLayers() const
bool isChildLayerOf(const QString &layerName) const
bool isCollapsed() const
bool isFrozen() const
bool isLocked() const
bool isOff() const
bool isOffIsFreeze() const
bool isOffOrFrozen() const
bool isPlottable() const
bool isSnappable() const
virtual void print(QDebug dbg) const
Stream operator for QDebug.
void setCollapsed(bool on)
void setColor(const RColor &c)
void setFrozen(bool on)
void setLinetypeId(RObject::Id lt)
void setLineweight(RLineweight::Lineweight lw)
void setLocked(bool on)
void setName(const QString &n)
void setOff(bool on)
void setOffIsFreeze(bool on)
void setPlottable(bool on)
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
void setSnappable(bool on)
static QList< QString > getChildLayerNamesStatic(const RDocument *doc, const QString &layerName, bool recursive=true)
static QString getHierarchySeparator()
static QList< QString > getLayerNameHierarchyStatic(const QString &layerName)
static RLayerProxy * getLayerProxy()
static QString getParentLayerNameStatic(const QString &layerName)
static RS::EntityType getRtti()
static QString getShortLayerNameStatic(const QString &layerName)
static bool hasChildLayersStatic(const RDocument *doc, const QString &layerName)
static bool hasProxy()
static void init()
static bool isChildLayerOfStatic(const QString &layerName, const QString &parentLayerName)
static void setLayerProxy(RLayerProxy *p)
static RPropertyTypeId PropertyCollapsed
static RPropertyTypeId PropertyColor
static RPropertyTypeId PropertyCustom
static RPropertyTypeId PropertyFrozen
static RPropertyTypeId PropertyHandle
static RPropertyTypeId PropertyLinetype
static RPropertyTypeId PropertyLineweight
static RPropertyTypeId PropertyLocked
static RPropertyTypeId PropertyName
static RPropertyTypeId PropertyOff
static RPropertyTypeId PropertyOffIsFreeze
static RPropertyTypeId PropertyPlottable
static RPropertyTypeId PropertyProtected
static RPropertyTypeId PropertySelected
static RPropertyTypeId PropertySnappable
static RPropertyTypeId PropertyType
RColor color
LayerFlags flags
RObject::Id linetypeId
RLineweight::Lineweight lineweight
QString name
static RLayerProxy * layerProxy

enum LayerFlag
Value Description
Off = 0x010 layer is off
Frozen = 0x020 layer is frozen
Locked = 0x040 layer is locked
Collapsed = 0x080 layer is collapsed
Plottable = 0x100 printing disabled for this layer
Snappable = 0x200 snap disabled for this layer
OffIsFreeze = 0x400 off means freeze for this layer

RLayer::RLayer()

RLayer::RLayer(const RLayer &other)

RLayer::RLayer(RDocument *document, const QString &name, bool frozen=false, bool locked=false, const RColor &color=Qt::black, RObject::Id linetypeId=RObject::INVALID_ID, RLineweight::Lineweight lineweight=RLineweight::Weight000, bool off=false)

virtual RLayer::~RLayer()

virtual

virtual QSharedPointer< RObject > RLayer::clone() const

virtual inline const

Reimplemented from clone.

QSharedPointer< RLayer > RLayer::cloneToLayer() const

inline const

QList< QString > RLayer::getChildLayerNames(bool recursive=true) const

inline const

RColor RLayer::getColor() const

inline const

QList< QString > RLayer::getLayerNameHierarchy() const

inline const

RObject::Id RLayer::getLinetypeId() const

inline const

RLineweight::Lineweight RLayer::getLineweight() const

inline const

QString RLayer::getName() const

inline const

RLayer::Id RLayer::getParentLayerId() const

const

QString RLayer::getParentLayerName() const

inline const

virtual QPair< QVariant, RPropertyAttributes > RLayer::getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)

virtual

Returns: The value and attributes of the given property or an invalid property if this property owner has no property with the given ID.

Reimplemented from getProperty.

QString RLayer::getShortLayerName() const

inline const

virtual RS::EntityType RLayer::getType() const

virtual inline const

Returns: The unique entity type, usually the same as RTTI, different for custom entities.

Reimplemented from getType.

bool RLayer::hasChildLayers() const

inline const

bool RLayer::isChildLayerOf(const QString &layerName) const

inline const

bool RLayer::isCollapsed() const

inline const

bool RLayer::isFrozen() const

inline const

bool RLayer::isLocked() const

inline const

bool RLayer::isOff() const

inline const

bool RLayer::isOffIsFreeze() const

inline const

bool RLayer::isOffOrFrozen() const

inline const

bool RLayer::isPlottable() const

inline const

bool RLayer::isSnappable() const

inline const

virtual void RLayer::print(QDebug dbg) const

virtual const

Stream operator for QDebug.

Reimplemented from print.

void RLayer::setCollapsed(bool on)

inline

void RLayer::setColor(const RColor &c)

inline

void RLayer::setFrozen(bool on)

inline

void RLayer::setLinetypeId(RObject::Id lt)

inline

void RLayer::setLineweight(RLineweight::Lineweight lw)

inline

void RLayer::setLocked(bool on)

inline

void RLayer::setName(const QString &n)

void RLayer::setOff(bool on)

inline

void RLayer::setOffIsFreeze(bool on)

inline

void RLayer::setPlottable(bool on)

inline

virtual bool RLayer::setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)

virtual

Sets the given property to the given value.

If this property owner does not know a property with that ID, it is up to the property owner what happens. The property might be added into a list of dynamic properties or dropped.

Returns: True if the property owner was modified in any way, false otherwise.

Reimplemented from setProperty.

void RLayer::setSnappable(bool on)

inline

static QList< QString > RLayer::getChildLayerNamesStatic(const RDocument *doc, const QString &layerName, bool recursive=true)

static inline

static QString RLayer::getHierarchySeparator()

static inline

static QList< QString > RLayer::getLayerNameHierarchyStatic(const QString &layerName)

static inline

static RLayerProxy * RLayer::getLayerProxy()

static inline

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

static QString RLayer::getParentLayerNameStatic(const QString &layerName)

static inline

static RS::EntityType RLayer::getRtti()

static inline

static QString RLayer::getShortLayerNameStatic(const QString &layerName)

static inline

static bool RLayer::hasChildLayersStatic(const RDocument *doc, const QString &layerName)

static inline

static bool RLayer::hasProxy()

static inline

static void RLayer::init()

static

static bool RLayer::isChildLayerOfStatic(const QString &layerName, const QString &parentLayerName)

static inline

static void RLayer::setLayerProxy(RLayerProxy *p)

static inline

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

static RPropertyTypeId RLayer::PropertyCollapsed

static

static RPropertyTypeId RLayer::PropertyColor

static

static RPropertyTypeId RLayer::PropertyCustom

static

static RPropertyTypeId RLayer::PropertyFrozen

static

static RPropertyTypeId RLayer::PropertyHandle

static

static RPropertyTypeId RLayer::PropertyLinetype

static

static RPropertyTypeId RLayer::PropertyLineweight

static

static RPropertyTypeId RLayer::PropertyLocked

static

static RPropertyTypeId RLayer::PropertyName

static

static RPropertyTypeId RLayer::PropertyOff

static

static RPropertyTypeId RLayer::PropertyOffIsFreeze

static

static RPropertyTypeId RLayer::PropertyPlottable

static

static RPropertyTypeId RLayer::PropertyProtected

static

static RPropertyTypeId RLayer::PropertySelected

static

static RPropertyTypeId RLayer::PropertySnappable

static

static RPropertyTypeId RLayer::PropertyType

static

RColor RLayer::color

private

LayerFlags RLayer::flags

private

RObject::Id RLayer::linetypeId

private

RLineweight::Lineweight RLayer::lineweight

private

QString RLayer::name

private

static RLayerProxy * RLayer::layerProxy = NULL

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.