MEPP2 Project
Predictor.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 #include <CGAL/boost/graph/iterator.h>
17 
19 
22 
23 #include <vector>
24 #include <utility>
25 
26 namespace FEVV {
27 namespace Filters {
28 
31 template<
32  typename HalfedgeGraph,
33  typename PointMap>
34 class Predictor
35 {
36 public:
40  typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor;
42  typename boost::graph_traits< HalfedgeGraph >::face_descriptor;
47  HalfedgeGraph &g,
49  *kp,
50  PointMap &pm)
51  : _g(g), _gt(Geometry(_g)), _pm(pm)
52  {
53  _kp = kp;
54  _kept_position = Point(0, 0, 0);
55  }
56  virtual ~Predictor(){}
57 
60  virtual std::vector< Vector >
62 
64  virtual std::pair< Point, Point >
65  place_points(const std::vector< Vector > &residuals,
66  vertex_descriptor vkept,
69  ) = 0;
70 
71  virtual FEVV::Filters::PREDICTION_TYPE get_type() const { return _type; }
72 
73  virtual void set_rev(bool /*b*/) = 0;
74 
75  virtual const Point& get_kept_position() const { return _kept_position; }
76 
77  virtual FEVV::Filters::VKEPT_POSITION get_type_KP() const { return _kp->get_type(); }
78 
79 
80  virtual std::string get_as_string() const = 0;
81 
82  int get_nb_residuals() const { return _nbResiduals; }
83 protected:
85  *_kp;
86  HalfedgeGraph &_g;
87  const Geometry _gt;
88  PointMap &_pm;
92 };
93 } // namespace Filters
94 } // namespace FEVV
FEVV::Filters::Predictor::halfedge_descriptor
typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor halfedge_descriptor
Definition: Predictor.h:40
FEVV::Filters::Predictor::Vector
typename FEVV::Geometry_traits< HalfedgeGraph >::Vector Vector
Definition: Predictor.h:43
FEVV::Filters::Predictor::get_type
virtual FEVV::Filters::PREDICTION_TYPE get_type() const
Definition: Predictor.h:71
FEVV::Filters::Predictor::Point
typename FEVV::Geometry_traits< HalfedgeGraph >::Point Point
Definition: Predictor.h:44
FEVV::Filters::Predictor::get_kept_position
virtual const Point & get_kept_position() const
Definition: Predictor.h:75
FEVV::Filters::Kept_position::get_type
VKEPT_POSITION get_type() const
Definition: Kept_position.h:46
FEVV::Filters::Predictor::get_nb_residuals
int get_nb_residuals() const
Definition: Predictor.h:82
FEVV::Filters::Predictor::face_descriptor
typename boost::graph_traits< HalfedgeGraph >::face_descriptor face_descriptor
Definition: Predictor.h:42
Kept_position.h
FEVV::Filters::PREDICTION_TYPE
PREDICTION_TYPE
Definition: Parameters.h:19
FEVV::Filters::Predictor::_pm
PointMap & _pm
Definition: Predictor.h:88
FEVV::Filters::Collapse_info< HalfedgeGraph, PointMap >
FEVV::Filters::Predictor::~Predictor
virtual ~Predictor()
Definition: Predictor.h:56
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
FEVV::Filters::Predictor::place_points
virtual std::pair< Point, Point > place_points(const std::vector< Vector > &residuals, vertex_descriptor vkept, halfedge_descriptor h1, halfedge_descriptor h2)=0
Decompression side: predicts a position from encoded residuals.
FEVV::Filters::Predictor::Predictor
Predictor(HalfedgeGraph &g, Kept_position< HalfedgeGraph, PointMap > *kp, PointMap &pm)
Definition: Predictor.h:46
FEVV::Filters::Predictor::compute_residuals
virtual std::vector< Vector > compute_residuals(Collapse_info< HalfedgeGraph, PointMap > &mem)=0
FEVV::Filters::Predictor
Abstract class used to predict position.
Definition: Predictor.h:35
FEVV::Filters::Predictor::set_rev
virtual void set_rev(bool)=0
FEVV::Filters::Predictor::_type
FEVV::Filters::PREDICTION_TYPE _type
Definition: Predictor.h:91
FEVV::Filters::Kept_position< HalfedgeGraph, PointMap >
FEVV::Filters::Predictor::get_as_string
virtual std::string get_as_string() const =0
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Filters::Predictor::Geometry
typename FEVV::Geometry_traits< HalfedgeGraph > Geometry
Definition: Predictor.h:45
Geometry_traits.h
FEVV::Filters::Predictor::get_type_KP
virtual FEVV::Filters::VKEPT_POSITION get_type_KP() const
Definition: Predictor.h:77
FEVV::Filters::VKEPT_POSITION
VKEPT_POSITION
Definition: Parameters.h:28
FEVV::Filters::Predictor::_kept_position
Point _kept_position
Definition: Predictor.h:90
FEVV::Filters::Predictor::_gt
const Geometry _gt
Definition: Predictor.h:87
Collapse_info.h
msdm2::vertex_descriptor
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
Definition: msdm2_surfacemesh.h:33
FEVV::Filters::Predictor::_nbResiduals
int _nbResiduals
Definition: Predictor.h:89
FEVV::Filters::Predictor::vertex_descriptor
typename boost::graph_traits< HalfedgeGraph >::vertex_descriptor vertex_descriptor
Definition: Predictor.h:38
FEVV::Filters::Predictor::_kp
Kept_position< HalfedgeGraph, PointMap > * _kp
Definition: Predictor.h:85
FEVV::Filters::Predictor::_g
HalfedgeGraph & _g
Definition: Predictor.h:86