From 98a6e04b7d37643368829acd50a74e2593899442 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 12 Aug 2009 05:47:07 -0400 Subject: [PATCH] Added defaults to TwoTerminal generators in Circ.asy. --- asymptote/Circ.asy | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/asymptote/Circ.asy b/asymptote/Circ.asy index 86dfd1e..191948c 100644 --- a/asymptote/Circ.asy +++ b/asymptote/Circ.asy @@ -269,8 +269,8 @@ struct TwoTerminal { real rstlth=2mm; int normal=0, variable=2; -TwoTerminal resistor(pair beg, int type, real ang, string name, string val, - bool draw=true) +TwoTerminal resistor(pair beg=(0,0), int type=normal, real ang=(0,0), + string name="", string val="", bool draw=true) { path pLine, pMisc[]={}; TwoTerminal term; @@ -299,8 +299,8 @@ TwoTerminal resistor(pair beg, int type, real ang, string name, string val, real coil=2mm; int Up=0, Down=1; -TwoTerminal inductor(pair beg, int type, real ang, string name, string val, - bool draw=true) +TwoTerminal inductor(pair beg=(0,0), int type=Up, real ang=0, string name="", + string val="", bool draw=true) { path pLine; TwoTerminal term; @@ -331,8 +331,8 @@ TwoTerminal inductor(pair beg, int type, real ang, string name, string val, real platsep=1mm; int normal=0, electrolytic=1, variable=2, variant=3; -TwoTerminal capacitor(pair beg, int type, real ang, string name, string val, - bool draw=true) +TwoTerminal capacitor(pair beg=(0,0), int type=normal, real ang=0, + string name="", string val="", bool draw=true) { path pLine[]={}, pMisc[]={}; TwoTerminal term; @@ -373,8 +373,8 @@ int zener=1, LED=2; // capacitors) are also polarized. The positioning method centerto(), // provides enough flexibility. -TwoTerminal diode(pair beg, int type, real ang, string name, string val, - bool draw=true) +TwoTerminal diode(pair beg=(0,0), int type=normal, real ang=0, string name="", + string val="", bool draw=true) { path pLine[]={}, pMisc[]={}; real lchar, lcharv; @@ -411,7 +411,7 @@ TwoTerminal diode(pair beg, int type, real ang, string name, string val, real bsize = 6mm; -TwoTerminal battery(pair beg, real ang, string name, string val, +TwoTerminal battery(pair beg=(0,0), real ang=0, string name="", string val="", bool draw=true) { path pLine[]={}, pMisc[]={}; @@ -441,8 +441,8 @@ real ssep=3mm, swt=1.2ssep; // TODO remove swt? /* `switch' is a Asymptote keyword (or it should be), so append SPST * for Single Pole Single Throw. */ -TwoTerminal switchSPST(pair beg, int type, real ang, string name, string val, - bool draw=true) +TwoTerminal switchSPST(pair beg=(0,0), int type=NO, real ang=0, string name="", + string val="", bool draw=true) { path pLine[]={}, pMisc[]={}; real lchar, lcharv; @@ -470,7 +470,7 @@ TwoTerminal switchSPST(pair beg, int type, real ang, string name, string val, real isize=2mm; // adjusted from makecirc original to center arrowhead under text -TwoTerminal current(pair beg, real ang, string name, string val, +TwoTerminal current(pair beg=(0,0), real ang=0, string name="", string val="", bool draw=true) { path pLine[]={}, pMisc[]={}; @@ -491,8 +491,8 @@ TwoTerminal current(pair beg, real ang, string name, string val, real ssize=6mm; int AC=0,DC=1,I=2,V=3; -TwoTerminal source(pair beg, int type, real ang, string name, string val, - bool draw=true) +TwoTerminal source(pair beg=(0,0), int type=AC, real ang=0, string name="", + string val="", bool draw=true) { path pLine[]={}, pMisc[]={}; real len, lchar, lcharv; -- 2.26.2