import java.awt.*; import java.util.*; //import Point2D; public class SubdivisionCurve2D extends Curve2D { // Constants public final static int APPROXIMATING = 0; public final static int INTERPOLATING = 1; // Member Variables //////////////////////////////////////////////////////////////////////////// // CS284: These are the variable you will be dealing with // Also look at the variables in Curve2D.java // Array of points on the curve Point2D[] m_aCurvePoints = new Point2D[m_iMaxCurvePoints+2]; // Number of points on the curve int m_iCurvePoints = 0; // Type of curve, either approximating or interpolating int m_iCurveType = APPROXIMATING; // Number of levels of subdivision int m_iSubdivisionLevel = 0; // Add additional varibles here // //////////////////////////////////////////////////////////////////////////// // Member Functions public SubdivisionCurve2D(int iLevel, int iType) { m_iSubdivisionLevel = iLevel; m_iCurveType = iType; } public void setType(int iType) { m_iCurveType = iType; calculateCurve(); } public void setLevel(int iLevel) { m_iSubdivisionLevel = iLevel; calculateCurve(); } public void calculateCurve() { int i, j; Point2D pt; pt = new Point2D(); Point2D pt1, pt2; if( m_iCurveType == APPROXIMATING ) { /////////////////////////////////////////////////////////////// // CS284: Replace the code below with code to calculate a curve // that approximates the control points (m_aControlPoint[]). // Set m_iCurvePoints to the total number curve points you // are calculating. // m_iCurvePoints = m_iSubdivisionLevel * m_iControlPoints * ... //num = m_iControlPoints; //for (i=0; i