2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2002-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
5 // This file must be used under the terms of the CeCILL.
6 // This source file is licensed as described in the file COPYING, which
7 // you should have received as part of this distribution. The terms
8 // are also available at
9 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11 function e=ge_draw_edge(n)
13 //Construct the graphic object associated with a new edge, the first
15 arrowWidth=4;arrowLength=6; ArcDx=0.25;ArcDy=15;//a mettre en parametres
17 if GraphList.edges.tail(n)==GraphList.edges.head(n) then //loop arc
21 [arc,xya,xyl,ang]=ge_profile2real(n)
22 if size(arc,'*')==6 then
23 xarc(arc(1),arc(2),arc(3),arc(4),arc(5),arc(6));e1=gce();
24 e1.arc_drawing_method='lines"; //to make the drawin less slow
26 xpoly(arc(:,1),arc(:,2));e1=gce();
29 else //arc between two distinct nodes
30 [xyc,xya,xyl,ang]=ge_profile2real(n)
32 xpoly(xyc(:,1),xyc(:,2));e1=gce();
35 [edge_width,edge_color,style]=ge_get_edge_style(n)
39 e1.thickness=edge_width;
40 e1.foreground=edge_color;
43 xpoly(xya(:,1),xya(:,2));e2=gce();
44 e2.thickness=edge_width;
45 e2.foreground=edge_color;
46 if ~GraphList.directed then e2.visible='off',end
51 font=ge_get_edge_font(n)
52 if Id==[] then Id=' ',end
53 r = stringbox(Id, 0, 0, 0, font(2), font(1));
54 r = abs(r(1,3) - r(1,1));
55 if ang>90&ang<270 then //co negatif
57 xstring(xyl(1)+r*cos(a),xyl(2)-r*sin(a),Id,ang+180 );
59 xstring(xyl(1),xyl(2),Id,ang);
62 e3.font_foreground=font(3)
67 if ~vis then e3.visible='off';end
69 //make a Compound with the arc elements