libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
peano_curve.cpp
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright © 2002 by J.M.McGuiness, coder@hussar.me.uk
3
**
4
** This library is free software; you can redistribute it and/or
5
** modify it under the terms of the GNU Lesser General Public
6
** License as published by the Free Software Foundation; either
7
** version 2.1 of the License, or (at your option) any later version.
8
**
9
** This library is distributed in the hope that it will be useful,
10
** but WITHOUT ANY WARRANTY; without even the implied warranty of
11
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
** Lesser General Public License for more details.
13
**
14
** You should have received a copy of the GNU Lesser General Public
15
** License along with this library; if not, write to the Free Software
16
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
*/
18
19
#
include
"peano_curve.hpp"
20
21
namespace
jmmcg
{
namespace
LIBJMMCG_VER_NAMESPACE
{
22
23
const
PeanoCurve
::dir_replacements
PeanoCurve
::replacements[]={
24
// North replacements.
25
{
26
// Replace "green_right_curve".
27
{
28
PeanoCurve
::
curve_element
(
green_left_curve
,
south
)
,
29
PeanoCurve
::
curve_element
(
red_right_curve
,
west
)
,
30
PeanoCurve
::
curve_element
(
green_right_curve
,
north
)
,
31
PeanoCurve
::
curve_element
(
red_straight
,
north
)
32
},
33
// Replace "red_right_curve".
34
{
35
PeanoCurve
::
curve_element
(
red_straight
,
west
)
,
36
PeanoCurve
::
curve_element
(
red_right_curve
,
north
)
,
37
PeanoCurve
::
curve_element
(
green_right_curve
,
east
)
,
38
PeanoCurve
::
curve_element
(
red_left_curve
,
north
)
,
39
},
40
// Replace "green_left_curve".
41
{
42
PeanoCurve
::
curve_element
(
green_straight
,
east
)
,
43
PeanoCurve
::
curve_element
(
green_left_curve
,
north
)
,
44
PeanoCurve
::
curve_element
(
red_left_curve
,
west
)
,
45
PeanoCurve
::
curve_element
(
green_right_curve
,
north
)
46
},
47
// Replace "red_left_curve".
48
{
49
PeanoCurve
::
curve_element
(
red_right_curve
,
south
)
,
50
PeanoCurve
::
curve_element
(
green_left_curve
,
east
)
,
51
PeanoCurve
::
curve_element
(
red_left_curve
,
north
)
,
52
PeanoCurve
::
curve_element
(
green_straight
,
north
)
53
},
54
// Replace "green_straight".
55
{
56
PeanoCurve
::
curve_element
(
green_left_curve
,
west
)
,
57
PeanoCurve
::
curve_element
(
red_right_curve
,
north
)
,
58
PeanoCurve
::
curve_element
(
green_right_curve
,
east
)
,
59
PeanoCurve
::
curve_element
(
red_left_curve
,
north
)
60
},
61
// Replace "red_straight".
62
{
63
PeanoCurve
::
curve_element
(
red_right_curve
,
east
)
,
64
PeanoCurve
::
curve_element
(
green_left_curve
,
north
)
,
65
PeanoCurve
::
curve_element
(
red_left_curve
,
west
)
,
66
PeanoCurve
::
curve_element
(
green_right_curve
,
north
)
67
}
68
},
69
// East replacements.
70
{
71
// Replace "green_right_curve".
72
{
73
PeanoCurve
::
curve_element
(
green_left_curve
,
west
)
,
74
PeanoCurve
::
curve_element
(
red_right_curve
,
north
)
,
75
PeanoCurve
::
curve_element
(
green_right_curve
,
east
)
,
76
PeanoCurve
::
curve_element
(
red_straight
,
east
)
77
},
78
// Replace "red_right_curve".
79
{
80
PeanoCurve
::
curve_element
(
red_straight
,
north
)
,
81
PeanoCurve
::
curve_element
(
red_right_curve
,
east
)
,
82
PeanoCurve
::
curve_element
(
green_right_curve
,
south
)
,
83
PeanoCurve
::
curve_element
(
red_left_curve
,
east
)
,
84
},
85
// Replace "green_left_curve".
86
{
87
PeanoCurve
::
curve_element
(
green_straight
,
south
)
,
88
PeanoCurve
::
curve_element
(
green_left_curve
,
east
)
,
89
PeanoCurve
::
curve_element
(
red_left_curve
,
north
)
,
90
PeanoCurve
::
curve_element
(
green_right_curve
,
east
)
91
},
92
// Replace "red_left_curve".
93
{
94
PeanoCurve
::
curve_element
(
red_right_curve
,
west
)
,
95
PeanoCurve
::
curve_element
(
green_left_curve
,
south
)
,
96
PeanoCurve
::
curve_element
(
red_left_curve
,
east
)
,
97
PeanoCurve
::
curve_element
(
green_straight
,
east
)
98
},
99
// Replace "green_straight".
100
{
101
PeanoCurve
::
curve_element
(
green_left_curve
,
north
)
,
102
PeanoCurve
::
curve_element
(
red_right_curve
,
east
)
,
103
PeanoCurve
::
curve_element
(
green_right_curve
,
south
)
,
104
PeanoCurve
::
curve_element
(
red_left_curve
,
east
)
105
},
106
// Replace "red_straight".
107
{
108
PeanoCurve
::
curve_element
(
red_right_curve
,
south
)
,
109
PeanoCurve
::
curve_element
(
green_left_curve
,
east
)
,
110
PeanoCurve
::
curve_element
(
red_left_curve
,
north
)
,
111
PeanoCurve
::
curve_element
(
green_right_curve
,
east
)
112
}
113
},
114
// South replacements.
115
{
116
// Replace "green_right_curve".
117
{
118
PeanoCurve
::
curve_element
(
green_left_curve
,
north
)
,
119
PeanoCurve
::
curve_element
(
red_right_curve
,
east
)
,
120
PeanoCurve
::
curve_element
(
green_right_curve
,
south
)
,
121
PeanoCurve
::
curve_element
(
red_straight
,
south
)
122
},
123
// Replace "red_right_curve".
124
{
125
PeanoCurve
::
curve_element
(
red_straight
,
east
)
,
126
PeanoCurve
::
curve_element
(
red_right_curve
,
south
)
,
127
PeanoCurve
::
curve_element
(
green_right_curve
,
west
)
,
128
PeanoCurve
::
curve_element
(
red_left_curve
,
south
)
,
129
},
130
// Replace "green_left_curve".
131
{
132
PeanoCurve
::
curve_element
(
green_straight
,
west
)
,
133
PeanoCurve
::
curve_element
(
green_left_curve
,
south
)
,
134
PeanoCurve
::
curve_element
(
red_left_curve
,
east
)
,
135
PeanoCurve
::
curve_element
(
green_right_curve
,
south
)
136
},
137
// Replace "red_left_curve".
138
{
139
PeanoCurve
::
curve_element
(
red_right_curve
,
north
)
,
140
PeanoCurve
::
curve_element
(
green_left_curve
,
west
)
,
141
PeanoCurve
::
curve_element
(
red_left_curve
,
south
)
,
142
PeanoCurve
::
curve_element
(
green_straight
,
south
)
143
},
144
// Replace "green_straight".
145
{
146
PeanoCurve
::
curve_element
(
green_left_curve
,
east
)
,
147
PeanoCurve
::
curve_element
(
red_right_curve
,
south
)
,
148
PeanoCurve
::
curve_element
(
green_right_curve
,
west
)
,
149
PeanoCurve
::
curve_element
(
red_left_curve
,
south
)
150
},
151
// Replace "red_straight".
152
{
153
PeanoCurve
::
curve_element
(
red_right_curve
,
west
)
,
154
PeanoCurve
::
curve_element
(
green_left_curve
,
south
)
,
155
PeanoCurve
::
curve_element
(
red_left_curve
,
east
)
,
156
PeanoCurve
::
curve_element
(
green_right_curve
,
south
)
157
}
158
},
159
// West replacements.
160
{
161
// Replace "green_right_curve".
162
{
163
PeanoCurve
::
curve_element
(
green_left_curve
,
east
)
,
164
PeanoCurve
::
curve_element
(
red_right_curve
,
south
)
,
165
PeanoCurve
::
curve_element
(
green_right_curve
,
west
)
,
166
PeanoCurve
::
curve_element
(
red_straight
,
west
)
167
},
168
// Replace "red_right_curve".
169
{
170
PeanoCurve
::
curve_element
(
red_straight
,
south
)
,
171
PeanoCurve
::
curve_element
(
red_right_curve
,
west
)
,
172
PeanoCurve
::
curve_element
(
green_right_curve
,
north
)
,
173
PeanoCurve
::
curve_element
(
red_left_curve
,
west
)
,
174
},
175
// Replace "green_left_curve".
176
{
177
PeanoCurve
::
curve_element
(
green_straight
,
north
)
,
178
PeanoCurve
::
curve_element
(
green_left_curve
,
west
)
,
179
PeanoCurve
::
curve_element
(
red_left_curve
,
south
)
,
180
PeanoCurve
::
curve_element
(
green_right_curve
,
west
)
181
},
182
// Replace "red_left_curve".
183
{
184
PeanoCurve
::
curve_element
(
red_right_curve
,
east
)
,
185
PeanoCurve
::
curve_element
(
green_left_curve
,
north
)
,
186
PeanoCurve
::
curve_element
(
red_left_curve
,
west
)
,
187
PeanoCurve
::
curve_element
(
green_straight
,
west
)
188
},
189
// Replace "green_straight".
190
{
191
PeanoCurve
::
curve_element
(
green_left_curve
,
south
)
,
192
PeanoCurve
::
curve_element
(
red_right_curve
,
west
)
,
193
PeanoCurve
::
curve_element
(
green_right_curve
,
north
)
,
194
PeanoCurve
::
curve_element
(
red_left_curve
,
west
)
195
},
196
// Replace "red_straight".
197
{
198
PeanoCurve
::
curve_element
(
red_right_curve
,
north
)
,
199
PeanoCurve
::
curve_element
(
green_left_curve
,
west
)
,
200
PeanoCurve
::
curve_element
(
red_left_curve
,
south
)
,
201
PeanoCurve
::
curve_element
(
green_right_curve
,
west
)
202
}
203
}
204
};
205
206
} }
core
peano_curve.cpp
Generated on Tue May 11 2021 17:16:11 for libjmmcg by
1.9.2