QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RLayout.h
Go to the documentation of this file.
1
20#ifndef RLAYOUT_H
21#define RLAYOUT_H
22
23#include "core_global.h"
24
25#include <QString>
26
27#include "RS.h"
28#include "RObject.h"
29#include "RVector.h"
30#include "RPropertyTypeId.h"
31
32class RDocument;
33class RTransaction;
34
43public:
48
64
86
88 {
89 Inches = 0, // Inches
90 Millimeters = 1, // Millimeters
91 Pixels = 2 // Pixels
92 };
93
95 {
96 Zero = 0, // No rotation (0)
97 CounterClockWise = 1, // 90 CCW (90)
98 Inverted = 2, // Inverted (180)
99 ClockWise = 3 // 90 CW (270)
100 };
101
103 {
104 Display = 0, // Display
105 Extents = 1, // Extents
106 Limits = 2, // Limits
107 View = 3, // View
108 Window = 4, // Window
109 Layout = 5 // Layout
110 };
111
113 {
114 Scale_ScaleToFit = 0, // Scaled to Fit
115 Scale_1_128in_1ft = 1, // 1/128" = 1'
116 Scale_1_64in_1ft = 2, // 1/64" = 1'
117 Scale_1_32in_1ft = 3, // 1/32" = 1'
118 Scale_1_16in_1ft = 4, // 1/16" = 1'
119 Scale_3_32in_1ft = 5, // 3/32" = 1'
120 Scale_1_8in_1ft = 6, // 1/8" = 1'
121 Scale_3_16in_1ft = 7, // 3/16" = 1'
122 Scale_1_4in_1ft = 8, // 1/4" = 1'
123 Scale_3_8in_1ft = 9, // 3/8" = 1'
124 Scale_1_2in_1ft = 10, // 1/2" = 1'
125 Scale_3_4in_1ft = 11, // 3/4" = 1'
126 Scale_1in_1ft = 12, // 1" = 1'
127 Scale_3in_1ft = 13, // 3" = 1'
128 Scale_6in_1ft = 14, // 6" = 1'
129 Scale_1ft_1ft = 15, // 1' = 1'
130 Scale_1_1 = 16, // 1:1
131 Scale_1_2 = 17, // 1:2
132 Scale_1_4 = 18, // 1:4
133 Scale_1_5 = 19, // 1:5
134 Scale_1_8 = 20, // 1:8
135 Scale_1_10 = 21, // 1:10
136 Scale_1_16 = 22, // 1:16
137 Scale_1_20 = 23, // 1:20
138 Scale_1_30 = 24, // 1:30
139 Scale_1_40 = 25, // 1:40
140 Scale_1_50 = 26, // 1:50
141 Scale_1_100 = 27, // 1:100
142 Scale_2_1 = 28, // 2:1
143 Scale_4_1 = 29, // 4:1
144 Scale_8_1 = 30, // 8:1
145 Scale_10_1 = 31, // 10:1
146 Scale_100_1 = 32, // 100:1
147 Scale_1000_1 = 33, // 1000:1
148 Scale_1and1_2in_1ft = 34 // 1.5"= 1'
149 };
150
151public:
152 RLayout();
153
154 RLayout(RDocument* document, const QString& name);
155
156 virtual ~RLayout();
157
158 static void init();
159
161 return RS::ObjectLayout;
162 }
163
164 virtual RS::EntityType getType() const {
165 return RS::ObjectLayout;
166 }
167
168 QSharedPointer<RObject> clone() const {
169 return QSharedPointer<RLayout>(new RLayout(*this));
170 }
171
172 QSharedPointer<RLayout> cloneToLayout() const {
173 return QSharedPointer<RLayout>(new RLayout(*this));
174 }
175
176 QString getName() const {
177 return name;
178 }
179
180 void setName(const QString& n);
181
182 int getTabOrder() const {
183 return tabOrder;
184 }
185
186 void setTabOrder(int to) {
187 tabOrder = to;
188 }
189
190 void setMinLimits(const RVector& minLimits) {
191 this->minLimits = minLimits;
192 }
193
195 return minLimits;
196 }
197
198 void setMaxLimits(const RVector& maxLimits) {
199 this->maxLimits = maxLimits;
200 }
201
203 return maxLimits;
204 }
205
206 void setInsertionBase(const RVector& insertionBase) {
207 this->insertionBase = insertionBase;
208 }
209
211 return insertionBase;
212 }
213
214 void setMinExtents(const RVector& minExtents) {
215 this->minExtents = minExtents;
216 }
217
219 return minExtents;
220 }
221
222 void setMaxExtents(const RVector& maxExtents) {
223 this->maxExtents = maxExtents;
224 }
225
227 return maxExtents;
228 }
229
231 plotPaperMarginLeftMM = v;
232 }
233
235 plotPaperMarginBottomMM = v;
236 }
237
239 plotPaperMarginRightMM = v;
240 }
241
242 void setPlotPaperMarginTopMM(double v) {
243 plotPaperMarginTopMM = v;
244 }
245
246 void setPlotPaperSize(const RVector& v) {
247 plotPaperSize = v;
248 }
249
250 void setPlotOrigin(const RVector& v) {
251 plotOrigin = v;
252 }
253
255 plotWindowAreaMin = v;
256 }
257
259 plotWindowAreaMax = v;
260 }
261
262 void setNumeratorCustomScale(double v) {
263 numeratorCustomScale = v;
264 }
265
267 denominatorCustomScale = v;
268 }
269
271 plotPaperUnits = v;
272 }
273
275 plotRotation = v;
276 }
277
279 plotType = v;
280 }
281
282 void setUseStandardScale(bool v) {
283 useStandardScale = v;
284 }
285
286 void setStandardScale(double v) {
287 standardScale = v;
288 }
289
291 standardScaleType = v;
292 }
293
294 void setCanonicalMediaName(const QString& v) {
295 canonicalMediaName = v;
296 }
297
298
299
301 return plotPaperMarginLeftMM;
302 }
303
305 return plotPaperMarginBottomMM;
306 }
307
309 return plotPaperMarginRightMM;
310 }
311
312 double getPlotPaperMarginTopMM() const {
313 return plotPaperMarginTopMM;
314 }
315
317 return plotPaperSize;
318 }
319
321 return plotOrigin;
322 }
323
325 return plotWindowAreaMin;
326 }
327
329 return plotWindowAreaMax;
330 }
331
332 double getNumeratorCustomScale() const {
333 return numeratorCustomScale;
334 }
335
337 return denominatorCustomScale;
338 }
339
341 return plotPaperUnits;
342 }
343
345 return plotRotation;
346 }
347
349 return plotType;
350 }
351
352 bool getUseStandardScale() const {
353 return useStandardScale;
354 }
355
356 double getStandardScale() const {
357 return standardScale;
358 }
359
361 return standardScaleType;
362 }
363
364 QString getCanonicalMediaName() const {
365 return canonicalMediaName;
366 }
367
368
369
370 virtual QPair<QVariant, RPropertyAttributes> getProperty(RPropertyTypeId& propertyTypeId,
371 bool humanReadable = false, bool noAttributes = false, bool showOnRequest = false);
372 virtual bool setProperty(RPropertyTypeId propertyTypeId,
373 const QVariant& value, RTransaction* transaction=NULL);
374
375protected:
379 virtual void print(QDebug dbg) const;
380
381private:
382 QString name;
384
390
391 // TODO: split into base class 'RPlotSettings':
409};
410
411
412Q_DECLARE_METATYPE(QSharedPointer<RLayout>)
413Q_DECLARE_METATYPE(QSharedPointer<RLayout>*)
424
425#endif
Q_DECLARE_METATYPE(RMath *)
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
Represents a layout definition in a drawing.
Definition RLayout.h:42
QSharedPointer< RLayout > cloneToLayout() const
Definition RLayout.h:172
static RPropertyTypeId PropertyMaxExtentsY
Definition RLayout.h:62
RVector plotPaperSize
Definition RLayout.h:396
void setPlotPaperMarginLeftMM(double v)
Definition RLayout.h:230
RVector getPlotWindowAreaMax() const
Definition RLayout.h:328
StandardScaleType standardScaleType
Definition RLayout.h:407
RVector maxExtents
Definition RLayout.h:389
void setStandardScaleType(RLayout::StandardScaleType v)
Definition RLayout.h:290
double denominatorCustomScale
Definition RLayout.h:401
RVector getMinExtents() const
Definition RLayout.h:218
static RPropertyTypeId PropertyInsertionBaseY
Definition RLayout.h:56
RVector insertionBase
Definition RLayout.h:387
static RPropertyTypeId PropertyUseStandardScale
Definition RLayout.h:82
void setPlotPaperSize(const RVector &v)
Definition RLayout.h:246
static RPropertyTypeId PropertyType
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RLayout.h:44
void setPlotPaperMarginTopMM(double v)
Definition RLayout.h:242
void setMinLimits(const RVector &minLimits)
Definition RLayout.h:190
void setNumeratorCustomScale(double v)
Definition RLayout.h:262
static RPropertyTypeId PropertyMinLimitsY
Definition RLayout.h:50
RLayout::StandardScaleType getStandardScaleType() const
Definition RLayout.h:360
virtual RS::EntityType getType() const
Definition RLayout.h:164
void setPlotPaperMarginRightMM(double v)
Definition RLayout.h:238
RVector getMaxLimits() const
Definition RLayout.h:202
RVector getMinLimits() const
Definition RLayout.h:194
static RPropertyTypeId PropertyStandardScale
Definition RLayout.h:83
static RPropertyTypeId PropertyCustom
Definition RLayout.h:45
static RPropertyTypeId PropertyPlotType
Definition RLayout.h:81
PlotPaperUnits
Definition RLayout.h:88
static RPropertyTypeId PropertyMinLimitsZ
Definition RLayout.h:51
RVector maxLimits
Definition RLayout.h:386
static RPropertyTypeId PropertyPlotPaperSizeWidth
Definition RLayout.h:69
RVector getPlotOrigin() const
Definition RLayout.h:320
static RPropertyTypeId PropertyPlotWindowAreaMaxY
Definition RLayout.h:76
void setPlotType(RLayout::PlotType v)
Definition RLayout.h:278
static RPropertyTypeId PropertyNumeratorCustomScale
Definition RLayout.h:77
static RPropertyTypeId PropertyDenominatorCustomScale
Definition RLayout.h:78
void setMinExtents(const RVector &minExtents)
Definition RLayout.h:214
QString getCanonicalMediaName() const
Definition RLayout.h:364
void setMaxLimits(const RVector &maxLimits)
Definition RLayout.h:198
static RPropertyTypeId PropertyPlotPaperMarginTopMM
Definition RLayout.h:68
void setPlotWindowAreaMax(const RVector &v)
Definition RLayout.h:258
void setStandardScale(double v)
Definition RLayout.h:286
static RPropertyTypeId PropertyStandardScaleType
Definition RLayout.h:84
static RPropertyTypeId PropertyMaxLimitsZ
Definition RLayout.h:54
double getStandardScale() const
Definition RLayout.h:356
int tabOrder
Definition RLayout.h:383
static RPropertyTypeId PropertyPlotPaperMarginRightMM
Definition RLayout.h:67
static RPropertyTypeId PropertyPlotPaperMarginLeftMM
Definition RLayout.h:65
double standardScale
Definition RLayout.h:406
double plotPaperMarginRightMM
Definition RLayout.h:394
void setTabOrder(int to)
Definition RLayout.h:186
static RPropertyTypeId PropertyMinExtentsY
Definition RLayout.h:59
static RPropertyTypeId PropertyPlotWindowAreaMaxX
Definition RLayout.h:75
PlotRotation plotRotation
Definition RLayout.h:403
static RPropertyTypeId PropertyMaxLimitsY
Definition RLayout.h:53
bool getUseStandardScale() const
Definition RLayout.h:352
double plotPaperMarginTopMM
Definition RLayout.h:395
void setPlotWindowAreaMin(const RVector &v)
Definition RLayout.h:254
QSharedPointer< RObject > clone() const
Definition RLayout.h:168
bool useStandardScale
Definition RLayout.h:405
StandardScaleType
Definition RLayout.h:113
static RPropertyTypeId PropertyMinLimitsX
Definition RLayout.h:49
PlotType plotType
Definition RLayout.h:404
static RPropertyTypeId PropertyMinExtentsX
Definition RLayout.h:58
static RPropertyTypeId PropertyMaxExtentsZ
Definition RLayout.h:63
RVector plotWindowAreaMin
Definition RLayout.h:398
double getNumeratorCustomScale() const
Definition RLayout.h:332
void setPlotOrigin(const RVector &v)
Definition RLayout.h:250
PlotType
Definition RLayout.h:103
static RPropertyTypeId PropertyName
Definition RLayout.h:46
RVector minExtents
Definition RLayout.h:388
static RPropertyTypeId PropertyPlotPaperSizeHeight
Definition RLayout.h:70
QString getName() const
Definition RLayout.h:176
RVector getMaxExtents() const
Definition RLayout.h:226
void setDenominatorCustomScale(double v)
Definition RLayout.h:266
RVector minLimits
Definition RLayout.h:385
RVector getPlotPaperSize() const
Definition RLayout.h:316
void setPlotPaperMarginBottomMM(double v)
Definition RLayout.h:234
static RPropertyTypeId PropertyPlotOriginY
Definition RLayout.h:72
double getPlotPaperMarginTopMM() const
Definition RLayout.h:312
static RPropertyTypeId PropertyPlotRotation
Definition RLayout.h:80
static RPropertyTypeId PropertyMaxExtentsX
Definition RLayout.h:61
RVector getInsertionBase() const
Definition RLayout.h:210
static RPropertyTypeId PropertyPlotWindowAreaMinX
Definition RLayout.h:73
static RS::EntityType getRtti()
Definition RLayout.h:160
double numeratorCustomScale
Definition RLayout.h:400
RVector getPlotWindowAreaMin() const
Definition RLayout.h:324
RLayout::PlotType getPlotType() const
Definition RLayout.h:348
double getPlotPaperMarginBottomMM() const
Definition RLayout.h:304
static RPropertyTypeId PropertyInsertionBaseZ
Definition RLayout.h:57
double getDenominatorCustomScale() const
Definition RLayout.h:336
double plotPaperMarginLeftMM
Definition RLayout.h:392
void setCanonicalMediaName(const QString &v)
Definition RLayout.h:294
QString name
Definition RLayout.h:382
RLayout::PlotRotation getPlotRotation() const
Definition RLayout.h:344
RVector plotWindowAreaMax
Definition RLayout.h:399
static RPropertyTypeId PropertyInsertionBaseX
Definition RLayout.h:55
double getPlotPaperMarginLeftMM() const
Definition RLayout.h:300
double plotPaperMarginBottomMM
Definition RLayout.h:393
static RPropertyTypeId PropertyPlotPaperMarginBottomMM
Definition RLayout.h:66
static RPropertyTypeId PropertyTabOrder
Definition RLayout.h:47
QString canonicalMediaName
Definition RLayout.h:408
int getTabOrder() const
Definition RLayout.h:182
void setPlotPaperUnits(RLayout::PlotPaperUnits v)
Definition RLayout.h:270
void setUseStandardScale(bool v)
Definition RLayout.h:282
RVector plotOrigin
Definition RLayout.h:397
RLayout::PlotPaperUnits getPlotPaperUnits() const
Definition RLayout.h:340
static RPropertyTypeId PropertyPlotPaperUnits
Definition RLayout.h:79
double getPlotPaperMarginRightMM() const
Definition RLayout.h:308
static RPropertyTypeId PropertyPlotOriginX
Definition RLayout.h:71
void setPlotRotation(RLayout::PlotRotation v)
Definition RLayout.h:274
void setInsertionBase(const RVector &insertionBase)
Definition RLayout.h:206
PlotPaperUnits plotPaperUnits
Definition RLayout.h:402
static RPropertyTypeId PropertyCanonicalMediaName
Definition RLayout.h:85
PlotRotation
Definition RLayout.h:95
void setMaxExtents(const RVector &maxExtents)
Definition RLayout.h:222
static RPropertyTypeId PropertyMaxLimitsX
Definition RLayout.h:52
static RPropertyTypeId PropertyMinExtentsZ
Definition RLayout.h:60
static RPropertyTypeId PropertyPlotWindowAreaMinY
Definition RLayout.h:74
Abstract base class for all objects.
Definition RObject.h:64
static void init()
Definition RObject.cpp:68
virtual bool setProperty(RPropertyTypeId propertyTypeId, const QVariant &value, RTransaction *transaction=NULL)
Sets the given property to the given value.
Definition RObject.cpp:180
virtual QPair< QVariant, RPropertyAttributes > getProperty(RPropertyTypeId &propertyTypeId, bool humanReadable=false, bool noAttributes=false, bool showOnRequest=false)
Definition RObject.cpp:136
virtual void print(QDebug dbg) const
Stream operator for QDebug.
Definition RObject.cpp:719
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RPropertyTypeId.h:54
EntityType
Entity types used for property handling / filtering.
Definition RS.h:227
@ ObjectLayout
Definition RS.h:234
Transaction implementation.
Definition RTransaction.h:73
Represents a 3d vector (x/y/z).
Definition RVector.h:47
Base class for all view tools.
Definition View.js:19
Base class for all window tools.
Definition Window.js:20
#define QCADCORE_EXPORT
Definition core_global.h:10
#define NULL
Definition opennurbs_system.h:256