Skip to content
Snippets Groups Projects
Commit 5ebbfb34 authored by samuel.hayden's avatar samuel.hayden
Browse files

Added generic lattice builder

This builder only needs to move all the data to the base class and resize the radii vector if required
parent bd442277
No related branches found
No related tags found
No related merge requests found
#pragma once
#include "BuildLattice.h"
template<class CellType>
class BuilderGenericLattice : public BuildLattice<CellType>
{
public:
BuilderGenericLattice(GenericLatticeData& data)
{
_cellX = data.dx;
_cellY = data.dy;
_cellZ = data.dz;
_cellPositions = std::move(data.positions);
if (data.radii.size() == 1)
{
size_t nCells = _cellPositions.size();
data.radii.resize(nCells);
for (size_t i = 1; i < nCells; i++)
data.radii[i] = data.radii[0];
}
_cellRadii = std::move(data.radii);
}
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment