File: CGAL_Lab_detect_sharp_edges.h

package info (click to toggle)
cgal 6.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144,952 kB
  • sloc: cpp: 811,597; ansic: 208,576; sh: 493; python: 411; makefile: 286; javascript: 174
file content (32 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

#ifndef LAB_DEMO_DETECT_SHARP_EDGES_H
#define LAB_DEMO_DETECT_SHARP_EDGES_H

#include <CGAL/Polygon_mesh_processing/detect_features.h>

namespace CGAL
{
  template<typename Polyhedron>
  void reset_sharp_edges(Polyhedron* pMesh)
  {
    typename boost::property_map<Polyhedron,edge_is_feature_t>::type if_pm =
        get(CGAL::edge_is_feature, *pMesh);
    for(typename boost::graph_traits<Polyhedron>::edge_descriptor ed : edges(*pMesh))
    {
      put(if_pm,ed,false);
    }
  }
  template<typename Polyhedron>
  void detect_sharp_edges(Polyhedron* pMesh, const double angle)
  {
    reset_sharp_edges(pMesh);

    // Detect edges in current polyhedron
    typename boost::property_map<Polyhedron,edge_is_feature_t>::type eif =
        get(CGAL::edge_is_feature, *pMesh);
    CGAL::Polygon_mesh_processing::detect_sharp_edges(*pMesh, angle, eif);
  }

}//end namespace CGAL

#endif //LAB_DEMO_DETECT_SHARP_EDGES_H