当前位置: 首页>>代码示例>>C++>>正文


C++ ConvexPolygon::intersect方法代码示例

本文整理汇总了C++中ConvexPolygon::intersect方法的典型用法代码示例。如果您正苦于以下问题:C++ ConvexPolygon::intersect方法的具体用法?C++ ConvexPolygon::intersect怎么用?C++ ConvexPolygon::intersect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConvexPolygon的用法示例。


在下文中一共展示了ConvexPolygon::intersect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: test

void ConvexPolygon::test()
{
	ConvexPolygon polyA;
	ConvexPolygon polyB;

	polyA.addPoint(cv::Point2f(1.2647, 0.737144));
	polyA.addPoint(cv::Point2f(1.09702, 2.24956));
	polyA.addPoint(cv::Point2f(0.6286, 2.28678));
	polyA.addPoint(cv::Point2f(0.505286, 2.26628));
	polyA.addPoint(cv::Point2f(0.390494, 2.11702));
	polyA.addPoint(cv::Point2f(0.300014, 1.97472));
	polyA.addPoint(cv::Point2f(0.145461, 1.70306));
	polyA.addPoint(cv::Point2f(0.0566236, 0.907763));
	polyA.addPoint(cv::Point2f(0.0161411, 0.400278));
	polyA.addPoint(cv::Point2f(0.00799566, 0.209088));
	polyA.addPoint(cv::Point2f(0, 0));
	polyA.addPoint(cv::Point2f(0.669949, 0.375082));

	polyB.addPoint(cv::Point2f(1.45802, 0.24155));
	polyB.addPoint(cv::Point2f(1.2647, 0.737144));
	polyB.addPoint(cv::Point2f(0.724684, 0.74934));
	polyB.addPoint(cv::Point2f(0.582521, 0.742624));
	polyB.addPoint(cv::Point2f(0.450183, 0.693712));
	polyB.addPoint(cv::Point2f(0.345872, 0.647083));
	polyB.addPoint(cv::Point2f(0.167695, 0.558064));
	polyB.addPoint(cv::Point2f(0.0652787, 0.297459));
	polyB.addPoint(cv::Point2f(0.0186083, 0.131165));
	polyB.addPoint(cv::Point2f(0.00921783, 0.0685148));
	polyB.addPoint(cv::Point2f(0, 0));
	polyB.addPoint(cv::Point2f(0.772354, 0.122908));

	ConvexPolygon polyC = polyA.intersect(polyB);

	polyA.print("A");
	polyB.print("B");
	polyC.print("C");
}
开发者ID:tiagojc,项目名称:IBTSFIF,代码行数:37,代码来源:convexpolygon.cpp


注:本文中的ConvexPolygon::intersect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。