*/
/**
- * Iterator to the first used vertex.
+ * Iterator to the first used vertex. This function can only be used if dim is
+ * not one.
*/
vertex_iterator begin_vertex() const;
/**
* Iterator to the first active vertex. Because all vertices are active,
- * begin_vertex() and begin_active_vertex() return the same vertex.
+ * begin_vertex() and begin_active_vertex() return the same vertex. This
+ * function can only be used if dim is not one.
*/
active_vertex_iterator begin_active_vertex() const;
/**
* Iterator past the end; this iterator serves for comparisons of iterators
- * with past-the-end or before-the-beginning states.
+ * with past-the-end or before-the-beginning states. This function can only be
+ * used if dim is not one.
*/
vertex_iterator end_vertex() const;
* The global vertex index of the vertex this object corresponds to.
*/
unsigned int global_vertex_index;
+
+private:
+
+ template <typename Accessor> friend class TriaRawIterator;
+ template <typename Accessor> friend class TriaIterator;
+ template <typename Accessor> friend class TriaActiveIterator;
};
TriaAccessor<0, dim, spacedim>::operator -- ()
{
if (global_vertex_index!=numbers::invalid_unsigned_int)
- --global_vertex_index;
+ {
+ --global_vertex_index;
+ if (global_vertex_index==static_cast<unsigned int>(-1))
+ global_vertex_index = numbers::invalid_unsigned_int;
+ }
}
{
if (dim==1)
{
+ // This does not work if dim==1 because TriaAccessor<0,1,spacedim> does not
+ // implement operator++
Assert(false, ExcNotImplemented());
return raw_vertex_iterator();
}
0);
if (i.state() != IteratorState::valid)
return i;
+ // This loop will end because every triangulation has used vertices.
while (i->used() == false)
if ((++i).state() != IteratorState::valid)
return i;