cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/26/08:06:31

Date: Tue, 26 May 1998 14:01:20 +0200
Message-Id: <199805261201.OAA12341@mbox.progetto3000.it>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: otg AT negroni DOT it (O.T.G.)
Subject: C++ compiler included in "Who is afraid of C++?"

--=====================_896216998==_
Content-Type: text/plain; charset="us-ascii"

1) Please, can you tell me if there are limits on the created program size
by your compiler?
Or is there a limit on the program handeble lines?
Or are there limits on array dimensions?
If there are no limits on created program size, can you explain me why if i
try to compile the attached program, the compiler doesn't finish its work
and no errors are shown?
I have seen that the problems begin with lines 719, 727 and 728. In these
lines there are instructions operating with different variable types. I have
controlled that the same instruction types don't rise problems, when
included in a small program. 
What's the problem?

BEST REGARDS
Ing. BELLETTI ILVER O.T.G.

--=====================_896216998==_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="PROVA.CC"


#include <iostream.h>
#include <fstream.h>
#include "string6.h"
#include <math.h>

main ()
{
ofstream stampo("dati.out");
unsigned char ch =3D 27;
float s[11][6] =3D {0.,0.}, l[21][23] =3D {0.,0.}, f[11][5] =3D {0.,0.},=
 v[24][5] =3D {0.,0.}, w[500][4] =3D {0.,0.}, r[4][4] =3D {0.,0.};
string c[4] =3D { "stampo:modulo e angolo reazioni vincolari,frecce massime,=
 momenti d'inerzia, rigidezze torsionali, grafico modulo freccia", ",=
 reazioni vincolari scomposte", ", equazioni momento, rotazione, spostamento=
 dei tronchetti", ", iterazioni ricerca frecce massime"};
short i, ts, kr, pc, ic, ni, ir, nl, ii, nf, clm, ksf, clt, ul, yil, yfl,=
 yau, oi, is, x, xi, n;
short e[461] =3D {0,0}, d[461] =3D {0,0};
string dwg, fs, sc, a, vs, z, ds, cpd;
float ro, ey, et, vc, po, dc, rt, bc, af, ptot, sipt, mz, sx, xint, dy,=
 xrif, dmax, lcus, recus, xmos, dx1, dx2, fts, xv, og;=20
const float ca =3D atan(1.)/45.;
ptot =3D 0.;
sipt =3D 0.;
clm =3D 0;
clt =3D 0;
ksf =3D0;
xmos =3D0.;
dx1 =3D 0.;
dx2 =3D0.;
n =3D 0;
string i1 =3D "commento al calcolo con numero disegno od offerta ";
string i2 =3D "riduttore o moltiplicatore a 2 assi=3Dn albero intermedio=3Ds=
 ";
string i3 =3D "tipo di stampa desiderato ";
string i4 =3D "voglio i grafici deformazione flessio-torsionale per=
 correzione longitudinale dei denti=3Ds, non li voglio=3Dn ";
string i5 =3D "peso specifico del materiale N/mm^3 ";
string i6 =3D "modulo elasticit=85 materiale N/mm^2 ";
string i7 =3D "modulo di poisson del materiale ";
string i8 =3D "velocit=85 rotazione albero condotto rpm ";
string i9 =3D "senso rotazione albero condotto o intermedio visto=
 utilizzatore antiorario s/n ";=20
string i10 =3D "potenza totale trasmessa kw ";
string i11 =3D "diametro primitivo albero condotto mm ";
string i12 =3D "rapporto di trasmissione ";
string i13 =3D "ci sono i collari s, non ci sono n ";
string i14 =3D "guardando la flangia utilizzatore angolo tra la retta=
 orizzontale e la retta congiungente i centri assi in senso antiorario ";
string i15 =3D "angolo di pressione normale gradi centesimali ";
string i16 =3D "vuoi cambiare qualcosa ";
string i17 =3D "cosa vuoi cambiare usa il codice mostrato ";
string i18 =3D "quanto pesa la massa concentrata esterna lato motore N ";
string i19 =3D "distanza dalla flangia motore del baricentro della massa + a=
 sbalzo - interna mm ";
string i20 =3D "quanti sono i tronchetti antecenti appoggio lato motore ";
string i21 =3D "diametro albero mm ";
string i22 =3D "lunghezza tronchetto mm ";
string i23 =3D "tronchetti esterni campata lato motore ";
string i24 =3D "tronchetti interni campata ";
string i25 =3D " 2 tronchetto interno campata con spostamento iniziale nullo=
 ";
string i26 =3D " 1 tronchetto interno campata con spostamento iniziale nullo=
 ";
string i27 =3D "diametro inerzia tronchetto mm ";
string i28 =3D "diametro massa tronchetto mm ";
string i29 =3D "angolo elica positivo sinistro gradi centesimali ";
string i30 =3D "diametro fondo dente resistente a torsione mm ";=20
string i31 =3D "tronchetti esterni campata lato utilizzatore";
l1: cout << i1 <<"?";
cin >> dwg;
if (z =3D=3D "s") goto l16;
l2: cout << i2 <<"?";
cin >> fs;
if (fs!=3D"s" && fs!=3D"n") goto l2;
if (z =3D=3D "s" && fs =3D=3D "n") {
z =3D "";
goto l10;
}
if (z =3D=3D "s" && fs =3D=3D "s") {
po=3D0.;
dc=3D0.;
rt=3D0.;
vs=3D"";
pc=3D0;
bc=3D0.;
af=3D0.;
}
l3: for (i =3D 1; i <=3D 4; i++){
 cout << i << "=3D";=20
 if (i>1) cout << i-1 << "+";
 cout << c[i-1] << endl;}
cout << i3 <<"?";
cin >> ts;
if (ts<1 || ts>4) goto l3;
if (z =3D=3D "s") goto l16;
l4: cout << i4 <<"?";
cin >> sc;
if (sc!=3D"s" && sc!=3D"n") goto l4;
if (z =3D=3D "s") goto l16;
l5: cout << i5 <<"?";
cin >> ro;
if (z =3D=3D "s") goto l16;
l6: cout << i6 <<"?";
cin >> ey;
if (z =3D=3D "s") goto l16;
l7: cout << i7 <<"?";
cin >> et;
if (z =3D=3D "s") goto l16;
l8: cout << i8 <<"?";
cin >> vc;
if (z =3D=3D "s") goto l16;
l9: cout << i9 <<"?";
cin >> a;
if (a!=3D"s" && a!=3D"n") goto l9;
if (a =3D=3D "s") kr =3D 1;
 else kr =3D -1;
if (z =3D=3D "s") goto l16;
if (fs =3D=3D "s") goto l16;
l10: cout << i10 <<"?";
cin >> po;
if (z =3D=3D "s") goto l16;
l11: cout << i11 <<"?";
cin >> dc;
if (z =3D=3D "s") goto l16;
l12: cout << i12 <<"?";
cin >> rt;
if (z =3D=3D "s") goto l16;
l13: cout << i13 <<"?";
cin >> vs;
if (vs!=3D"s" && vs!=3D"n") goto l13;
if (vs =3D=3D "s") pc =3D 1;
 else pc =3D 0;
if (z =3D=3D "s") goto l16;
l14: cout << i14 <<"?";
cin >> bc;
if (z =3D=3D "s") goto l16;
l15: cout << i15 <<"?";
cin >> af;
l16: cout << "1 " << dwg << endl;
if (fs =3D=3D "n") cout << "2 riduttore o moltiplicatore a 2 assi" << endl;
 else cout << "2 albero intermedio" << endl;
cout << "3 tipo stampa richiesto"<< endl;
for (i =3D 1; i <=3D ts; i++)
 cout << c[i-1] << endl;
if (sc =3D=3D "s") cout << "4 voglio i grafici deformazione=
 flesso-torsionale per correzione longitudinale dei denti" << endl;
 else cout << "4 non voglio i grafici deformazione flesso-torsionale per=
 correzione longitudinale dei denti" << endl;
cout << "5 " << i5 << ro << endl;
cout << "6 " << i6 << ey << endl;
cout << "7 " << i7 << et << endl;
cout << "8 " << i8 << vc << endl;
if (kr =3D=3D 1) cout << "9 l'utilizzatore vede la rotazione albero condotto=
 o intermedio antioraria" << endl;
 else cout <<"9 l'utilizzatore vede la rotazione albero condotto o=
 intermedio oraria" << endl;
if (fs =3D=3D "s") goto l17;=20
cout << "10 " << i10 << po << endl;
cout << "11 " << i11 << dc << endl;
cout << "12 " << i12 << rt << endl;
if (pc =3D=3D 0) cout << "13 non ci sono i collari" << endl;
 else cout << "13 ci sono i collari"<< endl;
cout << "14 " << i14 << bc << endl;
cout << "15 " << i15 << af << endl;
l17: cout << i16 <<"?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l13;
if (z =3D=3D"n") goto l18;
cout << i17 <<"?";
cin >> ic;
if (ic<1 || ic>15) goto l17;
switch (ic) {
 case 1: goto l1;
 case 2: goto l2;
 case 3: goto l3;
 case 4: goto l4;
 case 5: goto l5;
 case 6: goto l6;
 case 7: goto l7;
 case 8: goto l8;
 case 9: goto l9;
 case 10: goto l10;
 case 11: goto l11;
 case 12: goto l12;
 case 13: goto l13;
 case 14: goto l14;
 case 15: goto l15;
}
l18: stampo << "1 " << dwg << endl;
if (fs =3D=3D "n") stampo << "2 riduttore o moltiplicatore a 2 assi" <<=
 endl;
 else stampo << "2 albero intermedio" << endl;
stampo << "3 tipo stampa richiesto"<< endl;
for (i =3D 1; i <=3D ts; i++)
 stampo << c[i-1] << endl;
if (sc =3D=3D "s") stampo << "4 voglio i grafici deformazione=
 flesso-torsionale per correzione longitudinale dei denti" << endl;
 else stampo << "4 non voglio i grafici deformazione flesso-torsionale per=
 correzione longitudinale dei denti" << endl;
stampo << "5 " << i5 << ro << endl;
stampo << "6 " << i6 << ey << endl;
stampo << "7 " << i7 << et << endl;
stampo << "8 " << i8 << vc << endl;
if (kr =3D=3D 1) stampo << "9 l'utilizzatore vede la rotazione albero=
 condotto o intermedio antioraria" << endl;
 else stampo <<"9 l'utilizzatore vede la rotazione albero condotto o=
 intermedio oraria" << endl;
if (fs =3D=3D "s") goto l17;=20
stampo << "10 " << i10 << po << endl;
stampo << "11 " << i11 << dc << endl;
stampo << "12 " << i12 << rt << endl;
if (pc =3D=3D 0) stampo << "13 non ci sono i collari" << endl;
 else stampo << "13 ci sono i collari"<< endl;
stampo << "14 " << i14 << bc << endl;
stampo << "15 " << i15 << af << endl;
z=3D"";
l19: if (fs =3D=3D "s") cout << "attenzione descrizione albero intermedio=
 dal lato motore" << endl;
if (fs =3D=3D "n") cout << "attenzione descrizione albero condotto dal lato=
 motore" << endl;
if (fs =3D=3D "n") {
ptot =3D 1.;
sipt =3D 0.;}
if (fs =3D=3D "n" && ds =3D=3D "s") sipt =3D -1.;
l20: cout << i18 << "?";
cin >> mz;
if (z =3D=3D "s") goto l22;
l21: cout << i19 << "?";
cin >> sx;
if (z =3D=3D "s") goto l22;
l22: cout << "1 " << i18 << mz << endl;
cout << "2 " << i19 << sx << endl;
l23: cout << i16 <<"?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l23;
if (z =3D=3D"n") goto l25;
l24: cout << i17 <<"?";
cin >> ic;
if (ic<1 || ic>2) goto l24;
if (ic =3D=3D 1) goto l20;
if (ic =3D=3D 2) goto l21;
l25: cout << i20 << "?";
cin >> ni;
if (ni<1) goto l25;
cout << i23 << ni << endl;
l31: cout << "sei sicuro ?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l31;
if (z =3D=3D "n") goto l25;
for (i =3D 1; i <=3D ni; i++) {
cout << i21 << "?";
cin >> s[i][1];
cout << i22 << "?";
cin >> s[i][2];
}
l26: cout << i23 << endl;
for (i =3D 1; i <=3D ni; i++) {
cout << "tronchetto n " << i << " diametro " << s[i][1] << "lunghezza " <<=
 s[i][2] << endl;
}
l27: cout << i16 <<"?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l27;
if (z =3D=3D "n") goto l30;
l28: cout << "numero tronchetto ?";
cin >> ir;
if (ir<0 || ir>ni) goto l28;
l29: cout << "1=3Ddiametro 2=3Dlunghezza ?";
cin >> ic;
if (ic<1 || ic>2) goto l29;
cout << "nuovo valore ?";
cin >> s[ir][ic];
goto l26;
l30: stampo << "1 " << i18 << mz << endl;
stampo << "2 " << i19 << sx << endl;
for (i =3D 1; i <=3D ni; i++) {
stampo << "tronchetto n " << i << " diametro " << s[i][1] << "lunghezza " <<=
 s[i][2] << endl;
}
z =3D "";
l32: cout << i24 << "?";
cin >> nl;
if (nl<1) goto l32;
cout << i24 << nl << endl;
l33: cout << "sei sicuro ?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l33;
if (z =3D=3D "n") goto l32;
z =3D "";
l34: cout << "quanti appoggi interni alla campata si sono max 2 ";
cin >> ii;
v[21][3] =3D 0.;
v[21][1] =3D 0.;
if (ii>2 || ii<0) goto l34;
if (ii>1) {
cout << i25 << "?";
cin >> v[21][3];
}
if (ii>0) {
cout << i26 << "?";
cin >> v[21][1];
}
cout << i26 << v[21][1] << endl;
cout << i25 << v[21][3] << endl;
l35: cout << "sei sicuro ?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l35;
if (z =3D=3D "n") goto l34;
for (i =3D 1; i <=3D nl; i++) {
cout << i27 << "?";
cin >> l[i][1];
cout << i22 << "?";
cin >> l[i][2];
cout << i28 << "?";
cin >> l[i][3];
l36: cout << "si tratta di un tratto dentato s n ";
cin >> cpd;
if (cpd !=3D "s" && cpd !=3D "n") goto l36;=20
if (cpd =3D=3D "n") continue;
l[i][4] =3D 1.;
if (fs =3D=3D "n"){
cout << i29 << "?";
cin >> l[i][11];
cout << i30 << "?";
cin >> l[i][22];
}
}
l37: for (i =3D 1; i<=3Dnl; i++){
cout << i << " diam. iner." << l[i][1] << " lungh." << l[i][2] << " diam.=
 mass." << l[i][3] << endl;
if (l[i][4]>0. && fs =3D=3D "s") cout << "tratto dentato" << endl;
if (l[i][4]>0. && fs =3D=3D "n") cout << "ang.elica" << l[i][11] << " diam.=
 tors." << l[i][22] << endl;
}
l38: cout << i16 <<"?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l38;
if (z =3D=3D "n") goto l43;
l39: cout << "numero tronchetto ?";
cin >> ir;
if (ir<0 || ir>nl) goto l39;
l40: cout << "1=3Ddiametro inerzia 2=3Dlunghezza 3=3Ddiametro peso 4=3Delica=
 5=3Ddiametro torsione ?";
cin >> ic;
if (ic<1 || ic>5) goto l40;
if (ic =3D=3D 4 && l[ir][4] > 0.){
l41: cout << "si tratta ancora di un tratto dentato s n ";
cin >> cpd;
if (cpd !=3D "s" && cpd !=3D "n") goto l41;=20
if (cpd =3D=3D "n") {
l[ir][4] =3D 0.;
l[ir][11] =3D 0.;
l[ir][22] =3D 0.;
goto l37;
}
}
if (ic =3D=3D 4 && l[ir][4] =3D=3D 0.) l[ir][4] =3D 1.;
if (ic =3D=3D 4 && fs =3D=3D "s") goto l37;
if (ic =3D=3D 4) ic =3D 11;
if (ic =3D=3D 5) ic =3D 22;
l42: cout << "nuovo valore ?";
cin >> l[ir][ic];
if (ic =3D=3D 11 && l[ir][22] =3D=3D 0.){
cout << "il diametro resistente a torsione non pu=95 essere zero" << endl;
ic =3D 22;
goto l42;
}
goto l37;
l43: stampo << i24 << nl << endl;
if (ii>0) stampo << i26 << v[21][1] << endl;
if (ii>1) stampo << i25 << v[21][3] << endl;
for (i =3D 1; i<=3Dnl; i++){
stampo << i << " diam. iner." << l[i][1] << " lungh." << l[i][2] << " diam.=
 mass." << l[i][3] << endl;
if (l[i][4]>0. && fs =3D=3D "s") stampo << "tratto dentato" << endl;
if (l[i][4]>0. && fs =3D=3D "n") stampo << "ang.elica" << l[i][11] << "=
 diam. tors." << l[i][22] << endl;
}
l44: cout << i31 << "?";
cin >> nf;
if (nf<1) goto l44;
cout << i31 << nf << endl;
l45: cout << "sei sicuro ?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l45;
if (z =3D=3D "n") goto l44;
for (i =3D 1; i <=3D nf; i++) {
cout << i21 << "?";
cin >> f[i][1];
cout << i22 << "?";
cin >> f[i][2];
}
l46: cout << i31 << endl;
for (i =3D 1; i <=3D nf; i++) {
cout << "tronchetto n " << i << " diametro " << f[i][1] << "lunghezza " <<=
 f[i][2] << endl;
}
l47: cout << i16 <<"?";
cin >> z;
if (z!=3D"s" && z!=3D"n") goto l47;
if (z =3D=3D "n") goto l51;
l49: cout << "numero tronchetto ?";
cin >> ir;
if (ir<0 || ir>nf) goto l49;
l50: cout << "1=3Ddiametro 2=3Dlunghezza ?";
cin >> ic;
if (ic<1 || ic>2) goto l50;
cout << "nuovo valore ?";
cin >> f[ir][ic];
goto l46;
l51: stampo << i31 << nf << endl;
for (i =3D 1; i <=3D nf; i++) {
stampo << "tronchetto n " << i << " diametro " << f[i][1] << "lunghezza " <<=
 f[i][2] << endl;
}
if (sc =3D=3D "n") goto l100;=20
xint =3D 0.;
dy =3D 0.;
xrif =3D 0.;
if (ds =3D=3D "s") {
ksf=3D-kr;
if (bc-180<90 || bc-180>270) dy=3Ddc*(1.+rt)/2.;
}
if (fs =3D=3D "n" && ds !=3D "s") {
if (bc>=3D90 || bc<=3D270) dy=3Ddc*(1.+rt)/2.;
}
for (i =3D 1; i <=3D ni; i++){
w[clt][0] =3D xint;
w[clt][1] =3D s[i][1]/2.+dy;
w[clt][2] =3D xint+s[i][2];
w[clt][3] =3D s[i][1]/2.+dy;
clt +=3D 1;
w[clt][0] =3D xint;
w[clt][1] =3D -s[i][1]/2.+dy;
w[clt][2] =3D xint+s[i][2];
w[clt][3] =3D -s[i][1]/2.+dy;
clt +=3D 1;
if (i =3D=3D 1){
w[clt][0] =3D 0.;
w[clt][1] =3D s[i][1]/2.+dy;
w[clt][2] =3D 0.;
w[clt][3] =3D -s[i][1]/2.+dy;
clt +=3D 1;
}
if ( i > 1 && s[i][1] >=3D s[i-1][1] ){
w[clt][0] =3D xint;
w[clt][1] =3D s[i][1]/2.+dy;
w[clt][2] =3D xint;
w[clt][3] =3D -s[i][1]/2.+dy;
clt +=3D 1;
}
if ( i > 1 && s[i][1] < s[i-1][1] ){
w[clt][0] =3D xint;
w[clt][1] =3D s[i-1][1]/2.+dy;
w[clt][2] =3D xint;
w[clt][3] =3D -s[i-1][1]/2.+dy;
clt +=3D 1;
}
if (i > 1 || ds !=3D "s") goto l52;
w[clt][0] =3D xint+s[1][1]/2.;
w[clt][1] =3D -ksf*s[1][1]/2.+dy;
w[clt][2] =3D xint+3.*s[1][1]/8.;
w[clt][3] =3D -ksf*s[1][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+s[1][1]/2.;
w[clt][1] =3D -ksf*s[1][1]/2.+dy;
w[clt][2] =3D xint+5.*s[1][1]/8.;
w[clt][3] =3D -ksf*s[1][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+3.*s[1][1]/8.;
w[clt][1] =3D -ksf*s[1][1]/4.+dy;
w[clt][2] =3D xint+5.*s[1][1]/8.;
w[clt][3] =3D -ksf*s[1][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+s[1][1]/2.;
w[clt][1] =3D -ksf*s[1][1]/4.+dy;
w[clt][2] =3D xint+3.*s[1][1]/8.;
w[clt][3] =3D dy;
clt +=3D 1;
w[clt][0] =3D xint+s[1][1]/2.;
w[clt][1] =3D -ksf*s[1][1]/4.+dy;
w[clt][2] =3D xint+5.*s[1][1]/8.;
w[clt][3] =3D dy;
clt +=3D 1;
w[clt][0] =3D xint+3.*s[1][1]/8.;
w[clt][1] =3D dy;
w[clt][2] =3D xint+5.*s[1][1]/8.;
w[clt][3] =3D dy;
clt +=3D 1;
w[clt][0] =3D xint+9.*s[1][1]/16.;
w[clt][1] =3D dy;
w[clt][2] =3D xint+9.*s[1][1]/16.;
w[clt][3] =3D 3.*ksf*s[1][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+7.*s[1][1]/16.;
w[clt][1] =3D dy;
w[clt][2] =3D xint+7.*s[1][1]/16.;
w[clt][3] =3D 3.*ksf*s[1][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+7.*s[1][1]/16.;
w[clt][1] =3D dy+3.*ksf*s[1][1]/4.;
w[clt][2] =3D xint+9.*s[1][1]/16.;
w[clt][3] =3D 3.*ksf*s[1][1]/4.+dy;
clt +=3D 1;
l52: xint =3D xint+s[i][2];
}
for (i =3D 1; i <=3D nl; i++){
dmax =3D l[i][1];
if (l[i][3]>l[i][1] ) dmax =3D l[i][3];=20
if (l[i][4]>0. && xrif =3D=3D 0.) {
xrif =3D xint;
w[clt][0] =3D xint+l[i][2]/2.;
w[clt][1] =3D dy;
w[clt][2] =3D xint+3.*l[i][2]/8.;
w[clt][3] =3D ksf*l[i][2]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+l[i][2]/2.;
w[clt][1] =3D dy;
w[clt][2] =3D xint+5.*l[i][2]/8.;
w[clt][3] =3D ksf*l[i][2]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+3.*l[i][2]/8.;
w[clt][1] =3D dy+ksf*l[i][2]/4.;
w[clt][2] =3D xint+5.*l[i][2]/8.;
w[clt][3] =3D ksf*l[i][2]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+9.*l[i][2]/16.;
w[clt][1] =3D dy+ksf*l[i][2]/4.;
w[clt][2] =3D xint+9.*l[i][2]/16.;
w[clt][3] =3D ksf*l[i][2]+dy;
clt +=3D 1;
w[clt][0] =3D xint+7.*l[i][2]/16.;
w[clt][1] =3D dy+ksf*l[i][2]/4.;
w[clt][2] =3D xint+7.*l[i][2]/16.;
w[clt][3] =3D ksf*l[i][2]+dy;
clt +=3D 1;
w[clt][0] =3D xint+7.*l[i][2]/16.;
w[clt][1] =3D ksf*l[i][2]+dy;
w[clt][2] =3D xint+9.*l[i][2]/16.;
w[clt][3] =3D ksf*l[i][2]+dy;
clt +=3D 1;
}
w[clt][0] =3D xint;
w[clt][1] =3D dy+l[i][1]/2.;
w[clt][2] =3D xint+l[i][2];
w[clt][3] =3D l[i][1]/2.+dy;
clt +=3D 1;
w[clt][0] =3D xint;
w[clt][1] =3D dy-l[i][1]/2.;
w[clt][2] =3D xint+l[i][2];
w[clt][3] =3D -l[i][1]/2.+dy;
clt +=3D 1;
if (dmax > l[i][1] ) {
w[clt][0] =3D xint;
w[clt][1] =3D dy+dmax/2.;
w[clt][2] =3D xint+l[i][2];
w[clt][3] =3D dmax/2.+dy;
clt +=3D 1;
w[clt][0] =3D xint;
w[clt][1] =3D dy-dmax/2.;
w[clt][2] =3D xint+l[i][2];
w[clt][3] =3D -dmax/2.+dy;
clt +=3D 1;
}
if ( i =3D=3D 1 && dmax < s[ni][1] ) dmax =3D s[ni][1];
if ( i > 1 && dmax < l[i-1][1] ) dmax =3D l[i-1][1];
if ( i > 1 && dmax < l[i-1][3] ) dmax =3D l[i-1][3];
w[clt][0] =3D xint;
w[clt][1] =3D dy+dmax/2.;
w[clt][2] =3D xint;
w[clt][3] =3D -dmax/2.+dy;
clt +=3D 1;
if ( i > 1 && i < nl ) goto l53;
if ( i =3D=3D nl ) xint =3D xint+l[nl][2];
lcus =3D l[i][3];
if (lcus > l[1][2] ) lcus =3D l[1][2];
if (lcus > l[nl][2] ) lcus =3D l[nl][2];
if (lcus > s[1][2] ) lcus =3D s[1][2];
if (lcus > f[1][2] ) lcus =3D f[1][2];
recus =3D l[i][3]/4.+dc*(1.+rt)/8.;
if ( fs =3D=3D "s" ) recus =3D l[i][3]/2.+lcus/2.;
w[clt][0] =3D xint-lcus;
w[clt][1] =3D dy+l[i][3]/2.;
w[clt][2] =3D xint-lcus;
w[clt][3] =3D recus+dy;
clt +=3D 1;
w[clt][0] =3D xint+lcus;
w[clt][1] =3D dy+l[i][3]/2.;
w[clt][2] =3D xint+lcus;
w[clt][3] =3D recus+dy;
clt +=3D 1;
w[clt][0] =3D xint-lcus;
w[clt][1] =3D dy+recus;
w[clt][2] =3D xint+lcus;
w[clt][3] =3D recus+dy;
clt +=3D 1;
w[clt][0] =3D xint-lcus;
w[clt][1] =3D dy+l[i][3]/2.;
w[clt][2] =3D xint+lcus;
w[clt][3] =3D recus+dy;
clt +=3D 1;
w[clt][0] =3D xint+lcus;
w[clt][1] =3D dy+l[i][3]/2.;
w[clt][2] =3D xint-lcus;
w[clt][3] =3D recus+dy;
clt +=3D 1;
w[clt][0] =3D xint-lcus;
w[clt][1] =3D dy-l[i][3]/2.;
w[clt][2] =3D xint-lcus;
w[clt][3] =3D -recus+dy;
clt +=3D 1;
w[clt][0] =3D xint+lcus;
w[clt][1] =3D dy-l[i][3]/2.;
w[clt][2] =3D xint+lcus;
w[clt][3] =3D -recus+dy;
clt +=3D 1;
w[clt][0] =3D xint-lcus;
w[clt][1] =3D dy-recus;
w[clt][2] =3D xint+lcus;
w[clt][3] =3D -recus+dy;
clt +=3D 1;
w[clt][0] =3D xint-lcus;
w[clt][1] =3D dy-l[i][3]/2.;
w[clt][2] =3D xint+lcus;
w[clt][3] =3D -recus+dy;
clt +=3D 1;
w[clt][0] =3D xint+lcus;
w[clt][1] =3D dy-l[i][3]/2.;
w[clt][2] =3D xint-lcus;
w[clt][3] =3D -recus+dy;
clt +=3D 1;
if  ( i =3D=3D nl) break;
l53 : xint =3D xint+l[i][2];
}
for (i =3D 1; i <=3D nf; i++){
w[clt][0] =3D xint;
w[clt][1] =3D dy+f[i][1]/2.;
w[clt][2] =3D xint+f[i][2];
w[clt][3] =3D dy+f[i][1]/2.;
clt +=3D 1;
w[clt][0] =3D xint;
w[clt][1] =3D dy-f[i][1]/2.;
w[clt][2] =3D xint+f[i][2];
w[clt][3] =3D dy-f[i][1]/2.;
clt +=3D 1;
dmax =3D f[i][1];
if (i =3D=3D 1 && l[nl][1] > dmax ) dmax =3D l[nl][1];
if (i =3D=3D 1 && l[nl][3] > dmax ) dmax =3D l[nl][3];
if (i > 1 && f[i-1][1] > dmax ) dmax =3D f[i-1][1];
w[clt][0] =3D xint;
w[clt][1] =3D dy+dmax/2.;
w[clt][2] =3D xint;
w[clt][3] =3D dy-dmax/2.;
clt +=3D 1;
xint =3D xint+f[i][2];
}
w[clt][0] =3D xint;
w[clt][1] =3D dy+f[nf][1]/2.;
w[clt][2] =3D xint;
w[clt][3] =3D dy-f[nf][1]/2.;
clt +=3D 1;
for (i =3D 1; i <=3D 19; i++) {
w[clt][0] =3D xint*i/20.;
w[clt][1] =3D dy;
w[clt][2] =3D xint*(2.*i+1)/40.;
w[clt][3] =3D dy;
clt +=3D 1;
}
if (fs =3D=3D "s" || ds =3D=3D "s") goto l54;=20
w[clt][0] =3D xint-f[nf][1]/2.;
w[clt][1] =3D ksf*f[nf][1]/2.+dy;
w[clt][2] =3D xint+3.*f[nf][1]/8.;
w[clt][3] =3D +ksf*s[nf][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint-f[nf][1]/2.;
w[clt][1] =3D +ksf*f[nf][1]/2.+dy;
w[clt][2] =3D xint-5.*f[nf][1]/8.;
w[clt][3] =3D +ksf*f[nf][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint-3.*f[nf][1]/8.;
w[clt][1] =3D -ksf*f[nf][1]/4.+dy;
w[clt][2] =3D xint-5.*f[nf][1]/8.;
w[clt][3] =3D ksf*f[nf][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint+-f[nf][1]/2.;
w[clt][1] =3D +ksf*f[nf][1]/4.+dy;
w[clt][2] =3D xint-3.*f[nf][1]/8.;
w[clt][3] =3D dy;
clt +=3D 1;
w[clt][0] =3D xint-f[nf][1]/2.;
w[clt][1] =3D ksf*f[nf][1]/4.+dy;
w[clt][2] =3D xint-5.*f[nf][1]/8.;
w[clt][3] =3D dy;
clt +=3D 1;
w[clt][0] =3D xint-3.*f[nf][1]/8.;
w[clt][1] =3D dy;
w[clt][2] =3D xint-5.*f[nf][1]/8.;
w[clt][3] =3D dy;
clt +=3D 1;
w[clt][0] =3D xint-9.*f[nf][1]/16.;
w[clt][1] =3D dy;
w[clt][2] =3D xint-9.*f[nf][1]/16.;
w[clt][3] =3D -3.*ksf*f[nf][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint-7.*f[nf][1]/16.;
w[clt][1] =3D dy;
w[clt][2] =3D xint-7.*f[nf][1]/16.;
w[clt][3] =3D -3.*ksf*f[nf][1]/4.+dy;
clt +=3D 1;
w[clt][0] =3D xint-7.*f[nf][1]/16.;
w[clt][1] =3D dy-3.*ksf*f[nf][1]/4.;
w[clt][2] =3D xint-9.*f[nf][1]/16.;
w[clt][3] =3D -3.*ksf*f[nf][1]/4.+dy;
clt +=3D 1;
l54:if ( fs =3D=3D "n" && ds !=3D "s") {
clm =3D clt-1;
xmos =3D xrif;
goto l100;
}
if ( ds =3D=3D "s" && xmos < xrif ) dx2 =3D xrif-xmos;
if ( ds =3D=3D "s" && xrif < xmos ) dx1 =3D xmos-xrif;
if ( clm > 0 ) ul =3D clm;
else ul =3D clt-1;=20
for (i =3D 1; i <=3D ul; i++){
if (fs =3D=3D "n") w[i][0] =3D w[i][0]+dx2;
if (fs =3D=3D "n") w[i][2] =3D w[i][2]+dx2;
if (r[1][2] > w[i][0]) r[1][2] =3D w[i][0];
if (r[1][2] > w[i][2]) r[1][2] =3D w[i][2];
if (r[1][3] < w[i][0]) r[1][3] =3D w[i][0];
if (r[1][3] < w[i][2]) r[1][3] =3D w[i][2];
if (r[2][2] > w[i][1]) r[2][2] =3D w[i][1];
if (r[2][2] > w[i][3]) r[2][2] =3D w[i][3];
if (r[2][3] < w[i][1]) r[2][3] =3D w[i][1];
if (r[2][3] < w[i][3]) r[2][3] =3D w[i][3];
}
if (fs =3D=3D "s") goto l55;
for (i =3D ul+1; i <=3D clt-1; i++){
w[i][0] =3D w[i][0]+dx1;
w[i][2] =3D w[i][2]+dx1;
if (r[1][2] > w[i][0]) r[1][2] =3D w[i][0];
if (r[1][2] > w[i][2]) r[1][2] =3D w[i][2];
if (r[1][3] < w[i][0]) r[1][3] =3D w[i][0];
if (r[1][3] < w[i][2]) r[1][3] =3D w[i][2];
if (r[2][2] > w[i][1]) r[2][2] =3D w[i][1];
if (r[2][2] > w[i][3]) r[2][2] =3D w[i][3];
if (r[2][3] < w[i][1]) r[2][3] =3D w[i][1];
if (r[2][3] < w[i][3]) r[2][3] =3D w[i][3];
}
l55: fts =3D 450 /(r[2][3]-r[2][2]); =20
n =3D 8*int((r[1][3]-r[1][2])*fts/8.+1.);
stampo << ch;
ch =3D 65;
stampo << ch;
ch =3D 8;
stampo << ch;
for ( x =3D 0; x <=3D n; x +=3D 8 ){
for ( xi =3D 1; xi <=3D 8; xi++){
is =3D int(128/pow(2,xi-1));=20
xv =3D (x+xi-1)*fts+r[1][2];
for ( i =3D 1 ; i <=3D clt-1; i++){
if (fabs((w[i][0]-w[i][2])*fts) < 1) goto l56;
if (xv<w[i][0] && xv<w[i][2]) continue;
if (xv>w[i][0] && xv>w[i][2]) continue;
og =3D (w[i][3]-w[i][1])*(xv-w[i][0])/(w[i][2]-w[i][0])+w[i][1];
oi =3D int((og-r[2][2])*fts+1.);
if (e[oi]>0) continue;
d[oi] =3D d[oi]+is;
e[oi] =3D 1;
continue;
l56: if (xv>w[i][0]) continue;
}
}
}
l100: // fine disegno;
return 0;
}



--=====================_896216998==_--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019