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:
55 
56 public:
57  RPointEntity(RDocument* document, const RPointData& data,
58  RObject::Id objectId = RObject::INVALID_ID);
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  virtual RS::EntityType getType() const {
73  return RS::EntityPoint;
74  }
75 
76  bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
77  RTransaction* transaction=NULL);
78  QPair<QVariant, RPropertyAttributes> getProperty(
79  RPropertyTypeId& propertyTypeId,
80  bool humanReadable = false, bool noAttributes = false);
81 
82  virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
83 
84  virtual RPointData& getData() {
85  return data;
86  }
87 
88  virtual const RPointData& getData() const {
89  return data;
90  }
91 
92  RVector getPosition() const {
93  return data.getPosition();
94  }
95 
96 protected:
97  virtual void print(QDebug dbg) const;
98 
99 protected:
101 };
102 
104 Q_DECLARE_METATYPE(QSharedPointer<RPointEntity>)
105 Q_DECLARE_METATYPE(QSharedPointer<RPointEntity>*)
106 
107 #endif
static RPropertyTypeId PropertyPositionX
Definition: RPointEntity.h:52
Represents a 3d vector (x/y/z).
Definition: RVector.h:46
static RPropertyTypeId PropertyDrawOrder
Definition: RPointEntity.h:51
static RPropertyTypeId PropertyLineweight
Definition: RPointEntity.h:49
EntityType
Entity types used for property handling / filtering.
Definition: RS.h:75
#define QCADENTITY_EXPORT
Definition: entity_global.h:10
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPropertyTypeId.h:57
int Id
Definition: RObject.h:53
static RPropertyTypeId PropertyColor
Definition: RPointEntity.h:50
Point.
Definition: RS.h:82
static RPropertyTypeId PropertyPositionZ
Definition: RPointEntity.h:54
Transaction implementation.
Definition: RTransaction.h:70
Point entity.
Definition: RPointEntity.h:38
static const Id INVALID_ID
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RObject.h:54
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPointEntity.h:41
virtual RPointData & getData()
Definition: RPointEntity.h:84
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:63
Q_DECLARE_METATYPE(RMath *)
Copyright (c) 2011-2015 by Andrew Mustun.
Definition: RPointData.h:40
static RPropertyTypeId PropertyLinetypeScale
Definition: RPointEntity.h:48
RPointData data
Definition: RPointEntity.h:100
RVector getPosition() const
Definition: RPointEntity.h:92
virtual RPointEntity * clone() const
Definition: RPointEntity.h:68
virtual RS::EntityType getType() const
Definition: RPointEntity.h:72
static RPropertyTypeId PropertyLayer
Definition: RPointEntity.h:46
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false)
Definition: REntity.cpp:193
static RPropertyTypeId PropertyProtected
Definition: RPointEntity.h:43
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition: RPointEntity.h:64
static void init()
Definition: REntity.cpp:71
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition: REntity.cpp:277
Abstract base class for exporters.
Definition: RExporter.h:63
static RPropertyTypeId PropertyHandle
Definition: RPointEntity.h:42
static RPropertyTypeId PropertyPositionY
Definition: RPointEntity.h:53
virtual const RPointData & getData() const
Definition: RPointEntity.h:88
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:385