Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Hurstel
CGoGN
Commits
cb6cd448
Commit
cb6cd448
authored
Oct 28, 2011
by
Pierre Kraemer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
traversors2 updated
parent
d0f183b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
302 additions
and
5 deletions
+302
-5
include/Topology/generic/traversor1.h
include/Topology/generic/traversor1.h
+8
-0
include/Topology/generic/traversor2.h
include/Topology/generic/traversor2.h
+294
-5
No files found.
include/Topology/generic/traversor1.h
View file @
cb6cd448
...
...
@@ -30,6 +30,10 @@
namespace
CGoGN
{
/*******************************************************************************
VERTEX CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the edges incident to a given vertex
template
<
typename
MAP
>
class
Traversor1VE
...
...
@@ -103,6 +107,10 @@ public:
}
}
;
/*******************************************************************************
EDGE CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the vertices incident to a given edge
template
<
typename
MAP
>
class
Traversor1EV
...
...
include/Topology/generic/traversor2.h
View file @
cb6cd448
...
...
@@ -30,6 +30,10 @@
namespace
CGoGN
{
/*******************************************************************************
VERTEX CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the edges incident to a given vertex
template
<
typename
MAP
>
class
Traversor2VE
...
...
@@ -77,7 +81,7 @@ public:
if
(
current
!=
NIL
)
{
current
=
m
.
alpha1
(
current
)
;
if
(
m
.
isBoundarymarked
(
current
))
if
(
m
.
isBoundarymarked
(
current
))
// jump over a boundary face
current
=
m
.
alpha1
(
current
)
;
if
(
current
==
start
)
current
=
NIL
;
...
...
@@ -128,10 +132,183 @@ private:
public:
Traversor2VVaF
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
if
(
m
.
isBoundaryMarked
(
dart
))
dart
=
m
.
alpha1
(
dart
)
;
start
=
m
.
phi1
(
m
.
phi1
(
dart
))
;
if
(
start
==
dart
)
start
=
m
.
phi1
(
dart
)
;
stop
=
dart
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
phi1
(
current
)
;
if
(
current
==
stop
)
{
Dart
d
=
m
.
alpha1
(
current
)
;
if
(
m
.
isBoundaryMarked
(
d
))
// jump over a boundary face
d
=
m
.
alpha1
(
d
)
;
current
=
m
.
phi1
(
m
.
phi1
(
d
))
;
if
(
current
==
d
)
current
=
m
.
phi1
(
d
)
;
stop
=
d
;
}
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
/*******************************************************************************
EDGE CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the vertices incident to a given edge
template
<
typename
MAP
>
class
Traversor2EV
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2EV
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
phi2
(
current
)
;
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the faces incident to a given edge
template
<
typename
MAP
>
class
Traversor2EF
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2EF
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
phi2
(
current
)
;
if
(
current
==
start
||
m
.
isBoundaryMarked
(
current
))
// do not consider a boundary face
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the edges adjacent to a given edge through sharing a common vertex
template
<
typename
MAP
>
class
Traversor2EEaV
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
Dart
stop1
,
stop2
;
public:
Traversor2EEaV
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
alpha1
(
dart
)
;
stop1
=
dart
;
stop2
=
m
.
phi2
(
dart
)
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
alpha1
(
current
)
;
if
(
current
==
stop1
)
current
=
m
.
alpha1
(
stop2
)
;
else
if
(
current
==
stop2
)
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the edges adjacent to a given edge through sharing a common face
template
<
typename
MAP
>
class
Traversor2EEaF
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
Dart
stop1
,
stop2
;
public:
Traversor2EEaF
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
phi1
(
dart
)
;
stop
=
m
.
phi_1
(
dart
)
;
stop1
=
dart
;
stop2
=
m
.
phi2
(
dart
)
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
phi1
(
current
)
;
if
(
current
==
stop1
)
current
=
m
.
phi1
(
stop2
)
;
else
if
(
current
==
stop2
)
current
=
NIL
;
}
return
current
;
}
}
;
/*******************************************************************************
FACE CENTERED TRAVERSALS
*******************************************************************************/
// Traverse the vertices incident to a given face
template
<
typename
MAP
>
class
Traversor2FV
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2FV
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
...
...
@@ -140,11 +317,85 @@ public:
if
(
current
!=
NIL
)
{
current
=
m
.
phi1
(
current
)
;
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the edges incident to a given face
template
<
typename
MAP
>
class
Traversor2FE
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2FE
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
),
start
(
dart
)
{}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
phi1
(
current
)
;
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
// Traverse the faces adjacent to a given face through sharing a common vertex
template
<
typename
MAP
>
class
Traversor2FFaV
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
Dart
stop
;
public:
Traversor2FFaV
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
alpha1
(
m
.
alpha1
(
dart
))
;
current
=
start
;
if
(
start
==
dart
)
{
stop
=
m
.
alpha1
(
dart
)
;
start
=
next
()
;
}
stop
=
dart
;
if
(
m
.
isBoundaryMarked
(
start
))
start
=
next
()
;
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
current
=
m
.
alpha1
(
current
)
;
if
(
current
==
stop
)
{
Dart
d
=
m
.
phi2
(
current
)
;
current
=
m
.
phi1
(
d
)
;
stop
=
m
.
phi_1
(
d
)
;
Dart
d
=
m
.
phi1
(
current
)
;
current
=
m
.
alpha1
(
m
.
alpha1
(
d
))
;
if
(
current
==
d
)
{
stop
=
m
.
alpha1
(
d
)
;
return
next
()
;
}
stop
=
d
;
if
(
m
.
isBoundaryMarked
(
current
))
return
next
()
;
}
if
(
current
==
start
)
current
=
NIL
;
...
...
@@ -153,6 +404,44 @@ public:
}
}
;
// Traverse the faces adjacent to a given face through sharing a common edge
template
<
typename
MAP
>
class
Traversor2FFaE
{
private:
MAP
&
m
;
Dart
start
;
Dart
current
;
public:
Traversor2FFaE
(
MAP
&
map
,
Dart
dart
)
:
m
(
map
)
{
start
=
m
.
phi2
(
dart
)
;
while
(
start
!=
NIL
&&
m
.
isBoundaryMarked
(
start
))
{
start
=
m
.
phi2
(
m
.
phi1
(
m
.
phi2
(
start
)))
;
if
(
start
==
m
.
phi2
(
dart
))
start
=
NIL
;
}
}
Dart
begin
()
{
current
=
start
;
return
current
;
}
Dart
end
()
{
return
NIL
;
}
Dart
next
()
{
if
(
current
!=
NIL
)
{
do
{
current
=
m
.
phi2
(
m
.
phi1
(
m
.
phi2
(
current
)))
;
}
while
(
m
.
isBoundaryMarked
(
current
))
;
if
(
current
==
start
)
current
=
NIL
;
}
return
current
;
}
}
;
}
// namespace CGoGN
#endif
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