本文整理汇总了C++中cg::visualization::drawer_type::draw_point方法的典型用法代码示例。如果您正苦于以下问题:C++ drawer_type::draw_point方法的具体用法?C++ drawer_type::draw_point怎么用?C++ drawer_type::draw_point使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cg::visualization::drawer_type
的用法示例。
在下文中一共展示了drawer_type::draw_point方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void draw(cg::visualization::drawer_type & drawer) const
{
if (count >= 1)
drawer.draw_point(start, 2);
if (count == 2)
drawer.draw_point(finish, 2);
drawer.set_color(Qt::white);
for (unsigned int i = 0; i < input_points.size(); i++)
draw_vector(input_points[i].begin(), input_points[i].end(), drawer);
draw_vector(contour.begin(), contour.end(), drawer);
drawer.set_color(Qt::yellow);
draw_vector(output_points.begin(), output_points.end(), drawer);
}
示例2: draw
void draw(cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::white);
for (point_2 const & p : pts_)
drawer.draw_point(p);
drawer.set_color(Qt::green);
for (size_t lp = ch_size_ - 1, l = 0; l != ch_size_; lp = l++)
{
drawer.draw_point(pts_[l], 3);
drawer.draw_line(pts_[lp], pts_[l]);
}
}
示例3: draw_node
void draw_node(Node<double> *node, cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::green);
drawer.draw_point(node->point, 3);
if(node->children[0] == NULL)
return;
drawer.set_color(Qt::white);
point_2t<double> c = node->boundary.position;
double d = node->boundary.dimension;
point_2 p1(c.x + d, c.y+d/2);
point_2 p2(c.x + d/2, c.y+d);
point_2 p3(c.x, c.y+d/2);
point_2 p4(c.x+d/2, c.y);
drawer.draw_line(p1, p3);
drawer.draw_line(p2, p4);
draw_node(node->children[0], drawer);
draw_node(node->children[1], drawer);
draw_node(node->children[2], drawer);
draw_node(node->children[3], drawer);
}
示例4: draw
void draw(cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::red);
for (point_2 p : points)
drawer.draw_point(p, 5);
drawer.set_color(Qt::white);
for (contour_2 c : contours)
for (auto j = c.begin(); j < c.end(); ++j)
{
auto p = *j;
drawer.draw_point(p, 5);
drawer.draw_line(p, *(++c.circulator(j)));
}
drawer.set_color(Qt::green);
for (int i = 0; i < (int) route.size() - 1; i++)
drawer.draw_line(route[i], route[i + 1]);
}
示例5: draw
void draw(cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::white);
if (cg::has_intersection(r_, s_))
drawer.set_color(Qt::green);
drawer.draw_line(s_[0], s_[1]);
for(size_t l = 0; l != 2; ++l) {
drawer.draw_line(r_.corner(l, l), r_.corner(l^1, l));
drawer.draw_line(r_.corner(l, l), r_.corner(l, l^1));
}
if (idx_) {
drawer.set_color(rbutton_pressed_ ? Qt::red : Qt::yellow);
if(on_rect)
drawer.draw_point(r_.corner((*idx_).first, (*idx_).second), 5);
else
drawer.draw_point(s_[(*idx_).first], 5);
}
}
示例6: draw
void draw(cg::visualization::drawer_type &drawer) const
{
drawer.set_color(Qt::red);
if(have_first_point) {
drawer.draw_point(first_point, 5);
}
if(have_second_point) {
drawer.draw_point(second_point, 5);
}
if(have_first_point && have_second_point) {
dcel_by_lines->add_line(first_point, second_point);
}
drawer.set_color(Qt::blue);
drow_all_lines(drawer);
}
示例7: draw
void draw(cg::visualization::drawer_type & drawer) const override
{
drawer.set_color(Qt::white);
if (current_point_ && cg::contains(contour, *current_point_))
drawer.set_color(Qt::green);
for (size_t l = 0, lp = contour.size() - 1; l != contour.size(); lp = l++)
drawer.draw_line(contour[lp], contour[l]);
if (idx_)
drawer.draw_point(contour[*idx_], 5);
}
示例8: draw
void draw(cg::visualization::drawer_type & drawer) const override
{
drawer.set_color(Qt::white);
drawer.draw_point(*chain.begin(), 5);
for(auto i = chain.begin() + 1; i != chain.end(); ++i)
{
drawer.draw_point(*i, 5);
drawer.draw_line(*i, *(i-1));
}
std::vector<point_2> simple;
douglas_peucker(chain.begin(), chain.end(), eps, back_inserter(simple));
drawer.set_color(Qt::green);
drawer.draw_point(*simple.begin(), 5);
for(auto i = simple.begin() + 1; i != simple.end(); ++i)
{
drawer.draw_point(*i, 5);
drawer.draw_line(*i, *(i-1));
}
}
示例9: draw
void draw(cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::white);
if (current_point_ && cg::contains(t_, *current_point_))
drawer.set_color(Qt::green);
for (size_t l = 0, lp = 2; l != 3; lp = l++)
drawer.draw_line(t_[lp], t_[l]);
if (idx_)
{
drawer.set_color((rbutton_pressed_)? Qt::red : Qt::yellow);
drawer.draw_point(t_[*idx_], 5);
}
}
示例10: draw
void draw(cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::green);
for (segment_2 s : visibility_segments)
drawer.draw_line(s[0], s[1]);
drawer.set_color(Qt::white);
for (contour_2 c : contours)
{
for (auto p = c.begin(); p < c.end(); ++p)
{
drawer.draw_point(*p, 5);
drawer.draw_line(*p, *(++c.circulator(p)));
}
}
}
示例11: draw
void draw(cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::white);
if (cg::has_intersection(s_[0], s_[1]))
drawer.set_color(Qt::green);
for (size_t l = 0; l != 2; l++)
drawer.draw_line(s_[l][0], s_[l][1]);
if (idx_)
{
drawer.set_color(rbutton_pressed_ ? Qt::red : Qt::yellow);
drawer.draw_point(s_[(*idx_).first][(*idx_).second], 5);
}
}
示例12: draw
void draw(cg::visualization::drawer_type & drawer) const
{
if (!readyA && a.size() >= 2)
{
drawer.set_color(Qt::yellow);
drawer.draw_point(*a.begin(), MAGIC);
drawer.set_color(Qt::black);
drawer.draw_point(*a.begin(), MAGIC - 2);
}
if (readyA && !readyB && b.size() >= 2)
{
drawer.set_color(Qt::yellow);
drawer.draw_point(*b.begin(), MAGIC);
drawer.set_color(Qt::black);
drawer.draw_point(*b.begin(), MAGIC - 2);
}
drawer.set_color(Qt::white);
draw_contour(a, drawer);
drawer.set_color(Qt::yellow);
draw_contour(b, drawer);
drawer.set_color(Qt::blue);
for (auto temp : c)
drawer.draw_line(temp.first, temp.second, 2);
}
示例13: draw
void draw(cg::visualization::drawer_type & drawer) const
{
for (point_2 p : points)
{
if (cur_vertex && p == *cur_vertex)
drawer.set_color(Qt::red);
else
drawer.set_color(Qt::white);
drawer.draw_point(p, 5);
}
for (triangle_2 t : triangles)
{
drawer.set_color(Qt::green);
for (int j = 0; j < 3; ++j)
drawer.draw_line(t[j], t[(j + 1) % 3]);
drawer.set_color(Qt::gray);
if (auto st = find_triangle(cur_point))
drawer.draw_circle(get_circumcircle(*st));
}
}
示例14: draw
void draw(cg::visualization::drawer_type & drawer) const
{
for (size_t idx = 0; idx < cur_contour; idx++)
{
contour const & cont = conts[idx];
drawer.set_color(Qt::red);
if (cg::counterclockwise(cont))
drawer.set_color(Qt::green);
for (size_t i = 0; i < cont.size(); i++)
{
size_t j = (i + 1) % cont.size();
cg::point_2 p1 = cont[i], p2 = cont[j];
drawer.draw_line(p1, p2);
}
}
if (in_building_)
{
drawer.set_color(Qt::white);
for (size_t i = 1; i < conts[cur_contour].size(); ++i)
{
drawer.draw_line(conts[cur_contour][i - 1], conts[cur_contour][i]);
}
} else
{
drawer.set_color(Qt::blue);
drawer.draw_point(center, 3);
contour_2 result = minkowski_convex_sum(contour_2(conts[0]), contour_2(reversed));
for (size_t i = 0; i < result.size(); ++i)
{
size_t j = (i + 1) % result.size();
drawer.draw_line(result[i], result[j]);
}
}
}