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:
55 
63 
69 
73 
77 
78 public:
79  RDimRadialEntity(RDocument* document, const RDimRadialData& data);
80  virtual ~RDimRadialEntity();
81 
82  static void init();
83 
84  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
86  }
87 
88  virtual RDimRadialEntity* clone() const {
89  return new RDimRadialEntity(*this);
90  }
91 
92  virtual RS::EntityType getType() const {
93  return RS::EntityDimRadial;
94  }
95 
96  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
97  RTransaction* transaction=NULL);
98  QPair<QVariant, RPropertyAttributes> getProperty(
99  RPropertyTypeId& propertyTypeId,
100  bool humanReadable = false, bool noAttributes = false);
101 
102  virtual RDimRadialData& getData() {
103  return data;
104  }
105 
107  data = d;
108  }
109 
110  virtual const RDimRadialData& getData() const {
111  return data;
112  }
113 
114  void setChordPoint(const RVector& p) {
115  data.setChordPoint(p);
116  }
117 
119  return data.getChordPoint();
120  }
121 
122 protected:
123  virtual void print(QDebug dbg) const;
124 
125 protected:
127 };
128 
130 Q_DECLARE_METATYPE(QSharedPointer<RDimRadialEntity>)
131 Q_DECLARE_METATYPE(QSharedPointer<RDimRadialEntity>*)
132 
133 #endif
bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: RDimensionEntity.cpp:105
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:102
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimRadialEntity.h:43
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:76
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyLinetypeScale
Definition: RDimRadialEntity.h:50
virtual RDimRadialEntity * clone() const
Definition: RDimRadialEntity.h:88
static RPropertyTypeId PropertyType
Definition: RDimRadialEntity.h:46
static RPropertyTypeId PropertyHandle
Definition: RDimRadialEntity.h:44
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static RPropertyTypeId PropertyColor
Definition: RDimRadialEntity.h:52
static RPropertyTypeId PropertyLineweight
Definition: RDimRadialEntity.h:51
Transaction implementation.
Definition: RTransaction.h:74
RDimRadialData data
Definition: RDimRadialEntity.h:126
Copyright (c) 2011-2016 by Andrew Mustun.
Definition: RDimRadialData.h:36
static RPropertyTypeId PropertyLowerTolerance
Definition: RDimRadialEntity.h:61
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RDimRadialEntity.h:84
static RPropertyTypeId PropertyUpperTolerance
Definition: RDimRadialEntity.h:60
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: RDimensionEntity.cpp:300
static RPropertyTypeId PropertyChordPointY
Definition: RDimRadialEntity.h:75
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 PropertyChordPointX
Definition: RDimRadialEntity.h:74
Q_DECLARE_METATYPE(RMath *)
static RPropertyTypeId PropertyBlock
Definition: RDimRadialEntity.h:47
virtual const RDimRadialData & getData() const
Definition: RDimRadialEntity.h:110
void setData(RDimRadialData &d)
Definition: RDimRadialEntity.h:106
static RPropertyTypeId PropertyMeasuredValue
Definition: RDimRadialEntity.h:62
static RPropertyTypeId PropertyMiddleOfTextZ
Definition: RDimRadialEntity.h:58
static RPropertyTypeId PropertyDisplayedColor
Definition: RDimRadialEntity.h:53
RVector getChordPoint() const
Definition: RDimRadialEntity.h:118
static RPropertyTypeId PropertyDimScale
Definition: RDimRadialEntity.h:65
static RPropertyTypeId PropertyLinetype
Definition: RDimRadialEntity.h:49
static RPropertyTypeId PropertyDimBlockName
Definition: RDimRadialEntity.h:66
static RPropertyTypeId PropertyCenterPointX
Definition: RDimRadialEntity.h:70
Abstract base class for exporters.
Definition: RExporter.h:71
Radial Dimension.
Definition: RS.h:110
static RPropertyTypeId PropertyMiddleOfTextY
Definition: RDimRadialEntity.h:57
Aligned dimension entity class.
Definition: RDimRadialEntity.h:38
static RPropertyTypeId PropertyCenterPointZ
Definition: RDimRadialEntity.h:72
static RPropertyTypeId PropertyLinearFactor
Definition: RDimRadialEntity.h:64
static RPropertyTypeId PropertyMiddleOfTextX
Definition: RDimRadialEntity.h:56
static RPropertyTypeId PropertyAutoTextPos
Definition: RDimRadialEntity.h:67
static RPropertyTypeId PropertyDrawOrder
Definition: RDimRadialEntity.h:54
virtual RS::EntityType getType() const
Definition: RDimRadialEntity.h:92
static void init()
Definition: RDimensionEntity.cpp:67
static RPropertyTypeId PropertyLayer
Definition: RDimRadialEntity.h:48
static RPropertyTypeId PropertyFontName
Definition: RDimRadialEntity.h:68
static RPropertyTypeId PropertyCenterPointY
Definition: RDimRadialEntity.h:71
void setChordPoint(const RVector &p)
Definition: RDimRadialEntity.h:114
QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: RDimensionEntity.cpp:153
static RPropertyTypeId PropertyText
Definition: RDimRadialEntity.h:59
static RPropertyTypeId PropertyChordPointZ
Definition: RDimRadialEntity.h:76