Commit e59ff5cc authored by Martin Heistermann's avatar Martin Heistermann

TODOs + mark ids of connected components and surfaces

parent 2fe3f441
#include "VolumeMeshAnalysis.hh"
#include "VolumeMeshAnalysis.hh"
#if 0
# include <ACG/Geometry/Algorithms.hh>
......@@ -360,6 +360,7 @@ CellVariant tryIdentifyPyramid(const MeshT &mesh, CH ch)
break;
}
}
// TODO: check if all tri faces are properly connected to the apex
if (idx != 5) {
return OtherCell{};
}
......@@ -391,6 +392,7 @@ CellVariant tryIdentifyWedge(const MeshT &mesh, CH ch)
return OtherCell{};
}
//std::abort();
// TODO
return OtherCell{};
}
......@@ -417,8 +419,8 @@ template<class MeshT=PolyhedralMesh>
size_t count_boundary_surfaces(MeshT& mesh)
{
auto visited = mesh.template request_face_property<bool>("", false);
//auto boundary_id = mesh.template request_face_property<int>("info:boundary_id", -1);
//boundary_id->set_persistent(true);
auto boundary_id = mesh.template request_face_property<int>("info:boundary_id", -1);
boundary_id->set_persistent(true);
size_t n_boundary_surfaces = 0;
for (const auto &root_fh: mesh.faces())
......@@ -433,7 +435,7 @@ size_t count_boundary_surfaces(MeshT& mesh)
while(!stack.empty())
{
const auto fh = stack.top(); stack.pop();
//boundary_id[fh] = static_cast<int>(n_boundary_surfaces);
boundary_id[fh] = static_cast<int>(n_boundary_surfaces);
for (const auto &eh: mesh.face_edges(fh))
{
for (const auto &nb: mesh.edge_faces(eh)) {
......@@ -454,6 +456,8 @@ template<class MeshT=PolyhedralMesh>
//using MeshT = TetrahedralMesh;
size_t count_connected_components(MeshT& mesh)
{
auto cc = mesh.template request_vertex_property<int>("info:component_id", -1);
cc->set_persistent(true);
auto visited = mesh.template request_vertex_property<bool>("", false);
size_t n_connected_components = 0;
......@@ -467,7 +471,6 @@ size_t count_connected_components(MeshT& mesh)
if (visited[root_vh])
continue;
++n_connected_components;
visited[root_vh] = true;
++n_vertices_found;
......@@ -476,6 +479,7 @@ size_t count_connected_components(MeshT& mesh)
while(!stack.empty())
{
const auto vh = stack.top(); stack.pop();
cc[vh] = n_connected_components;
for (const auto &nb: mesh.vertex_vertices(vh))
{
if (!visited[nb]) {
......
......@@ -113,6 +113,8 @@ struct VolumeMeshAnalysisResult
bool manifold_dim3;
size_t num_nonconforming_faces;
};
......
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