OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
extent_iterator.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 // Copyright (C) 2003-2010 by the IPLT authors
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License as published by the Free
9 // Software Foundation; either version 3.0 of the License, or (at your option)
10 // any later version.
11 // This library is distributed in the hope that it will be useful, but WITHOUT
12 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 // details.
15 //
16 // You should have received a copy of the GNU Lesser General Public License
17 // along with this library; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 //------------------------------------------------------------------------------
20 
21 /*
22  iterate over a volume defined by an extent
23 
24  Author: Ansgar Philippsen
25 */
26 
27 #ifndef IMG_EXTENT_ITERATOR_H
28 #define IMG_EXTENT_ITERATOR_H
29 
30 #include "point.hh"
31 #include "data.hh"
32 
33 namespace ost { namespace img {
34 
35 class Extent;
36 
38 
53  public:
55  explicit ExtentIterator(const Extent& b, unsigned int domain=SPATIAL);
56 
59 
61  ExtentIterator& operator=(const ExtentIterator& p);
62 
64  ExtentIterator& operator++();
65 
67  ExtentIterator operator++(int);
68 
70  ExtentIterator& operator--();
71 
73  ExtentIterator operator--(int);
74 
76  void Inc();
77 
79  void Dec();
80 
82  ExtentIterator& ToStart();
83 
85  ExtentIterator& ToEnd();
86 
88  Extent GetExtent() const;
89 
91  const Point &GetStart() const;
92 
94  const Point &GetEnd() const;
95 
97  bool AtEnd() const;
98 
100  bool AtStart() const;
101 
103  int operator[](int i) const;
104 
105  operator Point() const;
106 
107  private:
108  Point start_, end_, current_,startpos_;
109 };
110 
111 }} // namespace img
112 
113 #endif
Defines lower and upper valid indices.
Definition: extent.hh:60
class encapsulating 1D to 3D point
Definition: point.hh:43
#define DLLEXPORT_OST_IMG_BASE