#ifndef GRIDNODE_H #define GRIDNODE_H #include "GridNodeBBox.h" #include "GridPoint.h" template class Grid; /** * INTERNAL DATASTRUCTURE * this data-structure is internally used by the Grid * to store additional information for each node besides * the user's requested data-structure */ class GridNode { template friend class Grid; /** INTERNAL: array-index */ int _idx = -1; /** INTERNAL: number of neighbors */ int _numNeighbors = 0; /** INTERNAL: store neighbors (via index) */ int _neighbors[12] = {}; public: GridNode() {;} /** get the node's index within its grid */ int getIdx() const {return _idx;} /** get the number of neighbors for this node */ int getNumNeighbors() const {return _numNeighbors;} /** get the n-th neighbor for this node */ template inline T& getNeighbor(const int nth, const Grid& grid) const { return grid.getNeighbor(_idx, nth); } }; #endif // GRIDNODE_H