gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz doc/pegboard/vobuml--tjl/peg.rst metacode/u...


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz doc/pegboard/vobuml--tjl/peg.rst metacode/u...
Date: Wed, 01 Jan 2003 08:19:53 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/01/01 08:19:53

Modified files:
        doc/pegboard/vobuml--tjl: peg.rst 
        metacode       : umldoc.py umlhelper.mp umlrst.py umltool.py 

Log message:
        First example diagram

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/vobuml--tjl/peg.rst.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umldoc.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umlhelper.mp.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umlrst.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/metacode/umltool.py.diff?tr1=1.10&tr2=1.11&r1=text&r2=text

Patches:
Index: gzz/doc/pegboard/vobuml--tjl/peg.rst
diff -u gzz/doc/pegboard/vobuml--tjl/peg.rst:1.6 
gzz/doc/pegboard/vobuml--tjl/peg.rst:1.7
--- gzz/doc/pegboard/vobuml--tjl/peg.rst:1.6    Tue Dec 31 10:50:21 2002
+++ gzz/doc/pegboard/vobuml--tjl/peg.rst        Wed Jan  1 08:19:53 2003
@@ -3,8 +3,8 @@
 =============================================================
 
 :Author:   Tuomas J. Lukka
-:Last-Modified: $Date: 2002/12/31 15:50:21 $
-:Revision: $Revision: 1.6 $
+:Last-Modified: $Date: 2003/01/01 13:19:53 $
+:Revision: $Revision: 1.7 $
 :Status:   Incomplete
 
 With PP and hierarchical coordinate systems, 
@@ -40,7 +40,7 @@
     Therefore, we shall use the *stereotype* notation
     for coordinate systems: defining stereotypes such as
     "orthoboxCS" for all coordinate system types, and
-    "*CS" for coordinate systems of indeterminate type.
+    "\*CS" for coordinate systems of indeterminate type.
 
 - Should we define images for the Vob and Coordsys stereotypes?
 
@@ -111,11 +111,31 @@
 
 Both types of relationships between coordinate systems
 in the same VobScene are represented as arrows; the arrow for
-transform parenthood (A ``transform`` B == A is child of B)
+transform parenthood (A ``vobtransform`` B == A is child of B)
 is thin and possibly contains (at the arrow end)
 the index of the parent as a role. The interpolation parenthood
-(A ``submatch`` B == A is interp child of B)
+(A ``vobsubmatch`` B == A is interp child of B)
 is represented by a thick arrow. 
+
+..  UML:: vobuml1
+
+    class A "*CS"
+
+    class B "scaleCS"
+
+    class C "orthoCS"
+       vobtransform - role(0) A
+       vobtransform - role(1) B
+
+    pat = vobsubmatch C A
+
+    ---
+
+    A.c = (0,0);
+    B.c = (100,0);
+    C.c = (50, -150);
+    pat.p = C.c{left} ... A.c{right};
+
 
 Relationships of Vobs
 ---------------------
Index: gzz/metacode/umldoc.py
diff -u gzz/metacode/umldoc.py:1.9 gzz/metacode/umldoc.py:1.10
--- gzz/metacode/umldoc.py:1.9  Tue Dec 31 05:08:01 2002
+++ gzz/metacode/umldoc.py      Wed Jan  1 08:19:53 2003
@@ -90,9 +90,11 @@
        rstfiles = _rstFiles(path)
 
         for rstfile in rstfiles:
+           print "Embed",path+"/"+rstfile
             umlrst.embed_diagram(path+"/"+rstfile)
 
     elif os.path.isfile(path) or os.path.isfile(path+'.rst'):
+       print "Embed",path
         umlrst.embed_diagram(path)
 
 def rst2html(path):
Index: gzz/metacode/umlhelper.mp
diff -u gzz/metacode/umlhelper.mp:1.13 gzz/metacode/umlhelper.mp:1.14
--- gzz/metacode/umlhelper.mp:1.13      Thu Dec 19 17:24:42 2002
+++ gzz/metacode/umlhelper.mp   Wed Jan  1 08:19:53 2003
@@ -122,6 +122,17 @@
     vc -- vc+vx+vy -- vc+2*vx -- vc+vx-vy -- cycle
 enddef;
 
+vardef arrowedpath(expr p, lx, ly) =
+    save vx, vy, vc;
+    pair vx, vy, vc;
+    vc = point 0 of p;
+    vx = direction 0 of p;
+    vx := 5 * vx / (abs(vx) + 0.0001);
+    vy = ly * vx rotated 90;
+    vx := lx*vx;
+    vc+vx+vy -- vc -- vc+vx-vy 
+enddef;
+
 vardef inheritpath(expr p) =
     save vx, vy, vc;
     pair vx, vy, vc;
@@ -182,6 +193,27 @@
     adornassocend(p, multi, role);
 enddef;
 
+vobtransformthick = .5 pt;
+
+vardef vobtransformfromassoc(expr p, multi, role) =
+    save pe;
+    pe = savepen;
+    pickup pencircle scaled vobtransformthick;
+    draw p;
+    adornassocend(p, multi, role);
+    pickup pe;
+enddef;
+
+vardef vobtransformtoassoc(expr p, multi, role) =
+    save pe;
+    pe = savepen;
+    pickup pencircle scaled vobtransformthick;
+    draw arrowedpath(p, 1, 1.3);
+    draw p;
+    adornassocend(p, multi, role);
+    pickup pe;
+enddef;
+
 vardef inherit(expr p) =
     save ap;
     path ap;
@@ -199,6 +231,17 @@
     fill ap withcolor white;
     draw ap;
 enddef;
+
+vobsubmatchthick = 2pt;
+vardef vobsubmatch(expr p) =
+    save pe;
+    pe = savepen;
+    pickup pencircle scaled vobsubmatchthick;
+    draw p;
+    draw arrowedpath(reversepath(p), 1.2, 1.4);
+    pickup pe;
+enddef;
+
 
 vardef dep(expr p, ster) = 
     drawarrow p dashed evenly;
Index: gzz/metacode/umlrst.py
diff -u gzz/metacode/umlrst.py:1.10 gzz/metacode/umlrst.py:1.11
--- gzz/metacode/umlrst.py:1.10 Thu Dec 19 17:24:42 2002
+++ gzz/metacode/umlrst.py      Wed Jan  1 08:19:53 2003
@@ -142,6 +142,8 @@
             insert = html.find("<!-- UML:")
         out.write(html)
         out.close()
+    else:
+       print "Strange: no file for",path+".gen.html -- ignoring"
 
 def embed_implicit(oldpath, name, path):
     """Terrible kludge to embed named diagram into path document
Index: gzz/metacode/umltool.py
diff -u gzz/metacode/umltool.py:1.10 gzz/metacode/umltool.py:1.11
--- gzz/metacode/umltool.py:1.10        Thu Dec 19 22:08:57 2002
+++ gzz/metacode/umltool.py     Wed Jan  1 08:19:53 2003
@@ -526,11 +526,11 @@
     def __init__(self, var, s, l):
        self.var = var or randomVar()
        self.name = ""
-       self.mems = s.split()
+       mems = s.split()
 
-       self.a = self.end(self.var+".a", self.mems)
-       self.mems.reverse()
-       self.b = self.end(self.var+".b", self.mems)
+       self.a = self.end(self.var+".a", mems)
+       mems.reverse()
+       self.b = self.end(self.var+".b", mems)
 
     def setupCode(self):
        s = """
@@ -550,6 +550,13 @@
            """ + self.a.drawCode() + self.b.drawCode() 
        return self.repl(s).replace("START", self.a.obj).replace("END", 
self.b.obj)
 
+class mpvobtransform(mpassoc):
+    def __init__(self, var, s, l):
+       mpassoc.__init__(self, var, s, l)
+       self.a.type = "vobtransformfrom"
+       self.b.type = "vobtransformto"
+
+
 
 class simpleRel(namedEl):
     def __init__(self, var, s, l):
@@ -599,6 +606,10 @@
     def drawCode(self):
        return self.pathCode() + self.repl(' dep(%%.p, "%stereo%"); ')
 
+class mpvobsubmatch(simpleRel):
+    def drawCode(self):
+       return self.pathCode() + self.repl(" vobsubmatch(%%.p); ")
+
 class placement(namedEl):
     def __init__(self, var, s, l):
        self.var = var or randomVar()
@@ -666,6 +677,8 @@
        elif key == "component": type = mpcomponent
        elif key == "interface": type = mpinterface
        elif key == "assoc": type = mpassoc
+       elif key == "vobtransform": type = mpvobtransform
+       elif key == "vobsubmatch": type = mpvobsubmatch
        elif key == "naryassoc": type = mpnary
        elif key == "supply": type = mpsupply
        elif key == "use": type = mpuse



reply via email to

[Prev in Thread] Current Thread [Next in Thread]