• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • htmesh
MeshIterator.h
Go to the documentation of this file.
1 /***************************************************************************
2  MeshIterator.h - K Desktop Planetarium
3  -------------------
4  begin : 2007-07-13
5  copyright : (C) 2007 James B. Bowlin
6  email : bowlin@mindspring.com
7 ***************************************************************************/
8 
9 #ifndef MESH_ITERATOR_H
10 #define MESH_ITERATOR_H
11 
12 #include "typedef.h"
13 
14 class HTMesh;
15 
16 /* @class MeshIterator is a very lightweight class used to iterate over the
17  * result set of an HTMesh intersection. If you want to iterate over the same
18  * result set multiple times in the same block of code, you don't need to create
19  * a new MeshIterator, just call the reset() method and then re-use the iterator.
20  */
21 
22 class MeshIterator {
23 
24  public:
25  MeshIterator(HTMesh *mesh, BufNum bufNum=0);
26 
27  /* @short true if there are more trixel to iterate over.
28  */
29  bool hasNext() const { return cnt < m_size; }
30 
31  /* @short returns the next trixel
32  */
33  Trixel next() const { return index[cnt++]; }
34 
35  /* @short returns the number of trixels stored
36  */
37  int size() const { return m_size; }
38 
39  /* @short sets the count back to zero so you can use this iterator
40  * to iterate again over the same result set.
41  */
42  void reset() const { cnt = 0; }
43 
44  private:
45  const Trixel *index;
46  int m_size;
47  mutable int cnt;
48 
49 };
50 
51 
52 #endif
typedef.h
HTMesh
Definition: HTMesh.h:58
MeshIterator::MeshIterator
MeshIterator(HTMesh *mesh, BufNum bufNum=0)
Definition: MeshIterator.cpp:7
BufNum
unsigned short BufNum
Definition: htmesh/typedef.h:5
MeshIterator::size
int size() const
Definition: MeshIterator.h:37
Trixel
unsigned int Trixel
Definition: htmesh/typedef.h:4
MeshIterator
Definition: MeshIterator.h:22
MeshIterator::hasNext
bool hasNext() const
Definition: MeshIterator.h:29
MeshIterator::reset
void reset() const
Definition: MeshIterator.h:42
MeshIterator::next
Trixel next() const
Definition: MeshIterator.h:33
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal