• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ visualization::drawer_type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cg::visualization::drawer_type的典型用法代码示例。如果您正苦于以下问题:C++ drawer_type类的具体用法?C++ drawer_type怎么用?C++ drawer_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: 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);
   }
开发者ID:sslavian812,项目名称:quadrotree,代码行数:27,代码来源:quad-tree.cpp


示例2: 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]);
   }
开发者ID:free0u,项目名称:cg,代码行数:8,代码来源:segment_contains_point.cpp


示例3: draw

    void draw(cg::visualization::drawer_type & drawer) const
    {
        for (triangle_2 tr : trs) {
            drawer.set_color(Qt::red);
            cg::visualization::draw(drawer, tr);

            drawer.set_color(Qt::yellow);
            cg::visualization::draw(drawer, tr.circumcenter(), tr.circumradius());
        }
    }
开发者ID:flevix,项目名称:cg,代码行数:10,代码来源:delaunay.cpp


示例4: draw

 void draw(cg::visualization::drawer_type & drawer) const
 {
    std::for_each(answer.begin(), answer.end(),
       [&](cg::triangle_2 tr)
       {
          drawer.set_color(Qt::white);
          cg::visualization::draw(drawer, tr);
          drawer.set_color(Qt::green);
          cg::visualization::draw(drawer, tr.center(), tr.radius());
       });
 }
开发者ID:wotopul,项目名称:cg,代码行数:11,代码来源:delaunay.cpp


示例5: 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);
   }
开发者ID:BigBot22,项目名称:cg,代码行数:12,代码来源:contour_contains_point.cpp


示例6: 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);
 }
开发者ID:Igorjan94,项目名称:cg,代码行数:13,代码来源:shortestPath.cpp


示例7: 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]);
      }
   }
开发者ID:Susak,项目名称:cg,代码行数:13,代码来源:andrew_hull.cpp


示例8: 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);
	  }
   }
开发者ID:BigBot22,项目名称:cg,代码行数:15,代码来源:triangle_contains_point.cpp


示例9: 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;
      }

   }
开发者ID:BigBot22,项目名称:cg,代码行数:15,代码来源:duglas_pecher.cpp


示例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)));
         }
     }
 }
开发者ID:dmekhanikov,项目名称:cg,代码行数:15,代码来源:visibility.cpp


示例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);
	  }
   }
开发者ID:BigBot22,项目名称:cg,代码行数:15,代码来源:segments_intersect.cpp


示例12: 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);
}
开发者ID:Igorjan94,项目名称:cg,代码行数:7,代码来源:fourTangent.cpp


示例13: 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]);
      }
   }
开发者ID:dvbobrov,项目名称:cg,代码行数:17,代码来源:exam_2401_2.cpp


示例14: 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);
}
开发者ID:Igorjan94,项目名称:cg,代码行数:8,代码来源:shortestPath.cpp


示例15: 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);

    }
开发者ID:markina,项目名称:cg,代码行数:20,代码来源:localization_point_viewer.cpp


示例16: 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());


   }
开发者ID:BigBot22,项目名称:cg,代码行数:33,代码来源:ccw_convex_contains_point.cpp


示例17: 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]);
 }
开发者ID:dmekhanikov,项目名称:cg,代码行数:17,代码来源:navigation.cpp


示例18: 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));
      }
   }
开发者ID:BorysMinaiev,项目名称:cg,代码行数:21,代码来源:douglas.cpp


示例19: 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]);
          }
      }
   }
开发者ID:dmekhanikov,项目名称:cg,代码行数:37,代码来源:minkowski_sum.cpp


示例20: 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));
     }
 }
开发者ID:dmekhanikov,项目名称:cg,代码行数:20,代码来源:delaunay_triangulation.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ visualization::printer_type类代码示例发布时间:2022-05-31
下一篇:
C++ cg::BasicBlockBuilder类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap