6#ifndef DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
7#define DUNE_GRID_IO_FILE_VTK_CORNERITERATOR_HH
11#include <dune/common/iteratorfacades.hh>
12#include <dune/common/typetraits.hh>
14#include <dune/geometry/referenceelements.hh>
16#include <dune/grid/io/file/vtk/corner.hh>
30 template<
typename CellIterator>
32 :
public ForwardIteratorFacade
33 < CornerIterator<CellIterator>,
34 const Corner<typename std::remove_const<typename std::iterator_traits<
35 CellIterator>::value_type>::type>,
36 const Corner<typename std::remove_const<typename std::iterator_traits<
37 CellIterator>::value_type>::type>&,
38 typename std::iterator_traits<CellIterator>::difference_type>
43 typedef VTK::Corner<
typename std::remove_const<
typename std::iterator_traits<
44 CellIterator>::value_type>::type>
Corner;
47 typedef typename std::iterator_traits<CellIterator>::difference_type
50 typedef typename std::iterator_traits<CellIterator>::value_type::Geometry::ctype
52 static const unsigned dim = std::iterator_traits<CellIterator>::
53 value_type::mydimension;
54 typedef ReferenceElements<ctype, dim> Refelems;
58 DifferenceType> Facade;
69 bool isDereferencable()
const {
70 return cellit != cellend;
74 bool mePassedTheEnd = !isDereferencable();
75 bool otherPassedTheEnd = !other.isDereferencable();
77 if(mePassedTheEnd && otherPassedTheEnd)
return true;
79 if(mePassedTheEnd || otherPassedTheEnd)
return false;
81 return cellit == other.cellit &&
88 if(index == Refelems::general(cellit->type()).size(dim)) {
90 if(cellit != cellend) {
106 unsigned vtkIndex = 0)
107 : cellit(cellit_), cellend(cellend_)
109 if(cellit != cellend) {
110 corner.
cell(*cellit);
119 : cellit(cellend_), cellend(cellend_)
iterate over the corners of some cell range
Definition: corneriterator.hh:39
CornerIterator(const CellIterator &cellit_, const CellIterator &cellend_, unsigned vtkIndex=0)
construct a CornerIterator
Definition: corneriterator.hh:105
CornerIterator(const CellIterator &cellend_)
construct a CornerIterator
Definition: corneriterator.hh:118
simple class representing a corner of a cell
Definition: corner.hh:25
unsigned vtkIndex() const
get the index of the corner within the cell in VTK-numbering
Definition: corner.hh:63
unsigned duneIndex() const
get the index of the corner within the cell in Dune-numbering
Definition: corner.hh:55
const Cell & cell() const
get reference to the cell
Definition: corner.hh:46
Include standard header files.
Definition: agrid.hh:60