QCAD
Open Source 2D CAD
RPointEntity.h
Go to the documentation of this file.
1 
20 #ifndef RPOINTENTITY_H
21 #define RPOINTENTITY_H
22 
23 #include "entity_global.h"
24 
25 #include "REntity.h"
26 #include "RPointData.h"
27 
28 class RDocument;
29 class RExporter;
30 
39 
40 public:
56 
57 public:
58  RPointEntity(RDocument* document, const RPointData& data);
59  RPointEntity(const RPointEntity& other);
60  virtual ~RPointEntity();
61 
62  static void init();
63 
64  static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
66  }
67 
68  virtual RPointEntity* clone() const {
69  return new RPointEntity(*this);
70  }
71 
72  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
73  RTransaction* transaction=NULL);
74  QPair<QVariant, RPropertyAttributes> getProperty(
75  RPropertyTypeId& propertyTypeId,
76  bool humanReadable = false, bool noAttributes = false);
77 
78  virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
79 
80  virtual RPointData& getData() {
81  return data;
82  }
83 
84  virtual const RPointData& getData() const {
85  return data;
86  }
87 
88  RVector getPosition() const {
89  return data.getPosition();
90  }
91 
92 protected:
93  virtual void print(QDebug dbg) const;
94 
95 protected:
97 };
98 
100 Q_DECLARE_METATYPE(QSharedPointer<RPointEntity>)
101 Q_DECLARE_METATYPE(QSharedPointer<RPointEntity>*)
102 
103 #endif
static RPropertyTypeId PropertyPositionX
Definition: RPointEntity.h:53
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
static RPropertyTypeId PropertyDrawOrder
Definition: RPointEntity.h:52
static RPropertyTypeId PropertyLineweight
Definition: RPointEntity.h:49
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPropertyTypeId.h:58
static RPropertyTypeId PropertyColor
Definition: RPointEntity.h:50
static RPropertyTypeId PropertyPositionZ
Definition: RPointEntity.h:55
Transaction implementation.
Definition: RTransaction.h:74
Point entity.
Definition: RPointEntity.h:38
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPointEntity.h:41
virtual RPointData & getData()
Definition: RPointEntity.h:80
static RPropertyTypeId PropertyType
Definition: RPointEntity.h:44
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
Q_DECLARE_METATYPE(RMath *)
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPointData.h:40
static RPropertyTypeId PropertyLinetypeScale
Definition: RPointEntity.h:48
static RPropertyTypeId PropertyDisplayedColor
Definition: RPointEntity.h:51
RPointData data
Definition: RPointEntity.h:96
RVector getPosition() const
Definition: RPointEntity.h:88
virtual RPointEntity * clone() const
Definition: RPointEntity.h:68
static RPropertyTypeId PropertyLayer
Definition: RPointEntity.h:46
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: REntity.cpp:228
static RPropertyTypeId PropertyProtected
Definition: RPointEntity.h:43
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RPointEntity.h:64
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 PropertyHandle
Definition: RPointEntity.h:42
static RPropertyTypeId PropertyPositionY
Definition: RPointEntity.h:54
virtual const RPointData & getData() const
Definition: RPointEntity.h:84
static RPropertyTypeId PropertyLinetype
Definition: RPointEntity.h:47
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const =0
Exports the entity to the given exporter.
static RPropertyTypeId PropertyBlock
Definition: RPointEntity.h:45
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition: REntity.cpp:468