Cleaning for opengl rendering prep.

This commit is contained in:
James Grogan 2022-11-14 11:19:51 +00:00
parent 402f381d10
commit 7c6a92f4ec
58 changed files with 570 additions and 533 deletions

View file

@ -0,0 +1,50 @@
#include "Grid.h"
template<typename T>
Grid<T>::Grid(const Rectangle& bounds)
: mBounds(bounds)
{
mValues = std::vector<T>(mNumX*mNumY, T());
}
template<typename T>
const Rectangle& Grid<T>::getBounds() const
{
return mBounds;
}
template<typename T>
double Grid<T>::getXSpacing() const
{
return mBounds.getWidth()/double(mNumX);
}
template<typename T>
double Grid<T>::getYSpacing() const
{
return mBounds.getHeight()/double(mNumY);
}
template<typename T>
const std::vector<T>& Grid<T>::getValues() const
{
return mValues;
}
template<typename T>
void Grid<T>::resetBounds(const Rectangle& bounds)
{
mBounds = bounds;
mValues = std::vector<T>(mNumX*mNumY, T());
}
template<typename T>
void Grid<T>::setValues(const std::vector<std::size_t>& indices, T value)
{
for (auto index : indices)
{
mValues[index] = value;
}
}
template class Grid<unsigned char>;