public bool ConvertRecursively1( string input_root_directory_path, string output_root_directory_path, string temporary_root_directory_path, string input_file_extension) { var total_count = RetrieveObjFileCount(input_root_directory_path, input_file_extension); var stopwatch = new Stopwatch(); stopwatch.Start(); long success_count = 0; long fail_count = 0; foreach (var input_file_path in Directory.GetFiles(input_root_directory_path, "*.*", SearchOption.AllDirectories) .Where(i => i.EndsWith(input_file_extension, StringComparison.OrdinalIgnoreCase)).ToList()) { bool is_success = ConvertToObjFile(input_file_path, output_root_directory_path, temporary_root_directory_path); string elapsed_time_span = stopwatch.Elapsed.ToString(@"dd\.hh\:mm\:ss"); if (is_success) { ++success_count; var progressed_count = success_count + fail_count; var message = string.Format(@"변환성공({0}/{1}/{2}) : {3} : {4}", fail_count, progressed_count, total_count, elapsed_time_span, input_file_path); Console.WriteLine(message); } else { ++fail_count; var progressed_count = success_count + fail_count; var message = string.Format(@"!!변환실패({0}/{1}/{2}) : {3} : {4}", fail_count, progressed_count, total_count, elapsed_time_span, input_file_path); Console.WriteLine(message); } } Console.WriteLine(@"tileset combining..."); string output_levelled_output_directory_path = NFileSystemUtil.GetAbsolutePath(output_root_directory_path, ZoomLevel.ToString()); DoCreateTotalTileSet(output_levelled_output_directory_path); return(false); }
private bool DoCopyTemporaryTileSetToOutputDirectory(string temporary_obj_file_path, string output_directory_path) { var base_name = Path.GetFileNameWithoutExtension(temporary_obj_file_path); var batch_directory_name = string.Format(@"Batched{0}", base_name); var batch_directory_parent_path = Path.GetDirectoryName(temporary_obj_file_path); var batch_directory_path = NFileSystemUtil.GetAbsolutePath(batch_directory_parent_path, batch_directory_name); var temporary_tile_set_file_path = NFileSystemUtil.GetAbsolutePath(batch_directory_path, "tileset.json"); var temporary_b3dm_file_path = NFileSystemUtil.GetAbsolutePath(batch_directory_path, string.Format("{0}.b3dm", base_name)); var output_temporary_tile_set_file_path = NFileSystemUtil.GetDestinationFilePath(batch_directory_path, output_directory_path, temporary_tile_set_file_path); var output_temporary_b3dm_file_path = NFileSystemUtil.GetDestinationFilePath(batch_directory_path, output_directory_path, temporary_b3dm_file_path); File.Copy(temporary_tile_set_file_path, output_temporary_tile_set_file_path, true); File.Copy(temporary_b3dm_file_path, output_temporary_b3dm_file_path, true); return(true); }