コード例 #1
0
void generate_circles(agg::path_storage& ps, 
                      const double* quad, 
                      unsigned num_circles, 
                      double radius)
{
    ps.remove_all();
    unsigned i;
    for(i = 0; i < 4; ++i)
    {
        unsigned n1 = i * 2;
        unsigned n2 = (i < 3) ? i * 2 + 2 : 0; 
        unsigned j;
        for(j = 0; j < num_circles; j++)
        {
            agg::ellipse ell(quad[n1]     + (quad[n2]     - quad[n1])     * j / num_circles, 
                             quad[n1 + 1] + (quad[n2 + 1] - quad[n1 + 1]) * j / num_circles, 
                             radius, radius, 100);
            ps.concat_path(ell);
        }
    }
}
コード例 #2
0
ファイル: roadmap_canvas.cpp プロジェクト: GitPicz/waze
void roadmap_canvas_draw_multiple_circles
        (int count, RoadMapGuiPoint *centers, int *radius, int filled,
         int fast_draw) {

   int i;

   static agg::path_storage path;

   for (i = 0; i < count; ++i) {

      int r = radius[i];

      int x = centers[i].x;
      int y = centers[i].y;

      agg::ellipse e( x, y, r, r);
      path.concat_path(e);

      if (filled) {

         ras.reset();
         ras.add_path(path);
         ren_solid.color(CurrentPen->color);
         agg::render_scanlines( ras, sl, ren_solid);

/*      } else if (fast_draw) {
         renderer_pr ren_pr(agg_renb);
         agg::rasterizer_outline<renderer_pr> ras_line(ren_pr);
         ren_pr.line_color(CurrentPen->color);
         ras_line.add_path(path);
*/
      } else {

         raso.add_path(path);
      }

      path.remove_all ();
   }
}