dune-grid  2.1.1
corner.hh
Go to the documentation of this file.
00001 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002 // vi: set et ts=8 sw=2 sts=2:
00003 
00004 #ifndef DUNE_GRID_IO_FILE_VTK_CORNER_HH
00005 #define DUNE_GRID_IO_FILE_VTK_CORNER_HH
00006 
00007 #include <dune/grid/io/file/vtk/common.hh>
00008 
00009 namespace Dune
00010 {
00013 
00014   namespace VTK {
00015 
00017 
00022     template<typename Cell>
00023     class Corner {
00024       // store a pointer to the element
00025       const Cell* cell_;
00026       // store index of the corner within element (Dune numbering)
00027       unsigned index;
00028 
00029     public:
00031 
00036       Corner(const Cell& cell, unsigned duneIndex)
00037         : cell_(&cell), index(duneIndex)
00038       { }
00039 
00041       Corner() { }
00042 
00044       const Cell& cell() const { return *cell_; }
00046 
00050       void cell(const Cell& cell__) { cell_ = &cell__; index = 0; }
00051 
00053       unsigned duneIndex() const { return index; }
00055       void duneIndex(unsigned i) { index = i; }
00056 
00058 
00061       unsigned vtkIndex() const { return renumber(cell_->type(), index); }
00063 
00066       void vtkIndex(unsigned i) { index = renumber(cell_->type(), i); }
00067     };
00068 
00069   } // namespace VTK
00070 
00072 
00073 } // namespace Dune
00074 
00075 #endif // DUNE_GRID_IO_FILE_VTK_CORNER_HH