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

////////////////////////////////////////////////////////////////////////////////
//
// FILE:	WMCam.java
//
// AUTHOR:	Manoj D. Muzumdar
//		archon@ai.mit.edu
//
// DATE:	April 99
//
// COPYRIGHT:	Massachusetts Institute of Technology
//		All rights reserved.
//
// PURPOSE:     Cam widget
//
// HISTORY:     April 99  archon  created
//
////////////////////////////////////////////////////////////////////////////////

package rec.meche;

import rec.geo.*;

public class WMCam extends WPart
{
  public WMCam( GPoint center, double angle, double size, Cloneable data )
  {
    super( center, angle, size, data );
  }

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

  public Object clone()
  {
    return( new WMCam( getCenter(), getAngle(), size(), getData() ) );
  }

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

  protected GShape[] create( double size, Cloneable data )
  {
    GShape[] shapes = new GShape[4];

    double unit = size / 6.0;

    // Create the outer circle.

    shapes[0] = new GCircle( new GPoint( unit * 4.0, unit * 2.0 ),
			     unit * 3.0 );

    // Create the inner circle.

    shapes[1] = new GCircle( new GPoint( unit * 4.0, unit * 2.0 ),
			     unit * 1.5 );

    // Create the inner cross-hatch.

    shapes[2] = new GSegment( new GPoint( unit * 2.5, unit * 2.0 ),
			      new GPoint( unit * 5.5, unit * 2.0 ) );
    shapes[3] = new GSegment( new GPoint( unit * 4.0, unit * 0.5 ),
			      new GPoint( unit * 4.0, unit * 3.5 ) );

    return( shapes );
  }
}

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