QCAD
Open Source 2D CAD
RDimAlignedEntity.h
Go to the documentation of this file.
1 
20 #ifndef RDIMALIGNEDENTITY_H
21 #define RDIMALIGNEDENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "RDimensionEntity.h"
26 #include "RDimAlignedData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40  Q_DECLARE_TR_FUNCTIONS(RDimAlignedEntity)
41 
42 public:
55 
63 
68 
78 
79 public:
80  RDimAlignedEntity(RDocument* document, const RDimAlignedData& data,
81  RObject::Id objectId = RObject::INVALID_ID);
82  virtual ~RDimAlignedEntity();
83 
84  static void init();
85 
86  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
88  }
89 
90  virtual RDimAlignedEntity* clone() const {
91  return new RDimAlignedEntity(*this);
92  }
93 
94  virtual RS::EntityType getType() const {
95  return RS::EntityDimAligned;
96  }
97 
98  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
99  RTransaction* transaction=NULL);
100  QPair<QVariant, RPropertyAttributes> getProperty(
101  RPropertyTypeId& propertyTypeId,
102  bool humanReadable = false, bool noAttributes = false);
103 
105  return data;
106  }
107 
109  data = d;
110  }
111 
112  virtual const RDimAlignedData& getData() const {
113  return data;
114  }
115 
116  void setExtensionPoint1(const RVector& p) {
117  data.setExtensionPoint1(p);
118  }
119 
121  return data.getExtensionPoint1();
122  }
123 
124  void setExtensionPoint2(const RVector& p) {
125  data.setExtensionPoint2(p);
126  }
127 
129  return data.getExtensionPoint2();
130  }
131 
132 protected:
133  virtual void print(QDebug dbg) const;
134 
135 protected:
137 };
138 
140 Q_DECLARE_METATYPE(QSharedPointer<RDimAlignedEntity>)
141 Q_DECLARE_METATYPE(QSharedPointer<RDimAlignedEntity>*)
142 
143 #endif
static RPropertyTypeId PropertyProtected
Definition: RDimAlignedEntity.h:45
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimAlignedEntity.h:86
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:103
static RPropertyTypeId PropertyLinearFactor
Definition: RDimAlignedEntity.h:64
RVector getExtensionPoint1() const
Definition: RDimAlignedEntity.h:120
static RPropertyTypeId PropertyType
Definition: RDimAlignedEntity.h:46
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Base class for dimension entity classes.
Definition: RDimensionEntity.h:38
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimAlignedEntity.h:57
static RPropertyTypeId PropertyFontName
Definition: RDimAlignedEntity.h:67
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
static RPropertyTypeId PropertyExtensionPoint2X
Definition: RDimAlignedEntity.h:75
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyExtensionPoint1X
Definition: RDimAlignedEntity.h:72
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimAlignedData.h:36
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimAlignedEntity.h:56
static RPropertyTypeId PropertyExtensionPoint2Z
Definition: RDimAlignedEntity.h:77
static RPropertyTypeId PropertyLayer
Definition: RDimAlignedEntity.h:48
int Id
Definition: RObject.h:53
static RPropertyTypeId PropertyLinetype
Definition: RDimAlignedEntity.h:49
Transaction implementation.
Definition: RTransaction.h:70
static RPropertyTypeId PropertyExtensionPoint1Y
Definition: RDimAlignedEntity.h:73
Linear aligned Dimension.
Definition: RS.h:107
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimAlignedEntity.h:53
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimAlignedEntity.h:66
static RPropertyTypeId PropertyColor
Definition: RDimAlignedEntity.h:52
static RPropertyTypeId PropertyBlock
Definition: RDimAlignedEntity.h:47
virtual const RDimAlignedData & getData() const
Definition: RDimAlignedEntity.h:112
static const Id INVALID_ID
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RObject.h:54
void setData(RDimAlignedData &d)
Definition: RDimAlignedEntity.h:108
static RPropertyTypeId PropertyText
Definition: RDimAlignedEntity.h:59
RDimAlignedData data
Definition: RDimAlignedEntity.h:136
static RPropertyTypeId PropertyLineweight
Definition: RDimAlignedEntity.h:51
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimAlignedEntity.h:62
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:286
static QSet< RPropertyTypeId > getPropertyTypeIds(const std::type_info &classInfo)
Gets all property type IDs that where registered for the given class.
Definition: RPropertyTypeId.cpp:229
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimAlignedEntity.h:60
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyDimensionLinePosZ
Definition: RDimAlignedEntity.h:71
static RPropertyTypeId PropertyDimensionLinePosX
Definition: RDimAlignedEntity.h:69
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimAlignedEntity.h:43
void setExtensionPoint2(const RVector &p)
Definition: RDimAlignedEntity.h:124
Abstract base class for exporters.
Definition: RExporter.h:71
virtual RS::EntityType getType() const
Definition: RDimAlignedEntity.h:94
Aligned dimension entity class.
Definition: RDimAlignedEntity.h:38
static RPropertyTypeId PropertyDimensionLinePosY
Definition: RDimAlignedEntity.h:70
static RPropertyTypeId PropertyHandle
Definition: RDimAlignedEntity.h:44
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimAlignedEntity.h:58
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimAlignedEntity.h:50
static void init()
Definition: RDimensionEntity.cpp:66
void setExtensionPoint1(const RVector &p)
Definition: RDimAlignedEntity.h:116
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimAlignedEntity.h:61
RVector getExtensionPoint2() const
Definition: RDimAlignedEntity.h:128
static RPropertyTypeId PropertyExtensionPoint2Y
Definition: RDimAlignedEntity.h:76
static RPropertyTypeId PropertyExtensionPoint1Z
Definition: RDimAlignedEntity.h:74
virtual RDimAlignedData & getData()
Definition: RDimAlignedEntity.h:104
static RPropertyTypeId PropertyDimScale
Definition: RDimAlignedEntity.h:65
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:150
virtual RDimAlignedEntity * clone() const
Definition: RDimAlignedEntity.h:90
static RPropertyTypeId PropertyDrawOrder
Definition: RDimAlignedEntity.h:54