GNU PIC で ユースケース図

GNU PIC でユースケース図 を書く。

GNU PIC でユースケース

.ps 14 # font size
.PS
scale = 2.54; # inch -> cm

define frame {
    top_mergin = $2;
    bottom_mergin = $3;
    left_mergin = $4;
    right_mergin = $5;

    line from $1.nw + (-left_mergin, top_mergin) to $1.ne + (right_mergin, top_mergin);
    line from $1.sw + (-left_mergin, -bottom_mergin) to $1.se + (right_mergin, -bottom_mergin);
    line from $1.nw + (-left_mergin, top_mergin) to $1.sw + (-left_mergin, -bottom_mergin);
    line from $1.ne + (right_mergin, top_mergin) to $1.se + (right_mergin, -bottom_mergin);
}

define actor {[
    circle rad 0.2;

    move to last circle.s +(0, -0.2);
    line left 0.5;

    move to last circle.s +(0, -0.2);
    line right 0.5;

    move to last circle.s;
    A: line down linewid / 2;
    move to A.end; line down 0.5 left  0.5;
    move to A.end; line down 0.5 right 0.5;
    box $1 invisible with .n at (A.end.x, last line.end.y);
]}

Boundary: [
    down;
    Function1: box wid 3 "function1";
    move;
    Function2: box wid 3 "function2";
]

frame(Boundary, 1, 0.5, 0.5, 0.5);
"Boundary" at Boundary.n + (0, 0.4);

down;

Actor1: actor("actor1") with .e at Boundary.Function1.w + (-2, 0);
line at Actor1.e to Boundary.Function1.w;
line at Actor1.e to Boundary.Function2.w;

move to Actor1.s + (0, -1);
Actor2: actor("actor2");
line at Actor2.e to Boundary.Function2.w;

Actor3: actor("actor3") with .w at Boundary.Function1.e + (2, 0);
line at Actor3.w to Boundary.Function1.e;
.PE