home *** CD-ROM | disk | FTP | other *** search
- (* ------------------------------------------------------ *)
- (* GR-EDIT3.INC *)
- (* Erweiterungen zum Programm VEKTORGRAPHIK *)
- (* (c) 1988 Helmut Wessels & TOOLBOX *)
- (* ------------------------------------------------------ *)
-
- {Einzufügen in Prozedur ZEICHNE:}
- ref_zeichen:
- begin
- zeichne(font, {rekusiver Aufruf}
- (vect^[off] and $F) shl 8 +vect^[off+1],
- true,faktor*vect^[off+2]/16,
- (vect^[off+3]+drehung) mod 180);
- inc(off,2)
- end; {ref_zeichen}
- texte : begin
- w1:=vect^[off] and $F;
- w2:=(vect^[off+1] + drehung) mod 180;
- x1:=vect^[off+2];
- {Textausgabe mit Zeichensatz LIT1.CHR}
- for z:=1 to x1 do
- zeichne(outfont,vect^[off+2+z],false,
- w1*faktor/32,w2);
- inc(off,x1+1)
- end; {texte}
- kreis : begin
- alp:=2*drehung+3*(vect^[off] and $F);
- x:=vect^[off+2]; y:=vect^[off+3];
- w1:=((x and $C0) shr 2)+(vect^[off+1] and $F);
- w2:=((y and $C0) shr 2)+(vect^[off+1] shr 4);
- x:=x and $3F; y:=y and $3F;
- if alp=0 then {ELLIPSE von BORLAND}
- ellipse(gcx+x1,gcy-y1,6*w1,6*w2,
- round(xf*x),round(faktor*y))
- else begin
- {schräge Ellipse, nicht von BORLAND}
- pi180:=pi/180; alp:=alp*pi180;
- sina:=sin(alp); cosa:=cos(alp);
- if w2<=w1 then inc(w2,60);
- z1 := x*cos(6*w1*pi180);
- z2 := y*sin(6*w1*pi180);
- moveto(gcx+x1+round((z1*cosa-z2*sina)*xf),
- gcy-y1-round((z1*sina+z2*cosa)*faktor));
- for z:= w1+1 to w2 do begin
- z1 := x*cos(6*z*pi180);
- z2 := y*sin(6*z*pi180);
- lineto(gcx+x1+round((z1*cosa-z2*sina)*xf),
- gcy-y1-round((z1*sina+z2*cosa)*faktor));
- end {Wer den Bogen noch runder möchte, darf}
- end; {eine schnelle INLINE-Routine schreiben}
- inc(off,2);
- moveto(gcx+x1,gcy-y1)
- end {kreis}
-
-
- {folgende Prozeduren müssen anstelle der Dummy's in die
- Prozedur EDIT eingefügt werden: }
-
-
- procedure text_eingeben; {Freier Text in Graphik}
- var k:byte;
- begin
- bar(txof,2*ty,getMaxX,cy_g-ty-1);
- moveto(txof,4*ty);
- meintext(5,'Bitte Text eingeben! ');
- moveto(txof,6*ty);
- meintext(5,'Ende des Textes --> [Ret]');
- moveto(txof,7*ty);
- meintext(5,'Zeichen löschen --> [<-]');
- moveto(txof,9*ty);
- meintext(5,'Drehen und Vergrößern ');
- moveto(txof,10*ty);
- meintext(5,'nach Eingabe mit [V] ');
- k:=0; inc(akt); paar:=knoten[akt];
- vector_plus_minus(2);
- with userfont do begin {Voreinstellung}
- vect^[knoten[akt]]:=ord(texte) shl 4 + 8; {Größe 8}
- vect^[knoten[akt]+1]:=0; {Drehung}
- vect^[knoten[akt]+2]:=1; {Länge }
- paar:=knoten[akt]+2;
- repeat
- if not f_taste(blink) then begin
- if c<>#13 then begin
- if (c=#8) and (k>0) then begin
- vect^[paar+(k and 1)]:=32; dec(k);
- if odd(k) then begin
- dec(vect^[knoten[akt]+2],2);
- vector_plus_minus(-1)
- end
- end;
- if c<>#8 then begin
- if odd(k) then begin
- inc(vect^[knoten[akt]+2],2);
- vector_plus_minus(1);
- vect^[paar+1]:=32
- end;
- inc(k);
- vect^[paar+(k and 1)]:=ord(c)
- end;
- if not keypressed then bild_neu;
- end
- end
- until c=#13
- end; {with}
- vector_neu
- end;
-
- procedure referenz; {Blendet andere Graphik ein}
- var i:word;
- begin
- restoreCrtMode; clrscr;
- writeln('Sie blenden nun ein anderes Bild in das '+
- 'aktuelle Bild ein');
- writeln;
- writeln('Welches Bild soll eingeblendet werden? '+
- '(0=Ende) ');
- i:=bildwahl;
- if i>0 then with userfont do begin
- inc(akt); paar:=knoten[akt];
- vector_plus_minus(2);
- vect^[knoten[akt]]:=ord(ref_zeichen) shl 4 + i shr 8;
- vect^[knoten[akt]+1]:=i and $FF;
- vect^[knoten[akt]+2]:=16; {Größe 16/16}
- vect^[knoten[akt]+3]:=0; {Drehung}
- end;
- setGraphMode(GraphMode);
- vector_neu
- end;
-
-
- procedure kreis_zeichnen; {Kreise / Ellipsen / Bögen}
- var x,y:byte; w1,w2:word;
- begin
- restoreCrtMode; clrscr;
- writeln('Ellipse (Kreis) mit Mittelpunkt am zuletzt '+
- 'gewählten Punkt:');
- write('Waagerechter Radius in Rastereinheiten: (Ende:0) ');
- x:=liesz;
- write('Senkrechter Radius in Rastereinheiten: (Ende:0) ');
- y:=liesz;
- if (x>0) or (y>0) then with userfont do begin
- inc(akt); paar:=knoten[akt];
- vector_plus_minus(2);
- writeln('Bitte nun Anfangs- und Endwinkel eingeben '+
- '(entgegen Uhrzeigersinn, 0-360°)');
- write('Anfangswinkel: (0-360) ');
- w1:=(liesz+3) div 6;
- write('Endwinkel: (0-360) ');
- w2:=(liesz+3) div 6;
- vect^[knoten[akt]]:= ord(kreis) shl 4;
- vect^[knoten[akt]+2]:=
- (x and $3F) + ((w1 and $30) shl 2);
- {waagerechter Radius}
- vect^[knoten[akt]+3]:=
- (y and $3F) + ((w2 and $30) shl 2);
- {senkrechter Radius}
- vect^[knoten[akt]+1]:=
- (w1 and $F) + ((w2 and $F) shl 4);
- end;
- setGraphMode(GraphMode);
- vector_neu
- end;
-
- (* ------------------------------------------------------ *)
- (* Ende GR-EDIT3.INC *)