| 
						
						
							
								
							
						
						
					 | 
					@ -3,7 +3,7 @@ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					#include <fstream> | 
					 | 
					 | 
					#include <fstream> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					#include <iomanip> | 
					 | 
					 | 
					#include <iomanip> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					#include <iostream> | 
					 | 
					 | 
					#include <iostream> | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					
 | 
					 | 
					 | 
					#include <sstream> | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					#include <nlohmann/json.hpp> | 
					 | 
					 | 
					#include <nlohmann/json.hpp> | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					#include "lut.hpp" | 
					 | 
					 | 
					#include "lut.hpp" | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -19,12 +19,25 @@ IA_API bool load_lut() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    auto t0 = std::chrono::high_resolution_clock::now(); | 
					 | 
					 | 
					    auto t0 = std::chrono::high_resolution_clock::now(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    std::ifstream fin("ia_lut.msgpack", std::ios::in | std::ios::binary); | 
					 | 
					 | 
					    std::ifstream fin("C:/Users/mckay/programs/ImplicitSurfaceNetwork/data/ia_lut.msgpack", std::ios::in | std::ios::binary); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					    if (!fin) { | 
					 | 
					 | 
					    if (!fin) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        std::cout << "Simplicial arrangement lookup table file not exist!" << std::endl; | 
					 | 
					 | 
					        std::cout << "Simplicial arrangement lookup table file not exist!" << std::endl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return false; | 
					 | 
					 | 
					        return false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    /*std::vector<char> msgpack; // 或 stl_vector_mp<char>
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    try { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 构造 vector 并赋值给 msgpack
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        msgpack.assign( | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            std::istreambuf_iterator<char>(fin), | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            std::istreambuf_iterator<char>() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        ); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        std::cout << "Read " << msgpack.size() << " bytes from file." << std::endl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } catch (...) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        std::cerr << "Unknown exception caught." << std::endl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return -1; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    }*/ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    stl_vector_mp<char> msgpack(std::istreambuf_iterator<char>(fin), {}); | 
					 | 
					 | 
					    stl_vector_mp<char> msgpack(std::istreambuf_iterator<char>(fin), {}); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    nlohmann::json      json = nlohmann::json::from_msgpack(msgpack); | 
					 | 
					 | 
					    nlohmann::json      json = nlohmann::json::from_msgpack(msgpack); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    fin.close(); | 
					 | 
					 | 
					    fin.close(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -56,6 +69,7 @@ IA_API bool load_lut() | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    }; | 
					 | 
					 | 
					    }; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ia_indices = json["start_index"].get<stl_vector_mp<uint32_t>>(); | 
					 | 
					 | 
					    ia_indices = json["start_index"].get<stl_vector_mp<uint32_t>>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    std::cout << ia_indices.size(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    ia_data.reserve(json["data"].size()); | 
					 | 
					 | 
					    ia_data.reserve(json["data"].size()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    for (const auto& entry : json["data"]) { ia_data.emplace_back(deserialize_ar(entry)); } | 
					 | 
					 | 
					    for (const auto& entry : json["data"]) { ia_data.emplace_back(deserialize_ar(entry)); } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |