Skip to content
Snippets Groups Projects
Commit 2b19d191 authored by Tom Fischer's avatar Tom Fischer
Browse files

[MGTL] Omit projectMeshOntoPlane().

parent cafd2e49
No related branches found
No related tags found
No related merge requests found
...@@ -99,9 +99,13 @@ void GeoMapper::mapOnMesh(const MeshLib::Mesh* mesh) ...@@ -99,9 +99,13 @@ void GeoMapper::mapOnMesh(const MeshLib::Mesh* mesh)
// init grid // init grid
MathLib::Point3d origin(std::array<double,3>{{0,0,0}}); MathLib::Point3d origin(std::array<double,3>{{0,0,0}});
MathLib::Vector3 normal(0,0,-1); MathLib::Vector3 normal(0,0,-1);
MeshLib::Mesh const*const flat_mesh = std::vector<MeshLib::Node*> flat_nodes;
MeshLib::projectMeshOntoPlane(*_surface_mesh, origin, normal); // copy nodes and project the copied nodes to the x-y-plane, i.e. set
std::vector<MeshLib::Node*> const& flat_nodes (flat_mesh->getNodes()); // z-coordinate to zero
for (auto n_ptr : _surface_mesh->getNodes()) {
flat_nodes.push_back(new MeshLib::Node(*n_ptr));
(*flat_nodes.back())[2] = 0.0;
}
_grid = new GeoLib::Grid<MeshLib::Node>(flat_nodes.cbegin(), flat_nodes.cend()); _grid = new GeoLib::Grid<MeshLib::Node>(flat_nodes.cbegin(), flat_nodes.cend());
if (GeoLib::isStation((*pnts)[0])) { if (GeoLib::isStation((*pnts)[0])) {
...@@ -111,7 +115,8 @@ void GeoMapper::mapOnMesh(const MeshLib::Mesh* mesh) ...@@ -111,7 +115,8 @@ void GeoMapper::mapOnMesh(const MeshLib::Mesh* mesh)
} }
delete _grid; delete _grid;
delete flat_mesh; for (auto n_ptr : flat_nodes)
delete n_ptr;
} }
void GeoMapper::mapToConstantValue(double value) void GeoMapper::mapToConstantValue(double value)
......
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