Line data Source code
1 5 : remove!(mesh::Mesh, v::VHnd) = removevertex!(mesh, v)
2 2 : remove!(mesh::Mesh, f::FHnd) = removeface!(mesh, f)
3 3 : remove!(mesh::Mesh, e::EHnd) = removeedge!(mesh, e)
4 3 : remove!(h::Tuple{Mesh, Hnd{S}}) where {S} = remove!(h...)
5 :
6 : """
7 : remove!(mesh, handle)
8 :
9 : Uniform interface for removing vertices, faces, and edges.
10 :
11 : See also [Convenience API](@ref)
12 : """ remove!
13 :
14 2 : mayremove(mesh::Mesh, e::EHnd) = mayremoveedge(mesh, e)
15 1 : mayremove(h::Tuple{Mesh, EHnd}) = mayremoveedge(h...)
16 :
17 : """
18 : mayremove(mesh, handle)
19 :
20 : Synonym for [`mayremoveedge`](@ref)
21 :
22 : See also [Convenience API](@ref)
23 : """ mayremove
24 :
25 :
26 : #-----------------------------------------------------------------------------
27 :
28 67 : Base.bind(mesh::Mesh{V, F, H, E}, h::Hnd{S}) where {V, F, H, E, S} = (mesh, h)
29 :
30 1 : Base.bind(h0::Tuple{Mesh{V, F, H, E}, Hnd{S}},
31 : h::Hnd{S}) where {V, F, H, E, S} = (h0[1], h)
32 :
33 29 : Base.bind(f::Base.Callable, mesh::Mesh{V, F, H, E}) where {V, F, H, E} =
34 626 : x -> f(mesh, x)
35 :
36 : """
37 : ch = bind(mesh, h::H) :: Tuple{Mesh, H}
38 :
39 : Bind handle `h` to `mesh`.
40 :
41 : fm = bind(f, mesh)
42 :
43 : Bind `mesh` as first argument to function `f`.
44 :
45 : See also [Convenience API](@ref)
46 : """ bind
47 :
48 : # Base.show(io, h::Tuple{Mesh, Hnd}) = show(io, "m->$(handle(h))")
49 :
50 5 : handle(h::Tuple{Mesh, Hnd{S}}) where {S} = h[2]
51 1 : VHnd(h::Tuple{Mesh, VHnd}) = handle(h) :: VHnd
52 1 : FHnd(h::Tuple{Mesh, FHnd}) = handle(h) :: FHnd
53 1 : HHnd(h::Tuple{Mesh, HHnd}) = handle(h) :: HHnd
54 1 : EHnd(h::Tuple{Mesh, EHnd}) = handle(h) :: EHnd
55 :
56 : #-----------------------------------------------------------------------------
57 :
58 1 : isused(h::Tuple{Mesh, Hnd{H}}) where {H} = isused(h...)
59 1 : isisolated(h::Tuple{Mesh, VHnd}) = isisolated(h...)
60 1 : isboundary(h::Tuple{Mesh, VHnd}) = isboundary(h...)
61 2 : ismanifold(h::Tuple{Mesh, VHnd}; kw...) = ismanifold(h...; kw...)
62 2 : isinner(h::Tuple{Mesh, VHnd}; kw...) = isinner(h...; kw...)
63 :
64 1 : degree(h::Tuple{Mesh, VHnd}) = degree(h...)
65 1 : degree(h::Tuple{Mesh, FHnd}) = degree(h...)
66 1 : istriangle(h::Tuple{Mesh, FHnd}) = istriangle(h...)
67 1 : isquad(h::Tuple{Mesh, FHnd}) = isquad(h...)
68 :
69 1 : opposite(h::Tuple{Mesh, HHnd}) = (h[1], opposite(h...))
70 1 : next(h::Tuple{Mesh, HHnd}) = (h[1], next(h...))
71 1 : nextinstar(h::Tuple{Mesh, HHnd}) = (h[1], nextinstar(h...))
72 1 : prev(h::Tuple{Mesh, HHnd}) = (h[1], prev(h...))
73 1 : previnstar(h::Tuple{Mesh, HHnd}) = (h[1], previnstar(h...))
74 1 : cw(h::Tuple{Mesh, HHnd}) = (h[1], cw(h...))
75 1 : ccw(h::Tuple{Mesh, HHnd}) = (h[1], ccw(h...))
76 :
77 1 : source(h::Tuple{Mesh, HHnd}) = (h[1], source(h...))
78 1 : destination(h::Tuple{Mesh, HHnd}) = (h[1], destination(h...))
79 :
80 : #-----------------------------------------------------------------------------
81 :
82 1 : vertices(h::Tuple{Mesh, FHnd}) = vertices(h...)
83 1 : vertices(h::Tuple{Mesh, HHnd}) = vertices(h...)
84 1 : vertices(h::Tuple{Mesh, EHnd}) = vertices(h...)
85 :
86 1 : halfedge(h::Tuple{Mesh, VHnd}) = (h[1], halfedge(h...))
87 1 : halfedge(h::Tuple{Mesh, FHnd}) = (h[1], halfedge(h...))
88 :
89 1 : function halfedges(h::Tuple{Mesh, HHnd})
90 1 : h0, h1 = halfedges(h...)
91 1 : (h[1], h0), (h[1], h1)
92 : end
93 :
94 1 : function halfedges(h::Tuple{Mesh, EHnd})
95 1 : h0, h1 = halfedges(h...)
96 1 : (h[1], h0), (h[1], h1)
97 : end
98 :
99 1 : face(h::Tuple{Mesh, FHnd}) = face(h...)
100 1 : triangle(h::Tuple{Mesh, FHnd}) = triangle(h...)
101 1 : quad(h::Tuple{Mesh, FHnd}) = quad(h...)
102 :
103 : #-----------------------------------------------------------------------------
104 :
105 1 : star(h::Tuple{Mesh, VHnd}) = star(h...)
106 1 : ring(h::Tuple{Mesh, VHnd}) = ring(h...)
107 1 : fan(h::Tuple{Mesh, VHnd}) = fan(h...)
108 :
109 : #-----------------------------------------------------------------------------
110 :
111 1 : flip!(h::Tuple{Mesh, HHnd}) = flip!(h...)
112 1 : flip!(h::Tuple{Mesh, EHnd}) = flip!(h...)
113 1 : mayflip(h::Tuple{Mesh, HHnd}) = mayflip(h...)
114 1 : mayflip(h::Tuple{Mesh, EHnd}) = mayflip(h...)
115 :
116 1 : collapse!(h::Tuple{Mesh, HHnd}) = collapse!(h...)
117 1 : maycollapse(h::Tuple{Mesh, HHnd}) = maycollapse(h...)
118 :
119 : """
120 : insert!((mesh, h0), h1) :: Tuple(Mesh, HHnd)
121 :
122 : Synonym for
123 :
124 : insertedge!(mesh, h0, HHnd(h1))
125 :
126 : See also [Convenience API](@ref), [`insertedge!`](@ref)
127 : """
128 1 : Base.insert!(h0::Tuple{Mesh, HHnd}, h1) = insertedge!(h0..., HHnd(h1))
129 :
130 1 : split!(h::Tuple{Mesh, HHnd}, args...) = split!(h..., args...)
131 1 : split!(h::Tuple{Mesh, EHnd}, args...) = split!(h..., args...)
132 1 : split!(h::Tuple{Mesh, FHnd}, args...) = split!(h..., args...)
133 :
134 : #-----------------------------------------------------------------------------
135 :
136 : # TODO: why does Base.show(io, mh::Tuple{Mesh, Hnd}) not work? --> Hnd{S} where {S}?!
|