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
43331e55
Commit
43331e55
authored
Jul 02, 2018
by
Philip Trettner
Browse files
some rotate fixes
parent
1b68796e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Readme.md
View file @
43331e55
...
...
@@ -17,11 +17,9 @@ Best used with glm and glow.
*
Test self-adjacent faces
*
smart ranges: filter, map
*
mid-level topo API: edge-rotate-next/prev, edge-split, edge-collapse, halfedge-split, halfedge-collapse, vertex-collapse
*
annotate property preservation for mid-level topo API
*
vector, set, map -> range
*
opposite edges (from vertex)
*
cotangens weights etc.
*
smoothing
*
make handle.
<primitives>
() contain only valid ones and provide an all_
<primitives>
() version
*
boundary iterators
*
_copy versions of topological operations that copy attributes
\ No newline at end of file
src/polymesh/Mesh.cc
View file @
43331e55
...
...
@@ -192,6 +192,10 @@ void Mesh::assert_consistency() const
assert
(
h
.
next
().
vertex_from
()
==
h
.
vertex_to
());
assert
(
h
.
prev
().
vertex_to
()
==
h
.
vertex_from
());
auto
ref_face
=
h
.
face
();
for
(
auto
h
:
h
.
ring
())
assert
(
h
.
face
()
==
ref_face
);
}
// check vertex consistencies
...
...
src/polymesh/cursors.hh
View file @
43331e55
...
...
@@ -154,23 +154,7 @@ struct halfedge_handle : primitive_handle<halfedge_tag>
halfedge_handle
prev
()
const
;
halfedge_handle
opposite
()
const
;
face_handle
opposite_face
()
const
;
///< invalid if opposite boundary
};
/// ======== IMPLEMENTATION ========
template
<
class
tag
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
primitive_index
<
tag
>
const
&
v
)
{
out
<<
primitive
<
tag
>::
name
<<
" "
<<
v
.
value
;
if
(
v
.
is_invalid
())
out
<<
" (invalid)"
;
return
out
;
}
template
<
class
tag
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
primitive_handle
<
tag
>
const
&
v
)
{
out
<<
v
.
idx
;
return
out
;
}
halfedge_ring
ring
()
const
;
///< all half-edges along the same ring
};
}
src/polymesh/fwd.hh
View file @
43331e55
...
...
@@ -63,4 +63,6 @@ struct vertex_halfedge_in_ring;
struct
vertex_face_ring
;
struct
vertex_edge_ring
;
struct
vertex_vertex_ring
;
struct
halfedge_ring
;
}
src/polymesh/impl/impl_cursors.hh
View file @
43331e55
...
...
@@ -118,4 +118,22 @@ inline vertex_edge_ring vertex_handle::edges() const { return {*this}; }
inline
vertex_face_ring
vertex_handle
::
faces
()
const
{
return
{
*
this
};
}
inline
vertex_vertex_ring
vertex_handle
::
adjacent_vertices
()
const
{
return
{
*
this
};
}
inline
halfedge_ring
halfedge_handle
::
ring
()
const
{
return
{
*
this
};
}
template
<
class
tag
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
primitive_index
<
tag
>
const
&
v
)
{
out
<<
primitive
<
tag
>::
name
<<
" "
<<
v
.
value
;
if
(
v
.
is_invalid
())
out
<<
" (invalid)"
;
return
out
;
}
template
<
class
tag
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
primitive_handle
<
tag
>
const
&
v
)
{
out
<<
v
.
idx
;
return
out
;
}
}
src/polymesh/iterators.hh
View file @
43331e55
...
...
@@ -178,4 +178,11 @@ struct vertex_edge_circulator : primitive_circulator<vertex_edge_circulator>
edge_handle
operator
*
()
const
{
return
handle
.
edge
();
}
void
advance
()
{
handle
=
handle
.
opposite
().
next
();
}
};
struct
halfedge_ring_circulator
:
primitive_circulator
<
halfedge_ring_circulator
>
{
using
primitive_circulator
<
halfedge_ring_circulator
>::
primitive_circulator
;
halfedge_handle
operator
*
()
const
{
return
handle
;
}
void
advance
()
{
handle
=
handle
.
next
();
}
};
}
src/polymesh/ranges.hh
View file @
43331e55
...
...
@@ -366,6 +366,17 @@ struct vertex_primitive_ring : primitive_ring<vertex_primitive_ring<tag, circula
circulator
end
()
const
{
return
{
vertex
.
any_outgoing_halfedge
(),
true
};
}
};
template
<
class
tag
,
class
circulator
>
struct
halfedge_primitive_ring
:
primitive_ring
<
halfedge_primitive_ring
<
tag
,
circulator
>
,
tag
>
{
halfedge_handle
halfedge
;
halfedge_primitive_ring
(
halfedge_handle
h
)
{
halfedge
=
h
;
}
// Iteration:
circulator
begin
()
const
{
return
{
halfedge
,
false
};
}
circulator
end
()
const
{
return
{
halfedge
,
true
};
}
};
/// all vertices belonging to a face
struct
face_vertex_ring
:
face_primitive_ring
<
vertex_tag
,
face_vertex_circulator
>
{
...
...
@@ -420,4 +431,9 @@ struct vertex_face_ring : vertex_primitive_ring<face_tag, vertex_face_circulator
using
vertex_primitive_ring
<
face_tag
,
vertex_face_circulator
>::
vertex_primitive_ring
;
};
/// all half-edges along a ring (next -> next -> ...)
struct
halfedge_ring
:
halfedge_primitive_ring
<
halfedge_tag
,
halfedge_ring_circulator
>
{
using
halfedge_primitive_ring
<
halfedge_tag
,
halfedge_ring_circulator
>::
halfedge_primitive_ring
;
};
}
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