/* Generated By:JJTree: Do not edit this line. ASTTriangle.java */

/**************************************************************

File				: ASTTrangle.java
Auther				: M. Spiller
Registration #		: Y0259667
Date				: Thursday 13th november 2003
Unit				: CMP-2A25 Programming - Software Development Techniques
Description			: Triangle class holding generate method

**************************************************************/

import java.io.*;

public class ASTTriangle extends SimpleNode 
{
	public ASTTriangle(int id) 
	{
		super(id);
	}

	public ASTTriangle(DrawPhase3 p, int id) 
	{
		super(p, id);
	}

	public void generate(FileWriter SVGFile, int Xsc, int Ysc, int X, 
						int Y, String colour, int brush)
	{
		//first point
		int x1 = ((ASTInt)jjtGetChild(0)).val;
		int x2 = ((ASTInt)jjtGetChild(1)).val;
		//second
		int x3 = ((ASTInt)jjtGetChild(2)).val;
		int x4 = ((ASTInt)jjtGetChild(3)).val;
		//third
		int x5 = ((ASTInt)jjtGetChild(4)).val;
		int x6 = ((ASTInt)jjtGetChild(5)).val;

		//draws three sides/lines of triangle
		DrawLine(SVGFile, Xsc, Ysc, X, Y, colour, brush, x1, x2, x3, x4);
		DrawLine(SVGFile, Xsc, Ysc, X, Y, colour, brush, x3, x4, x5, x6);
		DrawLine(SVGFile, Xsc, Ysc, X, Y, colour, brush, x5, x6, x1, x2);
    }
}
