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 
69 
79 
80 public:
81  RDimAlignedEntity(RDocument* document, const RDimAlignedData& data);
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  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
95  RTransaction* transaction=NULL);
96  QPair<QVariant, RPropertyAttributes> getProperty(
97  RPropertyTypeId& propertyTypeId,
98  bool humanReadable = false, bool noAttributes = false);
99 
101  return data;
102  }
103 
105  data = d;
106  }
107 
108  virtual const RDimAlignedData& getData() const {
109  return data;
110  }
111 
112  void setExtensionPoint1(const RVector& p) {
113  data.setExtensionPoint1(p);
114  }
115 
117  return data.getExtensionPoint1();
118  }
119 
120  void setExtensionPoint2(const RVector& p) {
121  data.setExtensionPoint2(p);
122  }
123 
125  return data.getExtensionPoint2();
126  }
127 
128 protected:
129  virtual void print(QDebug dbg) const;
130 
131 protected:
133 };
134 
136 Q_DECLARE_METATYPE(QSharedPointer<RDimAlignedEntity>)
137 Q_DECLARE_METATYPE(QSharedPointer<RDimAlignedEntity>*)
138 
139 #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:105
static RPropertyTypeId PropertyLinearFactor
Definition: RDimAlignedEntity.h:64
RVector getExtensionPoint1() const
Definition: RDimAlignedEntity.h:116
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:68
static RPropertyTypeId PropertyExtensionPoint2X
Definition: RDimAlignedEntity.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyExtensionPoint1X
Definition: RDimAlignedEntity.h:73
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimAlignedData.h:36
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimAlignedEntity.h:56
static RPropertyTypeId PropertyExtensionPoint2Z
Definition: RDimAlignedEntity.h:78
static RPropertyTypeId PropertyLayer
Definition: RDimAlignedEntity.h:48
static RPropertyTypeId PropertyLinetype
Definition: RDimAlignedEntity.h:49
Transaction implementation.
Definition: RTransaction.h:74
static RPropertyTypeId PropertyExtensionPoint1Y
Definition: RDimAlignedEntity.h:74
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimAlignedEntity.h:53
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimAlignedEntity.h:67
static RPropertyTypeId PropertyColor
Definition: RDimAlignedEntity.h:52
static RPropertyTypeId PropertyBlock
Definition: RDimAlignedEntity.h:47
virtual const RDimAlignedData & getData() const
Definition: RDimAlignedEntity.h:108
void setData(RDimAlignedData &d)
Definition: RDimAlignedEntity.h:104
static RPropertyTypeId PropertyText
Definition: RDimAlignedEntity.h:59
RDimAlignedData data
Definition: RDimAlignedEntity.h:132
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:300
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:72
static RPropertyTypeId PropertyDimensionLinePosX
Definition: RDimAlignedEntity.h:70
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimAlignedEntity.h:43
void setExtensionPoint2(const RVector &p)
Definition: RDimAlignedEntity.h:120
static RPropertyTypeId PropertyDimBlockName
Definition: RDimAlignedEntity.h:66
Abstract base class for exporters.
Definition: RExporter.h:71
Aligned dimension entity class.
Definition: RDimAlignedEntity.h:38
static RPropertyTypeId PropertyDimensionLinePosY
Definition: RDimAlignedEntity.h:71
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:67
void setExtensionPoint1(const RVector &p)
Definition: RDimAlignedEntity.h:112
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimAlignedEntity.h:61
RVector getExtensionPoint2() const
Definition: RDimAlignedEntity.h:124
static RPropertyTypeId PropertyExtensionPoint2Y
Definition: RDimAlignedEntity.h:77
static RPropertyTypeId PropertyExtensionPoint1Z
Definition: RDimAlignedEntity.h:75
virtual RDimAlignedData & getData()
Definition: RDimAlignedEntity.h:100
static RPropertyTypeId PropertyDimScale
Definition: RDimAlignedEntity.h:65
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:153
virtual RDimAlignedEntity * clone() const
Definition: RDimAlignedEntity.h:90
static RPropertyTypeId PropertyDrawOrder
Definition: RDimAlignedEntity.h:54