/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOUSE. See the GNU
 * General Public License for more details.
 *
 * You should have recieved a copy of the GNU General Public License
 * along with this program; if not write to the Free Software
 * Foundation, inc., 59 Temple Place, Suite 330, Boston MA 02111-1307
 * USA
 */
package j3d;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
/**
 * Insert the type's description here.
 *
 * @author: Yuriy Mikhaylovskiy
 */

public class shpXYZ implements shp{
  private float x0,y0,xx,xy,yx,yy,zx,zy;
  private float size = 20;
  public boolean show;

  public void paint(Graphics2D g, Canvas3D j3d){
    g.setColor(Color.black);
    //g.setStroke(new BasicStroke(2));
    g.draw(new Line2D.Double(x0,y0,xx,xy));
    g.draw(new Line2D.Double(x0,y0,yx,yy));
    g.draw(new Line2D.Double(x0,y0,zx,zy));
    g.setColor(Color.blue);
    TextLayout tx = new TextLayout("X", g.getFont(), g.getFontRenderContext());
    tx.draw(g,xx,xy);
    TextLayout ty = new TextLayout("Y", g.getFont(), g.getFontRenderContext());
    ty.draw(g,yx,yy);
    TextLayout tz = new TextLayout("Z", g.getFont(), g.getFontRenderContext());
    tz.draw(g,zx,zy);
  }

  public shpXYZ(){
  }
  public void transform2D(Matrix3D t, Vector3D cor){
    float sx = t.xx;
    float sy = t.yy;
    float sz = t.zz;
    //System.out.println(t);
    x0=size;//t.xo;
    y0=size+10;//t.yo;
    xx=size*t.xx/t.sx+size;//+t.xo;
    xy=size*t.yx/t.sx+size+10;//+t.yo;
    yx=size*t.xy/t.sx+size;//+t.xo;
    yy=size*t.yy/t.sx+size+10;//+t.yo;
    zx=size*t.xz/t.sx+size;//+t.xo;
    zy=size*t.yz/t.sx+size+10;//+t.yo;
  }

  public float get_Z(){
    return Float.MAX_VALUE;
  }
  public boolean isPickPoint(int x, int y) {
      
      return false;
      
  }

public boolean isPickPoint(Rectangle2D r) {
      
      return false;
      
  }

public void setShow(boolean s) {
    show = s;
}

public boolean isShow() {
    return show;
}




}