Example Redraw FunctionsThe following program shows how to use an alternative redraw function for a scene in GeoWin. (See also Example Update and Redraw Objects.) The redraw function The main function defines a Important Notice: Redraw functions are member template functions. Unfortunately, MSVC++ 6 does not support such functions. Please use redraw objects with this compiler. #include <LEDA/geowin.h> #include <LEDA/window.h> #include <LEDA/segment.h> #include <LEDA/float_geo_alg.h> using namespace leda; window& draw_seg(window& w, const segment& s, int) { w.draw_arrow(s.source().to_float(), s.target().to_float(), red); return w; } int main() { GeoWin geow; list<segment> lseg; GeoEditScene<list<segment> >* sc= geow.new_scene(lseg); geowin_set_draw_object_fcn(sc, draw_seg); geow.edit(sc); return 0; } |
See also:Example Update and Redraw Objects Basic Data Types for 2D Geometry Manual Pages: |