1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
diff --git a/librecad/src/actions/rs_actiondrawcircletan1_2p.cpp b/librecad/src/actions/rs_actiondrawcircletan1_2p.cpp
index c14da00e4..f305408aa 100644
--- a/librecad/src/actions/rs_actiondrawcircletan1_2p.cpp
+++ b/librecad/src/actions/rs_actiondrawcircletan1_2p.cpp
@@ -36,11 +36,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "rs_preview.h"
#include "rs_debug.h"
-namespace{
-//list of entity types supported by current action
-auto enTypeList={RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle};
-}
-
struct RS_ActionDrawCircleTan1_2P::Points {
std::vector<RS_Vector> points;
RS_CircleData cData;
diff --git a/librecad/src/actions/rs_actiondrawcircletan1_2p.h b/librecad/src/actions/rs_actiondrawcircletan1_2p.h
index a6f40a6ea..b5976c9f6 100644
--- a/librecad/src/actions/rs_actiondrawcircletan1_2p.h
+++ b/librecad/src/actions/rs_actiondrawcircletan1_2p.h
@@ -79,6 +79,9 @@ class RS_ActionDrawCircleTan1_2P : public RS_PreviewActionInterface {
private:
struct Points;
std::unique_ptr<Points> pPoints;
+
+ //list of entity types supported by current action
+ const std::initializer_list<RS2::EntityType> enTypeList {RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle};
};
#endif
diff --git a/librecad/src/actions/rs_actiondrawcircletan2.cpp b/librecad/src/actions/rs_actiondrawcircletan2.cpp
index d0558f05b..820e42266 100644
--- a/librecad/src/actions/rs_actiondrawcircletan2.cpp
+++ b/librecad/src/actions/rs_actiondrawcircletan2.cpp
@@ -33,10 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "rs_preview.h"
#include "rs_debug.h"
-namespace {
-auto enTypeList={RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle};
-}
-
struct RS_ActionDrawCircleTan2::Points {
RS_CircleData cData;
RS_Vector coord;
diff --git a/librecad/src/actions/rs_actiondrawcircletan2.h b/librecad/src/actions/rs_actiondrawcircletan2.h
index bed568970..5b2040e90 100644
--- a/librecad/src/actions/rs_actiondrawcircletan2.h
+++ b/librecad/src/actions/rs_actiondrawcircletan2.h
@@ -77,6 +77,9 @@ class RS_ActionDrawCircleTan2 : public RS_PreviewActionInterface {
private:
struct Points;
std::unique_ptr<Points> pPoints;
+
+ //list of entity types supported by current action
+ const std::initializer_list<RS2::EntityType> enTypeList {RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle};
};
#endif
diff --git a/librecad/src/actions/rs_actiondrawcircletan2_1p.cpp b/librecad/src/actions/rs_actiondrawcircletan2_1p.cpp
index 324c16686..51cd29a19 100644
--- a/librecad/src/actions/rs_actiondrawcircletan2_1p.cpp
+++ b/librecad/src/actions/rs_actiondrawcircletan2_1p.cpp
@@ -35,10 +35,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "rs_preview.h"
#include "rs_debug.h"
-namespace {
-auto enTypeList={RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle};
-}
-
struct RS_ActionDrawCircleTan2_1P::Points {
RS_Vector point;
RS_CircleData cData;
diff --git a/librecad/src/actions/rs_actiondrawcircletan2_1p.h b/librecad/src/actions/rs_actiondrawcircletan2_1p.h
index 40c239037..e44a56c36 100644
--- a/librecad/src/actions/rs_actiondrawcircletan2_1p.h
+++ b/librecad/src/actions/rs_actiondrawcircletan2_1p.h
@@ -73,6 +73,9 @@ class RS_ActionDrawCircleTan2_1P : public RS_PreviewActionInterface {
private:
struct Points;
std::unique_ptr<Points> pPoints;
+
+ //list of entity types supported by current action
+ const std::initializer_list<RS2::EntityType> enTypeList {RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle};
};
#endif
diff --git a/librecad/src/actions/rs_actiondrawcircletan3.cpp b/librecad/src/actions/rs_actiondrawcircletan3.cpp
index 026ed30e5..eaca13d63 100644
--- a/librecad/src/actions/rs_actiondrawcircletan3.cpp
+++ b/librecad/src/actions/rs_actiondrawcircletan3.cpp
@@ -35,10 +35,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "rs_preview.h"
#include "rs_debug.h"
-namespace {
-auto enTypeList={RS2::EntityArc, RS2::EntityCircle, RS2::EntityLine, RS2::EntityPoint};
-}
-
struct RS_ActionDrawCircleTan3::Points {
std::vector<RS_AtomicEntity*> circles;
std::shared_ptr<RS_CircleData> cData{std::make_shared<RS_CircleData>()};
diff --git a/librecad/src/actions/rs_actiondrawcircletan3.h b/librecad/src/actions/rs_actiondrawcircletan3.h
index d0cabfa2d..3201c5f88 100644
--- a/librecad/src/actions/rs_actiondrawcircletan3.h
+++ b/librecad/src/actions/rs_actiondrawcircletan3.h
@@ -78,6 +78,8 @@ class RS_ActionDrawCircleTan3 : public RS_PreviewActionInterface {
struct Points;
std::unique_ptr<Points> pPoints;
+ //list of entity types supported by current action
+ const std::initializer_list<RS2::EntityType> enTypeList {RS2::EntityArc, RS2::EntityCircle, RS2::EntityLine, RS2::EntityPoint};
};
#endif
diff --git a/librecad/src/actions/rs_actiondrawlinerelangle.cpp b/librecad/src/actions/rs_actiondrawlinerelangle.cpp
index 8415dd604..b9ce996fe 100644
--- a/librecad/src/actions/rs_actiondrawlinerelangle.cpp
+++ b/librecad/src/actions/rs_actiondrawlinerelangle.cpp
@@ -38,11 +38,6 @@
#include "rs_preview.h"
#include "rs_debug.h"
-namespace {
-auto enTypeList={RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle,
- RS2::EntityEllipse};
-}
-
RS_ActionDrawLineRelAngle::RS_ActionDrawLineRelAngle(
RS_EntityContainer& container,
RS_GraphicView& graphicView,
diff --git a/librecad/src/actions/rs_actiondrawlinerelangle.h b/librecad/src/actions/rs_actiondrawlinerelangle.h
index 1e102792d..71e5185b7 100644
--- a/librecad/src/actions/rs_actiondrawlinerelangle.h
+++ b/librecad/src/actions/rs_actiondrawlinerelangle.h
@@ -110,6 +110,9 @@ class RS_ActionDrawLineRelAngle : public RS_PreviewActionInterface {
* Is the angle fixed?
*/
bool fixedAngle;
+
+ //list of entity types supported by current action
+ const std::initializer_list<RS2::EntityType> enTypeList {RS2::EntityLine, RS2::EntityArc, RS2::EntityCircle,RS2::EntityEllipse};
};
#endif
diff --git a/librecad/src/actions/rs_actiondrawlinetangent1.cpp b/librecad/src/actions/rs_actiondrawlinetangent1.cpp
index 197b0cb6c..47a93c766 100644
--- a/librecad/src/actions/rs_actiondrawlinetangent1.cpp
+++ b/librecad/src/actions/rs_actiondrawlinetangent1.cpp
@@ -36,12 +36,6 @@
#include "rs_preview.h"
#include "rs_debug.h"
-namespace{
-auto circleType={RS2::EntityArc, RS2::EntityCircle,
- RS2::EntityEllipse, RS2::EntitySplinePoints
- };
-}
-
RS_ActionDrawLineTangent1::RS_ActionDrawLineTangent1(
RS_EntityContainer& container,
RS_GraphicView& graphicView)
diff --git a/librecad/src/actions/rs_actiondrawlinetangent1.h b/librecad/src/actions/rs_actiondrawlinetangent1.h
index 0f76b3684..d20d302dd 100644
--- a/librecad/src/actions/rs_actiondrawlinetangent1.h
+++ b/librecad/src/actions/rs_actiondrawlinetangent1.h
@@ -66,6 +66,12 @@ class RS_ActionDrawLineTangent1 : public RS_PreviewActionInterface {
std::unique_ptr<RS_Vector> point;
/** Chosen entity */
RS_Entity* circle;
+
+ //list of entity types supported by current action
+ const std::initializer_list<RS2::EntityType> circleType { RS2::EntityArc,
+ RS2::EntityCircle,
+ RS2::EntityEllipse,
+ RS2::EntitySplinePoints };
};
#endif
diff --git a/librecad/src/actions/rs_actiondrawlinetangent2.cpp b/librecad/src/actions/rs_actiondrawlinetangent2.cpp
index fed3545e0..0f1600e53 100644
--- a/librecad/src/actions/rs_actiondrawlinetangent2.cpp
+++ b/librecad/src/actions/rs_actiondrawlinetangent2.cpp
@@ -35,10 +35,6 @@
#include "rs_preview.h"
#include "rs_debug.h"
-namespace{
-auto circleType={RS2::EntityArc, RS2::EntityCircle, RS2::EntityEllipse};
-}
-
RS_ActionDrawLineTangent2::RS_ActionDrawLineTangent2(
RS_EntityContainer& container,
RS_GraphicView& graphicView)
diff --git a/librecad/src/actions/rs_actiondrawlinetangent2.h b/librecad/src/actions/rs_actiondrawlinetangent2.h
index b0d884cd7..95d82465d 100644
--- a/librecad/src/actions/rs_actiondrawlinetangent2.h
+++ b/librecad/src/actions/rs_actiondrawlinetangent2.h
@@ -68,6 +68,9 @@ class RS_ActionDrawLineTangent2 : public RS_PreviewActionInterface {
/** 2nd chosen entity */
RS_Entity* circle2;
bool valid;
+
+ //list of entity types supported by current action
+ const std::initializer_list<RS2::EntityType> circleType {RS2::EntityArc, RS2::EntityCircle, RS2::EntityEllipse};
};
#endif
|