MEPP2 Project
Graph_traits_extension_cgal_linear_cell_complex.h
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 /*
14  * Specialization of graph traits extension
15  * for CGAL::Linear_cell_complex
16  */
17 
18 #include "Graph_traits_extension.h"
19 #include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
20 
21 #define CGAL_LCC_TEMPLATE_ARGS \
22  template< unsigned int d_, \
23  unsigned int ambient_dim, \
24  class Traits_, \
25  class Items_, \
26  class Alloc_, \
27  template< unsigned int, class, class, class, class > class CMap, \
28  class Storage_ >
29 
30 #define CGAL_LCC_TYPE \
31  CGAL::Linear_cell_complex_for_combinatorial_map< d_, \
32  ambient_dim, \
33  Traits_, \
34  Items_, \
35  Alloc_, \
36  CMap, \
37  Storage_ >
38 
39 
40 namespace FEVV {
41 
42 
52 typename boost::graph_traits< CGAL_LCC_TYPE >::vertices_size_type
54 {
55  return lcc.template attributes< 0 >().size();
56 }
57 
58 
68 typename boost::graph_traits< CGAL_LCC_TYPE >::edges_size_type
70 {
71  return lcc.number_of_darts() / 2;
72 }
73 
74 
84 typename boost::graph_traits< CGAL_LCC_TYPE >::halfedges_size_type
86 {
87  return lcc.number_of_darts();
88 }
89 
90 
100 typename boost::graph_traits< CGAL_LCC_TYPE >::faces_size_type
102 {
103  return lcc.template attributes< 2 >().size();
104 }
105 
106 
107 } // namespace FEVV
108 
109 
110 // ELO note: Clear mesh
111 // see
112 // https://doc.cgal.org/latest/Combinatorial_map/classGenericMap.html
113 //
114 // void clear()
115 // Deletes all the darts and all the attributes of the generic map.
116 //
117 // probably used by
118 // void clear(FaceGraph& g)
119 // see CGAL-4.x/include/CGAL/boost/graph/helpers.h
120 //
121 
122 
123 #undef CGAL_LCC_TEMPLATE_ARGS
124 #undef CGAL_LCC_TYPE
125 
126 
FEVV::size_of_halfedges
boost::graph_traits< MeshT >::halfedges_size_type size_of_halfedges(const MeshT &g)
Real current number of halfedges of the mesh. Generic version.
Definition: Graph_traits_extension.h:63
FEVV::size_of_edges
boost::graph_traits< MeshT >::edges_size_type size_of_edges(const MeshT &g)
Real current number of edges of the mesh. Generic version.
Definition: Graph_traits_extension.h:46
FEVV
Interfaces for plugins These interfaces will be used for different plugins.
Definition: Assert.h:16
FEVV::size_of_faces
boost::graph_traits< MeshT >::faces_size_type size_of_faces(const MeshT &g)
Real current number of faces of the mesh. Generic version.
Definition: Graph_traits_extension.h:80
Graph_traits_extension.h
CGAL_LCC_TEMPLATE_ARGS
#define CGAL_LCC_TEMPLATE_ARGS
Definition: Graph_traits_extension_cgal_linear_cell_complex.h:21
CGAL_LCC_TYPE
#define CGAL_LCC_TYPE
Definition: Graph_traits_extension_cgal_linear_cell_complex.h:30
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