Mercurial > gemma
comparison pkg/mesh/vertex.go @ 5416:31b0e865e7a0 marking-single-beam
Stored marking points in database.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 07 Jul 2021 14:57:30 +0200 |
parents | 99f32f0dc70c |
children | e89ff1894bb4 |
comparison
equal
deleted
inserted
replaced
5415:4ad68ab239b7 | 5416:31b0e865e7a0 |
---|---|
1134 return out | 1134 return out |
1135 } | 1135 } |
1136 | 1136 |
1137 // FilterRemoved returns an iterator that only delivers the vertices | 1137 // FilterRemoved returns an iterator that only delivers the vertices |
1138 // which indices are not marked as removed. | 1138 // which indices are not marked as removed. |
1139 func (mpz MultiPointZ) FilterRemoved(removed map[int]struct{}) func() (Vertex, bool) { | 1139 func (mpz MultiPointZ) FilterRemoved(removed map[int32]struct{}) func() (Vertex, bool) { |
1140 var idx int | 1140 var idx int32 |
1141 return func() (Vertex, bool) { | 1141 return func() (v Vertex, ok bool) { |
1142 for { | 1142 for { |
1143 if idx >= len(mpz) { | 1143 if idx >= int32(len(mpz)) { |
1144 return Vertex{}, false | 1144 ok = false |
1145 return | |
1145 } | 1146 } |
1146 if _, rm := removed[idx]; rm { | 1147 if _, rm := removed[idx]; rm { |
1147 idx++ | 1148 idx++ |
1148 continue | 1149 continue |
1149 } | 1150 } |
1150 break | 1151 break |
1151 } | 1152 } |
1152 return mpz[idx], true | 1153 v, ok = mpz[idx], true |
1154 idx++ | |
1155 return | |
1153 } | 1156 } |
1154 } | 1157 } |
1155 | 1158 |
1156 // MinMaxVertex runs over a point iterator and figures out its boundary. | 1159 // MinMaxVertex runs over a point iterator and figures out its boundary. |
1157 func MinMaxVertex(points func() (Vertex, bool)) (Vertex, Vertex) { | 1160 func MinMaxVertex(points func() (Vertex, bool)) (Vertex, Vertex) { |