| Line |  | 
|---|
| 1 | /*! | 
|---|
| 2 | * @file grid.h | 
|---|
| 3 | * @brief Definition of ... | 
|---|
| 4 | */ | 
|---|
| 5 |  | 
|---|
| 6 | #ifndef _GRID_H | 
|---|
| 7 | #define _GRID_H | 
|---|
| 8 |  | 
|---|
| 9 | #include "vertex_array_model.h" | 
|---|
| 10 |  | 
|---|
| 11 | // FORWARD DECLARATION | 
|---|
| 12 |  | 
|---|
| 13 |  | 
|---|
| 14 |  | 
|---|
| 15 | //! A class for ... | 
|---|
| 16 | class Grid : public VertexArrayModel | 
|---|
| 17 | { | 
|---|
| 18 |  | 
|---|
| 19 | public: | 
|---|
| 20 | Grid(float sizeX, float sizeY, unsigned int resolutionX, unsigned int resolutionY); | 
|---|
| 21 | virtual ~Grid(); | 
|---|
| 22 |  | 
|---|
| 23 | float gridSpacing() const { return this->_gridSpacingX; }; | 
|---|
| 24 | float sizeX() const { return this->_sizeX; }; | 
|---|
| 25 | float sizeY() const { return this->_sizeY; }; | 
|---|
| 26 | unsigned int rows() const { return this->_rows; }; | 
|---|
| 27 | unsigned int columns() const { return this->_columns; }; | 
|---|
| 28 |  | 
|---|
| 29 | float& height(unsigned int row, unsigned int column) { return this->vertex(row*this->_columns + column).y;}; | 
|---|
| 30 | Vector& vertexG(unsigned int row, unsigned int column) { return this->vertex(row*this->_columns + column); }; | 
|---|
| 31 | Vector& normalG(unsigned int row, unsigned int column) { return this->normal(row*this->_columns + column); }; | 
|---|
| 32 |  | 
|---|
| 33 |  | 
|---|
| 34 | void rebuildNormals(float maxHeight); | 
|---|
| 35 |  | 
|---|
| 36 | private: | 
|---|
| 37 | float             _sizeX; | 
|---|
| 38 | float             _sizeY; | 
|---|
| 39 |  | 
|---|
| 40 | float             _gridSpacingX; | 
|---|
| 41 | float             _gridSpacingY; | 
|---|
| 42 |  | 
|---|
| 43 | unsigned int      _rows; | 
|---|
| 44 | unsigned int      _columns; | 
|---|
| 45 | }; | 
|---|
| 46 |  | 
|---|
| 47 | #endif /* _GRID_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.