MEPP2 Project
Graph_traits_extension.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 #include <boost/graph/graph_traits.hpp>
14 #include <iterator> // for std::distance
15 
16 namespace FEVV {
17 
18 
27 template< typename MeshT >
28 typename boost::graph_traits< MeshT >::vertices_size_type
30 {
31  return (typename boost::graph_traits< MeshT >::vertices_size_type)
32  std::distance(vertices(g).first, vertices(g).second);
33 }
34 
35 
44 template< typename MeshT >
45 typename boost::graph_traits< MeshT >::edges_size_type
47 {
48  return (typename boost::graph_traits< MeshT >::edges_size_type)std::distance(
49  edges(g).first, edges(g).second);
50 }
51 
52 
61 template< typename MeshT >
62 typename boost::graph_traits< MeshT >::halfedges_size_type
64 {
65  return (typename boost::graph_traits< MeshT >::halfedges_size_type)
66  std::distance(halfedges(g).first, halfedges(g).second);
67 }
68 
69 
78 template< typename MeshT >
79 typename boost::graph_traits< MeshT >::faces_size_type
81 {
82  return (typename boost::graph_traits< MeshT >::faces_size_type)std::distance(
83  faces(g).first, faces(g).second);
84 }
85 
86 
87 } // namespace FEVV
88 
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::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::DataStructures::AIF::edges
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::edge_iterator > edges(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the iterator range of the edges of the mesh.
Definition: Graph_traits_aif.h:238
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::DataStructures::AIF::faces
std::pair< typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator, typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_iterator > faces(const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns an iterator range over all faces of the mesh.
Definition: Graph_traits_aif.h:679
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
FEVV::DataStructures::AIF::AIFMesh
This class represents an AIF structure. AIF structure can deal with both manifold and non-manifold su...
Definition: AIFMesh.hpp:47
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