• 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
MeshBuffer.h
Go to the documentation of this file.
1 /***************************************************************************
2  MeshBuffer.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_BUFFER_H
10 #define MESH_BUFFER_H
11 
12 #include "typedef.h"
13 
14 class HTMesh;
15 
16 /* @class MeshBuffer the sole purpose of a MeshBuffer is to hold storage space
17  * for the results of an HTM inetersection and then allow multiple
18  * MeshIterator's to walk through the result set. The buffer space is allocated
19  * when the MeshBuffer is created. Mesh buffers will usually hang around for
20  * the life of an HTMesh. Each mesh buffer is re-usable. Simply reset() it and
21  * then fill it by append()'ing trixels. A MeshIterator grabs the size() and
22  * the buffer() so it can iterate over the results.
23  */
24 
25 class MeshBuffer {
26 
27  public:
28  MeshBuffer(HTMesh *mesh);
29 
30  ~MeshBuffer();
31 
32  /* @short prepare the buffer for a new result set
33  */
34  void reset() { m_size = m_error = 0; }
35 
36  /* @short add trixels to the buffer
37  */
38  int append(Trixel trixel);
39 
40  /* @short the location of the buffer for reading
41  */
42  const Trixel* buffer() const { return m_buffer; }
43 
44  /* @short the number of trixels in the result set
45  */
46  int size() const { return m_size; }
47 
48  /* @short returns the number of trixels that would have overflowed the
49  * buffer.
50  */
51  int error() const { return m_error; }
52 
53  /* @short fills the buffer with consecutive integers
54  */
55  void fill();
56 
57  private:
58  Trixel *m_buffer;
59  int m_size;
60  int maxSize;
61  int m_error;
62 
63 };
64 
65 #endif
typedef.h
MeshBuffer::buffer
const Trixel * buffer() const
Definition: MeshBuffer.h:42
MeshBuffer::append
int append(Trixel trixel)
Definition: MeshBuffer.cpp:26
HTMesh
Definition: HTMesh.h:58
MeshBuffer::fill
void fill()
Definition: MeshBuffer.cpp:36
MeshBuffer
Definition: MeshBuffer.h:25
MeshBuffer::~MeshBuffer
~MeshBuffer()
Definition: MeshBuffer.cpp:22
MeshBuffer::reset
void reset()
Definition: MeshBuffer.h:34
MeshBuffer::size
int size() const
Definition: MeshBuffer.h:46
Trixel
unsigned int Trixel
Definition: htmesh/typedef.h:4
MeshBuffer::error
int error() const
Definition: MeshBuffer.h:51
MeshBuffer::MeshBuffer
MeshBuffer(HTMesh *mesh)
Definition: MeshBuffer.cpp:7
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