MEPP2 Project
Butterfly.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 "Delta_predictor.h"
15 
16 #include <vector>
17 #include <list>
18 
19 namespace FEVV {
20 namespace Filters {
21 
24 template< typename HalfedgeGraph,
25  typename PointMap >
26 class Butterfly : public Predictor< HalfedgeGraph,
27  PointMap >
28 {
29 public:
33  typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor;
40  HalfedgeGraph &g,
42  *kp,
43  PointMap &pm)
44  : Super_class(g, kp, pm), _delta_for_borders(g, kp, pm)
45  {
46  _alpha = 1.15;
47  k_a = 0;
48  k_b = 0;
51  }
52 
53  std::vector< Vector >
55  {
56 
57  bool border_case = is_on_border(mem.get_vkept());
58  if(!border_case)
59  {
60 
61  halfedge_descriptor v3_to_vkept =
62  std::get< 0 >(halfedge(mem.get_v3(), mem.get_vkept(), Super_class::_g));
63 
64  halfedge_descriptor v4_to_vkept =
65  std::get< 0 >(halfedge(mem.get_v4(), mem.get_vkept(), Super_class::_g));
66 
67  Point A = mem.get_pos_vt();
68  Point B = mem.get_pos_vs();
69 
70  k_a = 0;
71  k_b = 0;
72 
73  halfedge_descriptor begin = v3_to_vkept, end = v4_to_vkept;
74  if(mem.get_reverse())
75  {
76  begin = v4_to_vkept;
77  end = v3_to_vkept;
78  Point save = std::move(A);
79  A = std::move(B);
80  B = std::move(save);
81  }
82  APred = A; // no std::move here!
83  BPred = B; // no std::move here!
84  // Get vertices from each stencil (for both A and B)
85  std::vector< Point > a_vertices, b_vertices, crown_a, crown_b;
86  fill_around_and_crown(a_vertices, crown_a, v3_to_vkept, v4_to_vkept, k_a);
87  fill_around_and_crown(b_vertices, crown_b, v4_to_vkept, v3_to_vkept, k_b);
88 
89  // Compute SA, SB (barycenters of direct neighbours) CA, CB (barycenter
90  // of crown neighbours)
91  Point SA = compute_S(a_vertices,
92  get(Super_class::_pm, mem.get_v3()),
93  get(Super_class::_pm, mem.get_v4()),
94  k_a);
95  Point SB = compute_S(b_vertices,
96  get(Super_class::_pm, mem.get_v3()),
97  get(Super_class::_pm, mem.get_v4()),
98  k_b);
99 
100 
101  Point CA = compute_C(crown_a, b_vertices, k_a);
102  Point CB = compute_C(crown_b, a_vertices, k_b);
103 
104  CApred = CA;
105  CBpred = CB;
106  SApred = SA;
107  SBpred = SB;
108 
109  Vector D = Super_class::_gt.sub_p(B, A);
110  // computing DA' and DB' (vector between kept position and the prediction)
111  std::vector< Vector > result =
112  compute_D_prime_A_and_B(CA, SA, CB, SB, mem.get_pos_vkept());
113  Vector DA = Super_class::_gt.sub_p(A, mem.get_pos_vkept());
114  Vector DB = Super_class::_gt.sub_p(B, mem.get_pos_vkept());
115  DApred = std::move(DA);
116  DBpred = std::move(DB);
117  Vector Dprime =
118  Super_class::_gt.scalar_mult(Super_class::_gt.add_v(result[0], result[1]), 0.5f);
119 
120  Point Aprime = Super_class::_gt.add_pv(mem.get_pos_vkept(),
121  Super_class::_gt.scalar_mult(Dprime, 0.5f));
122  Point Bprime = Super_class::_gt.add_pv(mem.get_pos_vkept(),
123  Super_class::_gt.scalar_mult(Dprime, -0.5f));
124 
125  Aprime = Point(std::round(Super_class::_gt.get_x(Aprime)),
126  std::round(Super_class::_gt.get_y(Aprime)),
127  std::round(Super_class::_gt.get_z(Aprime)));
128 
129  Bprime = Point(std::round(Super_class::_gt.get_x(Bprime)),
130  std::round(Super_class::_gt.get_y(Bprime)),
131  std::round(Super_class::_gt.get_z(Bprime)));
132 
133  if(mem.get_reverse())
134  {
135  Point save = std::move(Aprime);
136  Aprime = std::move(Bprime);
137  Bprime = std::move(save);
138  }
139 
140 
141  Dprime = Super_class::_gt.sub_p(Bprime, Aprime);
142  Vector E = Super_class::_gt.sub_v(D, Dprime);
143  auto tmp = Super_class::_gt.add_pv(Super_class::_gt.ORIGIN, E);
144  E = Vector(std::round(Super_class::_gt.get_x(tmp)),
145  std::round(Super_class::_gt.get_y(tmp)),
146  std::round(Super_class::_gt.get_z(tmp)));
147  Dpred = D;
148  std::vector< Vector > pushed_residual = {E};
149  mem.record_error_prediction(pushed_residual);
150  return pushed_residual;
151  }
152  else
153  {
154  return _delta_for_borders.compute_residuals(mem);
155  }
156  }
157 
158  std::pair< Point, Point > place_points(const std::vector< Vector > &residuals,
159  vertex_descriptor vkept,
161  halfedge_descriptor h2) override
162  {
163  bool is_border_case = is_on_border(vkept);
164  if(!is_border_case)
165  {
166 
167  const Point& current_point = get(Super_class::_pm, vkept);
168 
169  // Case using 1 residual
170 
171  Vector E = residuals[0];
172 
173  // Fill "a" vertices (vertices around a), count k_a (number of vertices
174  // around a) and compute c_a ("crown" around a) vertices.
175  std::vector< Point > a_vertices, c_a_vertices;
176  k_a = 0;
177  fill_around_and_crown(a_vertices, c_a_vertices, h1, h2, k_a);
178  // Fill "b" vertices (vertices around b), count k_b (number of vertices
179  // around b) and compute c_b ("crown" around b ) vertices.
180  std::vector< Point > b_vertices, c_b_vertices;
181  k_b = 0;
182  fill_around_and_crown(b_vertices, c_b_vertices, h2, h1, k_b);
183  // Compute CA, CB (prediction according to crown), SA and SB (prediction
184  // according to direct neighbours)
185  Point SA = compute_S(a_vertices,
188  k_a);
189 
190  Point SB = compute_S(b_vertices,
193  k_b);
194 
195  Point CA = compute_C(c_a_vertices, b_vertices, k_a);
196  Point CB = compute_C(c_b_vertices, a_vertices, k_b);
197 
198  std::vector< Vector > Ds =
199  compute_D_prime_A_and_B(CA, SA, CB, SB, current_point);
200 
201  // we get correct DA and DB
202  Vector Dprime =
203  Super_class::_gt.scalar_mult(Super_class::_gt.add_v(Ds[0], Ds[1]), 0.5f);
204 
205  Point Aprime = Super_class::_gt.add_pv(current_point, Super_class::_gt.scalar_mult(Dprime, 0.5f));
206  Point Bprime = Super_class::_gt.add_pv(current_point, Super_class::_gt.scalar_mult(Dprime, -0.5f));
207 
208  Aprime = Point(std::round(Super_class::_gt.get_x(Aprime)),
209  std::round(Super_class::_gt.get_y(Aprime)),
210  std::round(Super_class::_gt.get_z(Aprime)));
211  Bprime = Point(std::round(Super_class::_gt.get_x(Bprime)),
212  std::round(Super_class::_gt.get_y(Bprime)),
213  std::round(Super_class::_gt.get_z(Bprime)));
214  Dprime = Super_class::_gt.sub_p(Bprime, Aprime);
215 
216  Vector D = Super_class::_gt.add_v(Dprime, E);
217 
218  if(Super_class::_kp->get_type() == VKEPT_POSITION::MIDPOINT)
219  {
220  Vector DA = Super_class::_gt.scalar_mult(D, -0.5f);
221  auto tmp = Super_class::_gt.add_pv(Super_class::_gt.ORIGIN, DA);
222  DA = Vector(std::floor(Super_class::_gt.get_x(tmp)),
223  std::floor(Super_class::_gt.get_y(tmp)),
224  std::floor(Super_class::_gt.get_z(tmp)));
225  Vector DB = Super_class::_gt.add_v(D, DA);
226 
227  Point A = Super_class::_gt.add_pv(current_point, DA);
228 
229  Point B = Super_class::_gt.add_pv(current_point, DB);
230 
231  std::pair< Point, Point > resulting_points;
232 
233  resulting_points = std::make_pair(A, B);
234  return resulting_points;
235  }
236  if(Super_class::_kp->get_type() == VKEPT_POSITION::HALFEDGE)
237  {
238  Vector residual;
239  Point A;
240  Point B;
241 
242  if(_rev)
243  {
244  D = Super_class::_gt.scalar_mult(D, -1);
245 
246  A = Super_class::_gt.add_pv(current_point, D);
247  B = current_point;
248  }
249  else
250  {
251  A = current_point;
252  B = Super_class::_gt.add_pv(current_point, D);
253  }
254 
255 
256  std::pair< Point, Point > resulting_points;
257  resulting_points = std::make_pair(A, B);
258  return resulting_points;
259  }
260  return std::make_pair(Point(0, 0, 0), Point(0, 0, 0));
261  }
262  else
263  {
264  return _delta_for_borders.place_points(residuals,
265  vkept,
266  h1,
267  h2);
268  }
269  }
270 
271  const std::tuple< bool, bool, bool, bool >& get_midpoint() const
272  {
273  return _round_midpoint;
274  }
275  void set_bit_info(bool b1, bool b2, bool b3, bool b4)
276  {
277  _round_midpoint = std::make_tuple(b1, b2, b3, b4);
278  }
279  void set_rev(bool b) override
280  {
281  _rev = b; _delta_for_borders.set_rev(b);
282  }
283 
284  std::string get_as_string() const override { return "butterfly"; }
285 
286 
287  // used for debug: to record the stencil around a vertex, in order to color
288  // them later
289  void record_stencil(std::vector< vertex_descriptor > &around,
290  std::vector< vertex_descriptor > &crown,
291  halfedge_descriptor begin,
293  int &k)
294  {
295  halfedge_descriptor begin_b =
297  halfedge_descriptor first_crown_b = next(
299 
300 
301  k = 0;
302  crown.push_back(target(first_crown_b, Super_class::_g));
303  while(begin_b != end)
304  {
305  around.push_back(source(begin_b, Super_class::_g));
306  halfedge_descriptor current_crown =
309  crown.push_back(target(current_crown, Super_class::_g));
310  begin_b = opposite(next(begin_b, Super_class::_g), Super_class::_g);
311  k++;
312  }
313  }
314 
315 
316 private:
318  {
319  boost::iterator_range<
320  CGAL::Halfedge_around_target_iterator< HalfedgeGraph > >
321  iterator_range = CGAL::halfedges_around_target(v, Super_class::_g);
322  for(auto h_v : iterator_range)
323  {
324  if(CGAL::is_border(source(h_v, Super_class::_g), Super_class::_g))
325  {
326  return true;
327  }
328  }
329  return false;
330  }
331 
332  std::vector< Vector > compute_D_prime_A_and_B(const Point &CA,
333  const Point &SA,
334  const Point &CB,
335  const Point &SB,
336  const Point &kept_position)
337  {
338 
339  // Convert SA,SB,CA,CB to Vector (easier for computation)
340  Vector SA_vec = Vector(Super_class::_gt.get_x(SA),
341  Super_class::_gt.get_y(SA),
342  Super_class::_gt.get_z(SA));
343  Vector SB_vec = Vector(Super_class::_gt.get_x(SB),
344  Super_class::_gt.get_y(SB),
345  Super_class::_gt.get_z(SB));
346 
347 
348  Vector CA_vec = Vector(Super_class::_gt.get_x(CA),
349  Super_class::_gt.get_y(CA),
350  Super_class::_gt.get_z(CA));
351  Vector CB_vec = Vector(Super_class::_gt.get_x(CB),
352  Super_class::_gt.get_y(CB),
353  Super_class::_gt.get_z(CB));
354 
355  Vector V = Vector(Super_class::_gt.get_x(kept_position),
356  Super_class::_gt.get_y(kept_position),
357  Super_class::_gt.get_z(kept_position));
358 
359 
360  // following the formula from the paper
361 
362  Vector alphaSA = Super_class::_gt.scalar_mult(SA_vec, _alpha);
363  Vector alphaSB = Super_class::_gt.scalar_mult(SB_vec, _alpha);
364 
365  Vector opp_alphaCA = Super_class::_gt.scalar_mult(CA_vec, (1 - _alpha));
366  Vector opp_alphaCB = Super_class::_gt.scalar_mult(CB_vec, (1 - _alpha));
367 
368  Vector left_part_A =
369  Super_class::_gt.scalar_mult(Super_class::_gt.add_v(opp_alphaCA, alphaSA), k_a + 3);
370  Vector left_part_B =
371  Super_class::_gt.scalar_mult(Super_class::_gt.add_v(opp_alphaCB, alphaSB), k_b + 3);
372 
373  Vector right_part_A = Super_class::_gt.scalar_mult(V, _alpha - k_a - 3);
374  Vector right_part_B = Super_class::_gt.scalar_mult(V, _alpha - k_b - 3);
375 
376  Vector DA_prime = Super_class::_gt.add_v(left_part_A, right_part_A);
377  Vector DB_prime = Super_class::_gt.add_v(left_part_B, right_part_B);
378 
379  DA_prime = Super_class::_gt.scalar_mult(DA_prime, 1 / (k_a + 3 + _alpha));
380  DB_prime = Super_class::_gt.scalar_mult(DB_prime, 1 / (k_b + 3 + _alpha));
381  auto tmp = Super_class::_gt.add_pv(Super_class::_gt.ORIGIN, DA_prime);
382  auto tmp2 = Super_class::_gt.add_pv(Super_class::_gt.ORIGIN, DB_prime);
383 
384  DA_prime = Vector(std::round(Super_class::_gt.get_x(tmp) * (-2)),
385  std::round(Super_class::_gt.get_y(tmp) * (-2)),
386  std::round(Super_class::_gt.get_z(tmp) * (-2)));
387  DB_prime = Vector(std::round(Super_class::_gt.get_x(tmp2) * (2)),
388  std::round(Super_class::_gt.get_y(tmp2) * (2)),
389  std::round(Super_class::_gt.get_z(tmp2) * (2)));
390 
391  std::vector< Vector > Ds = {DA_prime, DB_prime};
392  return Ds;
393  }
394 
395  FEVV::Filters::Delta_predictor< HalfedgeGraph,
396  PointMap >
400 
401  double _alpha;
402 
403  int k_a, k_b;
404  bool _rev;
405 
409 
410  std::tuple< bool, bool, bool, bool > _round_midpoint;
411 
412  void fill_around_and_crown(std::vector< Point > &around,
413  std::vector< Point > &crown,
414  halfedge_descriptor begin,
416  int &k)
417  {
418  halfedge_descriptor begin_b =
420  halfedge_descriptor first_crown_b = next(
422 
423 
424  k = 0;
425  crown.push_back(
426  get(Super_class::_pm, target(first_crown_b, Super_class::_g)));
427  while(begin_b != end)
428  {
429  around.push_back(get(Super_class::_pm, source(begin_b, Super_class::_g)));
430  halfedge_descriptor current_crown =
433  crown.push_back(
434  get(Super_class::_pm, target(current_crown, Super_class::_g)));
435  begin_b = opposite(next(begin_b, Super_class::_g), Super_class::_g);
436  k++;
437  }
438  }
439 
440  Point compute_S(std::vector< Point > &around, Point v1, Point v2, int &k)
441  {
442  // Compute S
443  Point S(0, 0, 0);
444  for(auto it = around.begin(); it != around.end(); it++)
445  {
446  S = Point(Super_class::_gt.get_x(S) + Super_class::_gt.get_x(*it),
447  Super_class::_gt.get_y(S) + Super_class::_gt.get_y(*it),
448  Super_class::_gt.get_z(S) + Super_class::_gt.get_z(*it));
449  }
450 
451  S = Point(Super_class::_gt.get_x(S) + Super_class::_gt.get_x(v1) +
452  Super_class::_gt.get_x(v2),
453  Super_class::_gt.get_y(S) + Super_class::_gt.get_y(v1) +
454  Super_class::_gt.get_y(v2),
455  Super_class::_gt.get_z(S) + Super_class::_gt.get_z(v1) +
456  Super_class::_gt.get_z(v2));
457  S = Point(Super_class::_gt.get_x(S) / static_cast< double >((k + 3)),
458  Super_class::_gt.get_y(S) / static_cast< double >((k + 3)),
459  Super_class::_gt.get_z(S) / static_cast< double >((k + 3)));
460  return S;
461  }
462 
463  Point compute_C(std::vector< Point > &crown,
464  std::vector< Point > &around_opposite,
465  int &k)
466  {
467  Point b_one = Point(0, 0, 0);
468  Point b_kb = Point(0, 0, 0);
469  if(around_opposite.size() > 0)
470  {
471 
472  b_one = around_opposite[0];
473  b_kb = around_opposite.back();
474  }
475  Point C = Point(Super_class::_gt.get_x(b_one) + Super_class::_gt.get_x(b_kb),
476  Super_class::_gt.get_y(b_one) + Super_class::_gt.get_y(b_kb),
477  Super_class::_gt.get_z(b_one) + Super_class::_gt.get_z(b_kb));
478 
479  for(auto it = crown.begin(); it != crown.end(); it++)
480  {
481  C = Point(Super_class::_gt.get_x(C) + Super_class::_gt.get_x(*it),
482  Super_class::_gt.get_y(C) + Super_class::_gt.get_y(*it),
483  Super_class::_gt.get_z(C) + Super_class::_gt.get_z(*it));
484  }
485  C = Point(Super_class::_gt.get_x(C) / static_cast< double >((k + 3)),
486  Super_class::_gt.get_y(C) / static_cast< double >((k + 3)),
487  Super_class::_gt.get_z(C) / static_cast< double >((k + 3)));
488  return C;
489  }
490 
491 
492  void fill_crown_around_vertex(std::list< vertex_descriptor > &crown,
493  std::list< vertex_descriptor > &around,
494  vertex_descriptor center,
495  int &k)
496  {
497  k = 0;
498  boost::iterator_range<
499  CGAL::Halfedge_around_target_iterator< HalfedgeGraph > >
500  iterator_range = CGAL::halfedges_around_target(center, Super_class::_g);
501  for(auto h_v : iterator_range)
502  {
503  around.push_back(source(h_v, Super_class::_g));
504 
505  halfedge_descriptor next_h =
507 
508  halfedge_descriptor opp_next_h = opposite(next_h, Super_class::_g);
509 
510 
511  if(!CGAL::is_border(opp_next_h, Super_class::_g) &&
512  !CGAL::is_border(
513  next_h, Super_class::_g)) // second verification might be overkill
514  {
515 
516  halfedge_descriptor next_to_crown = next(opp_next_h, Super_class::_g);
517  crown.push_back(target(next_to_crown, Super_class::_g));
518  }
519  k += 1;
520  }
521  }
522 };
523 } // namespace Filters
524 } // namespace FEVV
FEVV::Filters::Collapse_info::get_vkept
vertex_descriptor get_vkept() const
Definition: Collapse_info.h:84
FEVV::Filters::Butterfly::get_midpoint
const std::tuple< bool, bool, bool, bool > & get_midpoint() const
Definition: Butterfly.h:271
Delta_predictor.h
FEVV::DataStructures::AIF::next
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor next(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the next halfedge around its face.
Definition: Graph_traits_aif.h:599
FEVV::Filters::Butterfly::record_stencil
void record_stencil(std::vector< vertex_descriptor > &around, std::vector< vertex_descriptor > &crown, halfedge_descriptor begin, halfedge_descriptor end, int &k)
Definition: Butterfly.h:289
FEVV::Filters::Predictor::get_type
virtual FEVV::Filters::PREDICTION_TYPE get_type() const
Definition: Predictor.h:71
FEVV::Filters::Butterfly::SBpred
Point SBpred
Definition: Butterfly.h:406
FEVV::Filters::Collapse_info::record_error_prediction
void record_error_prediction(const std::vector< Vector > &pred)
Definition: Collapse_info.h:144
FEVV::Filters::Butterfly::SApred
Point SApred
Definition: Butterfly.h:406
FEVV::Filters::Butterfly::set_rev
void set_rev(bool b) override
Definition: Butterfly.h:279
FEVV::Filters::Butterfly
Definition: Butterfly.h:28
FEVV::Filters::Butterfly::APred
Point APred
Definition: Butterfly.h:406
FEVV::Filters::Butterfly::fill_around_and_crown
void fill_around_and_crown(std::vector< Point > &around, std::vector< Point > &crown, halfedge_descriptor begin, halfedge_descriptor end, int &k)
Definition: Butterfly.h:412
FEVV::Filters::Collapse_info::get_reverse
bool get_reverse() const
Definition: Collapse_info.h:106
FEVV::Filters::Predictor::_pm
PointMap & _pm
Definition: Predictor.h:88
FEVV::Filters::Butterfly::CBpred
Point CBpred
Definition: Butterfly.h:406
FEVV::Filters::Butterfly::k_b
int k_b
Definition: Butterfly.h:403
FEVV::Filters::Butterfly::_estimated_a
Point _estimated_a
Definition: Butterfly.h:398
FEVV::Filters::Collapse_info< HalfedgeGraph, PointMap >
FEVV::Filters::Butterfly::_estimated_b
Point _estimated_b
Definition: Butterfly.h:399
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
FEVV::Filters::Butterfly::_delta_for_borders
FEVV::Filters::Delta_predictor< HalfedgeGraph, PointMap > _delta_for_borders
Definition: Butterfly.h:397
FEVV::Filters::Collapse_info::get_pos_vkept
const Point & get_pos_vkept() const
Get edge kept position.
Definition: Collapse_info.h:101
FEVV::Filters::Butterfly::DBpred
Vector DBpred
Definition: Butterfly.h:407
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::Butterfly::set_bit_info
void set_bit_info(bool b1, bool b2, bool b3, bool b4)
Definition: Butterfly.h:275
FEVV::Filters::Butterfly::compute_residuals
std::vector< Vector > compute_residuals(Collapse_info< HalfedgeGraph, PointMap > &mem) override
Definition: Butterfly.h:54
FEVV::Filters::Predictor
Abstract class used to predict position.
Definition: Predictor.h:35
FEVV::Filters::Collapse_info::get_pos_vs
const Point & get_pos_vs() const
Get edge source vertex position.
Definition: Collapse_info.h:99
FEVV::Filters::Collapse_info::get_pos_vt
const Point & get_pos_vt() const
Get edge target vertex position.
Definition: Collapse_info.h:97
FEVV::Filters::Butterfly::_round_midpoint
std::tuple< bool, bool, bool, bool > _round_midpoint
Definition: Butterfly.h:410
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::Predictor::_type
FEVV::Filters::PREDICTION_TYPE _type
Definition: Predictor.h:91
FEVV::Filters::Butterfly::Dpred
Vector Dpred
Definition: Butterfly.h:408
FEVV::Filters::Kept_position< HalfedgeGraph, PointMap >
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Filters::Butterfly::fill_crown_around_vertex
void fill_crown_around_vertex(std::list< vertex_descriptor > &crown, std::list< vertex_descriptor > &around, vertex_descriptor center, int &k)
Definition: Butterfly.h:492
FEVV::Filters::Butterfly::Vector
typename FEVV::Geometry_traits< HalfedgeGraph >::Vector Vector
Definition: Butterfly.h:34
FEVV::Filters::Butterfly::is_on_border
bool is_on_border(vertex_descriptor v) const
Definition: Butterfly.h:317
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::Math::Vector::scalar_mult
static std::vector< ElementType > scalar_mult(const std::vector< ElementType > &v1, ElementType coef)
Compute v1 * coef.
Definition: MatrixOperations.hpp:714
FEVV::Filters::Butterfly::Geometry
typename FEVV::Geometry_traits< HalfedgeGraph > Geometry
Definition: Butterfly.h:36
FEVV::Filters::Butterfly::compute_D_prime_A_and_B
std::vector< Vector > compute_D_prime_A_and_B(const Point &CA, const Point &SA, const Point &CB, const Point &SB, const Point &kept_position)
Definition: Butterfly.h:332
FEVV::Filters::Collapse_info::get_v4
vertex_descriptor get_v4() const
Definition: Collapse_info.h:94
FEVV::Filters::Collapse_info::get_v3
vertex_descriptor get_v3() const
Definition: Collapse_info.h:89
FEVV::Filters::Butterfly::k_a
int k_a
Definition: Butterfly.h:403
FEVV::Filters::Butterfly::BPred
Point BPred
Definition: Butterfly.h:406
FEVV::Filters::Predictor::_gt
const Geometry _gt
Definition: Predictor.h:87
FEVV::Filters::Delta_predictor
Definition: Delta_predictor.h:27
FEVV::Filters::Butterfly::DApred
Vector DApred
Definition: Butterfly.h:407
FEVV::Filters::Butterfly::_rev
bool _rev
Definition: Butterfly.h:404
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::Butterfly::place_points
std::pair< Point, Point > place_points(const std::vector< Vector > &residuals, vertex_descriptor vkept, halfedge_descriptor h1, halfedge_descriptor h2) override
Decompression side: predicts a position from encoded residuals.
Definition: Butterfly.h:158
FEVV::Filters::Butterfly::vertex_descriptor
typename boost::graph_traits< HalfedgeGraph >::vertex_descriptor vertex_descriptor
Definition: Butterfly.h:31
FEVV::Filters::Butterfly::CApred
Point CApred
Definition: Butterfly.h:406
msdm2::vertex_descriptor
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
Definition: msdm2_surfacemesh.h:33
FEVV::Filters::Butterfly::_alpha
double _alpha
Definition: Butterfly.h:401
FEVV::Filters::Butterfly::Butterfly
Butterfly(HalfedgeGraph &g, Kept_position< HalfedgeGraph, PointMap > *kp, PointMap &pm)
Definition: Butterfly.h:39
FEVV::Filters::Butterfly::Point
typename FEVV::Geometry_traits< HalfedgeGraph >::Point Point
Definition: Butterfly.h:35
FEVV::Filters::Predictor::_nbResiduals
int _nbResiduals
Definition: Predictor.h:89
FEVV::Filters::Butterfly::Super_class
Predictor< HalfedgeGraph, PointMap > Super_class
Definition: Butterfly.h:38
FEVV::Filters::Butterfly::halfedge_descriptor
typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor halfedge_descriptor
Definition: Butterfly.h:33
FEVV::Filters::Butterfly::get_as_string
std::string get_as_string() const override
Definition: Butterfly.h:284
FEVV::Filters::Predictor::_kp
Kept_position< HalfedgeGraph, PointMap > * _kp
Definition: Predictor.h:85
FEVV::Filters::Butterfly::compute_C
Point compute_C(std::vector< Point > &crown, std::vector< Point > &around_opposite, int &k)
Definition: Butterfly.h:463
FEVV::Filters::Butterfly::compute_S
Point compute_S(std::vector< Point > &around, Point v1, Point v2, int &k)
Definition: Butterfly.h:440
FEVV::Filters::PREDICTION_TYPE::POSITION
@ POSITION
FEVV::Filters::Predictor::_g
HalfedgeGraph & _g
Definition: Predictor.h:86
FEVV::GeometryTraits::add_v
GeometryTraits::Vector add_v(const typename GeometryTraits::Vector &v1, const typename GeometryTraits::Vector &v2)
Returns the sum of vectors V1 and V2.
Definition: Geometry_traits_operators.h:23