function [closure] = quad_do_enum(e,visit_proc,mark)
%global closure;
global saida;
closure=[];

mk_e = Mark(e);
while((mk_e ~= mark))
   %eval([visit_proc '(e,closure);']); % execute visit_proc(e,closure)
   %visit_proc(e);
   
   o = Org(e);
	d = Dest(e);
	x = [o.x,d.x];
	y = [o.y,d.y];
   %z = [o.z,d.z];
   
	aresta.x = x;
	aresta.y = y;

	%saida(length(saida)+1) = aresta
   
   if(is_Active(e))
		plot(x,y,'b*-');
      hold on;
   else
      break;
   end;
   
   
   set_Mark(e,mark);
   [closure] = quad_do_enum(Onext(Symet(e)),visit_proc,mark);
   e = Onext(e);
   mk_e = Mark(e);
end;


%void quad_do_enum (
%    edge_ref e, 
%    void visit_proc(edge_ref e, void *closure), 
%    void *closure,
%    unsigned mark
%  )
%  {
%    while (MARK(e) != mark)
%      {
%        visit_proc(e, closure);
%        MARK(e) = mark;
%        quad_do_enum (ONEXT(SYM(e)), visit_proc, closure, mark);
%        e = ONEXT(e);
%      }
%  }
