本文整理汇总了C++中PEdge::priority方法的典型用法代码示例。如果您正苦于以下问题:C++ PEdge::priority方法的具体用法?C++ PEdge::priority怎么用?C++ PEdge::priority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PEdge
的用法示例。
在下文中一共展示了PEdge::priority方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void R_s_k_2::draw_pedges(const float line_width)
{
int nb_edges = 0;
int nb_pinned = 0;
int nb_cyclic = 0;
int nb_discart = 0;
FT min_value = (std::numeric_limits<FT>::max)();
FT max_value = -(std::numeric_limits<FT>::max)();
std::vector<FT> values;
std::vector<Edge> edges;
for (Finite_edges_iterator ei = m_dt.finite_edges_begin(); ei != m_dt.finite_edges_end(); ++ei)
{
Edge edge = *ei;
for (unsigned int i = 0; i < 2; ++i)
{
if (m_dt.is_pinned(edge))
{
nb_pinned++;
continue;
}
if (m_dt.is_target_cyclic(edge))
{
nb_cyclic++;
continue;
}
PEdge pedge;
bool ok = create_pedge(edge, pedge);
if (ok)
{
edges.push_back(edge);
values.push_back(pedge.priority());
min_value = (std::min)(min_value, values.back());
max_value = (std::max)(max_value, values.back());
}
else
{
nb_discart++;
viewer->glColor3f(1.0, 0.0, 1.0);
draw_edge(edge);
}
edge = m_dt.twin_edge(edge);
nb_edges++;
}
}
if (min_value == max_value) max_value += 1.0;
std::size_t N = values.size();
for (unsigned int i = 0; i < N; ++i)
draw_one_pedge(edges[i], values[i], min_value, max_value, line_width);
std::cout << "There are: " << N << " pedges"
<< " x " << nb_discart << " discarted"
<< " x " << nb_pinned << " pinned"
<< " x " << nb_cyclic << " cyclic"
<< " = " << nb_edges << " edges"
<< std::endl;
}