本文整理汇总了C++中Triangulation::remove方法的典型用法代码示例。如果您正苦于以下问题:C++ Triangulation::remove方法的具体用法?C++ Triangulation::remove怎么用?C++ Triangulation::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Triangulation
的用法示例。
在下文中一共展示了Triangulation::remove方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
Triangulation t;
Vector midpoint(0.5, 0.5);
Face_handle fh;
Triangulation::Locate_type lt;
int i;
fh = t.locate(Point(0, 0) + midpoint, lt, i);
CGAL_assertion(lt == Triangulation::EMPTY);
Vertex_handle vh_midpoint = t.insert(Point(0, 0) + midpoint);
fh = t.locate(Point(0, 0) + midpoint, lt, i);
CGAL_assertion(lt == Triangulation::VERTEX && fh->vertex(i) == vh_midpoint);
t.remove(vh_midpoint);
CGAL_assertion(t.empty());
// High degree vertex
for (int n = 3; n < 8; ++n)
{
vh_midpoint = t.insert(Point(0, 0) + midpoint);
for (int i = 0; i < n; ++i)
{
t.insert(Point(0.3 * sin(i * 1.0 / n * 2 * M_PI), 0.3 * cos(i * 1.0 / n * 2 * M_PI)) + midpoint);
}
t.remove(vh_midpoint);
CGAL_assertion(t.is_valid(true));
while (!t.empty())
{
t.remove(t.vertices_begin());
CGAL_assertion(t.is_valid(true));
}
}
Random random(1284141159);
std::cout << "Seed: " << random.get_seed () << std::endl;
Random_points_in_square g(0.495, random);
CGAL_assertion(t.is_valid());
std::cout << "Removing first point" << std::endl;
Vertex_handle vh0 = t.insert(Point(0.5, 0.5));
CGAL_assertion(t.is_valid());
t.remove(vh0);
CGAL_assertion(t.is_valid());
CGAL_assertion(t.empty());
{
Random random(1284141159);
std::cout << "Seed: " << random.get_seed () << std::endl;
Random_points_in_square g(0.495, random);
Vector midpoint(0.5, 0.5);
Triangulation t;
CGAL_assertion(t.is_valid());
std::cout << "Removing first point" << std::endl;
Vertex_handle vh0 = t.insert(Point(0.5, 0.5));
CGAL_assertion(t.is_valid());
t.remove(vh0);
CGAL_assertion(t.is_valid());
CGAL_assertion(t.empty());
std::cout << "Inserting random points and removing them." << std::endl;
for (int i = 0; i < N_PTS; ++i)
{
t.insert(*(++g) + midpoint);
}
CGAL_assertion(t.is_valid());
for (int i = 0; i < N_PTS; ++i)
{
// Find a random vertex
Vertex_handle vh = t.locate(*(++g) + midpoint)->vertex(0);
vh = t.get_original_vertex(vh);
t.remove(vh);
CGAL_assertion(t.is_valid());
}
}
return 0;
}
示例2: remove_blue_point
void remove_blue_point(Point p){
blue_points.erase(std::remove(blue_points.begin(), blue_points.end(), p), blue_points.end());
blue_red_t.remove(blue_red_t.nearest_vertex(p));
}