/***************************************************************** * @file: GeomObj.java * @synopsis: * --Base Class for all geometric objects * --All geometric objects (points, lines, etc) ought to * be extensions of this class. * --One important application is when an operation * can return one of several possible Geometric objects. * E.g., intersecting two lines can return a point, an empty * set, or a line. All these are Geometric Objects. * @author Chee Yap * @version Version 0.1. Feb 12, 2003. Used for * my undergraduate visualization class. * * $Id: GeomObj.java,v 1.2 2003/02/20 16:59:57 yap Exp yap $ *****************************************************************/ class GeomObj { static final int NULL_TYPE = -1; static final int NUMBER_TYPE = 0; static final int POINT_TYPE = 1; static final int LINE_TYPE = 2; static final int SEGMENT_TYPE = 3; static final int TRIANGLE_TYPE = 4; static final int POLYGON_TYPE = 5; public int dim = -1; public int type; GeomObj(){ type = NULL_TYPE; dim = -1; } GeomObj(int t, int d){ type = t; dim = d; } int draw(){ return 0; }; int dump(){ System.out.println("dim=" + dim + ", type=" + type); return 0; }; }