OpenStructure
line_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-2020 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  Authors: Ansgar Philippsen, Giani Signorell
23 */
24 
25 #ifndef IMG_ALG_FILTER_LINE_ITERATOR_H
26 #define IMG_ALG_FILTER_LINE_ITERATOR_H
27 
29 #include <ost/img/extent.hh>
30 
31 namespace ost { namespace img {
32 
33 class ExtentIterator;
34 
35 namespace alg {
36 
38 
42 public:
44 
49  LineIterator(const Extent& ext, unsigned int flag= (Axis::X | Axis::Y | Axis::Z) );
51  bool AtEnd();
53  void Inc();
57  int GetSize() const;
58 
61 
64 
67 
68 private:
69 
70  unsigned int flag_;
71  Extent ext_;
72  int current_dir_;
73  Point start_,end_,indx_;
74 };
75 
76 
77 }}} //namespaces
78 
79 #endif
Defines lower and upper valid indices.
Definition: extent.hh:60
class encapsulating 1D to 3D point
Definition: point.hh:47
line iterator generator
LineIterator(const Extent &ext, unsigned int flag=(Axis::X|Axis::Y|Axis::Z))
Initialization with extent and flag.
void Inc()
increase method
ExtentIterator GetLine()
retrieve current line (in form of an ExtentIterator)
LineIterator & operator++()
Prefix increase operator.
int GetSize() const
Retrieve Size of current line.
ExtentIterator GetNextLine()
convenience method, but preferred!
LineIterator operator++(int)
Postfix increase operator.
bool AtEnd()
return true if iterator has reached end
#define DLLEXPORT_IMG_ALG
static const int Y
Definition: def.hh:34
static const int X
Definition: def.hh:33
static const int Z
Definition: def.hh:35
Definition: base.dox:1