本文整理汇总了C++中cg::visualization::drawer_type::draw_line方法的典型用法代码示例。如果您正苦于以下问题:C++ drawer_type::draw_line方法的具体用法?C++ drawer_type::draw_line怎么用?C++ drawer_type::draw_line使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cg::visualization::drawer_type
的用法示例。
在下文中一共展示了drawer_type::draw_line方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void draw(cg::visualization::drawer_type & drawer) const
{
if (in_building)
{
drawer.set_color(Qt::white);
for (size_t i = 1; i < points_.size(); ++i)
{
drawer.draw_line(points_[i - 1], points_[i]);
}
return;
}
cg::contour_2 cont(points_);
if (!cg::counterclockwise(cont) || !cg::convex(cont))
{
drawer.set_color(Qt::yellow);
} else
{
drawer.set_color(cg::convex_contains(cont, *current_point_) ? Qt::green : Qt::red);
}
for (size_t i = 1; i < points_.size(); ++i)
{
drawer.draw_line(points_[i - 1], points_[i]);
}
drawer.draw_line(points_.front(), points_.back());
}
示例2: 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)));
}
}
}
示例3: draw_contour
void draw_contour(contour_2f const& p, cg::visualization::drawer_type & drawer)
{
if (p.size() <= 1)
return;
for (auto a = p.begin(), b = a + 1; b != p.end(); a++, b++)
drawer.draw_line(*a, *b);
}
示例4: 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);
}
示例5: 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]);
}
示例6: draw
void draw(cg::visualization::drawer_type & drawer) const
{
drawer.set_color(Qt::white);
// drawer.draw_line(s_[0], s_[1]);
for (size_t l = 0, lp = 2; l != 3; lp = l++)
{
drawer.draw_line(t_[lp], t_[l]);
drawer.draw_line(s_[lp], s_[l]);
}
drawer.set_color(Qt::green);
for (size_t l = 0, lp = int_.size() - 1; l != int_.size(); lp = l++)
{
drawer.draw_line(int_[lp], int_[l]);
}
}
示例7: 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::red);
drawer.draw_line(t_[0], t_[1]);
}
示例8: draw_vector
void draw_vector(Iter a, Iter c, cg::visualization::drawer_type & drawer)
{
if (a == c)
return;
Iter b = a + 1;
for (; b != c; a++, b++)
drawer.draw_line(*a, *b);
}
示例9: 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);
}
}
示例10: 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);
}
示例11: 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));
}
}
示例12: 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]);
}
}
示例13: 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]);
}
}
}
示例14: draw
void draw(cg::visualization::drawer_type & drawer) const
{
if (in_building_)
{
drawer.set_color(Qt::white);
for (size_t i = 1; i < points_.size(); ++i)
{
drawer.draw_line(points_[i - 1], points_[i]);
}
return;
}
}
示例15: 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);
}
}