QCAD
Open Source 2D CAD
RDimRadialEntity.h
Go to the documentation of this file.
1 
20 #ifndef RDIMRADIALENTITY_H
21 #define RDIMRADIALENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "RDimensionEntity.h"
26 #include "RDimRadialData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40  Q_DECLARE_TR_FUNCTIONS(RDimRadialEntity)
41 
42 public:
54 
62 
67 
71 
75 
76 public:
77  RDimRadialEntity(RDocument* document, const RDimRadialData& data,
78  RObject::Id objectId = RObject::INVALID_ID);
79  virtual ~RDimRadialEntity();
80 
81  static void init();
82 
83  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
85  }
86 
87  virtual RDimRadialEntity* clone() const {
88  return new RDimRadialEntity(*this);
89  }
90 
91  virtual RS::EntityType getType() const {
92  return RS::EntityDimRadial;
93  }
94 
95  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
96  RTransaction* transaction=NULL);
97  QPair<QVariant, RPropertyAttributes> getProperty(
98  RPropertyTypeId& propertyTypeId,
99  bool humanReadable = false, bool noAttributes = false);
100 
101  virtual RDimRadialData& getData() {
102  return data;
103  }
104 
106  data = d;
107  }
108 
109  virtual const RDimRadialData& getData() const {
110  return data;
111  }
112 
113  void setChordPoint(const RVector& p) {
114  data.setChordPoint(p);
115  }
116 
118  return data.getChordPoint();
119  }
120 
121 protected:
122  virtual void print(QDebug dbg) const;
123 
124 protected:
126 };
127 
129 Q_DECLARE_METATYPE(QSharedPointer<RDimRadialEntity>)
130 Q_DECLARE_METATYPE(QSharedPointer<RDimRadialEntity>*)
131 
132 #endif
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:101
static RPropertyTypeId PropertyProtected
Definition: RDimRadialEntity.h:45
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
Base class for dimension entity classes.
Definition: RDimensionEntity.h:38
virtual RDimRadialData & getData()
Definition: RDimRadialEntity.h:101
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RDimRadialEntity.h:43
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:75
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimRadialEntity.h:50
virtual RDimRadialEntity * clone() const
Definition: RDimRadialEntity.h:87
static RPropertyTypeId PropertyType
Definition: RDimRadialEntity.h:46
static RPropertyTypeId PropertyHandle
Definition: RDimRadialEntity.h:44
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPropertyTypeId.h:57
int Id
Definition: RObject.h:53
static RPropertyTypeId PropertyColor
Definition: RDimRadialEntity.h:52
static RPropertyTypeId PropertyLineweight
Definition: RDimRadialEntity.h:51
Transaction implementation.
Definition: RTransaction.h:70
RDimRadialData data
Definition: RDimRadialEntity.h:125
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RDimRadialData.h:36
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimRadialEntity.h:60
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimRadialEntity.h:83
static const Id INVALID_ID
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RObject.h:54
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimRadialEntity.h:59
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:275
static RPropertyTypeId PropertyChordPointY
Definition: RDimRadialEntity.h:73
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:63
static RPropertyTypeId PropertyChordPointX
Definition: RDimRadialEntity.h:72
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyBlock
Definition: RDimRadialEntity.h:47
virtual const RDimRadialData & getData() const
Definition: RDimRadialEntity.h:109
void setData(RDimRadialData &d)
Definition: RDimRadialEntity.h:105
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimRadialEntity.h:61
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimRadialEntity.h:57
RVector getChordPoint() const
Definition: RDimRadialEntity.h:117
static RPropertyTypeId PropertyDimScale
Definition: RDimRadialEntity.h:64
static RPropertyTypeId PropertyLinetype
Definition: RDimRadialEntity.h:49
static RPropertyTypeId PropertyCenterPointX
Definition: RDimRadialEntity.h:68
Abstract base class for exporters.
Definition: RExporter.h:63
Radial Dimension.
Definition: RS.h:99
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimRadialEntity.h:56
Aligned dimension entity class.
Definition: RDimRadialEntity.h:38
static RPropertyTypeId PropertyCenterPointZ
Definition: RDimRadialEntity.h:70
static RPropertyTypeId PropertyLinearFactor
Definition: RDimRadialEntity.h:63
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimRadialEntity.h:55
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimRadialEntity.h:65
static RPropertyTypeId PropertyDrawOrder
Definition: RDimRadialEntity.h:53
virtual RS::EntityType getType() const
Definition: RDimRadialEntity.h:91
static void init()
Definition: RDimensionEntity.cpp:65
static RPropertyTypeId PropertyLayer
Definition: RDimRadialEntity.h:48
static RPropertyTypeId PropertyFontName
Definition: RDimRadialEntity.h:66
static RPropertyTypeId PropertyCenterPointY
Definition: RDimRadialEntity.h:69
void setChordPoint(const RVector &p)
Definition: RDimRadialEntity.h:113
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:148
static RPropertyTypeId PropertyText
Definition: RDimRadialEntity.h:58
static RPropertyTypeId PropertyChordPointZ
Definition: RDimRadialEntity.h:74