38 lines
462 B
C++
38 lines
462 B
C++
|
#ifndef __REPLICATE_GENERATOR_HPP
|
||
|
#define __REPLICATE_GENERATOR_HPP
|
||
|
|
||
|
namespace CosmoTool
|
||
|
{
|
||
|
|
||
|
template<typename Coord, int N>
|
||
|
class ReplicateGenerator
|
||
|
{
|
||
|
public:
|
||
|
ReplicateGenerator(const Coord x[N])
|
||
|
{
|
||
|
face = 0;
|
||
|
}
|
||
|
|
||
|
bool next()
|
||
|
{
|
||
|
if (face == (2*N))
|
||
|
return false;
|
||
|
|
||
|
face++;
|
||
|
|
||
|
}
|
||
|
|
||
|
Coord getPosition()
|
||
|
{
|
||
|
return x_shifted;
|
||
|
}
|
||
|
|
||
|
private:
|
||
|
Coord x_shifted[N];
|
||
|
int face;
|
||
|
};
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif
|