本文整理汇总了C++中polygon::outer方法的典型用法代码示例。如果您正苦于以下问题:C++ polygon::outer方法的具体用法?C++ polygon::outer怎么用?C++ polygon::outer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类polygon
的用法示例。
在下文中一共展示了polygon::outer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: read_polygon
void read_polygon(uint8_t byte_order, InputIterator& itr, polygon& poly)
{
const size_t count(brig::detail::ogc::read<uint32_t>(byte_order, itr));
if (count == 0) return;
read_line(byte_order, itr, poly.outer());
poly.inners().resize(count - 1);
for (size_t i(0); i < poly.inners().size(); ++i)
read_line(byte_order, itr, poly.inners()[i]);
}
示例2: scorePoly
//score polygon by scoring each line
float scorePoly(polygon p)
{
float poly_score = 0;
std::vector<boost_point> const& points = p.outer();
for (int i = 0; i < points.size() -1; ++i)
{
poly_score += scoreLine(cvPointFromBoostPoint(points[i]), cvPointFromBoostPoint(points[i+1]));
}
if(cvPointFromBoostPoint(points[points.size()-1]) != cvPointFromBoostPoint(points[0]))
poly_score += scoreLine(cvPointFromBoostPoint(points[points.size()-1]), cvPointFromBoostPoint(points[0]));
return poly_score;
}
示例3: drawPoly
void drawPoly(polygon poly, Mat img, Scalar color)
{
std::vector<boost_point> const& points = poly.outer();
if(points.size()>3)
{
for (int i = 0; i < points.size() -1; ++i)
{
line( img, cvPointFromBoostPoint(points[i]), cvPointFromBoostPoint(points[i+1]), color, 2, CV_AA);
//cout<<cvPointFromBoostPoint(points[i]);
}
if(cvPointFromBoostPoint(points[points.size()-1]) != cvPointFromBoostPoint(points[0]))
{
line( img, cvPointFromBoostPoint(points[points.size()-1]), cvPointFromBoostPoint(points[0]), color, 2, CV_AA);
//cout<<cvPointFromBoostPoint(points[points.size()-1])<<endl;
}
}
}
示例4: poly_to_obj
//write polygon to obj file
void poly_to_obj(polygon p, float z1, float z2, ofstream& file)
{
std::vector<boost_point> const& points = p.outer();
int vctr = 1;
for (int i = 0; i < points.size() -1; ++i)
{
file<<"v "<<points[i].x()*scale<<" "<<points[i].y()*scale*-1<<" "<<z1<<endl;
file<<"v "<<points[i].x()*scale<<" "<<points[i].y()*scale*-1<<" "<<z2<<endl;
file<<"v "<<points[i+1].x()*scale<<" "<<points[i+1].y()*scale*-1<<" "<<z1<<endl;
file<<"v "<<points[i+1].x()*scale<<" "<<points[i+1].y()*scale*-1<<" "<<z2<<endl;
file<<"f "<<vctr<<" "<<vctr+2<<" "<<vctr+1<<endl;
file<<"f "<<vctr+2<<" "<<vctr+3<<" "<<vctr+1<<endl;
vctr += 4;
}
// if(cvPointFromBoostPoint(points[points.size()-1]) != cvPointFromBoostPoint(points[0]))
// {
// line( img, cvPointFromBoostPoint(points[points.size()-1]), cvPointFromBoostPoint(points[0]), color, 2, CV_AA);
// }
}
示例5: rasterize_polygon_border
void painter::rasterize_polygon_border(FIBITMAP* bitmap, polygon& p)
{
for (unsigned int i = 0; i < p.outer().size() - 1; ++i)
rasterize_line(bitmap, p.outer()[i], p.outer()[i + 1]);
rasterize_line(bitmap, p.outer()[0], p.outer()[p.outer().size() - 1]);
}