QCAD
Open Source 2D CAD
RLayer Class Reference

Represents a layer in a drawing. More...

#include <RLayer.h>

Inheritance diagram for RLayer:
RObject

Public Member Functions

virtual RLayerclone () const
 
QList< QString > getChildLayerNames (bool recursive=true) const
 
RColor getColor () const
 
QList< QString > getLayerNameHierarchy () const
 
RLinetype::Id getLinetypeId () const
 
RLineweight::Lineweight getLineweight () const
 
QString getName () const
 
RLayer::Id getParentLayerId () const
 
QString getParentLayerName () const
 
virtual QPair< QVariant, RPropertyAttributesgetProperty (RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
 
QString getShortLayerName () const
 
virtual RS::EntityType getType () const
 
bool hasChildLayers () const
 
bool isChildLayerOf (const QString &layerName) const
 
bool isFrozen () const
 
bool isLocked () const
 
virtual bool isSelectedForPropertyEditing ()
 
 RLayer ()
 
 RLayer (RDocument *document, const QString &name, bool frozen=false, bool locked=false, const RColor &color=Qt::black, RLinetype::Id linetypeId=RLinetype::INVALID_ID, RLineweight::Lineweight lineweight=RLineweight::Weight000)
 
 RLayer (const RLayer &other)
 
void setColor (const RColor &c)
 
void setFrozen (bool on)
 
void setLinetypeId (RLinetype::Id lt)
 
void setLineweight (RLineweight::Lineweight lw)
 
void setLocked (bool on)
 
void setName (const QString &n)
 
virtual bool setProperty (RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
 Sets the given property to the given value. More...
 
virtual ~RLayer ()
 
- Public Member Functions inherited from RObject
void copyCustomPropertiesFrom (RObject *other, const QString &title=RDEFAULT_QSTRING)
 Copies all custom properties from the given object. More...
 
void dump ()
 
virtual int getComplexity () const
 
bool getCustomBoolProperty (const QString &title, const QString &key, bool defaultValue) const
 
double getCustomDoubleProperty (const QString &title, const QString &key, double defaultValue) const
 
int getCustomIntProperty (const QString &title, const QString &key, int defaultValue) const
 
QMap< QString, QVariantMap > getCustomProperties () const
 
QVariant getCustomProperty (const QString &title, const QString &key, const QVariant &defaultValue=RDEFAULT_QVARIANT) const
 
QStringList getCustomPropertyKeys (const QString &title) const
 
QStringList getCustomPropertyTitles () const
 
virtual QSet< RPropertyTypeIdgetCustomPropertyTypeIds () const
 
RDocumentgetDocument ()
 
const RDocumentgetDocument () const
 
RObject::Handle getHandle () const
 
RObject::Id getId () const
 
virtual QSet< RPropertyTypeIdgetPropertyTypeIds () const
 
bool hasCustomProperties () const
 
bool hasCustomProperty (const QString &title, const QString &key) const
 
bool hasCustomProperty (const QString &title, const QRegExp &key) const
 
virtual bool hasPropertyType (RPropertyTypeId propertyTypeId)
 
bool isProtected () const
 
bool isUndone () const
 
void removeCustomProperty (const QString &title, const QString &key)
 Removes the custom property with the given name. More...
 
 RObject (RDocument *document=NULL)
 
 RObject (const RObject &other)
 
virtual void setAutoUpdatesBlocked (bool on)
 
void setCustomProperty (const QString &title, const QString &key, const QVariant &value)
 Sets a custom property with the given name. More...
 
void setDocument (RDocument *document)
 
void setProtected (bool on)
 
virtual ~RObject ()
 

Static Public Member Functions

static QList< QString > getChildLayerNamesStatic (const RDocument *doc, const QString &layerName, bool recursive=true)
 
static QString getHierarchySeparator ()
 
static QList< QString > getLayerNameHierarchyStatic (const QString &layerName)
 
static RLayerProxygetLayerProxy ()
 
static QString getParentLayerNameStatic (const QString &layerName)
 
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 Public Member Functions inherited from RObject
static void init ()
 
template<class T >
static bool setMember (T &variable, const QVariant &value, bool condition=true)
 

Static Public Attributes

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 PropertyProtected
 
static RPropertyTypeId PropertyType
 
- Static Public Attributes inherited from RObject
static const Handle INVALID_HANDLE = -1
 
static const Id INVALID_ID = -1
 Copyright (c) 2011-2016 by Andrew Mustun. More...
 
static RPropertyTypeId PropertyCustom
 
static RPropertyTypeId PropertyHandle
 
static RPropertyTypeId PropertyProtected
 
static RPropertyTypeId PropertyType
 

Private Attributes

RColor color
 
bool frozen
 
RLinetype::Id linetypeId
 
RLineweight::Lineweight lineweight
 
bool locked
 
QString name
 

Static Private Attributes

static RLayerProxylayerProxy = NULL
 Copyright (c) 2011-2016 by Andrew Mustun. More...
 

Additional Inherited Members

- Public Types inherited from RObject
typedef int Handle
 
typedef int Id
 
enum  XYZ { X, Y, Z }
 
- Protected Member Functions inherited from RObject
virtual void print (QDebug dbg) const
 Stream operator for QDebug. More...
 
void setHandle (RObject::Handle h)
 
void setId (RObject::Id id)
 
void setUndone (bool on)
 
- Static Protected Member Functions inherited from RObject
static bool setMember (QString &variable, const QVariant &value, bool condition=true)
 Sets the given property. More...
 
static bool setMember (double &variable, const QVariant &value, bool condition=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static bool setMember (int &variable, const QVariant &value, bool condition=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static bool setMember (bool &variable, const QVariant &value, bool condition=true)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
static bool setMember (QList< double > &variable, const QVariant &value, bool condition)
 
static bool setMemberVector (QList< RVector > &variable, const QVariant &value, RObject::XYZ xyz)
 
static bool setMemberX (QList< RVector > &variable, const QVariant &value, bool condition=true)
 
static bool setMemberY (QList< RVector > &variable, const QVariant &value, bool condition=true)
 
static bool setMemberZ (QList< RVector > &variable, const QVariant &value, bool condition=true)
 

Detailed Description

Represents a layer in a drawing.

Scriptable:
This class is available in script environments.
Shared Pointer Support:
Objects can be used in QSharedPointer.

Constructor & Destructor Documentation

RLayer::RLayer ( )
RLayer::RLayer ( RDocument document,
const QString &  name,
bool  frozen = false,
bool  locked = false,
const RColor color = Qt::black,
RLinetype::Id  linetypeId = RLinetype::INVALID_ID,
RLineweight::Lineweight  lineweight = RLineweight::Weight000 
)
RLayer::RLayer ( const RLayer other)
RLayer::~RLayer ( )
virtual

Member Function Documentation

RLayer * RLayer::clone ( ) const
virtual

Implements RObject.

QList<QString> RLayer::getChildLayerNames ( bool  recursive = true) const
inline
static QList<QString> RLayer::getChildLayerNamesStatic ( const RDocument doc,
const QString &  layerName,
bool  recursive = true 
)
inlinestatic
RColor RLayer::getColor ( ) const
inline
static QString RLayer::getHierarchySeparator ( )
inlinestatic
QList<QString> RLayer::getLayerNameHierarchy ( ) const
inline
static QList<QString> RLayer::getLayerNameHierarchyStatic ( const QString &  layerName)
inlinestatic
static RLayerProxy* RLayer::getLayerProxy ( )
inlinestatic
Non-Scriptable:
This function is not available in script environments.
RLinetype::Id RLayer::getLinetypeId ( ) const
inline
RLineweight::Lineweight RLayer::getLineweight ( ) const
inline
QString RLayer::getName ( ) const
inline
RLayer::Id RLayer::getParentLayerId ( ) const
QString RLayer::getParentLayerName ( ) const
inline
static QString RLayer::getParentLayerNameStatic ( const QString &  layerName)
inlinestatic
QPair< QVariant, RPropertyAttributes > RLayer::getProperty ( RPropertyTypeId propertyTypeId,
bool  humanReadable = false,
bool  noAttributes = 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 RObject.

QString RLayer::getShortLayerName ( ) const
inline
static QString RLayer::getShortLayerNameStatic ( const QString &  layerName)
inlinestatic
virtual RS::EntityType RLayer::getType ( ) const
inlinevirtual

Implements RObject.

bool RLayer::hasChildLayers ( ) const
inline
static bool RLayer::hasChildLayersStatic ( const RDocument doc,
const QString &  layerName 
)
inlinestatic
static bool RLayer::hasProxy ( )
inlinestatic
void RLayer::init ( )
static
bool RLayer::isChildLayerOf ( const QString &  layerName) const
inline
static bool RLayer::isChildLayerOfStatic ( const QString &  layerName,
const QString &  parentLayerName 
)
inlinestatic
bool RLayer::isFrozen ( ) const
inline
bool RLayer::isLocked ( ) const
inline
bool RLayer::isSelectedForPropertyEditing ( )
virtual
Returns
True if this object is selected for editing. This means that the properties of this object should for example be shown in a property editor.

Implements RObject.

void RLayer::setColor ( const RColor c)
inline
void RLayer::setFrozen ( bool  on)
inline
static void RLayer::setLayerProxy ( RLayerProxy p)
inlinestatic
Non-Scriptable:
This function is not available in script environments.
void RLayer::setLinetypeId ( RLinetype::Id  lt)
inline
void RLayer::setLineweight ( RLineweight::Lineweight  lw)
inline
void RLayer::setLocked ( bool  on)
inline
void RLayer::setName ( const QString &  n)
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 RObject.

Member Data Documentation

RColor RLayer::color
private
bool RLayer::frozen
private
RLayerProxy * RLayer::layerProxy = NULL
staticprivate

Copyright (c) 2011-2016 by Andrew Mustun.

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::Id RLayer::linetypeId
private
RLineweight::Lineweight RLayer::lineweight
private
bool RLayer::locked
private
QString RLayer::name
private
RPropertyTypeId RLayer::PropertyColor
static
RPropertyTypeId RLayer::PropertyCustom
static
RPropertyTypeId RLayer::PropertyFrozen
static
RPropertyTypeId RLayer::PropertyHandle
static
RPropertyTypeId RLayer::PropertyLinetype
static
RPropertyTypeId RLayer::PropertyLineweight
static
RPropertyTypeId RLayer::PropertyLocked
static
RPropertyTypeId RLayer::PropertyName
static
RPropertyTypeId RLayer::PropertyProtected
static
RPropertyTypeId RLayer::PropertyType
static

The documentation for this class was generated from the following files: