QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RToleranceEntity.h
Go to the documentation of this file.
1
20#ifndef RTOLERANCEENTITY_H
21#define RTOLERANCEENTITY_H
22
23#include "entity_global.h"
24
25#include <QList>
26
27#include "REntity.h"
28#include "RToleranceData.h"
29
30class RDocument;
31class REntity;
32class RExporter;
33class RLine;
34class RObject;
36class RPropertyTypeId;
37class RShape;
38class RTextData;
39class RToleranceData;
41class RTransaction;
42class RVector;
43
44
45
54 Q_DECLARE_TR_FUNCTIONS(RToleranceEntity)
55
56public:
70
80
81public:
82 RToleranceEntity(RDocument* document, const RToleranceData& data);
84 virtual ~RToleranceEntity();
85
86 static void init();
87
90 }
91
95
96 virtual QSharedPointer<RObject> clone() const {
97 return QSharedPointer<RObject>(new RToleranceEntity(*this));
98 }
99
100 QSharedPointer<RToleranceEntity> cloneToToleranceEntity() const {
101 return QSharedPointer<RToleranceEntity>(new RToleranceEntity(*this));
102 }
103
104 virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant& value,
105 RTransaction* transaction=NULL);
106 virtual QPair<QVariant, RPropertyAttributes> getProperty(
107 RPropertyTypeId& propertyTypeId,
108 bool humanReadable = false, bool noAttributes = false, bool showOnRequest = false);
109
111 return data;
112 }
113
115 data = d;
116 }
117
118 virtual const RToleranceData& getData() const {
119 return data;
120 }
121
122 void setLocation(const RVector& l) {
123 data.setLocation(l);
124 }
125
127 return data.getLocation();
128 }
129
130 void setDirection(const RVector& p) {
131 data.setDirection(p);
132 }
133
135 return data.getDirection();
136 }
137
138 void setText(const QString& t) {
139 data.setText(t);
140 }
141
142 QString getText() const {
143 return data.getText();
144 }
145
146 double getDimtxt(bool scale=true) const {
147 return data.getDimtxt(scale);
148 }
149
150 void setDimtxt(double v) {
151 data.setDimtxt(v);
152 }
153
154 double getDimscale() const {
155 return data.getDimscale();
156 }
157
158 void setDimscale(double v) {
159 data.setDimscale(v);
160 }
161
162 QList<QSharedPointer<RShape> > getExploded() const {
163 return data.getExploded();
164 }
165
166 virtual void exportEntity(RExporter& e, bool preview=false, bool forceSelected=false) const;
167
168 QList<RTextData> getTextLabels() const {
169 return data.getTextLabels();
170 }
171
172 QList<RLine> getFrame() const {
173 return data.getFrame();
174 }
175
176 int getRows() const {
177 return data.getRows();
178 }
179
181 data.clearStyleOverrides();
182 }
183
184protected:
185 virtual void print(QDebug dbg) const;
186
187protected:
189};
190
192Q_DECLARE_METATYPE(QSharedPointer<RToleranceEntity>)
193Q_DECLARE_METATYPE(QSharedPointer<RToleranceEntity>*)
194
195#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
Low-level mathematical representation of a line.
Definition RLine.h:41
Abstract base class for all objects.
Definition RObject.h:64
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPropertyAttributes.h:42
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
@ EntityTolerance
Tolerance.
Definition RS.h:278
Interface for geometrical shape classes.
Definition RShape.h:72
Text entity data class.
Definition RTextData.h:38
Tolerance entity data class.
Definition RToleranceData.h:45
Tolerance entity class.
Definition RToleranceEntity.h:53
void setLocation(const RVector &l)
Definition RToleranceEntity.h:122
static RPropertyTypeId PropertyLocationX
Definition RToleranceEntity.h:71
QSharedPointer< RToleranceEntity > cloneToToleranceEntity() const
Definition RToleranceEntity.h:100
void setText(const QString &t)
Definition RToleranceEntity.h:138
RVector getLocation() const
Definition RToleranceEntity.h:126
static RPropertyTypeId PropertyProtected
Definition RToleranceEntity.h:59
static RPropertyTypeId PropertyDimscale
Definition RToleranceEntity.h:78
static RPropertyTypeId PropertyLinetypeScale
Definition RToleranceEntity.h:65
static RPropertyTypeId PropertyDimtxt
Definition RToleranceEntity.h:79
static RPropertyTypeId PropertyDisplayedColor
Definition RToleranceEntity.h:68
void setDimscale(double v)
Definition RToleranceEntity.h:158
static RPropertyTypeId PropertyDirectionX
Definition RToleranceEntity.h:74
double getDimtxt(bool scale=true) const
Definition RToleranceEntity.h:146
static RPropertyTypeId PropertyHandle
Definition RToleranceEntity.h:58
void setData(RToleranceData &d)
Definition RToleranceEntity.h:114
static RPropertyTypeId PropertyColor
Definition RToleranceEntity.h:67
static RPropertyTypeId PropertyBlock
Definition RToleranceEntity.h:62
static QSet< RPropertyTypeId > getStaticPropertyTypeIds()
Definition RToleranceEntity.h:92
static RPropertyTypeId PropertyDirectionZ
Definition RToleranceEntity.h:76
static RPropertyTypeId PropertyLayer
Definition RToleranceEntity.h:63
static RPropertyTypeId PropertyType
Definition RToleranceEntity.h:61
void clearStyleOverrides()
Definition RToleranceEntity.h:180
void setDimtxt(double v)
Definition RToleranceEntity.h:150
QString getText() const
Definition RToleranceEntity.h:142
virtual QSharedPointer< RObject > clone() const
Definition RToleranceEntity.h:96
static RS::EntityType getRtti()
Definition RToleranceEntity.h:88
RVector getDirection() const
Definition RToleranceEntity.h:134
QList< RTextData > getTextLabels() const
Definition RToleranceEntity.h:168
QList< RLine > getFrame() const
Definition RToleranceEntity.h:172
static RPropertyTypeId PropertyWorkingSet
Definition RToleranceEntity.h:60
static RPropertyTypeId PropertyLineweight
Definition RToleranceEntity.h:66
int getRows() const
Definition RToleranceEntity.h:176
virtual const RToleranceData & getData() const
Definition RToleranceEntity.h:118
QList< QSharedPointer< RShape > > getExploded() const
Definition RToleranceEntity.h:162
void setDirection(const RVector &p)
Definition RToleranceEntity.h:130
double getDimscale() const
Definition RToleranceEntity.h:154
static RPropertyTypeId PropertyDrawOrder
Definition RToleranceEntity.h:69
static RPropertyTypeId PropertyText
Definition RToleranceEntity.h:77
virtual RToleranceData & getData()
Definition RToleranceEntity.h:110
static RPropertyTypeId PropertyLocationY
Definition RToleranceEntity.h:72
static RPropertyTypeId PropertyLocationZ
Definition RToleranceEntity.h:73
static RPropertyTypeId PropertyDirectionY
Definition RToleranceEntity.h:75
static RPropertyTypeId PropertyCustom
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RToleranceEntity.h:57
RToleranceData data
Definition RToleranceEntity.h:188
static RPropertyTypeId PropertyLinetype
Definition RToleranceEntity.h:64
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
void scale(void e, void factor, void focusPoint)
Scales the given entity or shape by the given factor with the given focus point.
Definition simple_modify.js:15
#define NULL
Definition opennurbs_system.h:256