MEPP2 Project
Kept_position.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 
15 
16 #include <boost/graph/graph_traits.hpp>
17 #include <boost/graph/properties.hpp>
18 #include <CGAL/boost/graph/iterator.h>
20 
21 namespace FEVV {
22 namespace Filters {
27 template< typename HalfedgeGraph,
28  typename PointMap,
29  typename Geometry = typename FEVV::Geometry_traits< HalfedgeGraph > >
31 {
32 public:
33  using Vector = typename Geometry::Vector;
34  using Point = typename Geometry::Point;
35  Kept_position(HalfedgeGraph &g,
36  PointMap &pm)
37  : _g(g), _gt(Geometry(_g)), _pm(pm){}
38  Kept_position(HalfedgeGraph &g,
39  PointMap &pm,
40  Geometry &gt)
41  : _g(g), _gt(gt), _pm(pm){}
42  virtual ~Kept_position(){}
45  typename boost::graph_traits< HalfedgeGraph >::edge_descriptor edge) = 0;
46  VKEPT_POSITION get_type() const { return _type; }
49  bool get_reverse() const { return _reverse; }
50  virtual std::string get_as_string() const = 0;
51 
52 protected:
53  HalfedgeGraph &_g;
54  const Geometry _gt;
55  PointMap &_pm;
57  bool _reverse;
58 };
59 } // namespace Filters
60 } // namespace FEVV
FEVV::Filters::Kept_position::Kept_position
Kept_position(HalfedgeGraph &g, PointMap &pm)
Definition: Kept_position.h:35
FEVV::Filters::Kept_position< HalfedgeGraph, PointMap, typename FEVV::Geometry_traits< HalfedgeGraph > >::Vector
typename Geometry::Vector Vector
Definition: Kept_position.h:33
Vector
AIFMesh::Vector Vector
Definition: Graph_properties_aif.h:22
FEVV::Filters::Kept_position::_pm
PointMap & _pm
Definition: Kept_position.h:55
FEVV::Filters::Kept_position::get_type
VKEPT_POSITION get_type() const
Definition: Kept_position.h:46
Parameters.h
FEVV::Filters::Kept_position::_g
HalfedgeGraph & _g
Definition: Kept_position.h:53
FEVV::Filters::Kept_position::get_as_string
virtual std::string get_as_string() const =0
FEVV::Filters::Kept_position::get_reverse
bool get_reverse() const
Definition: Kept_position.h:49
FEVV::Geometry_traits< HalfedgeGraph >
Point
AIFMesh::Point Point
Definition: Graph_properties_aif.h:21
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::Kept_position::compute_position
virtual Point compute_position(typename boost::graph_traits< HalfedgeGraph >::edge_descriptor edge)=0
Compute the kept vertex position of an edge.
FEVV::Filters::Kept_position
Abstract class to represent the position type of the resulting vertex of an edge collapse.
Definition: Kept_position.h:31
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::Filters::Kept_position::_type
FEVV::Filters::VKEPT_POSITION _type
Definition: Kept_position.h:56
Geometry_traits.h
FEVV::Filters::VKEPT_POSITION
VKEPT_POSITION
Definition: Parameters.h:28
FEVV::Filters::Kept_position::~Kept_position
virtual ~Kept_position()
Definition: Kept_position.h:42
FEVV::Filters::Kept_position< HalfedgeGraph, PointMap, typename FEVV::Geometry_traits< HalfedgeGraph > >::Point
typename Geometry::Point Point
Definition: Kept_position.h:34
FEVV::Filters::Kept_position::_gt
const Geometry _gt
Definition: Kept_position.h:54
FEVV::Filters::Kept_position::_reverse
bool _reverse
Definition: Kept_position.h:57
FEVV::Filters::Kept_position::Kept_position
Kept_position(HalfedgeGraph &g, PointMap &pm, Geometry &gt)
Definition: Kept_position.h:38