QCAD
Open Source 2D CAD
RDimAngularEntity.h
Go to the documentation of this file.
1 
20 #ifndef RDIMANGULARENTITY_H
21 #define RDIMANGULARENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "RDimensionEntity.h"
26 #include "RDimAngularData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40  Q_DECLARE_TR_FUNCTIONS(RDimAngularEntity)
41 
42 public:
55 
64 
68 
72 
76 
80 
84 
85 public:
86  RDimAngularEntity(RDocument* document, const RDimAngularData& data);
87  virtual ~RDimAngularEntity();
88 
89  static void init();
90 
91  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
93  }
94 
95  virtual RDimAngularEntity* clone() const {
96  return new RDimAngularEntity(*this);
97  }
98 
99  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
100  RTransaction* transaction=NULL);
101  QPair<QVariant, RPropertyAttributes> getProperty(
102  RPropertyTypeId& propertyTypeId,
103  bool humanReadable = false, bool noAttributes = false);
104 
106  return data;
107  }
108 
110  data = d;
111  }
112 
113  virtual const RDimAngularData& getData() const {
114  return data;
115  }
116 
118  getData().setExtensionLine1Start(p);
119  }
120 
122  return getData().getExtensionLine1Start();
123  }
124 
125  void setExtensionLine1End(const RVector& p) {
126  getData().setExtensionLine1End(p);
127  }
128 
130  return getData().getExtensionLine1End();
131  }
132 
134  getData().setExtensionLine2Start(p);
135  }
136 
138  return getData().getExtensionLine2Start();
139  }
140 
141  void setExtensionLine2End(const RVector& p) {
142  getData().setExtensionLine2End(p);
143  }
144 
146  return getData().getExtensionLine2End();
147  }
148 
149  void setDimArcPosition(const RVector& p) {
150  getData().setDimArcPosition(p);
151  }
152 
154  return getData().getDimArcPosition();
155  }
156 
157 protected:
158  virtual void print(QDebug dbg) const;
159 
160 protected:
162 };
163 
165 Q_DECLARE_METATYPE(QSharedPointer<RDimAngularEntity>)
166 Q_DECLARE_METATYPE(QSharedPointer<RDimAngularEntity>*)
167 
168 #endif
Aligned dimension entity class.
Definition: RDimAngularEntity.h:38
static RPropertyTypeId PropertyExtensionLine1StartX
Definition: RDimAngularEntity.h:65
static RPropertyTypeId PropertyLayer
Definition: RDimAngularEntity.h:48
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:105
static RPropertyTypeId PropertyLinetype
Definition: RDimAngularEntity.h:49
static RPropertyTypeId PropertyHandle
Definition: RDimAngularEntity.h:44
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Base class for dimension entity classes.
Definition: RDimensionEntity.h:38
RDimAngularData data
Definition: RDimAngularEntity.h:161
static RPropertyTypeId PropertyExtensionLine2EndY
Definition: RDimAngularEntity.h:78
virtual RDimensionData & getData()=0
RVector getDimArcPosition() const
Definition: RDimAngularEntity.h:153
RVector getExtensionLine2End() const
Definition: RDimAngularEntity.h:145
void setDimArcPosition(const RVector &p)
Definition: RDimAngularEntity.h:149
static RPropertyTypeId PropertyColor
Definition: RDimAngularEntity.h:52
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimAngularEntity.h:60
static RPropertyTypeId PropertyText
Definition: RDimAngularEntity.h:59
static RPropertyTypeId PropertyExtensionLine2EndX
Definition: RDimAngularEntity.h:77
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
void setExtensionLine2End(const RVector &p)
Definition: RDimAngularEntity.h:141
RVector getExtensionLine1Start() const
Definition: RDimAngularEntity.h:121
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static RPropertyTypeId PropertyDimArcPositionY
Definition: RDimAngularEntity.h:82
void setExtensionLine1End(const RVector &p)
Definition: RDimAngularEntity.h:125
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimAngularEntity.h:62
Transaction implementation.
Definition: RTransaction.h:74
static RPropertyTypeId PropertyType
Definition: RDimAngularEntity.h:46
static RPropertyTypeId PropertyExtensionLine1StartZ
Definition: RDimAngularEntity.h:67
void setData(RDimAngularData &d)
Definition: RDimAngularEntity.h:109
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimAngularEntity.h:43
static RPropertyTypeId PropertyExtensionLine1StartY
Definition: RDimAngularEntity.h:66
static RPropertyTypeId PropertyFontName
Definition: RDimAngularEntity.h:63
virtual const RDimAngularData & getData() const
Definition: RDimAngularEntity.h:113
void setExtensionLine2Start(const RVector &p)
Definition: RDimAngularEntity.h:133
static RPropertyTypeId PropertyExtensionLine2StartY
Definition: RDimAngularEntity.h:74
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:300
static RPropertyTypeId PropertyExtensionLine1EndZ
Definition: RDimAngularEntity.h:71
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
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimAngularEntity.h:57
Q_DECLARE_METATYPE(RMath *)
virtual RDimAngularData & getData()
Definition: RDimAngularEntity.h:105
static RPropertyTypeId PropertyExtensionLine1EndX
Definition: RDimAngularEntity.h:69
static RPropertyTypeId PropertyExtensionLine2EndZ
Definition: RDimAngularEntity.h:79
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimAngularEntity.h:91
static RPropertyTypeId PropertyDrawOrder
Definition: RDimAngularEntity.h:54
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RDimAngularData.h:38
void setExtensionLine1Start(const RVector &p)
Definition: RDimAngularEntity.h:117
RVector getExtensionLine1End() const
Definition: RDimAngularEntity.h:129
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimAngularEntity.h:50
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimAngularEntity.h:56
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimAngularEntity.h:61
static RPropertyTypeId PropertyExtensionLine2StartX
Definition: RDimAngularEntity.h:73
Abstract base class for exporters.
Definition: RExporter.h:71
RVector getExtensionLine2Start() const
Definition: RDimAngularEntity.h:137
virtual RDimAngularEntity * clone() const
Definition: RDimAngularEntity.h:95
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimAngularEntity.h:53
static RPropertyTypeId PropertyLineweight
Definition: RDimAngularEntity.h:51
static RPropertyTypeId PropertyProtected
Definition: RDimAngularEntity.h:45
static RPropertyTypeId PropertyExtensionLine1EndY
Definition: RDimAngularEntity.h:70
static RPropertyTypeId PropertyBlock
Definition: RDimAngularEntity.h:47
static void init()
Definition: RDimensionEntity.cpp:67
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimAngularEntity.h:58
static RPropertyTypeId PropertyDimArcPositionZ
Definition: RDimAngularEntity.h:83
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:153
static RPropertyTypeId PropertyExtensionLine2StartZ
Definition: RDimAngularEntity.h:75
static RPropertyTypeId PropertyDimArcPositionX
Definition: RDimAngularEntity.h:81