38 #ifndef PCL_GRAPH_IMPL_EDGE_WEIGHT_COMPUTER_CPP
39 #define PCL_GRAPH_IMPL_EDGE_WEIGHT_COMPUTER_CPP
59 template <
typename EdgeWeightMap>
69 template <
typename EdgeDescriptor>
bool
86 template <
typename Po
intT,
typename Enable =
void>
95 template <
typename Po
intT>
100 return (p1.curvature > 0.0f && p2.curvature > 0.0f);
110 template <
typename GraphT>
111 template <
class EdgeWeightMap>
void
114 typename boost::graph_traits<GraphT>::edge_iterator ei, ee;
117 if (g_terms_.size() || l_terms_.size())
119 for (
size_t i = 0; i < g_terms_.size(); ++i)
121 g_terms_[i].init(boost::num_edges(graph));
123 for (
size_t i = 0; i < l_terms_.size(); ++i)
125 l_terms_[i].init(boost::num_edges(graph), boost::num_vertices(graph));
129 for (boost::tie(ei, ee) = boost::edges(graph); ei != ee; ++ei, ++edge_id)
131 typename boost::graph_traits<GraphT>::vertex_descriptor v1, v2;
133 for (
size_t i = 0; i < g_terms_.size(); ++i)
135 g_terms_[i].round1(graph[v1], graph[v2], edge_id);
137 for (
size_t i = 0; i < l_terms_.size(); ++i)
139 l_terms_[i].round1(graph[v1], graph[v2], v1, v2, edge_id);
143 for (
size_t i = 0; i < g_terms_.size(); ++i)
145 g_terms_[i].extract();
147 for (
size_t i = 0; i < l_terms_.size(); ++i)
149 l_terms_[i].extract();
157 for (boost::tie(ei, ee) = boost::edges(graph); ei != ee; ++ei, ++edge_id)
159 typename boost::graph_traits<GraphT>::vertex_descriptor v1, v2;
161 const PointT& p1 = graph[v1];
162 const PointT& p2 = graph[v2];
164 for (
size_t i = 0; i < terms_.size(); ++i)
166 a *= balancing_function_(terms_[i].compute_(p1, p2), terms_[i].getInfluence(is_convex(p1, p2)));
168 for (
size_t i = 0; i < g_terms_.size(); ++i)
170 a *= balancing_function_(g_terms_[i].round2(edge_id), g_terms_[i].getInfluence(is_convex(p1, p2)));
172 for (
size_t i = 0; i < l_terms_.size(); ++i)
174 a *= balancing_function_(l_terms_[i].round2(v1, v2, edge_id), l_terms_[i].getInfluence(is_convex(p1, p2)));
183 case SMALL_WEIGHT_IGNORE:
187 case SMALL_WEIGHT_COERCE_TO_THRESHOLD:
189 typedef typename boost::graph_traits<GraphT>::edge_iterator
EdgeIterator;
191 for (boost::tie(ei, ee) = boost::edges(graph); ei != ee; ++ei)
192 if (weights[*ei] < threshold_)
194 weights[*ei] = threshold_;
198 case SMALL_WEIGHT_REMOVE_EDGE:
204 re(predicate, graph);