// (c) MIT 2003.  All rights reserved.

////////////////////////////////////////////////////////////////////////////////
//
// FILE:	WTriangle.java
//
// AUTHOR:	Manoj D. Muzumdar
//		archon@ai.mit.edu
//
// DATE:	06-XX-98
//
// COPYRIGHT:	Massachusetts Institute of Technology
//		All rights reserved.
//
// PURPOSE:     Drawing recognition
//
// HISTORY:     11-15-98 archon
//              Now aware of new rec.geo package
//
////////////////////////////////////////////////////////////////////////////////

package rec.core.widgets;

import java.awt.*;
import rec.util.*;
import rec.geo.*;
import rec.sys.*;

public class WTriangle extends WPolygon
{
  public WTriangle( GPoint[] points )
  {
    super( points );

    setEnglishName( "Triangle" );
    Assert.check( points.length == 3, "triangles must have 3 sides" );
  }

  public WTriangle( PolygonInfo pi )
  {
    super( pi );
    setEnglishName( "Triangle" );

    Assert.check( pi.getNumberOfSides() == 3, "triangles must have 3 sides" );
  }

  public WTriangle( WPolygon pi )
  {
    super( pi );

    setEnglishName( "Triangle" );
    Assert.check( pi.m_Polygon.getNumberOfSides() == 3, "triangles must have 3 sides" );
  }

  /////////////////////////////////////////////////////////////////////////////

  protected WTriangle()
  {
    // For subclass use.
  }

  public Object clone()
  {
    WTriangle ret = new WTriangle();

    ret.m_Polygon = new GPolygon( m_Polygon );

    return( ret );
  }
}

////////////////////////////////////////////////////////////////////////////////
