Go to the documentation of this file.
13 #include <boost/graph/graph_traits.hpp>
14 #include <boost/graph/properties.hpp>
16 #include <CGAL/boost/graph/helpers.h>
41 template<
typename HalfedgeGraph,
typename Po
intMap,
typename GeometryTraits >
45 const HalfedgeGraph &g,
47 const GeometryTraits >)
50 typedef typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor
53 if(
halfedge(v, g) == boost::graph_traits< HalfedgeGraph >::null_halfedge())
55 return gt.NULL_VECTOR;
58 Vector normal = gt.NULL_VECTOR;
64 halfedge_descriptor he =
halfedge(v, g);
65 halfedge_descriptor end = he;
68 if(!CGAL::is_border(he, g))
70 Vector n = FEVV::Operators::
71 calculate_face_normal< HalfedgeGraph, PointMap, GeometryTraits >(
72 face(he, g), g, pm, gt);
73 normal = gt.add_v(normal, n);
85 assert(cpt == (
static_cast< int >(
degree(v, g)) - nbBorders));
90 return gt.NULL_VECTOR;
92 return gt.normalize(normal);
107 template<
typename HalfedgeGraph,
109 typename FaceNormalMap,
110 typename GeometryTraits >
114 const HalfedgeGraph &g,
116 const FaceNormalMap &fnm,
117 const GeometryTraits >)
120 typedef typename boost::graph_traits< HalfedgeGraph >::halfedge_descriptor
124 boost::graph_traits< HalfedgeGraph >::null_halfedge())
126 return gt.NULL_VECTOR;
128 Vector normal = gt.NULL_VECTOR;
134 halfedge_descriptor he =
halfedge(v, g);
135 halfedge_descriptor end = he;
138 if(!CGAL::is_border(he, g))
140 normal = gt.add_v(normal,
get(fnm,
face(he, g)));
152 assert(cpt == (
static_cast< int >(
degree(v, g)) - nbBorders));
157 return gt.NULL_VECTOR;
159 return gt.normalize(normal);
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor next(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the next halfedge around its face.
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::degree_size_type degree(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor u, const FEVV::DataStructures::AIF::AIFMesh &)
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor opposite(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns the halfedge with source and target swapped.
FEVV::PCLPointCloudPointMap::value_type get(const FEVV::PCLPointCloudPointMap &pm, FEVV::PCLPointCloudPointMap::key_type key)
Specialization of get(point_map, key) for PCLPointCloud.
Interfaces for plugins These interfaces will be used for different plugins.
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor halfedge(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::vertex_descriptor v, const FEVV::DataStructures::AIF::AIFMesh &sm)
Returns a halfedge with target v.
boost::graph_traits< MeshT >::vertex_descriptor vertex_descriptor
boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::face_descriptor face(typename boost::graph_traits< FEVV::DataStructures::AIF::AIFMesh >::halfedge_descriptor h, const FEVV::DataStructures::AIF::AIFMesh &)
Returns the face incident to halfedge h.
GeometryTraits::Vector calculate_vertex_normal(typename boost::graph_traits< HalfedgeGraph >::vertex_descriptor v, const HalfedgeGraph &g, const PointMap &pm, const GeometryTraits >)
Computes the unit normal at considered vertex v as the average of the normals of incident faces.