/* * Copyright (c) 1996 CONNIE K. PENG All Rights Reserved. * * Permission to use, copy, modify, and distribute this software * and its documentation for NON-COMMERCIAL purposes. * */ import java.awt.Color; public class Face { int line[]; // lines that enclose the face int numLines; // totacl number of lines on this faces Color color; // color of this face boolean behind; // flag that indicate if the face is behind the view int cur; // current index of the line public Face (int num) { color = null; line = new int[num]; numLines = num; behind = false; cur = 0; } public Face (int r, int g, int b, int num) { color = new Color(r, g, b); line = new int[num]; numLines = num; behind = false; cur = 0; } public Face (Face f) { if (f.color == null) color = null; else color = new Color(f.color.getRGB()); numLines = f.numLines; cur = f.cur; behind = f.behind; line = new int[numLines]; for (int i = 0; i < numLines; i++) line[i] = f.line[i]; } void addLine (int lindex) { line[cur] = lindex; cur++; } void setBehind(boolean flag) { behind = flag; } }