File Archive

 
Output of file : VGGETDSP.PAS contained in archive : ITP9012.ZIP

{Include File: VgGetDsp.PAS ***********************************}
{***** Read object definitions from file then display them *****}

PROCEDURE GetDspObjs(VAR T: Text);
VAR
LineType : Char;
P1,P2,P3,P4,P5 : Real;
Point1 : Point;
Line1 : Line;
Circle1 : Circle;
Arc1 : Arc;
NewColor : Word;
DummyString : String;
Entities : ARRAY[1..10] OF Entity; {** New Line **}
I : Integer; {** New Line **}
ObjPtr : EntityPtr; {** New Line **}
EntityNbr,
NbrElements,
EntityID : Integer; {** New Line **}

BEGIN
Read(T,LineType);
WHILE LineType <> '!' DO BEGIN
CASE LineType OF
'P' : BEGIN
ReadLn(T,P1,P2);
Point1.Init(P1,P2);
Point1.Disp(0.0,0.0,1.0,0.0);
END;
'L' : BEGIN
ReadLn(T,P1,P2,P3,P4);
Line1.Init(P1,P2,P3,P4);
Line1.Disp(0.0,0.0,1.00,0.0);
END;
'C' : BEGIN
ReadLn(T,P1,P2,P3);
Circle1.Init(P1,P2,P3);
Circle1.Disp(0.0,0.0,1.00,0.0);
END;
'A' : BEGIN
ReadLn(T,P1,P2,P3,P4,P5);
Arc1.Init(P1,P2,P3,P4,P5);
Arc1.Disp(0.0,0.0,1.00,0.0);
END;

{** New Section Added to VgGetDsp.PAS include file **}

'D' : BEGIN
ReadLn(T,EntityNbr,NbrElements);
Entities[EntityNbr].Init(NbrElements);
FOR I := 1 TO NbrElements DO BEGIN
Read(T,LineType);
ObjPtr := NIL;
IF LineType = 'E' THEN BEGIN
Read(T,EntityID);
ObjPtr := @Entities[EntityID];
END;
Entities[EntityNbr].AddElement(T,LineType,ObjPtr)
END
END;
'E' : BEGIN
ReadLn(T,I,P2,P3,P4,P5);
Entities[I].Disp(P2,P3,P4,P5)
END;

{** End of New Section Added to VgGetDsp.PAS include file **}

'*' : BEGIN
ReadLn(T,NewColor);
IF NewColor <= MC THEN SetColor(NewColor)
END;
ELSE
ReadLn(T,DummyString)
END;
Read(T,LineType);
END;
END;

{***** End of VgGetDsp.PAS include file ************************}