本文整理汇总了C++中Triangulation::source_vertex方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::source_vertex方法的具体用法?C++ Triangulation::source_vertex怎么用?C++ Triangulation::source_vertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangulation
的用法示例。
在下文中一共展示了Triangulation::source_vertex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void R_s_k_2::draw_edge_footpoints(const Triangulation& mesh,
const Edge& edge,
const float red,
const float green,
const float blue)
{
const Point& a = mesh.source_vertex(edge)->point();
const Point& b = mesh.target_vertex(edge)->point();
const Sample_vector& samples = edge.first->samples(edge.second);
Sample_vector::const_iterator it;
for (it = samples.begin(); it != samples.end(); ++it)
{
Sample_* sample = *it;
Point p = sample->point();
FT m = 0.5*(1.0 - sample->mass());
Point q;
if (mesh.get_plan(edge) == 0)
{
viewer->glColor3f(0.8f + m, m, m);
FT Da = CGAL::squared_distance(p, a);
FT Db = CGAL::squared_distance(p, b);
if (Da < Db) q = a;
else q = b;
}
else
{
viewer->glColor3f(red + m, green + m, blue + m);
FT t = sample->coordinate();
q = CGAL::ORIGIN + (1.0 - t)*(a - CGAL::ORIGIN) + t*(b - CGAL::ORIGIN);
}
draw_segment(p, q);
}
}