Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
polymesh
Commits
6292e574
Commit
6292e574
authored
Sep 20, 2018
by
Philip Trettner
Browse files
Merge commit '
de48ee7e
'
parents
8704b964
de48ee7e
Changes
2
Show whitespace changes
Inline
Side-by-side
src/polymesh/bind.hh
View file @
6292e574
...
...
@@ -9,25 +9,25 @@
namespace
polymesh
{
template
<
class
FuncT
,
class
...
Args
>
auto
fbind
(
FuncT
&&
f
,
Args
...
args
)
auto
fbind
(
FuncT
&&
f
,
Args
...
args
)
->
decltype
(
f
(
std
::
declval
<
face_handle
>
(),
std
::
forward
<
Args
>
(
args
)...))
{
return
[
&
](
face_handle
h
)
{
return
f
(
h
,
std
::
forward
<
Args
>
(
args
)...);
};
}
template
<
class
FuncT
,
class
...
Args
>
auto
vbind
(
FuncT
&&
f
,
Args
...
args
)
auto
vbind
(
FuncT
&&
f
,
Args
...
args
)
->
decltype
(
f
(
std
::
declval
<
vertex_handle
>
(),
std
::
forward
<
Args
>
(
args
)...))
{
return
[
&
](
vertex_handle
h
)
{
return
f
(
h
,
std
::
forward
<
Args
>
(
args
)...);
};
}
template
<
class
FuncT
,
class
...
Args
>
auto
ebind
(
FuncT
&&
f
,
Args
...
args
)
auto
ebind
(
FuncT
&&
f
,
Args
...
args
)
->
decltype
(
f
(
std
::
declval
<
edge_handle
>
(),
std
::
forward
<
Args
>
(
args
)...))
{
return
[
&
](
edge_handle
h
)
{
return
f
(
h
,
std
::
forward
<
Args
>
(
args
)...);
};
}
template
<
class
FuncT
,
class
...
Args
>
auto
hbind
(
FuncT
&&
f
,
Args
...
args
)
auto
hbind
(
FuncT
&&
f
,
Args
...
args
)
->
decltype
(
f
(
std
::
declval
<
halfedge_handle
>
(),
std
::
forward
<
Args
>
(
args
)...))
{
return
[
&
](
halfedge_handle
h
)
{
return
f
(
h
,
std
::
forward
<
Args
>
(
args
)...);
};
}
...
...
src/polymesh/detail/topology_iterator.hh
View file @
6292e574
...
...
@@ -40,21 +40,21 @@ struct bfs_range
return
queue
.
empty
()
?
handle_t
()
:
queue
.
front
().
of
(
mesh
);
}
template
<
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
_t
,
vertex_handle
>
::
value
>::
type
>
template
<
class
handle
=
handle_t
,
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
,
vertex_handle
>
::
value
>::
type
>
void
expand
(
vertex_handle
v
)
{
for
(
auto
vv
:
v
.
adjacent_vertices
())
if
(
seen
.
insert
(
vv
))
queue
.
push
(
vv
);
}
template
<
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
_t
,
face_handle
>
::
value
>::
type
>
template
<
class
handle
=
handle_t
,
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
,
face_handle
>
::
value
>::
type
>
void
expand
(
face_handle
f
)
{
for
(
auto
ff
:
f
.
adjacent_faces
())
if
(
ff
.
is_valid
()
&&
seen
.
insert
(
ff
))
queue
.
push
(
ff
);
}
template
<
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
_t
,
edge_handle
>
::
value
>::
type
>
template
<
class
handle
=
handle_t
,
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
,
edge_handle
>
::
value
>::
type
>
void
expand
(
edge_handle
e
)
{
for
(
auto
ee
:
e
.
vertexA
().
edges
())
...
...
@@ -65,7 +65,7 @@ struct bfs_range
if
(
seen
.
insert
(
ee
))
queue
.
push
(
ee
);
}
template
<
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
_t
,
halfedge_handle
>
::
value
>::
type
>
template
<
class
handle
=
handle_t
,
class
Enabled
=
typename
std
::
enable_if
<
std
::
is_same
<
handle
,
halfedge_handle
>
::
value
>::
type
>
void
expand
(
halfedge_handle
h
)
{
for
(
auto
hh
:
h
.
vertex_to
().
outgoing_halfedges
())
...
...
Write
Preview
Supports
Markdown
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