doc/images/nodeshape_4.eps
author deba
Tue, 17 Oct 2006 10:50:57 +0000
changeset 2247 269a0dcee70b
permissions -rw-r--r--
Update the Path concept
Concept check for paths

DirPath renamed to Path
The interface updated to the new lemon interface
Make difference between the empty path and the path from one node
Builder interface have not been changed
// I wanted but there was not accordance about it

UPath is removed
It was a buggy implementation, it could not iterate on the
nodes in the right order
Right way to use undirected paths => path of edges in undirected graphs

The tests have been modified to the current implementation
alpar@1907
     1
%!PS-Adobe-2.0 EPSF-2.0
alpar@1907
     2
%%Title: LEMON GraphToEps figure
alpar@1907
     3
%%Creator: LEMON GraphToEps function
alpar@1907
     4
%%BoundingBox: 0 -199 200 200
alpar@1907
     5
%%EndComments
alpar@1907
     6
/lb { setlinewidth setrgbcolor newpath moveto
alpar@1907
     7
      4 2 roll 1 index 1 index curveto stroke } bind def
alpar@1907
     8
/l { setlinewidth setrgbcolor newpath moveto lineto stroke } bind def
alpar@1907
     9
/c { newpath dup 3 index add 2 index moveto 0 360 arc closepath } bind def
alpar@1907
    10
/sq { newpath 2 index 1 index add 2 index 2 index add moveto
alpar@1907
    11
      2 index 1 index sub 2 index 2 index add lineto
alpar@1907
    12
      2 index 1 index sub 2 index 2 index sub lineto
alpar@1907
    13
      2 index 1 index add 2 index 2 index sub lineto
alpar@1907
    14
      closepath pop pop pop} bind def
alpar@1907
    15
/di { newpath 2 index 1 index add 2 index moveto
alpar@1907
    16
      2 index             2 index 2 index add lineto
alpar@1907
    17
      2 index 1 index sub 2 index             lineto
alpar@1907
    18
      2 index             2 index 2 index sub lineto
alpar@1907
    19
      closepath pop pop pop} bind def
alpar@1907
    20
/nc { 0 0 0 setrgbcolor 5 index 5 index 5 index c fill
alpar@1907
    21
     setrgbcolor 1.1 div c fill
alpar@1907
    22
   } bind def
alpar@1907
    23
/nsq { 0 0 0 setrgbcolor 5 index 5 index 5 index sq fill
alpar@1907
    24
     setrgbcolor 1.1 div sq fill
alpar@1907
    25
   } bind def
alpar@1907
    26
/ndi { 0 0 0 setrgbcolor 5 index 5 index 5 index di fill
alpar@1907
    27
     setrgbcolor 1.1 div di fill
alpar@1907
    28
   } bind def
alpar@1907
    29
/nfemale { 0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
alpar@1907
    30
  newpath 5 index 5 index moveto 5 index 5 index 5 index 3.01 mul sub
alpar@1907
    31
  lineto 5 index 4 index .7 mul sub 5 index 5 index 2.2 mul sub moveto
alpar@1907
    32
  5 index 4 index .7 mul add 5 index 5 index 2.2 mul sub lineto stroke
alpar@1907
    33
  5 index 5 index 5 index c fill
alpar@1907
    34
  setrgbcolor 1.1 div c fill
alpar@1907
    35
  } bind def
alpar@1907
    36
/nmale {
alpar@1907
    37
  0 0 0 setrgbcolor 3 index 0.0909091 1.5 mul mul setlinewidth
alpar@1907
    38
  newpath 5 index 5 index moveto
alpar@1907
    39
  5 index 4 index 1 mul 1.5 mul add
alpar@1907
    40
  5 index 5 index 3 sqrt 1.5 mul mul add
alpar@1907
    41
  1 index 1 index lineto
alpar@1907
    42
  1 index 1 index 7 index sub moveto
alpar@1907
    43
  1 index 1 index lineto
alpar@1907
    44
  exch 5 index 3 sqrt .5 mul mul sub exch 5 index .5 mul sub lineto
alpar@1907
    45
  stroke
alpar@1907
    46
  5 index 5 index 5 index c fill
alpar@1907
    47
  setrgbcolor 1.1 div c fill
alpar@1907
    48
  } bind def
alpar@1907
    49
/arrl 1 def
alpar@1907
    50
/arrw 0.3 def
alpar@1907
    51
/lrl { 2 index mul exch 2 index mul exch rlineto pop} bind def
alpar@1907
    52
/arr { setrgbcolor /y1 exch def /x1 exch def /dy exch def /dx exch def
alpar@1907
    53
       /w exch def /len exch def
alpar@1907
    54
       newpath x1 dy w 2 div mul add y1 dx w 2 div mul sub moveto
alpar@1907
    55
       len w sub arrl sub dx dy lrl
alpar@1907
    56
       arrw dy dx neg lrl
alpar@1907
    57
       dx arrl w add mul dy w 2 div arrw add mul sub
alpar@1907
    58
       dy arrl w add mul dx w 2 div arrw add mul add rlineto
alpar@1907
    59
       dx arrl w add mul neg dy w 2 div arrw add mul sub
alpar@1907
    60
       dy arrl w add mul neg dx w 2 div arrw add mul add rlineto
alpar@1907
    61
       arrw dy dx neg lrl
alpar@1907
    62
       len w sub arrl sub neg dx dy lrl
alpar@1907
    63
       closepath fill } bind def
alpar@1907
    64
/cshow { 2 index 2 index moveto dup stringwidth pop
alpar@1907
    65
         neg 2 div fosi .35 mul neg rmoveto show pop pop} def
alpar@1907
    66
alpar@1907
    67
gsave
alpar@1907
    68
100 dup scale
alpar@1907
    69
%Edges:
alpar@1907
    70
gsave
alpar@1907
    71
grestore
alpar@1907
    72
%Nodes:
alpar@1907
    73
gsave
alpar@1907
    74
1 1 1 0.2 1 0.2 nfemale
alpar@1907
    75
grestore
alpar@1907
    76
grestore
alpar@1907
    77
showpage