Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
LEFEBVREJP email
radix
Commits
3e696274
Commit
3e696274
authored
Jun 23, 2018
by
LEFEBVREJP email
Browse files
Fixing states 5 and 10 to ensure clock-wise walk.
parent
2f73167c
Pipeline
#13843
failed with stages
in 6 minutes and 38 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
radixalgorithm/marchingsquares.i.hh
View file @
3e696274
...
...
@@ -97,8 +97,6 @@ std::vector<std::pair<int, int>> MarchingSquares<data_type>::march(
// of rows and columns to allow for traveling the boundaries
if
(
column
>=
0
&&
column
<=
mColumns
&&
row
>=
0
&&
row
<=
mRows
)
{
radix_tagged_line
(
"("
<<
row
<<
", "
<<
column
<<
") ="
<<
int
(
next_step
));
out
.
push_back
({
row
,
column
});
}
...
...
@@ -206,10 +204,7 @@ void MarchingSquares<data_type>::step(size_t r, size_t c)
next_step
=
StepDirection
::
Left
;
break
;
case
2
:
if
(
prev_step
==
StepDirection
::
Left
)
next_step
=
StepDirection
::
Up
;
else
next_step
=
StepDirection
::
Right
;
break
;
case
3
:
next_step
=
StepDirection
::
Left
;
...
...
@@ -218,57 +213,54 @@ void MarchingSquares<data_type>::step(size_t r, size_t c)
next_step
=
StepDirection
::
Right
;
break
;
case
5
:
next_step
=
StepDirection
::
Up
;
break
;
case
6
:
if
(
prev_step
==
StepDirection
::
Down
)
next_step
=
StepDirection
::
Down
;
next_step
=
StepDirection
::
Right
;
else
next_step
=
StepDirection
::
Left
;
break
;
case
6
:
next_step
=
StepDirection
::
Up
;
break
;
case
7
:
if
(
prev_step
==
StepDirection
::
Up
)
next_step
=
StepDirection
::
Left
;
else
next_step
=
StepDirection
::
Down
;
break
;
case
8
:
next_step
=
StepDirection
::
Down
;
break
;
case
9
:
if
(
prev_step
==
StepDirection
::
Down
)
next_step
=
StepDirection
::
Down
;
else
next_step
=
StepDirection
::
Up
;
break
;
case
10
:
if
(
prev_step
==
StepDirection
::
Left
)
next_step
=
StepDirection
::
Down
;
else
next_step
=
StepDirection
::
Up
;
break
;
case
11
:
if
(
prev_step
==
StepDirection
::
Left
)
next_step
=
StepDirection
::
Down
;
else
next_step
=
StepDirection
::
Right
;
break
;
case
12
:
next_step
=
StepDirection
::
Right
;
break
;
case
13
:
if
(
prev_step
==
StepDirection
::
Down
)
next_step
=
StepDirection
::
Right
;
else
next_step
==
StepDirection
::
Up
;
break
;
case
14
:
if
(
prev_step
==
StepDirection
::
Down
)
next_step
=
StepDirection
::
Left
;
else
next_step
=
StepDirection
::
Up
;
break
;
default:
next_step
=
StepDirection
::
None
;
break
;
}
radix_tagged_line
(
"("
<<
r
<<
", "
<<
c
<<
") ="
<<
state
<<
" "
<<
((
next_step
==
StepDirection
::
Up
)
?
"Up"
:
((
next_step
==
StepDirection
::
Down
)
?
"Down"
:
(
next_step
==
StepDirection
::
Left
)
?
"Left"
:
"Right"
)));
}
}
// namespace radix
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment