本文整理汇总了C++中Draw::DrawPolyPolyline方法的典型用法代码示例。如果您正苦于以下问题:C++ Draw::DrawPolyPolyline方法的具体用法?C++ Draw::DrawPolyPolyline怎么用?C++ Draw::DrawPolyPolyline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Draw
的用法示例。
在下文中一共展示了Draw::DrawPolyPolyline方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawPolyPolygonRaw
static void DrawPolyPolygonRaw(Draw& draw, const Point *vertices, int vertex_count,
const int *subpolygon_counts, int subpolygon_count_count,
bool is_inside, int outline_width, Color outline_color
)
{
#ifdef SYSTEMDRAW
SystemDraw *w = dynamic_cast<SystemDraw *>(&draw);
if(w) { SystemDraw& draw = *w;
#endif
draw.SetDrawPen(outline_width, outline_color);
ASSERT(sizeof(POINT) == sizeof(Point)); // modify algorithm when not
enum { MAX_POLY = 8000 };
if(subpolygon_count_count == 1 && vertex_count < MAX_POLY)
Polygon(draw, (const POINT *)vertices, vertex_count);
else if(vertex_count < MAX_POLY)
PolyPolygon(draw, (const POINT *)vertices, subpolygon_counts, subpolygon_count_count);
else {
if(is_inside) {
draw.SetDrawPen(PEN_NULL, Black);
Vector<Point> split_vertices;
Vector<int> split_counts;
#ifdef SYSTEMDRAW
SplitPolygon(vertices, vertex_count, subpolygon_counts, subpolygon_count_count,
split_vertices, split_counts, Size(9999, 9999));
#else
SplitPolygon(vertices, vertex_count, subpolygon_counts, subpolygon_count_count,
split_vertices, split_counts, draw.GetClip());
#endif
//!! todo: maxcount for splitpolygon
const Point *sv = split_vertices.Begin();
for(const int *sc = split_counts.Begin(), *se = split_counts.End(); sc < se; sc++) {
Polygon(draw, (const POINT *)sv, *sc);
sv += *sc;
}
}
if(outline_width != PEN_NULL) {
draw.DrawPolyPolyline(vertices, vertex_count, subpolygon_counts, subpolygon_count_count,
outline_width, outline_color, Null);
Buffer<Point> finish(2 * subpolygon_count_count);
Buffer<int> counts(subpolygon_count_count);
Fill(&counts[0], &counts[subpolygon_count_count], 2);
Point *d = finish;
const Point *p = vertices;
const int *c = subpolygon_counts, *e = c + subpolygon_count_count;
while(c < e)
{
*d++ = *p;
*d++ = (p += *c++)[-1];
}
draw.DrawPolyPolyline(finish, 2 * subpolygon_count_count,
counts, subpolygon_count_count, outline_width, outline_color, Null);
}
draw.SetDrawPen(outline_width, outline_color);
}
#ifdef SYSTEMDRAW
}
#endif
}