MEPP2 Project
Batch_collapser.h
Go to the documentation of this file.
1 // Copyright (c) 2012-2022 University of Lyon and CNRS (France).
2 // All rights reserved.
3 //
4 // This file is part of MEPP2; you can redistribute it and/or modify
5 // it under the terms of the GNU Lesser General Public License as
6 // published by the Free Software Foundation; either version 3 of
7 // the License, or (at your option) any later version.
8 //
9 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
10 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
11 
12 #pragma once
13 
14 #include <boost/graph/graph_traits.hpp>
15 #include <boost/graph/properties.hpp>
16 
18 
19 #include "CGAL/boost/graph/Euler_operations.h"
20 
24 
26 
30 
32 
37 
39 
40 #include <iostream>
41 #include <fstream>
42 #include <vector>
43 #include <list>
44 #include <set>
45 #include <map>
46 #include <limits>
47 
48 namespace FEVV {
49 namespace Filters {
50 
51 enum class BATCH_CONDITION { ALL_EDGES = 0, REACH_THRESHOLD };
52 
60 template< typename HalfedgeGraph,
61  typename PointMap,
62  typename Metric,
63  typename EdgeColorMap,
64  typename VertexColorMap >
66 {
67 public:
71  typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor;
73  typename boost::graph_traits< HalfedgeGraph >::edge_descriptor;
75  typename boost::graph_traits< HalfedgeGraph >::face_descriptor;
79 
96  HalfedgeGraph &g,
97  PointMap &pm,
98  Metric *metric,
100  *predictor,
101  VertexColorMap &vcm,
102  EdgeColorMap &ecm,
103  BATCH_CONDITION batch_stop)
104  : _g(g), _pm(pm), _metric(metric),
105  _vcm(vcm), _ecm(ecm),
106  _gt(Geometry(g)), _predictor(predictor)
107  {
108  _batch_id = 0;
109  _forbidden = 0;
110  _link_condition = 0;
111  _nb_collapse = 0;
114  _batch_stop = batch_stop;
115  }
117 
120  bool stop()
121  {
122  switch(_batch_stop)
123  {
124  case BATCH_CONDITION::ALL_EDGES:
125  return _metric->is_queue_empty();
126  break;
128  if(!_metric->is_queue_empty())
129  {
130 
131  return (_metric->get_top_cost() > _metric->get_mean_threshold());
132  }
133  else
134  {
135  return true;
136  }
137  break;
138 
139  default:
140  return _metric->is_queue_empty();
141  break;
142  }
143 
144  }
145 
151  PointMap >
152  &spanningtree)
153  {
154  std::ofstream file_encode;
155  file_encode.open("encodingspanning" +
156  std::to_string(_batch_id) + ".txt");
157  auto span = spanningtree.get_spanning_tree_vertices();
158  typename std::list< vertex_descriptor >::const_iterator it = span.begin();
159 
160  for( ; it != span.end(); it++)
161  {
162  const Point& pt = get(_pm, *it);
163  std::list< vertex_descriptor > list_v_around =
165  file_encode << _gt.get_x(pt) << " " << _gt.get_y(pt) << " "
166  << _gt.get_z(pt) << " " << list_v_around.size() << std::endl;
167  }
168  file_encode.close();
169  }
170 
174  Header_handler &header,
175  double diag,
176  bool skip
177  )
178  {
179  if(!skip)
180  {
181  std::cout << "computing symmetrical L2 (max L2/Hausdorff and RMSE)" << std::endl;
182  HalfedgeGraph current_graph = _g; // needs a copy
183  PointMap current_pm = get(boost::vertex_point, current_graph);
185  current_graph,
186  current_pm,
187  header.get_quantization(),
188  header.get_dimension(),
189  header.get_init_coord());
190 
192  double geometric_error =
193  g_metric.compute_symmetric_L2(current_graph, true);
194  _RMSE_distortion_per_batch.push_back(geometric_error / diag);
195  geometric_error =
196  g_metric.compute_symmetric_L2(current_graph, false);
197  _hausdorff_distortion_per_batch.push_back(geometric_error / diag);
198  }
199  else
200  {
201  _RMSE_distortion_per_batch.push_back(-1);
202  _hausdorff_distortion_per_batch.push_back(-1);
203  }
204  }
205 
206  private:
209  PointMap >
210  &spanningtree)
211  {
213  _list_memory.sort(mc);
214  }
215 
218  PointMap >
219  /*&spanningtree*/)
220  {
221  auto it_list = _list_memory.begin();
222 
223  for( ; it_list != _list_memory.end(); ++it_list)
224  {
225  _predictor->compute_residuals((*it_list));
226  }
227  }
228 
229 public:
237  {
238  // Count every case: forbidden edges, edges which would make our mesh non
239  // manifold or non-decodable.
240  _forbidden = 0;
241  _link_condition = 0;
242  _metric->compute_error(); // Compute all edge costs for the current batch.
243  // Implements lines 7 to 11 of Algorithm 1.
244 
245  bool collapse_possible = true;
246  _nb_collapse = 0;
247 
248  // Collapse until we meet our stopping condition.
249  // Implements lines 12 to 23 of Algorithm 1.
250  while(!stop())
251  {
252  collapse_possible = collapse_top_queue(); // Get the edge with lowest cost
253  // and collapse it (if possible).
254  if(collapse_possible)
255  {
256  _nb_collapse += 1;
257  }
258  }
259  int64_t number_current_vertices = FEVV::size_of_vertices(_g);
260 #if(DEBUG)
261  // Compute percentage of removed vertices compared to original mesh.
262  double percentage_vertices = (1 - (double)number_current_vertices /
263  (double)_number_vertices_original) * 100;
264  std::cout << "Percentage vertices removed from start " << percentage_vertices << std::endl;
265 
266  percentage_vertices = (1 - (double)number_current_vertices / (double)_number_vertices_last) * 100;
267  std::cout << "Percentage vertices removed from last " << percentage_vertices << std::endl;
268 #endif
269  _number_vertices_last = number_current_vertices;
271  // Spanning tree construction. Implements line 24 of Algorithm 1.
273  PointMap > spanningtree(_g, _pm, true);
274  sort_list_memory(spanningtree); // Sort _list_memory according to vertex
275  // st traversal.
276  // Implements line 25 of Algorithm 1.
278  // Store refinement info as bitstreams and residuals.
279  Refinement_info< HalfedgeGraph,
280  PointMap >
281  ref_settings(_g, _list_memory);
282 
283  // set_bitMask, set_connectivity_topology, and set_reverse_bool
284  // implement line 26 of Algorithm 1.
285  // Compute vertex to split bitmask.
286  ref_settings.set_bitMask(spanningtree); // set vertex to split bitmask
287 
288  // Compute connectivity bitmask (to know which halfedges to expand at the
289  // decompression step).
290  ref_settings.set_connectivity_topology(spanningtree,
291  _pm,
292  _list_memory); // set one-ring bitmask
293  ref_settings.set_reverse_bool();// set reverse bitmask
294 
295  // Compute Predictions.
296  // The two lines below implement line 27 of Algorithm 1.
297  setup_prediction(spanningtree); // compute residuals
298  ref_settings.set_error_prediction(); // set residuals array
300  _refinements.push_back(ref_settings); // Implements line 28 of Algorithm 1
302 #if(DEBUG)
303  std::cout << "batch nb " << _batch_id << " done" << std::endl;
304 #endif
305  _batch_id++;
306  _forbidden_edges.clear();
307  _list_memory.clear();
308  }
309 
310  private:
313  const Point &pos_vkept)
314  {
315  return (is_vertex_position_change_without_normal_flip(h_collapse, source(h_collapse, _g), pos_vkept) &&
316  is_vertex_position_change_without_normal_flip(h_collapse, target(h_collapse, _g), pos_vkept));
317  }
318 
323  halfedge_descriptor h_collapse,
324  vertex_descriptor vertex,
325  const Point& pos_vkept)
326  {
327  assert(vertex == source(h_collapse, _g) ||
328  vertex == target(h_collapse, _g));
329 
330  const Point& pvertex = get(_pm, vertex);
331 
332  if(pos_vkept == pvertex)
333  return true;
334  else
335  {
336  auto iterator_range = CGAL::halfedges_around_target(vertex, _g);
337  for(auto h : iterator_range)
338  {
339  // case where h is a border
340  if(CGAL::is_border(h, _g))
341  continue;
342 
343  face_descriptor f = face(h, _g); // we know that f!=null_face()
344 
345  // when f is one of the two incident faces to the collapsed edge
346  if(f == face(h_collapse, _g))
347  continue;
348 
349  if(f == face(opposite(h_collapse, _g), _g))
350  continue;
351 
352  const Point& p1 = get(_pm, source(h, _g));
353  const Point& p0 = get(_pm, source(prev(h, _g), _g));
354 
355  if((p0 == pvertex) || (p1 == pvertex))
356  {
357  std::cerr << "Warning: is_vertex_position_change_without_normal_flip: "
358  "we should not have dupplicate at this stage ";
359  }
360 
361  Vector face_normal, face_normal_after_collapse;
362  // get the normal of the current face
363  // check if the current face is flat
364  bool b = FEVV::Math::Vector::are_collinear< Geometry >(
365  _gt.sub_p(p0, p1), _gt.sub_p(pvertex, p1));
366  if(!b)
367  face_normal =
368  _gt.normal(p0, p1, pvertex); // gt.unit_normal(p0, p1, pvertex);
369  else
370  { // when the current face is flat
371  face_normal =
372  Vector(std::numeric_limits< typename FEVV::Geometry_traits<
373  HalfedgeGraph >::Scalar >::quiet_NaN(),
374  std::numeric_limits< typename FEVV::Geometry_traits<
375  HalfedgeGraph >::Scalar >::quiet_NaN(),
376  std::numeric_limits< typename FEVV::Geometry_traits<
377  HalfedgeGraph >::Scalar >::quiet_NaN());
378 
379  //return false; // the face was flat, but with the new pos_vkept
380  // can resolve it
381  }
382  // simulation of the new face after collapse and check if its
383  // normal has the same sign
384  auto cross = _gt.cross_product(p0 - p1, p0 - pos_vkept);
385  if(cross != Vector(0, 0, 0))
386  {
387  face_normal_after_collapse = _gt.unit_normal(
388  p0, p1, pos_vkept);
389 
390  const typename Geometry::Scalar sign =
391  _gt.dot_product(face_normal, face_normal_after_collapse);
392  if(sign < 0.0)
393  return false;
394  }
395  else
396  {
397  return false;
398  }
399  }
400 
401  return true;
402  }
403  }
404 
406  {
407  // forbid border cases for the first version
408  return (
409  ((_forbidden_edges.find(h) == _forbidden_edges.end() &&
410  _forbidden_edges.find(opposite(h, _g)) == _forbidden_edges.end()) &&
411  _metric->is_present_in_map(edge(h, _g))));
412  }
413 
420  {
421  bool mesh_changed = false;
422  if(!_metric->is_queue_empty())
423  {
424  // we obtain the edge with the lowest cost
425  std::tuple< edge_descriptor, double, Point > current_edge =
426  _metric->get_top_queue(); // Implements line 13 of Algorithm 1.
427 
428  // is the current edge forbidden?
429  auto current_halfedge = halfedge(std::get< 0 >(current_edge), _g);
430 
431  if(is_forbidden(current_halfedge, std::get< 2 >(current_edge)))
432  {
433  if(CGAL::Euler::does_satisfy_link_condition(std::get< 0 >(current_edge),
434  _g))
435  {
436  vertex_descriptor vs = source(current_halfedge, _g);
437  vertex_descriptor vt = target(current_halfedge, _g);
438 
439  const Point& pvkept = std::get< 2 >(current_edge); // vkept position
440 
441  // Check if collapsing this edge would flip normals, thus adding
442  // artifacts. If it does, do not collapse.
443  bool normal_flip = are_halfedge_vertex_positions_change_without_normal_flip(current_halfedge, pvkept); // true when ok
444 
445  if(normal_flip)
446  {
447  // Here the edge is collapsible (line 14 of Algorithm 1).
448 
449  // Create a collapse info objet to store the info we need to
450  // reconstruct the edge.
452  memory.record_vt_vs_pos(get(_pm, vt), get(_pm, vs));
453  memory.record_v3_v4(current_halfedge);
454 
455  // give collapse info a unique ID (useful for debugging)
457 
458  // forbid the simplification of the neighbourhood of the collapsed
459  // edge for the current batch
460  forbid_edges(_g, vs, _forbidden_edges); // Implements line 16 of Algorithm 1.
461  forbid_edges(_g, vt, _forbidden_edges); // Implements line 17 of Algorithm 1.
462 
463  // Collapse edge.
464  // Implements line 18 of Algorithm 1.
465  vertex_descriptor vkept =
466  CGAL::Euler::collapse_edge(std::get< 0 >(current_edge), _g);
467  mesh_changed = true;
468 
469  // set position of the kept vertex
470  put(_pm, vkept, pvkept);
471 
472  memory.record_pos_vkept(vkept);
473  memory.record_vkept(vkept);
474 
475  _list_memory.push_back(std::move(memory));
476  }
477 #if(DEBUG)
478  else
479  {
480  std::cerr << "Warning: collapse_top_queue: an collapse did not occur due to a normal flip." << std::endl;
481  }
482 #endif
483  _link_condition++;
484  }
485  }
486  else
487  {
488  _forbidden++;
489  mesh_changed = false;
490  }
491  _metric->pop_queue(); // dans tous les cas on pop
492  }
493  return mesh_changed;
494  }
495 
496 public:
497  const std::vector< Refinement_info< HalfedgeGraph,
498  PointMap > >&
500  {
501 
502  return _refinements;
503  }
504 
505  const std::vector< double >& get_RMSE_distortion() const { return _RMSE_distortion_per_batch; }
506  const std::vector< double >& get_hausdorff_distortion() const { return _hausdorff_distortion_per_batch; }
507 private:
508  HalfedgeGraph &_g;
509  PointMap &_pm;
510  Metric *_metric;
511  VertexColorMap &_vcm;
512  EdgeColorMap &_ecm;
513  std::set< halfedge_descriptor > _forbidden_edges;
514  const Geometry _gt;
515  int _batch_id;
517  std::list< Collapse_info< HalfedgeGraph, PointMap > > _list_memory;
518  FEVV::Filters::
520  Predictor< HalfedgeGraph, PointMap >
522  std::vector< Refinement_info< HalfedgeGraph,
523  PointMap > >
525 
529  std::vector< std::vector< bool > > _list_edge_bitmask;
534 };
535 
536 } // namespace Filters
537 } // namespace FEVV
FEVV::Header_handler::get_init_coord
const std::vector< double > & get_init_coord() const
Definition: Header_handler.h:161
FEVV::Filters::Batch_collapser::get_RMSE_distortion
const std::vector< double > & get_RMSE_distortion() const
Definition: Batch_collapser.h:505
FEVV::Filters::Batch_collapser::sort_list_memory
void sort_list_memory(const FEVV::Comparator::Spanning_tree_vertex_edge_comparator< HalfedgeGraph, PointMap > &spanningtree)
Definition: Batch_collapser.h:207
FEVV::Filters::Batch_collapser::is_vertex_position_change_without_normal_flip
bool is_vertex_position_change_without_normal_flip(halfedge_descriptor h_collapse, vertex_descriptor vertex, const Point &pos_vkept)
Definition: Batch_collapser.h:322
FEVV::Filters::Batch_collapser::face_descriptor
typename boost::graph_traits< HalfedgeGraph >::face_descriptor face_descriptor
Definition: Batch_collapser.h:75
FEVV::Filters::Batch_collapser::get_refinements
const std::vector< Refinement_info< HalfedgeGraph, PointMap > > & get_refinements() const
Definition: Batch_collapser.h:499
FEVV::Filters::Batch_collapser::_list_memory
std::list< Collapse_info< HalfedgeGraph, PointMap > > _list_memory
Definition: Batch_collapser.h:517
Volume_preserving.h
FEVV::Comparator::get_adjacent_vertices
std::list< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor > get_adjacent_vertices(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, const FEVV::DataStructures::AIF::AIFMesh &)
Definition: Spanning_tree_vertex_edge_comparator.hpp:28
FEVV::Filters::Collapse_info::record_v3_v4
void record_v3_v4(halfedge_descriptor h)
Definition: Collapse_info.h:116
FEVV::Filters::Batch_collapser::Batch_collapser
Batch_collapser(HalfedgeGraph &g, PointMap &pm, Metric *metric, Predictor< HalfedgeGraph, PointMap > *predictor, VertexColorMap &vcm, EdgeColorMap &ecm, BATCH_CONDITION batch_stop)
Batch_collapser.
Definition: Batch_collapser.h:95
FEVV::Filters::Batch_collapser::compute_distortion_l2
void compute_distortion_l2(FEVV::Filters::Geometric_metrics< HalfedgeGraph, PointMap > &g_metric, Header_handler &header, double diag, bool skip)
Computes the L2 distorsion between the original mesh and the current LoD.
Definition: Batch_collapser.h:172
FEVV::Filters::Batch_collapser::_g
HalfedgeGraph & _g
Definition: Batch_collapser.h:508
FEVV::Filters::Batch_collapser::Point
typename FEVV::Geometry_traits< HalfedgeGraph >::Point Point
Definition: Batch_collapser.h:77
FEVV::Header_handler::get_quantization
int get_quantization() const
Definition: Header_handler.h:159
FEVV::Filters::Batch_collapser::Vector
typename FEVV::Geometry_traits< HalfedgeGraph >::Vector Vector
Definition: Batch_collapser.h:76
FEVV::Filters::Batch_collapser::_metric
Metric * _metric
Definition: Batch_collapser.h:510
FEVV::Header_handler::get_dimension
const std::vector< double > & get_dimension() const
Definition: Header_handler.h:160
FEVV::Filters::Batch_collapser::setup_prediction
void setup_prediction(FEVV::Comparator::Spanning_tree_vertex_edge_comparator< HalfedgeGraph, PointMap >)
Definition: Batch_collapser.h:216
FEVV::Filters::Collapse_info< HalfedgeGraph, PointMap >
FEVV::Filters::Batch_collapser::_nb_collapse
int _nb_collapse
current batch number
Definition: Batch_collapser.h:516
FEVV::DataStructures::AIF::opposite
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor opposite(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the halfedge with source and target swapped.
Definition: Graph_traits_aif.h:625
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
Uniform_dequantization.h
FEVV::Filters::Collapse_info::record_vkept
void record_vkept(vertex_descriptor vkept)
Definition: Collapse_info.h:137
FEVV::Filters::Batch_collapser::_gt
const Geometry _gt
Edges that cannot be collapsed in the current batch.
Definition: Batch_collapser.h:514
FEVV::Filters::Uniform_dequantization::point_dequantization
void point_dequantization()
Dequantizes all vertex positions stored in the point map.
Definition: Uniform_dequantization.h:111
FEVV::Filters::Geometric_metrics
Geometric_metrics is a class dedicated to the geometric distance computation between an original full...
Definition: Geometric_metrics.h:55
FEVV::DataStructures::AIF::source
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor source(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the source vertex of e.
Definition: Graph_traits_aif.h:387
FEVV::Filters::Batch_collapser::collapse_top_queue
bool collapse_top_queue()
collapse_top_queue collapses the edge with the lowest cost, and records the necessary information in ...
Definition: Batch_collapser.h:419
Memory_comparator.h
FEVV::DataStructures::AIF::edge
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor edge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the edge corresponding to h and opposite(h).
Definition: Graph_traits_aif.h:345
FEVV::Filters::Predictor
Abstract class used to predict position.
Definition: Predictor.h:35
FEVV::Filters::Batch_collapser::_link_condition
int _link_condition
Definition: Batch_collapser.h:530
FEVV::Filters::Batch_collapser::save_spanning_tree
void save_spanning_tree(const FEVV::Comparator::Spanning_tree_vertex_edge_comparator< HalfedgeGraph, PointMap > &spanningtree)
Definition: Batch_collapser.h:149
FEVV::Filters::Collapse_info::record_vt_vs_pos
void record_vt_vs_pos(const Point &v1, const Point &v2)
Definition: Collapse_info.h:131
FEVV::get
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
Definition: Graph_properties_pcl_point_cloud.h:117
FEVV::Filters::Collapse_info::record_pos_vkept
void record_pos_vkept(vertex_descriptor vkept)
Definition: Collapse_info.h:149
FEVV::Comparator::Spanning_tree_vertex_edge_comparator
Definition: Spanning_tree_vertex_edge_comparator.hpp:258
FEVV::Filters::Batch_collapser::get_hausdorff_distortion
const std::vector< double > & get_hausdorff_distortion() const
Definition: Batch_collapser.h:506
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Filters::Batch_collapser::_ecm
EdgeColorMap & _ecm
Definition: Batch_collapser.h:512
FEVV::Filters::Batch_collapser::_list_edge_bitmask
std::vector< std::vector< bool > > _list_edge_bitmask
Definition: Batch_collapser.h:529
FEVV::Filters::Batch_collapser::_refinements
std::vector< Refinement_info< HalfedgeGraph, PointMap > > _refinements
Definition: Batch_collapser.h:524
FEVV::Filters::Collapse_info::set_num_collapse
void set_num_collapse(int nb)
Definition: Collapse_info.h:109
FEVV::Filters::Batch_collapser::stop
bool stop()
stop() : Depending on the chosen Batch condition, will return whether we have to continue collapsing ...
Definition: Batch_collapser.h:120
FEVV::Filters::Batch_collapser::edge_descriptor
typename boost::graph_traits< HalfedgeGraph >::edge_descriptor edge_descriptor
Definition: Batch_collapser.h:73
stencil.h
FEVV::Filters::Refinement_info
Definition: Refinement_info.h:46
FEVV::Filters::Geometric_metrics::compute_symmetric_L2
double compute_symmetric_L2(const HalfedgeGraph &LoD, bool compute_RMSE_instead_of_max)
Proposed RMSE and Hausdorff distances implementation.
Definition: Geometric_metrics.h:211
Butterfly.h
FEVV::DataStructures::AIF::halfedge
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor halfedge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns a halfedge with target v.
Definition: Graph_traits_aif.h:296
FEVV::DataStructures::AIF::target
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor target(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_descriptor e, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the target vertex of e.
Definition: Graph_traits_aif.h:400
FEVV::Filters::Batch_collapser::Geometry
typename FEVV::Geometry_traits< HalfedgeGraph > Geometry
Definition: Batch_collapser.h:78
FEVV::Filters::BATCH_CONDITION::ALL_EDGES
@ ALL_EDGES
apply_color.h
FEVV::Filters::Batch_collapser::vertex_descriptor
typename boost::graph_traits< HalfedgeGraph >::vertex_descriptor vertex_descriptor
Definition: Batch_collapser.h:69
FEVV::Filters::Batch_collapser::_number_vertices_last
int64_t _number_vertices_last
Definition: Batch_collapser.h:532
FEVV::Filters::Memory_comparator
Functor object to sort sequential container of Collapse_info objects. It is based on the Spanning_tre...
Definition: Memory_comparator.h:29
FEVV::Filters::Batch_collapser::_vcm
VertexColorMap & _vcm
Measuring collapse cost of each edge.
Definition: Batch_collapser.h:511
Edge_length_metric.h
FEVV::Filters::Batch_collapser::collapse_batch
void collapse_batch()
Definition: Batch_collapser.h:236
FEVV::Filters::Batch_collapser::_RMSE_distortion_per_batch
std::vector< double > _RMSE_distortion_per_batch
Definition: Batch_collapser.h:528
FEVV::Filters::Batch_collapser::~Batch_collapser
~Batch_collapser()
Definition: Batch_collapser.h:116
FEVV::DataStructures::AIF::prev
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor prev(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the previous halfedge around its face.
Definition: Graph_traits_aif.h:612
FEVV::Filters::Uniform_dequantization< HalfedgeGraph, PointMap >
generic_writer.hpp
FEVV::Filters::Batch_collapser::is_forbidden
bool is_forbidden(halfedge_descriptor h, Point)
Definition: Batch_collapser.h:405
FEVV::Filters::Batch_collapser::_predictor
FEVV::Filters::Predictor< HalfedgeGraph, PointMap > * _predictor
Definition: Batch_collapser.h:521
msdm2::vertex_descriptor
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
Definition: msdm2_surfacemesh.h:33
Geometric_metrics.h
FEVV::Filters::Batch_collapser::_forbidden_edges
std::set< halfedge_descriptor > _forbidden_edges
Definition: Batch_collapser.h:513
FEVV::put
void put(FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key, const FEVV::PCLPointCloudPointMap::value_type &value)
Specialization of put(point_map, key, value) for PCLPointCloud.
Definition: Graph_properties_pcl_point_cloud.h:126
FEVV::Filters::Batch_collapser::_number_vertices_original
int64_t _number_vertices_original
Definition: Batch_collapser.h:532
FEVV::Filters::Batch_collapser::_hausdorff_distortion_per_batch
std::vector< double > _hausdorff_distortion_per_batch
Definition: Batch_collapser.h:528
QEM_3D.h
FEVV::Filters::Batch_collapser
Batch_collapser: Takes an halfedge graph and collapses its edges. A Batch_collapser object can simpli...
Definition: Batch_collapser.h:66
FEVV::DataStructures::AIF::face
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor face(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the face incident to halfedge h.
Definition: Graph_traits_aif.h:664
FEVV::Header_handler
Definition: Header_handler.h:35
Refinement_info.h
FEVV::Filters::Batch_collapser::halfedge_descriptor
typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor halfedge_descriptor
Definition: Batch_collapser.h:71
FEVV::Filters::Batch_collapser::_pm
PointMap & _pm
the mesh being simplified
Definition: Batch_collapser.h:509
FEVV::Filters::Batch_collapser::_batch_stop
BATCH_CONDITION _batch_stop
Definition: Batch_collapser.h:533
Spanning_tree_vertex_edge_comparator.hpp
FEVV::Filters::forbid_edges
void forbid_edges(HalfedgeGraph &g, vertex_descriptor v, std::set< halfedge_descriptor > &forbidden_edges)
Definition: stencil.h:69
Raw_positions.h
FEVV::Filters::Batch_collapser::_batch_id
int _batch_id
Definition: Batch_collapser.h:515
Header_handler.h
FEVV::Filters::Batch_collapser::_forbidden
int _forbidden
Definition: Batch_collapser.h:531
FEVV::Filters::BATCH_CONDITION
BATCH_CONDITION
Definition: Batch_collapser.h:51
FEVV::size_of_vertices
boost::graph_traits< MeshT >::vertices_size_type size_of_vertices(const MeshT &g)
Real current number of vertices of the mesh. Generic version.
Definition: Graph_traits_extension.h:29
FEVV::Filters::Batch_collapser::are_halfedge_vertex_positions_change_without_normal_flip
bool are_halfedge_vertex_positions_change_without_normal_flip(halfedge_descriptor h_collapse, const Point &pos_vkept)
Returns whether the edge collapse causes a normal flip.
Definition: Batch_collapser.h:312
FEVV::face_normal
@ face_normal
Definition: properties.h:77