QCAD
Open Source 2D CAD
RAttributeData.h
Go to the documentation of this file.
1 
20 #ifndef RATTRIBUTEDATA_H
21 #define RATTRIBUTEDATA_H
22 
23 #include "entity_global.h"
24 
25 #include <QTextLayout>
26 
27 #include "RBlockReferenceEntity.h"
28 #include "RDocument.h"
29 #include "RTextData.h"
30 
32 
43  friend class RAttributeEntity;
44 
45 protected:
47 
48 public:
50  RAttributeData(const RTextBasedData& textData, RBlockReferenceEntity::Id blockReferenceId, const QString& tag);
51  virtual ~RAttributeData() {}
52 
53  virtual RS::EntityType getType() const {
54  return RS::EntityAttribute;
55  }
56  virtual QString getRenderedText(bool escUnicode=false) const;
57 
58  QString getTag() const {
59  return tag;
60  }
61 
62  void setTag(const QString& t) {
63  tag = t;
64  }
65 
66  bool isInvisible() const {
67  return invisible;
68  }
69 
70  void setInvisible(bool i) {
71  invisible = i;
72  }
73 
74  virtual RLinetype::Id getLinetypeId(bool resolve, const QStack<REntity*>& blockRefStack) const;
75  virtual RLineweight::Lineweight getLineweight(bool resolve, const QStack<REntity*>& blockRefStack) const;
76  virtual RColor getColor(bool resolve, const QStack<REntity*>& blockRefStack) const;
77  virtual RColor getColor() const {
78  return RTextBasedData::getColor();
79  }
80 
84  friend QDebug operator<<(QDebug dbg, const RAttributeData& t);
85 
86 private:
87  QString tag;
88  bool invisible;
89 };
90 
94 Q_DECLARE_METATYPE(QSharedPointer<RAttributeData>)
95 Q_DECLARE_METATYPE(QSharedPointer<RAttributeData>*)
96 
97 #endif
bool isInvisible() const
Definition: RAttributeData.h:66
virtual RLineweight::Lineweight getLineweight() const
Definition: REntityData.h:257
virtual RS::EntityType getType() const
Definition: RAttributeData.h:53
virtual RColor getColor() const
Definition: REntityData.h:277
RAttributeData()
Definition: RAttributeData.h:49
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
virtual QString getRenderedText(bool escapeUnicode=false) const
Definition: RTextBasedData.cpp:430
int Id
Definition: RObject.h:57
QDebug operator<<(QDebug dbg, const RBox &b)
Stream operator for QDebug.
Definition: RBox.cpp:447
Block attribute.
Definition: RS.h:90
bool invisible
Definition: RAttributeData.h:88
virtual RLinetype::Id getLinetypeId() const
Definition: REntityData.h:239
Lineweight
Definition: RLineweight.h:42
void setTag(const QString &t)
Definition: RAttributeData.h:62
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RAttributeDefinitionData.h:39
Stores and manages all data that defines the geometry and appearance of a text based entity (text...
Definition: RTextBasedData.h:44
Color.
Definition: RColor.h:42
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
Q_DECLARE_METATYPE(RMath *)
RAttributeData data
Definition: RAttributeEntity.h:131
void setInvisible(bool i)
Definition: RAttributeData.h:70
Stores and manages all data that defines the geometry and appearance of a block attribute entity...
Definition: RAttributeData.h:42
virtual RColor getColor() const
Definition: RAttributeData.h:77
QString tag
Definition: RAttributeData.h:87
virtual ~RAttributeData()
Definition: RAttributeData.h:51
Attribute entity.
Definition: RAttributeEntity.h:39
QString getTag() const
Definition: RAttributeData.h:58
RDocument * document
Definition: RObject.h:271