MEPP2 Project
print_face_normals.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 <iostream>
14 #include <boost/graph/graph_traits.hpp>
15 
16 namespace FEVV {
17 namespace Filters {
18 
19 
26 template< typename HalfedgeGraph, typename NormalMap >
27 void
28 print_face_normals(const HalfedgeGraph &g, NormalMap nm)
29 {
30  std::cout << "Face normals:" << std::endl;
31  typedef boost::graph_traits< HalfedgeGraph > GraphTraits;
32  typedef typename GraphTraits::face_iterator face_iterator;
33  for(face_iterator it = faces(g).begin(); it != faces(g).end(); ++it)
34  {
35  // Facet_iterator is a face_descriptor, so we can use it as the
36  // key here
37  std::cout << nm[*it] << std::endl;
38  }
39 }
40 
41 
42 } // namespace Filters
43 } // namespace FEVV
FEVV::Filters::print_face_normals
void print_face_normals(const HalfedgeGraph &g, NormalMap nm)
Print all faces normals.
Definition: print_face_normals.hpp:28
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