本文整理汇总了C++中Polygon_2::is_counterclockwise_oriented方法的典型用法代码示例。如果您正苦于以下问题:C++ Polygon_2::is_counterclockwise_oriented方法的具体用法?C++ Polygon_2::is_counterclockwise_oriented怎么用?C++ Polygon_2::is_counterclockwise_oriented使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygon_2
的用法示例。
在下文中一共展示了Polygon_2::is_counterclockwise_oriented方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: build_skeleton
void build_skeleton(const char* fname)
{
typedef typename Kernel::Point_2 Point_2;
typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Straight_skeleton_builder_traits_2<Kernel> SsBuilderTraits;
typedef CGAL::Straight_skeleton_2<Kernel> Ss;
typedef CGAL::Straight_skeleton_builder_2<SsBuilderTraits,Ss> SsBuilder;
Polygon_2 pgn;
std::ifstream input(fname);
FT x,y;
while(input)
{
input >> x;
if (!input) break;
input >> y;
if (!input) break;
pgn.push_back( Point_2( typename Kernel::FT(x), typename Kernel::FT(y) ) );
}
input.close();
std::cout << "Polygon has " << pgn.size() << " points\n";
if(!pgn.is_counterclockwise_oriented()) {
std::cerr << "Polygon is not CCW Oriented" << std::endl;
}
if(!pgn.is_simple()) {
std::cerr << "Polygon is not simple" << std::endl;
}
CGAL::Timer time;
time.start();
SsBuilder ssb;
ssb.enter_contour(pgn.vertices_begin(), pgn.vertices_end());
boost::shared_ptr<Ss> straight_ske = ssb.construct_skeleton();
time.stop();
std::cout << "Time spent to build skeleton " << time.time() << "\n";
if(!straight_ske->is_valid()) {
std::cerr << "Straight skeleton is not valid" << std::endl;
}
std::cerr.precision(60);
print_straight_skeleton(*straight_ske);
}