dune-grid  2.3.1
corner.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 
4 #ifndef DUNE_GRID_IO_FILE_VTK_CORNER_HH
5 #define DUNE_GRID_IO_FILE_VTK_CORNER_HH
6 
8 
9 namespace Dune
10 {
13 
14  namespace VTK {
15 
17 
22  template<typename Cell>
23  class Corner {
24  // store a pointer to the element
25  const Cell* cell_;
26  // store index of the corner within element (Dune numbering)
27  unsigned index;
28 
29  public:
31 
36  Corner(const Cell& cell, unsigned duneIndex)
37  : cell_(&cell), index(duneIndex)
38  { }
39 
41  Corner() { }
42 
44  const Cell& cell() const { return *cell_; }
46 
50  void cell(const Cell& cell__) { cell_ = &cell__; index = 0; }
51 
53  unsigned duneIndex() const { return index; }
55  void duneIndex(unsigned i) { index = i; }
56 
58 
61  unsigned vtkIndex() const { return renumber(cell_->type(), index); }
63 
66  void vtkIndex(unsigned i) { index = renumber(cell_->type(), i); }
67  };
68 
69  } // namespace VTK
70 
72 
73 } // namespace Dune
74 
75 #endif // DUNE_GRID_IO_FILE_VTK_CORNER_HH