3#ifndef DUNE_GEOGRID_INTERSECTIONITERATOR_HH
4#define DUNE_GEOGRID_INTERSECTIONITERATOR_HH
6#include <dune/grid/geometrygrid/entitypointer.hh>
7#include <dune/grid/geometrygrid/intersection.hh>
18 template<
class Gr
id,
class HostIntersectionIterator >
19 class IntersectionIterator
21 typedef typename remove_const< Grid >::type::Traits Traits;
23 typedef GeoGrid::Intersection< Grid, typename HostIntersectionIterator::Intersection > IntersectionImpl;
25 typedef typename Traits::template Codim< 0 >::EntityPointerImpl EntityPointerImpl;
26 typedef typename Traits::template Codim< 0 >::Geometry ElementGeometry;
31 typedef typename Traits::template Codim< 0 >::EntityPointer EntityPointer;
33 template<
class Entity >
34 IntersectionIterator (
const Entity &inside,
35 const HostIntersectionIterator &hostIterator )
36 : hostIterator_( hostIterator ),
37 intersection_( IntersectionImpl( inside.geometry() ) )
40 IntersectionIterator (
const IntersectionIterator &other )
41 : hostIterator_( other.hostIterator_ ),
42 intersection_( IntersectionImpl( Grid::getRealImplementation( other.intersection_ ) ) )
45 IntersectionIterator &operator= (
const IntersectionIterator &other )
47 hostIterator_ = other.hostIterator_;
48 Grid::getRealImplementation( intersection_ ) = Grid::getRealImplementation( other.intersection_ );
52 bool equals (
const IntersectionIterator &other )
const
54 return (hostIterator_ == other.hostIterator_);
60 intersectionImpl().invalidate();
63 const Intersection &dereference ()
const
65 if( !intersectionImpl() )
66 intersectionImpl().initialize( *hostIterator_ );
71 IntersectionImpl &intersectionImpl ()
const
73 return Grid::getRealImplementation( intersection_ );
76 HostIntersectionIterator hostIterator_;
77 mutable Intersection intersection_;
Dune namespace.
Definition: alignment.hh:14