QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RAttributeEntity.h
Go to the documentation of this file.
1
20#ifndef RATTRIBUTEENTITY_H
21#define RATTRIBUTEENTITY_H
22
23#include "entity_global.h"
24
25#include "RTextBasedEntity.h"
26#include "RAttributeData.h"
27
28class RDocument;
29class RExporter;
30
39
40 Q_DECLARE_TR_FUNCTIONS(RAttributeEntity)
41
42public:
56
58
78
79public:
80 RAttributeEntity(RDocument* document, const RAttributeData& data);
81 virtual ~RAttributeEntity();
82
83 static void init();
84
87 }
88
92
93 virtual QSharedPointer<RObject> clone() const {
94 return QSharedPointer<RObject>(new RAttributeEntity(*this));
95 }
96
97 QSharedPointer<RAttributeEntity> cloneToAttributeEntity() {
98 return QSharedPointer<RAttributeEntity>(new RAttributeEntity(*this));
99 }
100
102 return data;
103 }
104
105 virtual const RAttributeData& getData() const {
106 return data;
107 }
108
110 data = d;
111 }
112
113
114 virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
115 RTransaction* transaction=NULL);
116 virtual QPair<QVariant, RPropertyAttributes> getProperty(
117 RPropertyTypeId& propertyTypeId,
118 bool humanReadable = false, bool noAttributes = false, bool showOnRequest = false);
119
120 void exportEntity(RExporter& e, bool preview, bool forceSelected=false) const;
121
122 QString getTag() const {
123 return data.getTag();
124 }
125
126 void setTag(const QString& t) {
127 data.setTag(t);
128 }
129
130 bool isInvisible() const {
131 return data.isInvisible();
132 }
133
134 void setInvisible(bool i) {
135 data.setInvisible(i);
136 }
137
138 virtual bool isSelectable() const {
140 }
141
142protected:
143 virtual void print(QDebug dbg) const;
144
145protected:
147};
148
150Q_DECLARE_METATYPE(QSharedPointer<RAttributeEntity>)
151Q_DECLARE_METATYPE(QSharedPointer<RAttributeEntity>*)
152
153#endif
Q_DECLARE_METATYPE(RMath *)
int i
Copyright (c) 2011-2018 by Andrew Mustun.
Definition autostart.js:32
Stores and manages all data that defines the geometry and appearance of a block attribute entity.
Definition RAttributeData.h:42
Attribute entity.
Definition RAttributeEntity.h:38
static RPropertyTypeId PropertyXScale
Definition RAttributeEntity.h:60
static RPropertyTypeId PropertyPositionX
Definition RAttributeEntity.h:68
static RPropertyTypeId PropertyLineSpacingFactor
Definition RAttributeEntity.h:67
static RPropertyTypeId PropertyHandle
Definition RAttributeEntity.h:44
static RPropertyTypeId PropertyItalic
Definition RAttributeEntity.h:66
RAttributeData data
Definition RAttributeEntity.h:146
static RPropertyTypeId PropertyType
Definition RAttributeEntity.h:47
static RPropertyTypeId PropertyLayer
Definition RAttributeEntity.h:49
static RPropertyTypeId PropertyLinetype
Definition RAttributeEntity.h:50
void setData(RAttributeData &d)
Definition RAttributeEntity.h:109
static RPropertyTypeId PropertyHAlign
Definition RAttributeEntity.h:63
virtual const RAttributeData & getData() const
Definition RAttributeEntity.h:105
static RPropertyTypeId PropertyFontName
Definition RAttributeEntity.h:62
static RPropertyTypeId PropertyWorkingSet
Definition RAttributeEntity.h:46
static RPropertyTypeId PropertyUpsideDown
Definition RAttributeEntity.h:77
static RPropertyTypeId PropertyTag
Definition RAttributeEntity.h:71
static RPropertyTypeId PropertyProtected
Definition RAttributeEntity.h:45
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RAttributeEntity.h:43
void setInvisible(bool i)
Definition RAttributeEntity.h:134
virtual QSharedPointer< RObject > clone() const
Definition RAttributeEntity.h:93
static RPropertyTypeId PropertyParentId
Definition RAttributeEntity.h:57
bool isInvisible() const
Definition RAttributeEntity.h:130
static RPropertyTypeId PropertyPositionY
Definition RAttributeEntity.h:69
static RPropertyTypeId PropertyBlock
Definition RAttributeEntity.h:48
virtual RAttributeData & getData()
Definition RAttributeEntity.h:101
static RPropertyTypeId PropertyLineweight
Definition RAttributeEntity.h:52
static RPropertyTypeId PropertyText
Definition RAttributeEntity.h:72
static RPropertyTypeId PropertyBackward
Definition RAttributeEntity.h:76
static RPropertyTypeId PropertyLinetypeScale
Definition RAttributeEntity.h:51
static RS::EntityType getRtti()
Definition RAttributeEntity.h:85
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition RAttributeEntity.h:89
static RPropertyTypeId PropertyDisplayedColor
Definition RAttributeEntity.h:54
static RPropertyTypeId PropertyColor
Definition RAttributeEntity.h:53
void setTag(const QString &t)
Definition RAttributeEntity.h:126
virtual bool isSelectable() const
Definition RAttributeEntity.h:138
static RPropertyTypeId PropertyBold
Definition RAttributeEntity.h:61
QString getTag() const
Definition RAttributeEntity.h:122
static RPropertyTypeId PropertyDrawOrder
Definition RAttributeEntity.h:55
static RPropertyTypeId PropertyVAlign
Definition RAttributeEntity.h:74
static RPropertyTypeId PropertyWidth
Definition RAttributeEntity.h:65
static RPropertyTypeId PropertyHeight
Definition RAttributeEntity.h:64
static RPropertyTypeId PropertyInvisible
Definition RAttributeEntity.h:75
static RPropertyTypeId PropertyAngle
Definition RAttributeEntity.h:59
QSharedPointer< RAttributeEntity > cloneToAttributeEntity()
Definition RAttributeEntity.h:97
static RPropertyTypeId PropertyPlainText
Definition RAttributeEntity.h:73
static RPropertyTypeId PropertyPositionZ
Definition RAttributeEntity.h:70
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
virtual bool isSelectable() const
Definition REntity.cpp:462
Abstract base class for exporters.
Definition RExporter.h:78
bool isInvisible() const
Definition RObject.h:186
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPropertyTypeId.h:54
static QSet< RPropertyTypeId > getPropertyTypeIds(RS::EntityType type, RPropertyAttributes::Option=RPropertyAttributes::NoOptions)
Gets all property type IDs that where registered for the given class.
Definition RPropertyTypeId.cpp:283
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ EntityAttribute
Block attribute.
Definition RS.h:244
Text entity.
Definition RTextBasedEntity.h:38
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition RTextBasedEntity.cpp:94
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition RTextBasedEntity.cpp:234
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const
Exports the entity to the given exporter.
Definition RTextBasedEntity.cpp:200
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
Definition RTextBasedEntity.cpp:153
static void init()
Definition RTextBasedEntity.cpp:61
Transaction implementation.
Definition RTransaction.h:73
#define QCADENTITY_EXPORT
Definition entity_global.h:10
#define NULL
Definition opennurbs_system.h:256