MEPP2 Project
calculate_vertices_one_ring_geometric_laplacian.hpp
Go to the documentation of this file.
1 // Copyright (c) 2012-2019 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 #pragma once
12 
13 #include <boost/graph/graph_traits.hpp>
14 #include <boost/graph/properties.hpp>
15 
18 
19 namespace FEVV {
20 namespace Filters {
21 
44 template< typename FaceGraph,
45  typename PointMap,
46  typename CentroidMap,
47  typename GeometryTraits = FEVV::Geometry_traits< FaceGraph > >
48 void
50  const FaceGraph &g,
51  const PointMap &pm, // const map (follows CGAL usage)
52  CentroidMap geom_laplacians_pm, // modifiable map (follows CGAL usage)
53  const typename GeometryTraits::Scalar smoothing_factor,
54  const GeometryTraits &gt)
55 {
56  typedef boost::graph_traits< FaceGraph > GraphTraits;
57 
58  typedef typename GraphTraits::vertex_iterator vertex_iterator;
59  //typedef typename GraphTraits::vertex_descriptor vertex_descriptor;
60  //typedef typename boost::property_traits< PointMap >::value_type Point;
61  //typedef typename boost::property_traits< PointMap >::reference Reference;
62 
63  // this code works only for Polyhedron_3, Surface Mesh, OpenMesh and AIF
64  auto iterator_pair = vertices(g); // vertices() returns a vertex_iterator pair
65 
66  vertex_iterator vi = iterator_pair.first;
67  vertex_iterator vi_end = iterator_pair.second;
68  for(; vi != vi_end; ++vi)
69  {
70  geom_laplacians_pm[*vi] =
72  PointMap,
73  GeometryTraits >(
74  *vi, g, pm, smoothing_factor, gt);
75  }
76 }
77 
78 template< typename FaceGraph,
79  typename PointMap,
80  typename CentroidMap,
81  typename GeometryTraits = FEVV::Geometry_traits< FaceGraph > >
82 void
84  const FaceGraph &g,
85  const PointMap &pm, // const map (follows CGAL usage)
86  CentroidMap geom_laplacians_pm, // modifiable map (follows CGAL usage)
87  const typename GeometryTraits::Scalar smoothing_factor = 0.1)
88 
89 {
90  GeometryTraits gt(g);
92  PointMap,
93  CentroidMap,
94  GeometryTraits >(
95  g, pm, geom_laplacians_pm, smoothing_factor, gt);
96 }
97 
98 } // namespace Filters
99 } // namespace FEVV
FEVV::DataStructures::AIF::vertices
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_iterator > vertices(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the iterator range of the vertices of the mesh.
Definition: Graph_traits_aif.h:172
FEVV::Filters::calculate_vertices_one_ring_geometric_laplacian
void calculate_vertices_one_ring_geometric_laplacian(const FaceGraph &g, const PointMap &pm, CentroidMap geom_laplacians_pm, const typename GeometryTraits::Scalar smoothing_factor, const GeometryTraits &gt)
Compute geometric laplacians for all vertices and store them in geom_laplacians_pm.
Definition: calculate_vertices_one_ring_geometric_laplacian.hpp:49
vertex_one_ring_geometric_laplacian.hpp
FEVV::Geometry_traits
Refer to Geometry_traits_documentation_dummy for further documentation on provided types and algorith...
Definition: Geometry_traits.h:162
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
Geometry_traits.h
FEVV::Operators::vertex_one_ring_geometric_laplacian
boost::property_traits< PointMap >::value_type vertex_one_ring_geometric_laplacian(typename boost::graph_traits< FaceGraph >::vertex_descriptor v, const FaceGraph &g, const PointMap &pm, const typename GeometryTraits::Scalar smoothing_factor, const GeometryTraits &gt)
Geometric Laplacian of the vertex' one ring of vertex positions.
Definition: vertex_one_ring_geometric_laplacian.hpp:47