QCAD
Open Source 2D CAD
Loading...
Searching...
No Matches
RTransformOp.h
Go to the documentation of this file.
1
20#ifndef RTRANSFORMOP_H
21#define RTRANSFORMOP_H
22
23#include "../core_global.h"
24
25#include "RMath.h"
26
35public:
36 enum Type {
39 Rotation
40 };
41
42 static RTransformOp createTranslation(qreal dx, qreal dy) {
44 t.type = Translation;
45 t.d1 = dx;
46 t.d2 = dy;
47 return t;
48 }
49
50 static RTransformOp createScale(qreal sx, qreal sy) {
52 t.type = Scale;
53 t.d1 = sx;
54 t.d2 = sy;
55 return t;
56 }
57
58 static RTransformOp createRotation(qreal a) {
60 t.type = Rotation;
61 t.d1 = a;
62 t.d2 = RNANDOUBLE;
63 return t;
64 }
65
67 return type;
68 }
69
70 qreal getD1() const {
71 return d1;
72 }
73
74 qreal getD2() const {
75 return d2;
76 }
77
78public:
86 qreal d1;
90 qreal d2;
91};
92
96
97#endif
#define RNANDOUBLE
Definition RMath.h:74
Q_DECLARE_METATYPE(RMath *)
Copyright (c) 2011-2020 by Andrew Mustun.
Definition RTransformOp.h:34
qreal d2
Getter function for this property: getD2
Definition RTransformOp.h:90
qreal getD2() const
Definition RTransformOp.h:74
static RTransformOp createScale(qreal sx, qreal sy)
Definition RTransformOp.h:50
static RTransformOp createTranslation(qreal dx, qreal dy)
Definition RTransformOp.h:42
Type
Definition RTransformOp.h:36
@ Scale
Definition RTransformOp.h:38
@ Translation
Definition RTransformOp.h:37
RTransformOp::Type type
Getter function for this property: getType
Definition RTransformOp.h:82
static RTransformOp createRotation(qreal a)
Definition RTransformOp.h:58
RTransformOp::Type getType() const
Definition RTransformOp.h:66
qreal getD1() const
Definition RTransformOp.h:70
qreal d1
Getter function for this property: getD1
Definition RTransformOp.h:86
Scales selected entities.
Definition Scale.js:11
#define QCADCORE_EXPORT
Definition core_global.h:10