| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								#pragma once
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								#include <fwd_types.hpp>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								#include <blobtree.hpp>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								#include <implicit_arrangement.hpp>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								#include <settings.h>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								using grid_region = std::pair<Eigen::Vector<size_t, 3>, Eigen::Vector<size_t, 3>>;
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
								void                    extract_vertex_infos(const s_settings&           settings,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                             const baked_blobtree_t&     tree,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                             scene_bg_mesh_info_t&       scene_bg_mesh_info,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                             Eigen::Ref<Eigen::MatrixXd> vertex_infos);
							 | 
						
					
						
							| 
								
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
								void                    build_tetrahedron_and_adjacency(const scene_bg_mesh_info_t&                          scene_bg_mesh_info,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                        stl_vector_mp<std::array<uint32_t, 4>>&              tetrahedrons,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                        flat_hash_map_mp<uint32_t, uint32_t>&                vertex_lexigraphical_adjacency,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                        flat_hash_map_mp<uint32_t, stl_vector_mp<uint32_t>>& reverse_vertex_adjacency,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                        btree_map_mp<uint32_t, stl_vector_mp<uint32_t>>&     vertex_to_tet_mapping);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								void                    filter_tet_by_subface(const btree_map_mp<uint32_t, stl_vector_mp<uint32_t>>&     vertex_to_tet_mapping,
							 | 
						
					
						
							| 
								
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
								                                              Eigen::MatrixXd&                                           vertex_infos,
							 | 
						
					
						
							| 
								
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
								                                              flat_hash_map_mp<uint32_t, uint32_t>&                      vertex_indices_mapping,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                              stl_vector_mp<std::array<uint32_t, 4>>&                    tetrahedrons,
							 | 
						
					
						
							| 
								
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
								                                              flat_hash_map_mp<uint32_t, uint32_t>&                      vertex_lexigraphical_adjacency,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                              const flat_hash_map_mp<uint32_t, stl_vector_mp<uint32_t>>& reverse_vertex_adjacency,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                              stl_vector_mp<uint32_t>&                                   tetrahedron_active_subface_start_index,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                              stl_vector_mp<uint32_t>&                                   active_subface_indices,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                              flat_hash_map_mp<uint32_t, stl_vector_mp<uint32_t>>&       zero_vertex_to_incident_tet_mapping);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								// in turn: num_1_func, num_2_func, num_more_func
							 | 
						
					
						
							| 
								
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
								std::array<uint32_t, 3> compute_implicit_arrangements(const Eigen::Ref<const Eigen::MatrixXd>       vertex_infos,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                      const flat_hash_map_mp<uint32_t, uint32_t>&   vertex_indices_mapping,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                      const stl_vector_mp<std::array<uint32_t, 4>>& tetrahedrons,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                      const stl_vector_mp<uint32_t>& tetrahedron_active_subface_start_index,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                      const stl_vector_mp<uint32_t>& active_subface_indices,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                                      stl_vector_mp<arrangement_t>&  tetrahedron_arrangements);
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								// extract iso-mesh (topology only)
							 | 
						
					
						
							| 
								
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
								void                    extract_iso_mesh(const std::array<uint32_t, 3>&                tet_active_subface_counts,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         const stl_vector_mp<arrangement_t>&           tetrahedron_arrangements,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         const scene_bg_mesh_info_t&                   scene_bg_mesh_info,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         const stl_vector_mp<std::array<uint32_t, 4>>& tetrahedrons,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         const stl_vector_mp<uint32_t>&                tetrahedron_active_subface_start_index,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         const stl_vector_mp<uint32_t>&                active_subface_indices,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         const Eigen::Ref<const Eigen::MatrixXd>       vertex_infos,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         const flat_hash_map_mp<uint32_t, uint32_t>&   vertex_indices_mapping,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         stl_vector_mp<Eigen::Vector3d>&               iso_pts,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         stl_vector_mp<iso_vertex_t>&                  iso_verts,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
								                                         stl_vector_mp<polygon_face_t>&                iso_faces);
							 |