|
| MAS ETH ARCH/CAAD - 2005/06 - STUDENT PAGES Master of Advanced Studies in Architecture, Specialization in Computer Aided Architectural Design | 065-0005/6 Supervision: Prof. Dr. Ludger Hovestadt, Philipp Schaerer Chair of CAAD, ETH Zurich PROCEDURE mapping; VAR currentCell:HANDLE; layerRed, layerGreen, layerBlue : STRING; tag,data : STRING; flag,id : INTEGER; r,g,b : LONGINT; x,y,RVALUE,GVALUE,BVALUE : REAL; fileName : STRING; col : REAL; objectHand : HANDLE; PROCEDURE readData(VAR dData,dTag:STRING;VAR OCFlag:INTEGER); VAR rString:STRING; rChar:CHAR; f1:INTEGER; BEGIN {setzen der Variablen in den Grundzustand} f1:=0; OCFlag:=0; dData:=''; {Name/Art der Wertebezeichnung aus dem XML} rString:=''; dTag:=''; {Wert/Daten aus dem XML} WHILE ((f1=0) AND (NOT EOF(fileName))) DO BEGIN Read(rChar); IF rChar='/' THEN BEGIN IF OCFlag=1 THEN OCFlag:=2; rString:=''; END ELSE BEGIN IF rChar='<' THEN BEGIN OCFLag:=1; dData:=rString; rString:=''; END ELSE BEGIN IF rChar='>' THEN BEGIN dTag:=rString; f1:=1; END ELSE BEGIN rString:=Concat(rString,rChar); END; END; END; END; IF EOF(fileName) THEN dTag:='xx'; END; BEGIN GetFile(fileName); Open(fileName); WHILE tag<>'xx' DO BEGIN readData(data,tag,flag); IF (flag=2) THEN BEGIN IF tag='CELL' THEN BEGIN Layer('layerRed'); Oval(x,y,x+1,y+1); ColorIndexToRGB(7,r,g,b); objectHand := LNewObj; SetFillBack(objectHand,r*RVALUE,g*RVALUE,b*RVALUE); Layer('layerGreen'); Oval(x+.5,y+.5,x+1.5,y+1.5); ColorIndexToRGB(6,r,g,b); objectHand := LNewObj; SetFillBack(objectHand,r*GVALUE,g*GVALUE,b*GVALUE); Layer('layerBlue'); Oval(x+.75,y,x+1.75,y+1); ColorIndexToRGB(4,r,g,b); objectHand := LNewObj; SetFillBack(objectHand,r*BVALUE,g*BVALUE,b*BVALUE); objectHand := LNewObj; END; IF tag='ID' THEN BEGIN id := Str2Num(data); END; IF tag='RVALUE' THEN BEGIN RVALUE := Str2Num(data); END; IF tag='GVALUE' THEN BEGIN GVALUE := Str2Num(data); END; IF tag='BVALUE' THEN BEGIN BVALUE := Str2Num(data); END; IF tag='X' THEN BEGIN x := Str2Num(data)*1.80; END; IF tag='Y' THEN BEGIN y := Str2Num(data)*-1.5; END; END; IF(flag=1) THEN BEGIN END; Message(x,' ',y,' ',RVALUE,GVALUE,BVALUE); END; Close(fileName); END; RUN(mapping);
|
This website has been archived and is no longer maintained.