Commit 2a197938 authored by Jan Möbius's avatar Jan Möbius

Moved generate function to constructor. Silences cppcheck

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17562 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b2edcaec
......@@ -358,8 +358,7 @@ int PrimitivesGeneratorPlugin::addTetrahedralCuboid(const Vector& _position,
object->setName("Cuboid " + QString::number(object_id));
TetrahedralCuboidGenerator gen;
gen.generate(*(object->mesh()), _position, _length, n_x, n_y, n_z);
TetrahedralCuboidGenerator gen(*(object->mesh()), _position, _length, n_x, n_y, n_z);
emit updatedObject(object_id, UPDATE_ALL);
......
......@@ -337,10 +337,14 @@ void TetrahedralCuboidGenerator::add_cube_type_2_cells(std::size_t i, std::size_
mesh_->add_cell(hf);
}
void TetrahedralCuboidGenerator::generate(PolyhedralMesh& mesh, Vector const& position,
Vector const& length, unsigned const n_x, unsigned const n_y, unsigned const n_z)
TetrahedralCuboidGenerator::TetrahedralCuboidGenerator(PolyhedralMesh& mesh,
Vector const& position,
Vector const& length,
unsigned const n_x,
unsigned const n_y,
unsigned const n_z) :
mesh_(&mesh)
{
mesh_ = &mesh;
mesh_->clear();
size_[0] = n_x;
......
......@@ -75,8 +75,8 @@ inline bool operator<(SortedFace const& f1, SortedFace const& f2)
class TetrahedralCuboidGenerator
{
public:
void generate(PolyhedralMesh& mesh, Vector const& position, Vector const& length,
unsigned const n_x, unsigned const n_y, unsigned const n_z);
TetrahedralCuboidGenerator(PolyhedralMesh& mesh, Vector const& position, Vector const& length,
unsigned const n_x, unsigned const n_y, unsigned const n_z);
private:
void add_vertices(Vector const& position, Vector const& length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment