]> granicus.if.org Git - graphviz/commitdiff
Jenny didn't really want earlier shapes removed
authorJohn Ellson <ellson@research.att.com>
Fri, 21 Sep 2012 08:13:15 +0000 (04:13 -0400)
committerJohn Ellson <ellson@research.att.com>
Fri, 21 Sep 2012 08:13:15 +0000 (04:13 -0400)
19 files changed:
doc/info/back.gif
doc/info/both.gif
doc/info/forward.gif
doc/info/larrow.gif [new file with mode: 0644]
doc/info/lpromoter.gif [new file with mode: 0644]
doc/info/nohead.gif
doc/info/rarrow.gif [new file with mode: 0644]
doc/info/rpromoter.gif [new file with mode: 0644]
doc/info/shapes.html
doc/infosrc/Makefile.old
doc/infosrc/back.gif [deleted file]
doc/infosrc/both.gif [deleted file]
doc/infosrc/forward.gif [deleted file]
doc/infosrc/nohead.gif [deleted file]
doc/infosrc/shapelist
doc/infosrc/shapes.2
lib/common/const.h
lib/common/render.h
lib/common/shapes.c

index 6cb3f8c67f88d84c5f38cf8b918c0590357ceda5..9177de6a53d4b01f45d17d90584b4bfdba142072 100644 (file)
Binary files a/doc/info/back.gif and b/doc/info/back.gif differ
index 6060f5c60b50aead41044b9ae36196dbec977898..a3f10e9820cd8c500f70b5874e0c792e950b3303 100644 (file)
Binary files a/doc/info/both.gif and b/doc/info/both.gif differ
index 1e806bcc421e598ee88705f6b9b01844334689d2..4c0411be8603c678d90a4c03c535698f719ca606 100644 (file)
Binary files a/doc/info/forward.gif and b/doc/info/forward.gif differ
diff --git a/doc/info/larrow.gif b/doc/info/larrow.gif
new file mode 100644 (file)
index 0000000..1c99db9
Binary files /dev/null and b/doc/info/larrow.gif differ
diff --git a/doc/info/lpromoter.gif b/doc/info/lpromoter.gif
new file mode 100644 (file)
index 0000000..25b55ca
Binary files /dev/null and b/doc/info/lpromoter.gif differ
index 6b40069ef8b89b469bac3b148209f21f421fd347..543d88b0155ee9ea7ab58036cde31f97d3949808 100644 (file)
Binary files a/doc/info/nohead.gif and b/doc/info/nohead.gif differ
diff --git a/doc/info/rarrow.gif b/doc/info/rarrow.gif
new file mode 100644 (file)
index 0000000..b0a9ffc
Binary files /dev/null and b/doc/info/rarrow.gif differ
diff --git a/doc/info/rpromoter.gif b/doc/info/rpromoter.gif
new file mode 100644 (file)
index 0000000..2fc1bac
Binary files /dev/null and b/doc/info/rpromoter.gif differ
index 1ce109be92ed0710b41f53a970b50c55802f31bd..c768ae7728c8525a40a51d76ffba0a5fddd052de 100644 (file)
@@ -180,11 +180,23 @@ The possible polygon-based shapes are displayed below.
     <TD><IMG SRC=rnastab.gif>
     <TD><IMG SRC=proteasesite.gif>
     <TD><IMG SRC=proteinstab.gif>
+    <TD><IMG SRC=rpromoter.gif>
   </TR>
   <TR ALIGN=CENTER>
     <TD><A NAME=d:rnastab>rnastab</A>
     <TD><A NAME=d:proteasesite>proteasesite</A>
     <TD><A NAME=d:proteinstab>proteinstab</A>
+    <TD><A NAME=d:rpromoter>rpromoter</A>
+  </TR>
+  <TR ALIGN=CENTER>
+    <TD><IMG SRC=rarrow.gif>
+    <TD><IMG SRC=larrow.gif>
+    <TD><IMG SRC=lpromoter.gif>
+  </TR>
+  <TR ALIGN=CENTER>
+    <TD><A NAME=d:rarrow>rarrow</A>
+    <TD><A NAME=d:larrow>larrow</A>
+    <TD><A NAME=d:lpromoter>lpromoter</A>
   </TR>
 </TABLE>
 As the figures suggest, the shapes <TT>rect</TT> and <TT>rectangle</TT> are synonyms for <TT>box</TT>, and <TT>none</TT> is a synonym for <TT>plaintext</TT>.
@@ -225,8 +237,12 @@ The synthetic biology shapes:
 <TT>insulator</TT>,
 <TT>ribosite</TT>,
 <TT>rnastab</TT>,
-<TT>proteasesite</TT> and
-<TT>proteinstab</TT>
+<TT>proteasesite</TT>,
+<TT>proteinstab</TT>,
+<TT>rpromoter</TT>,
+<TT>rarrow</TT>,
+<TT>larrow</TT> and
+<TT>lpromoter</TT>
 were contributed by Jenny Cheng.
 
 <H2><A NAME=record>Record-based Nodes</A></H2>
index 2f533ca000a06af40a66a3fbe77f2179c3820800..231e99c173470c7718963a13ae0a49b24b42ae69 100644 (file)
@@ -48,7 +48,7 @@ SGIF = Mcircle.gif Mdiamond.gif Msquare.gif box.gif \
       primersite.gif restrictionsite.gif fivepoverhang.gif \
       threepoverhang.gif noverhang.gif assembly.gif signature.gif \
       insulator.gif ribosite.gif rnastab.gif proteasesite.gif \
-      proteinstab.gif
+      proteinstab.gif rpromoter.gif rarrow.gif larrow.gif lpromoter.gif
 
 AGIF = a_normal.gif a_inv.gif a_dot.gif a_invdot.gif a_odot.gif \
        a_invodot.gif a_curve.gif a_none.gif \
diff --git a/doc/infosrc/back.gif b/doc/infosrc/back.gif
deleted file mode 100644 (file)
index 6cb3f8c..0000000
Binary files a/doc/infosrc/back.gif and /dev/null differ
diff --git a/doc/infosrc/both.gif b/doc/infosrc/both.gif
deleted file mode 100644 (file)
index 6060f5c..0000000
Binary files a/doc/infosrc/both.gif and /dev/null differ
diff --git a/doc/infosrc/forward.gif b/doc/infosrc/forward.gif
deleted file mode 100644 (file)
index 1e806bc..0000000
Binary files a/doc/infosrc/forward.gif and /dev/null differ
diff --git a/doc/infosrc/nohead.gif b/doc/infosrc/nohead.gif
deleted file mode 100644 (file)
index 6b40069..0000000
Binary files a/doc/infosrc/nohead.gif and /dev/null differ
index dbfddfca8d38e7f9111752d8f1c70a98abb9fdcd..ce23f0629dd62f0d4a0f20185fbe0706d9ec54df 100644 (file)
@@ -49,3 +49,7 @@ ribosite
 rnastab
 proteasesite
 proteinstab
+rpromoter
+rarrow
+larrow
+lpromoter
index 67d00b0f45ae6fd3addedc2592b699863ef46eba..b73bad12fbe12d271d144f4add016f3f84136d4f 100644 (file)
@@ -37,8 +37,12 @@ The synthetic biology shapes:
 <TT>insulator</TT>,
 <TT>ribosite</TT>,
 <TT>rnastab</TT>,
-<TT>proteasesite</TT> and
-<TT>proteinstab</TT>
+<TT>proteasesite</TT>,
+<TT>proteinstab</TT>,
+<TT>rpromoter</TT>,
+<TT>rarrow</TT>,
+<TT>larrow</TT> and
+<TT>lpromoter</TT>
 were contributed by Jenny Cheng.
 
 <H2><A NAME=record>Record-based Nodes</A></H2>
index e1f8e207cbf91c4a58638854e4013440fb78c34e..9935cae9ba7b35b5210059e519b033c177331395 100644 (file)
 #define CHAR_LATIN1    1
 #define CHAR_BIG5      2
 
-/* style flags */
-#define FILLED         (1 << 0)
-#define RADIAL  (1 << 1)
-#define ROUNDED (1 << 2)
-#define DIAGONALS (1 << 3)
-#define AUXLABELS (1 << 4)
-#define INVISIBLE (1 << 5)
-#define DOGEAR (1 << 6)
-#define TAB (1 << 7)
-#define FOLDER (1 << 8)
-#define BOX3D (1 << 9)
-#define COMPONENT (1 << 10)
-#define STRIPED (1 << 11)
-#define DOTTED (1 << 12)
-#define DASHED (1 << 13)
-#define WEDGED  (1 << 14)
-#define PROMOTER (1 << 15)
-#define CDS (1 << 16)
-#define TERMINATOR (1 << 17)
-#define UTR (1 << 18)
-#define PRIMERSITE (1 << 19)
-#define RESTRICTIONSITE (1 << 20)
-#define FIVEPOVERHANG (1 << 21)
-#define THREEPOVERHANG (1 << 22)
-#define NOVERHANG (1 << 23)
-#define ASSEMBLY (1 << 24)
-#define SIGNATURE (1 << 25)
-#define INSULATOR (1 << 26)
-#define RIBOSITE (1 << 27)
-#define RNASTAB (1 << 28)
-#define PROTEASESITE (1 << 29)
-#define PROTEINSTAB (1 << 30)
+/* style flags (0-23)*/
+#define FILLED         (1 << 0)
+#define RADIAL         (1 << 1)
+#define ROUNDED                (1 << 2)
+#define DIAGONALS      (1 << 3)
+#define AUXLABELS      (1 << 4)
+#define INVISIBLE      (1 << 5)
+#define STRIPED                (1 << 6)
+#define DOTTED         (1 << 7)
+#define DASHED         (1 << 8)
+#define WEDGED         (1 << 9)
+
+#define SHAPE_MASK     (127 << 24)
+
+/* shape (1-127) */
+#define DOGEAR         (1 << 24)
+#define TAB            (2 << 24)
+#define FOLDER         (3 << 24)
+#define BOX3D          (4 << 24)
+#define COMPONENT      (5 << 24)
+#define PROMOTER       (6 << 24)
+#define CDS            (7 << 24)
+#define TERMINATOR     (8 << 24)
+#define UTR            (9 << 24)
+#define PRIMERSITE     (10 << 24)
+#define RESTRICTIONSITE        (11 << 24)
+#define FIVEPOVERHANG  (12 << 24)
+#define THREEPOVERHANG (13 << 24)
+#define NOVERHANG      (14 << 24)
+#define ASSEMBLY       (15 << 24)
+#define SIGNATURE      (16 << 24)
+#define INSULATOR      (17 << 24)
+#define RIBOSITE       (18 << 24)
+#define RNASTAB                (19 << 24)
+#define PROTEASESITE   (20 << 24)
+#define PROTEINSTAB    (21 << 24)
+#define RPROMOTER      (22 << 24)
+#define RARROW         (23 << 24)
+#define LARROW         (24 << 24)
+#define LPROMOTER      (25 << 24)
 
 /* fill types */
-#define FILL      1
-#define GRADIENT  2
-#define RGRADIENT 3
-#define NO_POLY   4    /* bit flag: if set, do fill only */
+#define FILL           1
+#define GRADIENT       2
+#define RGRADIENT      3
+#define NO_POLY        4    /* bit flag: if set, do fill only */
 
 /* label types */
 #define LT_NONE        (0 << 1)
index 4b25a725f862d6e246e9b1a37bd87282a166bc96..ab83308b73bc4e7f3e88977c63a297fcc32fc51c 100644 (file)
@@ -142,7 +142,7 @@ extern "C" {
     extern int rank(graph_t * g, int balance, int maxiter);
     extern port resolvePort(node_t*  n, node_t* other, port* oldport);
     extern void resolvePorts (edge_t* e);
-    extern void round_corners(GVJ_t*, pointf*, int, int,int);
+    extern void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled);
     extern int routesplinesinit(void);
     extern pointf *routesplines(path *, int *);
     extern void routesplinesterm(void);
index 3aad6715f3e546c16730182fe5957326ac55f7df..29e221023f0f24efa17d3cfc110a8fc659780c49 100644 (file)
@@ -116,12 +116,15 @@ static polygon_t p_threepoverhang = { FALSE, 1, 4, 0., 0., 0., THREEPOVERHANG};
 static polygon_t p_noverhang = { FALSE, 1, 4, 0., 0., 0., NOVERHANG};
 static polygon_t p_assembly = { FALSE, 1, 4, 0., 0., 0., ASSEMBLY};
 static polygon_t p_signature = { FALSE, 1, 4, 0., 0., 0., SIGNATURE};
+static polygon_t p_rpromoter = { FALSE, 1, 4, 0., 0., 0., RPROMOTER};
+static polygon_t p_rarrow = { FALSE, 1, 4, 0., 0., 0., RARROW};
+static polygon_t p_larrow = { FALSE, 1, 4, 0., 0., 0., LARROW};
+static polygon_t p_lpromoter = { FALSE, 1, 4, 0., 0., 0., LPROMOTER};
 
 #define IS_BOX(n) (ND_shape(n)->polygon == &p_box)
 
 /* True if style requires processing through round_corners. */
-#define SPECIAL_CORNERS(style) \
-    ((style) & (ROUNDED | DIAGONALS | DOGEAR | TAB | FOLDER | BOX3D | COMPONENT | PROMOTER | CDS | TERMINATOR | UTR | PRIMERSITE | RESTRICTIONSITE | FIVEPOVERHANG | THREEPOVERHANG | NOVERHANG | ASSEMBLY | SIGNATURE | INSULATOR | RIBOSITE | RNASTAB | PROTEASESITE | PROTEINSTAB))
+#define SPECIAL_CORNERS(style) ((style) & (ROUNDED | DIAGONALS | SHAPE_MASK))
 
 
 /*
@@ -237,6 +240,10 @@ static shape_desc Shapes[] = {     /* first entry is default for no such shape */
     {"noverhang", &poly_fns, &p_noverhang},
     {"assembly", &poly_fns, &p_assembly},
     {"signature", &poly_fns, &p_signature},
+    {"rpromoter", &poly_fns, &p_rpromoter},
+    {"larrow",  &poly_fns, &p_larrow},
+    {"rarrow",  &poly_fns, &p_rarrow},
+    {"lpromoter",  &poly_fns, &p_lpromoter},
        /*  *** shapes other than polygons  *** */
     {"record", &record_fns, NULL},
     {"Mrecord", &record_fns, NULL},
@@ -465,13 +472,14 @@ void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled)
 {
     pointf *B, C[4], *D, p0, p1;
     double rbconst, d, dx, dy, t;
-    int i, seg, mode;
+    int i, seg, mode, shape;
     pointf* pts;
 
+    shape = style & SHAPE_MASK;
     if (style & DIAGONALS)
        mode = DIAGONALS;
-    else if (style & (DOGEAR | TAB | FOLDER | BOX3D | COMPONENT | PROMOTER | CDS | TERMINATOR | UTR | PRIMERSITE | RESTRICTIONSITE | FIVEPOVERHANG | THREEPOVERHANG | NOVERHANG | ASSEMBLY | SIGNATURE | INSULATOR | RIBOSITE | RNASTAB | PROTEASESITE | PROTEINSTAB))
-       mode = style & (DOGEAR | TAB | FOLDER | BOX3D | COMPONENT | PROMOTER | CDS | TERMINATOR | UTR | PRIMERSITE | RESTRICTIONSITE | FIVEPOVERHANG | THREEPOVERHANG | NOVERHANG | ASSEMBLY | SIGNATURE | INSULATOR | RIBOSITE | RNASTAB | PROTEASESITE | PROTEINSTAB);
+    else if (style & SHAPE_MASK)
+       mode = shape;
     else
        mode = ROUNDED;
     B = N_NEW(4 * sides + 4, pointf);
@@ -502,9 +510,9 @@ void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled)
        dy = p1.y - p0.y;
        d = sqrt(dx * dx + dy * dy);
        t = rbconst / d;
-       if (style & (BOX3D | COMPONENT))
+       if (shape == BOX3D || shape == COMPONENT)
            t /= 3;
-       else if (style & DOGEAR)
+       else if (shape == DOGEAR)
            t /= 2;
        if (mode != ROUNDED)
            B[i++] = p0;
@@ -915,11 +923,11 @@ void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled)
        /*
        * half arrow shape, scales in the x-direction
        *                 D[1]
-       *                   |\           
-       *                   | \  
+       *                   |\
+       *                   | \
        *                   |  \
        *       ------------    \
-       *       |                \       
+       *       |                \
        *       ------------------\ D[0]                         
        *                               
        *   --------------------------------
@@ -1592,6 +1600,156 @@ void round_corners(GVJ_t * job, pointf * AF, int sides, int style, int filled)
        free(D);
 
        break;        
+
+    case RPROMOTER:
+       /*
+        * Adjust the perimeter for the protrusions.
+        *
+        *  
+        *      D[1] = AF[1]      |\
+        *       +----------------+ \
+        *       |              D[0] \
+        *       |                    \
+        *       |                    /    
+        *       |                   /
+        *       |        +-------+ /
+        *       |        |       |/
+        *       +--------+
+        */
+       /* Add the tab edges. */
+       D = N_NEW(sides + 5, pointf); /*5 new points*/
+       D[0].x = B[1].x - (B[2].x - B[3].x)/2;
+       D[0].y = B[1].y - (B[3].y - B[4].y)/2;
+       D[1].x = B[3].x;
+       D[1].y = B[3].y - (B[3].y - B[4].y)/2;
+       D[2].x = AF[2].x;
+       D[2].y = AF[2].y;
+       D[3].x = B[2].x + (B[2].x - B[3].x)/2;
+       D[3].y = AF[2].y;
+       D[4].x = B[2].x + (B[2].x - B[3].x)/2;
+       D[4].y = AF[2].y + (B[3].y - B[4].y)/2;
+       D[5].x = B[1].x - (B[2].x - B[3].x)/2;
+       D[5].y = AF[2].y + (B[3].y - B[4].y)/2;
+       D[6].x = B[1].x - (B[2].x - B[3].x)/2;
+       D[6].y = AF[3].y;
+       D[7].y = AF[0].y - (AF[0].y - AF[3].y)/2; /*triangle point */
+       D[7].x = AF[0].x; /*triangle point */
+       D[8].y = AF[0].y;
+       D[8].x = B[1].x - (B[2].x - B[3].x)/2;
+
+       gvrender_polygon(job, D, sides + 5, filled);
+       free(D);
+       break;
+                               
+    case RARROW:
+       /*
+        * Adjust the perimeter for the protrusions.
+        *
+        *  
+        *      D[1] = AF[1]      |\
+        *       +----------------+ \
+        *       |              D[0] \
+        *       |                    \
+        *       |                    /    
+        *       |                   /
+        *       +----------------+ /
+        *                        |/
+        *       
+        */
+       /* Add the tab edges. */
+       D = N_NEW(sides + 3, pointf); /*3 new points*/
+       D[0].x = B[1].x - (B[2].x - B[3].x)/2;
+       D[0].y = B[1].y - (B[3].y - B[4].y)/2;
+       D[1].x = B[3].x;
+       D[1].y = B[3].y - (B[3].y - B[4].y)/2;
+       D[2].x = AF[2].x;
+       D[2].y = AF[2].y + (B[3].y - B[4].y)/2;
+       D[3].x = B[1].x - (B[2].x - B[3].x)/2;
+       D[3].y = AF[2].y + (B[3].y - B[4].y)/2;
+       D[4].x = B[1].x - (B[2].x - B[3].x)/2;
+       D[4].y = AF[3].y;
+       D[5].y = AF[0].y - (AF[0].y - AF[3].y)/2;/*triangle point*/
+       D[5].x = AF[0].x; /*triangle point */
+       D[6].y = AF[0].y;
+       D[6].x = B[1].x - (B[2].x - B[3].x)/2;
+
+       gvrender_polygon(job, D, sides + 3, filled);
+       free(D);
+       break;
+
+    case LARROW:
+       /*
+        * Adjust the perimeter for the protrusions.
+        *
+        *  
+        *      /|     
+        *     / +----------------+ 
+        *    /                   |        
+        *    \                   |   
+        *     \ +----------------+ 
+        *      \|                
+        *       
+        */
+       /* Add the tab edges. */
+       D = N_NEW(sides + 3, pointf); /*3 new points*/
+       D[0].x = AF[0].x;
+       D[0].y = AF[0].y - (B[3].y-B[4].y)/2;
+       D[1].x = B[2].x + (B[2].x - B[3].x)/2;
+       D[1].y = AF[0].y - (B[3].y-B[4].y)/2;/*D[0].y*/
+       D[2].x = B[2].x + (B[2].x - B[3].x)/2;/*D[1].x*/
+       D[2].y = B[2].y;
+       D[3].x = AF[1].x; /*triangle point*/
+       D[3].y = AF[1].y - (AF[1].y - AF[2].y)/2; /*triangle point*/
+       D[4].x = B[2].x + (B[2].x - B[3].x)/2;/*D[1].x*/
+       D[4].y = AF[2].y;
+       D[5].y = AF[2].y + (B[3].y-B[4].y)/2;
+       D[5].x = B[2].x + (B[2].x - B[3].x)/2;/*D[1].x*/
+       D[6].y = AF[3].y + (B[3].y - B[4].y)/2;
+       D[6].x = AF[0].x;/*D[0]*/
+
+       gvrender_polygon(job, D, sides + 3, filled);
+       free(D);
+       break;
+
+    case LPROMOTER:
+       /*
+        * Adjust the perimeter for the protrusions.
+        *
+        *  
+        *      /|     
+        *     / +----------------+ 
+        *    /                 D[0] 
+        *   /                    |    
+        *   \                    |        
+        *    \                   |   
+        *     \ +--------+       + 
+        *      \|        |       |
+        *                +-------+
+        */
+       /* Add the tab edges. */
+       D = N_NEW(sides + 5, pointf); /*3 new points*/
+       D[0].x = AF[0].x;
+       D[0].y = AF[0].y - (B[3].y-B[4].y)/2;
+       D[1].x = B[2].x + (B[2].x - B[3].x)/2;
+       D[1].y = AF[0].y - (B[3].y-B[4].y)/2;/*D[0].y*/
+       D[2].x = B[2].x + (B[2].x - B[3].x)/2;/*D[1].x*/
+       D[2].y = B[2].y;
+       D[3].x = AF[1].x; /*triangle point*/
+       D[3].y = AF[1].y - (AF[1].y - AF[2].y)/2; /*triangle point*/
+       D[4].x = B[2].x + (B[2].x - B[3].x)/2;/*D[1].x*/
+       D[4].y = AF[2].y;
+       D[5].y = AF[2].y + (B[3].y-B[4].y)/2;
+       D[5].x = B[2].x + (B[2].x - B[3].x)/2;/*D[1].x*/
+       D[6].y = AF[3].y + (B[3].y - B[4].y)/2;
+       D[6].x = B[1].x - (B[2].x - B[3].x)/2;
+       D[7].x = B[1].x - (B[2].x - B[3].x)/2;/*D[6].x*/
+       D[7].y = AF[3].y;
+       D[8].x = AF[3].x;
+       D[8].y = AF[3].y;
+                               
+       gvrender_polygon(job, D, sides + 5, filled);
+       free(D);
+       break;
     }
     free(B);
 }