本文整理汇总了C++中Tr::number_of_faces方法的典型用法代码示例。如果您正苦于以下问题:C++ Tr::number_of_faces方法的具体用法?C++ Tr::number_of_faces怎么用?C++ Tr::number_of_faces使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tr
的用法示例。
在下文中一共展示了Tr::number_of_faces方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char** argv)
{
int arg_count = 1;
bool terminal_output = true;
bool delaunay = false;
bool verbose = false;
if(argc < 2)
{
usage(argv);
return 1;
}
while(argv[arg_count][0] == '-' && std::string(argv[arg_count]) != "--")
{
if(std::string(argv[arg_count]) == "-Q")
terminal_output = false;
else if(std::string(argv[arg_count]) == "-D")
delaunay = true;
else if(std::string(argv[arg_count]) == "-v")
verbose = true;
else
{
std::cerr << "Unknown option " << argv[arg_count] << std::endl;
usage(argv);
return 1;
}
++arg_count;
}
if(std::string(argv[arg_count]) == "--")
++arg_count;
if(argc < arg_count+1 || argc > arg_count+2)
{
usage(argv);
return 1;
}
std::ifstream input(argv[arg_count]);
if(input)
{
Tr t;
CGAL::read_triangle_poly_file(t, input);
if(delaunay)
{
if(verbose)
std::cerr << "Make conforming Delaunay..." << std::endl;
CGAL::make_conforming_Delaunay_2(t);
}
else
{
if(verbose)
std::cerr << "Make conforming Gabriel..." << std::endl;
CGAL::make_conforming_Gabriel_2(t);
}
if(argc==arg_count+1)
{
if(terminal_output)
CGAL::write_triangle_poly_file(t, std::cout);
}
else
{
std::ofstream output(argv[arg_count+1]);
CGAL::write_triangle_poly_file(t, output);
}
if(terminal_output)
std::cerr
<< "Number of points: " << t.number_of_vertices() << std::endl
<< "Number of triangles: " << t.number_of_faces () << std::endl;
}
else
{
std::cerr << "Bad file: " << argv[arg_count] << std::endl;
usage(argv);
return 1;
}
return 0;
}