DEAL_II_NAMESPACE_OPEN
template <int dim, int spacedim> class Triangulation;
+template <int, int, int> class TriaAccessorBase;
template <typename> class TriaRawIterator;
template <typename> class TriaIterator;
-
// note: in non-debug mode, i.e. with optimizations, the file
// tria_iterator.templates.h is included at the end of this file.
// this includes a lot of templates and thus makes compilation
template <typename OtherAccessor>
TriaRawIterator (const TriaRawIterator<OtherAccessor> &i);
+ /**
+ * Another conversion operator,
+ * where we use the pointers to
+ * the Triangulation from a
+ * TriaAccessorBase object, while
+ * the additional data is used
+ * according to the actual type
+ * of Accessor.
+ */
+ TriaRawIterator (const TriaAccessorBase<Accessor::structure_dimension,Accessor::dimension,Accessor::space_dimension>& tria_accessor,
+ const typename Accessor::AccessorData *local_data);
+
/**
* Conversion constructor. Same
* as above with the difference
* version.
*/
Accessor & operator * ();
-
+
/**
* Dereferencing operator, returns a
* reference of the cell pointed to.
* version.
*/
Accessor * operator -> ();
+
+
+ /**
+ * In order be able to assign
+ * end-iterators for different
+ * accessors to each other, we
+ * need an access function which
+ * returns the accessor
+ * regardless of its state.
+ *
+ * @warning This function should
+ * not be used in application
+ * programs. It is only intended
+ * for limited purposes inside
+ * the library and it makes
+ * debugging much harder.
+ */
+ const Accessor& access_any () const;
+
/*@}*/
/**
template <typename OtherAccessor>
TriaIterator (const TriaIterator<OtherAccessor> &i);
+ /**
+ * Another conversion operator,
+ * where we use the pointers to
+ * the Triangulation from a
+ * TriaAccessorBase object, while
+ * the additional data is used
+ * according to the actual type
+ * of Accessor.
+ */
+ TriaIterator (const TriaAccessorBase<Accessor::structure_dimension,Accessor::dimension,Accessor::space_dimension>& tria_accessor,
+ const typename Accessor::AccessorData *local_data);
+
/**
* Similar conversion operator to the above
* one, but does a check whether the
template <typename OtherAccessor>
TriaActiveIterator (const TriaActiveIterator<OtherAccessor> &i);
+ /**
+ * Another conversion operator,
+ * where we use the pointers to
+ * the Triangulation from a
+ * TriaAccessorBase object, while
+ * the additional data is used
+ * according to the actual type
+ * of Accessor.
+ */
+ TriaActiveIterator (const TriaAccessorBase<Accessor::structure_dimension,Accessor::dimension,Accessor::space_dimension>& tria_accessor,
+ const typename Accessor::AccessorData *local_data);
+
/**
* Similar conversion operator to the above
* one, but does a check whether the
+template <typename Accessor>
+inline
+const Accessor &
+TriaRawIterator<Accessor>::access_any () const
+{
+ return accessor;
+}
+
+
+
template <typename Accessor>
inline
const Accessor *
{}
+template <typename Accessor>
+inline
+TriaRawIterator<Accessor>::TriaRawIterator (
+ const TriaAccessorBase<Accessor::structure_dimension,Accessor::dimension,Accessor::space_dimension>& tria_accessor,
+ const typename Accessor::AccessorData *local_data)
+ :
+ accessor(0, -2, -2, local_data)
+{
+ accessor.copy_from(tria_accessor);
+}
+
+
template <typename Accessor>
inline
TriaRawIterator<Accessor> &
}
+template <typename Accessor>
+inline
+TriaIterator<Accessor>::TriaIterator (
+ const TriaAccessorBase<Accessor::structure_dimension,Accessor::dimension,Accessor::space_dimension>& tria_accessor,
+ const typename Accessor::AccessorData *local_data)
+ : TriaRawIterator<Accessor> (tria_accessor, local_data)
+{
+#ifdef DEBUG
+ // do this like this, because:
+ // if we write
+ // "Assert (IteratorState::past_the_end || used)"
+ // used() is called anyway, even if
+ // state==IteratorState::past_the_end, and will then
+ // throw the exception!
+ if (this->state() != IteratorState::past_the_end)
+ Assert (this->accessor.used(),
+ ExcAssignmentOfUnusedObject());
+#endif
+}
+
+
template <typename Accessor>
inline
TriaIterator<Accessor> &
}
+template <typename Accessor>
+inline
+TriaActiveIterator<Accessor>::TriaActiveIterator (
+ const TriaAccessorBase<Accessor::structure_dimension,Accessor::dimension,Accessor::space_dimension>& tria_accessor,
+ const typename Accessor::AccessorData *local_data)
+ : TriaIterator<Accessor> (tria_accessor, local_data)
+{
+#ifdef DEBUG
+ // do this like this, because:
+ // if we write
+ // "Assert (IteratorState::past_the_end || !has_children())"
+ // has_children() is called anyway, even if
+ // state==IteratorState::past_the_end, and will then
+ // throw the exception!
+ if (this->state() != IteratorState::past_the_end)
+ Assert (this->accessor.has_children()==false,
+ ExcAssignmentOfInactiveObject());
+#endif
+}
+
+
template <typename Accessor>
inline
TriaActiveIterator<Accessor> &