QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
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
28class RDocument;
29class RExporter;
30
39
40public:
57
58 // for aama file support:
59 // static RPropertyTypeId PropertyThickness;
60 // static RPropertyTypeId PropertyNormalX;
61 // static RPropertyTypeId PropertyNormalY;
62 // static RPropertyTypeId PropertyNormalZ;
63
64public:
65 RPointEntity(RDocument* document, const RPointData& data);
66 RPointEntity(const RPointEntity& other);
67 virtual ~RPointEntity();
68
69 static void init();
70
72 return RS::EntityPoint;
73 }
74
75 static QSet<RPropertyTypeId> getStaticPropertyTypeIds() {
77 }
78
79 virtual QSharedPointer<RObject> clone() const {
80 return QSharedPointer<RObject>(new RPointEntity(*this));
81 }
82
83 QSharedPointer<RPointEntity> cloneToPointEntity() const {
84 return QSharedPointer<RPointEntity>(new RPointEntity(*this));
85 }
86
87 virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
88 RTransaction* transaction=NULL);
89 virtual QPair<QVariant, RPropertyAttributes> getProperty(
90 RPropertyTypeId& propertyTypeId,
91 bool humanReadable = false, bool noAttributes = false, bool showOnRequest = false);
92
93 virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
94
95 virtual RPointData& getData() {
96 return data;
97 }
98
99 virtual const RPointData& getData() const {
100 return data;
101 }
102
104 return data.getPosition();
105 }
106
107 // for aama files:
108 // void setThickness(double t) {
109 // data.setThickness(t);
110 // }
111 // double getThickness() const {
112 // return data.getThickness();
113 // }
114
115 // void setNormal(const RVector& dir) {
116 // data.setNormal(dir);
117 // }
118 // RVector getNormal() const {
119 // return data.getNormal();
120 // }
121
122protected:
123 virtual void print(QDebug dbg) const;
124
125protected:
127};
128
130Q_DECLARE_METATYPE(QSharedPointer<RPointEntity>)
131Q_DECLARE_METATYPE(QSharedPointer<RPointEntity>*)
132
133#endif
Q_DECLARE_METATYPE(RMath *)
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
Base class for all entity classes.
Definition REntity.h:63
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
Definition REntity.cpp:236
static void init()
Definition REntity.cpp:89
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition REntity.cpp:338
virtual void exportEntity(RExporter &e, bool preview=false, bool forceSelected=false) const =0
Exports the entity to the given exporter.
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition REntity.cpp:487
Abstract base class for exporters.
Definition RExporter.h:78
Stores and manages all data that defines the geometry and appearance of a point entity.
Definition RPointData.h:43
Point entity.
Definition RPointEntity.h:38
static RPropertyTypeId PropertyColor
Definition RPointEntity.h:51
static RPropertyTypeId PropertyProtected
Definition RPointEntity.h:43
static RPropertyTypeId PropertyDisplayedColor
Definition RPointEntity.h:52
static RPropertyTypeId PropertyDrawOrder
Definition RPointEntity.h:53
static RPropertyTypeId PropertyType
Definition RPointEntity.h:45
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPointEntity.h:41
static RPropertyTypeId PropertyBlock
Definition RPointEntity.h:46
virtual RPointData & getData()
Definition RPointEntity.h:95
static RPropertyTypeId PropertyPositionZ
Definition RPointEntity.h:56
static RPropertyTypeId PropertyLinetype
Definition RPointEntity.h:48
static RS::EntityType getRtti()
Definition RPointEntity.h:71
static RPropertyTypeId PropertyLinetypeScale
Definition RPointEntity.h:49
static RPropertyTypeId PropertyPositionX
Definition RPointEntity.h:54
static RPropertyTypeId PropertyLineweight
Definition RPointEntity.h:50
RPointData data
Definition RPointEntity.h:126
virtual const RPointData & getData() const
Definition RPointEntity.h:99
virtual QSharedPointer< RObject > clone() const
Definition RPointEntity.h:79
static RPropertyTypeId PropertyWorkingSet
Definition RPointEntity.h:44
QSharedPointer< RPointEntity > cloneToPointEntity() const
Definition RPointEntity.h:83
RVector getPosition() const
Definition RPointEntity.h:103
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition RPointEntity.h:75
static RPropertyTypeId PropertyLayer
Definition RPointEntity.h:47
static RPropertyTypeId PropertyHandle
Definition RPointEntity.h:42
static RPropertyTypeId PropertyPositionY
Definition RPointEntity.h:55
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPropertyTypeId.h:54
static QSet< RPropertyTypeId > getPropertyTypeIds(RS::EntityType type, RPropertyAttributes::Option=RPropertyAttributes::NoOptions)
Gets all property type IDs that where registered for the given class.
Definition RPropertyTypeId.cpp:283
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ EntityPoint
Point.
Definition RS.h:248
Transaction implementation.
Definition RTransaction.h:73
Represents a 3d vector (x/y/z).
Definition RVector.h:47
#define QCADENTITY_EXPORT
Definition entity_global.h:10
#define NULL
Definition opennurbs_system.h:256