Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/graphics/importer/array.h @ 4577

Last change on this file since 4577 was 4577, checked in by bensch, 20 years ago

orxonox/trunk: model is now able to return the values of its vertices

File size: 1.4 KB
Line 
1/*!
2  \file array.h
3  \brief Contains the Array Class that handles float arrays.
4  this class creates a Array of a semi-Dynamic length.
5  beware, that after finalizing the array may not be resized again.
6*/
7
8#ifndef _ARRAY_H
9#define _ARRAY_H
10#include "glincl.h"
11
12//! Array Class that handles dynamic-float arrays.
13class Array
14{
15 public:
16  Array ();
17  ~Array();
18
19  void initializeArray ();
20  void finalizeArray (void);
21  void addEntry (GLfloat entry);
22  void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2);
23
24  /** \returns The array */
25  inline const GLfloat* getArray () const { return this->array; };
26  /**   \returns The Count of entries in the Array*/
27  inline int getCount(void)const { return this->entryCount; };
28  void debug(void) const ;
29 private:
30  //! One entry of the Array
31  struct Entry
32  {
33    GLfloat value;  //!< The value of this Entry.
34    Entry* next;    //!< Pointer to the Next entry.
35  };
36
37  GLfloat* array;      //!< The array that will be produced when finalizing the Array.
38  int entryCount;      //!< The count of Entries in this Array.
39  bool finalized;      //!< If this variable is set to true, the Array can not be changed anymore. true if finalized, false else (initially).
40  Entry* firstEntry;   //!< Pointer to the first Entry of this Array
41  Entry* currentEntry; //!< Pointer to the current Entry of this Array. The one Entry we are working with.
42
43
44};
45
46#endif
Note: See TracBrowser for help on using the repository browser.