Computer Assited Medical Intervention Tool Kit  version 3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
AtomIterator.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2014 UJF-Grenoble 1, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 
27 #ifndef TOOLS_ATOMITERATOR_H
28 #define TOOLS_ATOMITERATOR_H
29 
30 #include <string.h>
31 #include "PhysicalModel.h"
32 #include "Load.h"
41 
42  public:
43 
45  AtomIterator(PhysicalModel* pml, std::string targetList);
47  ~AtomIterator();
48 
50  void begin();
52  bool end();
54  void next();
56  Atom* currentAtom();
57 
59  void operator++();
60 
61  private:
63  std::vector<Atom*> atoms;
65  unsigned int index;
66 
67 };
68 
69 #endif // TOOLS_ATOMITERATOR_H
void begin()
place iterator on first atom
~AtomIterator()
destructor
bool end()
return true if iterator is over the last atom
void next()
if iteration is not finished, advance to next atom
unsigned int index
current atom index
Definition: AtomIterator.h:65
void operator++()
redefinition of ++ operator, advance iterator to next atom
An atom has an unique index in the physical model object, a 3D position, and different basic properti...
Definition: Atom.h:44
This is the main class of this project.
Definition: PhysicalModel.h:74
AtomIterator(PhysicalModel *pml, std::string targetList)
constructor
Allow iteration over a set of atoms given by a target list (component name or index list) ...
Definition: AtomIterator.h:40
string(REGEX REPLACE"^.*-(.*)-.*""\\1"ARCH"${CAMITK_CONTINUOUS_INTEGRATION}") string(REGEX REPLACE"^.*-.*-(.*)""\\1"BUILDTYPE"$
Definition: continuous.cmake:34
Atom * currentAtom()
return current atom
std::vector< Atom * > atoms
atoms list
Definition: AtomIterator.h:63