|
@ -44,7 +44,7 @@ void compute_patch_edges(const stl_vector_mp<polygon_face_t>& patch_faces, |
|
|
void compute_patches(const stl_vector_mp<stl_vector_mp<uint32_t>>& edges_of_face, |
|
|
void compute_patches(const stl_vector_mp<stl_vector_mp<uint32_t>>& edges_of_face, |
|
|
const stl_vector_mp<iso_edge_t>& patch_edges, |
|
|
const stl_vector_mp<iso_edge_t>& patch_edges, |
|
|
const stl_vector_mp<polygon_face_t>& patch_faces, |
|
|
const stl_vector_mp<polygon_face_t>& patch_faces, |
|
|
flat_index_group& patches, |
|
|
flat_index_group& patches, |
|
|
stl_vector_mp<uint32_t>& patch_of_face_mapping) |
|
|
stl_vector_mp<uint32_t>& patch_of_face_mapping) |
|
|
{ |
|
|
{ |
|
|
stl_vector_mp<bool> visited_face(edges_of_face.size(), false); |
|
|
stl_vector_mp<bool> visited_face(edges_of_face.size(), false); |
|
@ -84,9 +84,9 @@ void compute_chains(size_t iso_vert_count, |
|
|
size_t patch_count, |
|
|
size_t patch_count, |
|
|
stl_vector_mp<uint32_t>& patch_of_face, |
|
|
stl_vector_mp<uint32_t>& patch_of_face, |
|
|
stl_vector_mp<iso_edge_t>& patch_edges, |
|
|
stl_vector_mp<iso_edge_t>& patch_edges, |
|
|
flat_index_group& chains, |
|
|
flat_index_group& chains, |
|
|
stl_vector_mp<iso_edge_t>& chain_representative_headers, |
|
|
stl_vector_mp<iso_edge_t>& chain_representative_headers, |
|
|
flat_index_group& chain_of_patch) |
|
|
flat_index_group& chain_of_patch) |
|
|
{ |
|
|
{ |
|
|
stl_vector_mp<stl_vector_mp<uint32_t>> non_manifold_edges_of_vert{}; |
|
|
stl_vector_mp<stl_vector_mp<uint32_t>> non_manifold_edges_of_vert{}; |
|
|
stl_vector_mp<uint32_t> non_manifold_edges{}; |
|
|
stl_vector_mp<uint32_t> non_manifold_edges{}; |
|
@ -209,9 +209,9 @@ void compute_chains(size_t iso_vert_count, |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void compute_shells_and_components(const stl_vector_mp<stl_vector_mp<uint32_t>>& half_patch_adj_list, |
|
|
void compute_shells_and_components(const stl_vector_mp<stl_vector_mp<uint32_t>>& half_patch_adj_list, |
|
|
flat_index_group& shells, |
|
|
flat_index_group& shells, |
|
|
stl_vector_mp<uint32_t>& shell_of_half_patch, |
|
|
stl_vector_mp<uint32_t>& shell_of_half_patch, |
|
|
flat_index_group& components, |
|
|
flat_index_group& components, |
|
|
stl_vector_mp<uint32_t>& component_of_patch) |
|
|
stl_vector_mp<uint32_t>& component_of_patch) |
|
|
{ |
|
|
{ |
|
|
const auto num_patch = half_patch_adj_list.size() / 2; |
|
|
const auto num_patch = half_patch_adj_list.size() / 2; |
|
@ -298,7 +298,7 @@ void compute_shells_and_components(const stl_vector_mp<stl_vector_mp<uint32_t>>& |
|
|
|
|
|
|
|
|
void compute_arrangement_cells(uint32_t num_shell, |
|
|
void compute_arrangement_cells(uint32_t num_shell, |
|
|
const stl_vector_mp<std::pair<uint32_t, uint32_t>>& shell_links, |
|
|
const stl_vector_mp<std::pair<uint32_t, uint32_t>>& shell_links, |
|
|
flat_index_group& arrangement_cells) |
|
|
flat_index_group& arrangement_cells) |
|
|
{ |
|
|
{ |
|
|
// build shell adjacency list
|
|
|
// build shell adjacency list
|
|
|
uint32_t sink_shell = num_shell; |
|
|
uint32_t sink_shell = num_shell; |
|
@ -347,16 +347,15 @@ void compute_arrangement_cells(uint32_t |
|
|
sink_free_cells.index_group.reserve(arrangement_cells.index_group.size()); |
|
|
sink_free_cells.index_group.reserve(arrangement_cells.index_group.size()); |
|
|
sink_free_cells.start_indices.reserve(arrangement_cells.size() + 1); |
|
|
sink_free_cells.start_indices.reserve(arrangement_cells.size() + 1); |
|
|
sink_free_cells.start_indices.emplace_back(0); |
|
|
sink_free_cells.start_indices.emplace_back(0); |
|
|
sink_free_cells.group_foreach([&](uint32_t group_idx, uint32_t range_start, uint32_t range_end) { |
|
|
for (auto cell_index : arrangement_cells.group_indices()) { |
|
|
if (sink_free_cells.index_group.size() > sink_free_cells.start_indices.back()) { |
|
|
if (sink_free_cells.index_group.size() > sink_free_cells.start_indices.back()) { |
|
|
sink_free_cells.start_indices.emplace_back(static_cast<uint32_t>(sink_free_cells.index_group.size())); |
|
|
sink_free_cells.start_indices.emplace_back(static_cast<uint32_t>(sink_free_cells.index_group.size())); |
|
|
} |
|
|
} |
|
|
for (auto i = range_start; i < range_end; ++i) { |
|
|
|
|
|
if (arrangement_cells.index_group[i] < num_shell) { |
|
|
for (auto shell_index : arrangement_cells.group(cell_index)) { |
|
|
sink_free_cells.index_group.emplace_back(arrangement_cells.index_group[i]); |
|
|
if (shell_index < num_shell) sink_free_cells.index_group.emplace_back(shell_index); |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
}); |
|
|
} |
|
|
sink_free_cells.index_group.shrink_to_fit(); |
|
|
sink_free_cells.index_group.shrink_to_fit(); |
|
|
sink_free_cells.start_indices.shrink_to_fit(); |
|
|
sink_free_cells.start_indices.shrink_to_fit(); |
|
|
std::swap(arrangement_cells, sink_free_cells); |
|
|
std::swap(arrangement_cells, sink_free_cells); |
|
|