33 template<
typename MeshT >
51 std::cout <<
"use existing vertex-color map" << std::endl;
56 std::cout <<
"create vertex-color map" << std::endl;
64 std::cout <<
"using existing edge-color map" << std::endl;
69 std::cout <<
"create edge-color map" << std::endl;
77 std::cout <<
"use existing vertex-normal map" << std::endl;
82 std::cout <<
"create vertex-normal map" << std::endl;
95 template<
typename MeshT >
101 int number_batches = 70;
102 int min_number_vertices = -1;
103 int bits_quantization = 12;
104 std::string output_file_path_save_preprocess =
105 "progressive_compression_original_mesh_after_preprocess.obj";
108 std::cout <<
"Apply a progressive compression filter to the input mesh." << std::endl;
109 std::cout <<
"Usage: " << argv[0] <<
" input_mesh_filename" << std::endl;
110 std::cout <<
"Example: " << argv[0]
111 <<
" ../Testing/Data/CubeNonTriangleFaces.off" << std::endl;
115 std::string path_binary =
"";
117 FEVV::Filters::BATCH_CONDITION::ALL_EDGES;
119 mode = atoi(argv[2]);
123 path_binary = argv[3];
124 if (path_binary ==
".")
126 std::cerr <<
"The binary path cannot be set to \".\". Therefore, it will be set to default value." << std::endl;
134 std::string output_path =
"";
137 output_path = argv[4];
138 if (output_path ==
".")
140 std::cerr <<
"The output path path cannot be set to \".\". Therefore, it will be set to \"./\"." << std::endl;
146 output_path =
typeid(m).name();
147 if (output_path.find(
"Surface_mesh") != std::string::npos)
149 output_path =
"./Surface_mesh_";
151 else if (output_path.find(
"Polyhedron_3") != std::string::npos)
153 output_path =
"./Polyhedron_3_";
155 else if (output_path.find(
"Linear_cell_complex") != std::string::npos)
157 output_path =
"./LCC_";
159 else if (output_path.find(
"AIF") != std::string::npos)
161 output_path =
"./AIF_";
165 output_path =
"./Other_mesh_type_";
173 FEVV::Filters::VKEPT_POSITION::HALFEDGE;
177 int predint = atoi(argv[5]);
182 int metrint = atoi(argv[6]);
187 int vkeptint = atoi(argv[7]);
191 number_batches = atoi(argv[8]);
193 min_number_vertices = atoi(argv[9]);
196 int batchint = atoi(argv[10]);
201 bits_quantization = atoi(argv[11]);
204 std::string input_file_path = argv[1];
206 std::string output_file_path =
"progressive_compression_filter_base_mesh.obj";
212 if (min_number_vertices == -1) {
224 m, pmaps_bag, v_cm, e_cm, v_nm);
227 auto pm =
get(boost::vertex_point, m);
233 std::cout <<
"Single Compression" << std::endl;
235 prediction_type, vkeptpos, metric_type,
true,
false, bits_quantization);
254 output_file_path_save_preprocess);
266 std::cout <<
"Measure mode, all metrics being tested" << std::endl;
267 std::vector< FEVV::Filters::PREDICTION_TYPE > available_predictions = {
269 FEVV::Filters::PREDICTION_TYPE::DELTA
272 std::vector< FEVV::Filters::VKEPT_POSITION > available_operators = {
273 FEVV::Filters::VKEPT_POSITION::MIDPOINT,
274 FEVV::Filters::VKEPT_POSITION::HALFEDGE
276 std::vector< FEVV::Filters::METRIC_TYPE > available_metrics = {
277 FEVV::Filters::METRIC_TYPE::EDGE_LENGTH,
282 std::vector< int > tested_quantizations = {10, 12, 16};
286 for(
size_t i = 0; i < available_predictions.size(); i++)
288 for(
size_t j = 0; j < available_operators.size(); j++)
290 for(
size_t k = 0; k < available_metrics.size(); k++)
292 for(
size_t l = 0; l < tested_quantizations.size(); l++)
299 if (first && (min_number_vertices == -1)) {
310 MeshT >::pmap_type v_nm2;
320 auto pm2 =
get(boost::vertex_point, mesh);
323 available_operators[j],
324 available_metrics[k],
327 tested_quantizations[l]);
347 output_file_path_save_preprocess);
350 std::cout <<
"finished = " <<
static_cast<double>(cpt)/(available_predictions.size() * available_operators.size() * available_metrics.size() * tested_quantizations.size()) << std::endl;