Cleaning for opengl rendering prep.
This commit is contained in:
parent
402f381d10
commit
7c6a92f4ec
58 changed files with 570 additions and 533 deletions
|
@ -3,54 +3,28 @@
|
|||
#include "Rectangle.h"
|
||||
#include <vector>
|
||||
|
||||
template<typename T>
|
||||
class Grid
|
||||
{
|
||||
public:
|
||||
|
||||
Grid(const Rectangle& bounds)
|
||||
: mBounds(bounds)
|
||||
{
|
||||
mValues = std::vector<double>(mNumX*mNumY, 0.0);
|
||||
}
|
||||
Grid(const Rectangle& bounds);
|
||||
|
||||
Rectangle GetBounds() const
|
||||
{
|
||||
return mBounds;
|
||||
}
|
||||
const Rectangle& getBounds() const;
|
||||
|
||||
double GetXSpacing() const
|
||||
{
|
||||
return mBounds.GetWidth()/double(mNumX);
|
||||
}
|
||||
double getXSpacing() const;
|
||||
|
||||
double GetYSpacing() const
|
||||
{
|
||||
return mBounds.GetHeight()/double(mNumY);
|
||||
}
|
||||
double getYSpacing() const;
|
||||
|
||||
std::vector<double> GetValues() const
|
||||
{
|
||||
return mValues;
|
||||
}
|
||||
const std::vector<T>& getValues() const;
|
||||
|
||||
void ResetBounds(const Rectangle& bounds)
|
||||
{
|
||||
mBounds = bounds;
|
||||
mValues = std::vector<double>(mNumX*mNumY, 0.0);
|
||||
}
|
||||
|
||||
void SetValues(const std::vector<std::size_t>& indices, double value)
|
||||
{
|
||||
for (auto index : indices)
|
||||
{
|
||||
mValues[index] = value;
|
||||
}
|
||||
}
|
||||
void resetBounds(const Rectangle& bounds);
|
||||
|
||||
void setValues(const std::vector<std::size_t>& indices, T value);
|
||||
|
||||
private:
|
||||
Rectangle mBounds;
|
||||
std::vector<double> mValues;
|
||||
std::vector<T> mValues;
|
||||
unsigned mNumX{5};
|
||||
unsigned mNumY{5};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue