Last change
on this file since 3202 was
3196,
checked in by bensch, 20 years ago
|
orxonox/trunk: moved importer into the Trunk, now no merging is needed anymore.
|
File size:
1.3 KB
|
Rev | Line | |
---|
[2842] | 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 | |
---|
[2776] | 8 | #ifndef _ARRAY_H |
---|
| 9 | #define _ARRAY_H |
---|
| 10 | |
---|
[2842] | 11 | extern int verbose; //!< will be obsolete soon |
---|
[2804] | 12 | |
---|
[3196] | 13 | #include "../stdincl.h" |
---|
[2823] | 14 | #include <fstream> |
---|
[2842] | 15 | |
---|
| 16 | |
---|
| 17 | //! Array Class that handles dynamic-float arrays. |
---|
[2754] | 18 | class Array |
---|
| 19 | { |
---|
| 20 | public: |
---|
| 21 | Array (); |
---|
[2847] | 22 | ~Array(); |
---|
[2754] | 23 | |
---|
[2842] | 24 | void initializeArray (); |
---|
[2754] | 25 | void finalizeArray (void); |
---|
| 26 | void addEntry (GLfloat entry); |
---|
| 27 | void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2); |
---|
| 28 | |
---|
| 29 | GLfloat* getArray (); |
---|
[2760] | 30 | int getCount(); |
---|
[2758] | 31 | void debug(void); |
---|
[2754] | 32 | private: |
---|
[3186] | 33 | //! One entry of the Array |
---|
[2807] | 34 | struct Entry |
---|
| 35 | { |
---|
[3186] | 36 | GLfloat value; //!< The value of this Entry. |
---|
| 37 | Entry* next; //!< Pointer to the Next entry. |
---|
[2807] | 38 | }; |
---|
| 39 | |
---|
[3186] | 40 | GLfloat* array; //!< The array that will be produced when finalizing the Array. |
---|
| 41 | int entryCount; //!< The count of Entries in this Array. |
---|
| 42 | bool finalized; //!< If this variable is set to true, the Array can not be changed anymore. true if finalized, false else (initially). |
---|
| 43 | Entry* firstEntry; //!< Pointer to the first Entry of this Array |
---|
| 44 | Entry* currentEntry; //!< Pointer to the current Entry of this Array. The one Entry we are working with. |
---|
[2807] | 45 | |
---|
| 46 | |
---|
[2754] | 47 | }; |
---|
[2776] | 48 | |
---|
| 49 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.