15 #include <boost/graph/graph_traits.hpp>
62 template<
typename HalfedgeGraph,
64 typename VertexColorMap,
65 typename GeometryTraits >
70 const GeometryTraits&,
71 draco::DecoderBuffer& buffer,
72 bool dequantize =
true,
73 unsigned int nb_max_batches = 10000)
85 HalfedgeGraph, PointMap >
87 coarse.decode_coarse_mesh(buffer);
94 PointMap>* KP =
nullptr;
97 PointMap>* predictor =
nullptr;
100 if(_vkept == FEVV::Filters::VKEPT_POSITION::HALFEDGE)
106 else if(_vkept == FEVV::Filters::VKEPT_POSITION::MIDPOINT)
113 throw std::runtime_error(
"progressive_decompression_filter cannot handle kept position type.");
118 std::cout <<
"butterfly" << std::endl;
121 PointMap>(g, KP, pm);
123 else if(_pred == FEVV::Filters::PREDICTION_TYPE::DELTA)
125 std::cout <<
"delta" << std::endl;
128 PointMap>(g, KP, pm);
130 else if(_pred == FEVV::Filters::PREDICTION_TYPE::POSITION)
132 std::cout <<
"position" << std::endl;
134 PointMap >(g, KP, pm);
139 throw std::runtime_error(
"progressive_decompression_filter cannot handle geometric prediction type.");
162 while((buffer.remaining_size() != 0) && (nb < nb_max_batches))
164 _batch.decompress_binary_batch(buffer);
197 template<
typename HalfedgeGraph,
199 typename VertexColorMap,
200 typename GeometryTraits >
204 VertexColorMap &v_cm,
205 const GeometryTraits & gt,
206 const std::string &input_file_path,
207 bool dequantize =
true,
208 unsigned int nb_max_batches = 10000)
211 auto time_point_before_decomp = std::chrono::high_resolution_clock::now();
213 std::fstream filebin;
214 filebin.open(input_file_path, std::fstream::in | std::fstream::binary);
215 draco::DecoderBuffer buffer;
216 buffer.set_bitstream_version(DRACO_BITSTREAM_VERSION(2, 2));
218 std::vector< char > data;
221 while(filebin.get(b))
228 buffer.Init(data.data(), data.size());
233 auto time_point_after_decomp = std::chrono::high_resolution_clock::now();
234 auto duration_decomp = std::chrono::duration_cast<std::chrono::milliseconds>(time_point_after_decomp - time_point_before_decomp);
235 std::cout <<
"Decompression time: " << duration_decomp.count() <<
" milliseconds" << std::endl;
258 template<
typename HalfedgeGraph,
260 typename VertexColorMap,
265 VertexColorMap &v_cm,
266 const std::string &input_file_path,
267 bool dequantize =
true,
268 unsigned int nb_max_batches = 10000)
271 GeometryTraits gt(g);
276 g, pm, v_cm, gt, input_file_path, dequantize, nb_max_batches);