QCAD
Open Source 2D CAD
RCircleEntity.h
Go to the documentation of this file.
1 
20 #ifndef RCIRCLENTITY_H
21 #define RCIRCLENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "REntity.h"
26 #include "RCircleData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40 public:
57 
61 
62 public:
63  RCircleEntity(RDocument* document, const RCircleData& data);
64  RCircleEntity(const RCircleEntity& other);
65  virtual ~RCircleEntity();
66 
67  static void init();
68 
69  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
71  }
72 
73  virtual RCircleEntity* clone() const {
74  return new RCircleEntity(*this);
75  }
76 
77  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
78  RTransaction* transaction=NULL);
79  QPair<QVariant, RPropertyAttributes> getProperty(
80  RPropertyTypeId& propertyTypeId,
81  bool humanReadable = false, bool noAttributes = false);
82 
83  virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
84 
85  virtual RCircleData& getData() {
86  return data;
87  }
88 
89  virtual const RCircleData& getData() const {
90  return data;
91  }
92 
93  RVector getCenter() const {
94  return data.getCenter();
95  }
96 
97  double getRadius() const {
98  return data.getRadius();
99  }
100 
101  void setRadius(double radius) {
102  data.setRadius(radius);
103  }
104 
105  double getLength() const {
106  return data.getLength();
107  }
108 
109 protected:
110  virtual void print(QDebug dbg) const;
111 
112 protected:
114 };
115 
117 Q_DECLARE_METATYPE(QSharedPointer<RCircleEntity>)
118 Q_DECLARE_METATYPE(QSharedPointer<RCircleEntity>*)
119 
120 #endif
static RPropertyTypeId PropertyBlock
Definition: RCircleEntity.h:45
static RPropertyTypeId PropertyCenterZ
Definition: RCircleEntity.h:55
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
void setRadius(double radius)
Definition: RCircleEntity.h:101
double getLength() const
Definition: RCircleEntity.h:105
static RPropertyTypeId PropertyDisplayedColor
Definition: RCircleEntity.h:51
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
static RPropertyTypeId PropertyType
Definition: RCircleEntity.h:44
static RPropertyTypeId PropertyDiameter
Definition: RCircleEntity.h:58
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RCircleData.h:40
virtual RCircleData & getData()
Definition: RCircleEntity.h:85
Circle entity.
Definition: RCircleEntity.h:38
static RPropertyTypeId PropertyLayer
Definition: RCircleEntity.h:46
Transaction implementation.
Definition: RTransaction.h:74
static RPropertyTypeId PropertyColor
Definition: RCircleEntity.h:50
static RPropertyTypeId PropertyArea
Definition: RCircleEntity.h:60
double getRadius() const
Definition: RCircleEntity.h:97
static RPropertyTypeId PropertyProtected
Definition: RCircleEntity.h:43
static RPropertyTypeId PropertyHandle
Definition: RCircleEntity.h:42
static RPropertyTypeId PropertyRadius
Definition: RCircleEntity.h:56
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
Base class for all entity classes.
Definition: REntity.h:64
A graphics document contains and owns entities, layers, user coordinate systems, variables, block definitions, etc.
Definition: RDocument.h:67
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RCircleEntity.h:41
Q_DECLARE_METATYPE(RMath *)
virtual RCircleEntity * clone() const
Definition: RCircleEntity.h:73
virtual const RCircleData & getData() const
Definition: RCircleEntity.h:89
static RPropertyTypeId PropertyDrawOrder
Definition: RCircleEntity.h:52
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RCircleEntity.h:69
static RPropertyTypeId PropertyLinetypeScale
Definition: RCircleEntity.h:48
static RPropertyTypeId PropertyLineweight
Definition: RCircleEntity.h:49
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: REntity.cpp:228
static void init()
Definition: REntity.cpp:82
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: REntity.cpp:321
Abstract base class for exporters.
Definition: RExporter.h:71
static RPropertyTypeId PropertyLinetype
Definition: RCircleEntity.h:47
static RPropertyTypeId PropertyCenterX
Definition: RCircleEntity.h:53
RVector getCenter() const
Definition: RCircleEntity.h:93
static RPropertyTypeId PropertyCenterY
Definition: RCircleEntity.h:54
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const =0
Exports the entity to the given exporter.
RCircleData data
Definition: RCircleEntity.h:113
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: REntity.cpp:468
static RPropertyTypeId PropertyCircumference
Definition: RCircleEntity.h:59