Example Drawing Operations
#include <LEDA/core/list.h> #include <LEDA/geo/point.h> #include <LEDA/geo/circle.h> #include <LEDA/geo/random_point.h> #include <LEDA/graphics/window.h> #include <LEDA/geo/geo_alg.h> using namespace leda; int main() { window W; W.init(-110,110,-110); W.open(); W.display(); for (;;) { W.clear(); list<point> L;random_points_in_square(10,50,L); list<circle> LC;ALL_ENCLOSING_CIRCLES(L,LC); W.set_node_width(3);W.set_line_width(2); point p; forall(p,L) W.draw_filled_node(p.to_point()); circle C; forall(C,LC) W.draw_circle(C.to_circle(),red); if (W.read_mouse()==MOUSE_BUTTON(3)) break; } return 0; } |
See also:Example Program for Computing Extremal Circles Basic Data Types for 2D Geometry Manual Pages: |