/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package net.sf.surfaceplot;
/**
 * @author salagarsamy
*/
// Adapted by M. Turhan Coban
public class ExampleSurfaceModel1 implements ISurfacePlotModel
{   float x[],y[],z[];
    String xlabel,ylabel,zlabel; 
    float xmin,xmax,ymin,ymax,zmin,zmax; 
    boolean boxed,mesh,scalebox, displayxy,displayz,displaygrid;
    int calcdiv,dispdiv;
    f_xy f;
    public ExampleSurfaceModel1(f_xy f1,double xmini,double xmaxi,double ymini,double ymaxi,double zmini,double zmaxi)
	{f=f1;xmin=(float)xmini;xmax=(float)xmaxi;ymin=(float)ymini;ymax=(float)ymaxi;
	 zmin=(float)zmini;zmax=(float)zmaxi;
	 boxed=true;
	 mesh=true;
	 scalebox=false;
	 displayxy=true;
	 displayz=true;
	 displaygrid=true;
	 calcdiv=80;
	 dispdiv=80;
	 xlabel="X";
	 ylabel="Y";
	 zlabel="Z";
	}			
    public ExampleSurfaceModel1(f_xy f1,double xmini,double xmaxi,double ymini,double ymaxi,double zmini,double zmaxi,String lx,String ly,String lz)
	{f=f1;xmin=(float)xmini;xmax=(float)xmaxi;ymin=(float)ymini;ymax=(float)ymaxi;
	 zmin=(float)zmini;zmax=(float)zmaxi;
	 xlabel=lx;
	 ylabel=ly;
	 zlabel=lz;
	 boxed=true;
	 mesh=true;
	 scalebox=false;
	 displayxy=true;
	 displayz=true;
	 displaygrid=true;
	 calcdiv=100;
	 dispdiv=100;
	}			
	public float calculateZ(float x, float y) 
	{   
		return (float)f.func(x,y);
	}
		
    public double calculateZ(double x, double y) 
    {	 return f.func(x,y);}
    
	public int getPlotMode()
	{return ISurfacePlotModel.PLOT_MODE_SPECTRUM;}

	public boolean isBoxed()
	{return boxed;}

	public boolean isMesh()
	{return mesh;}

	public boolean isScaleBox()
	{return scalebox;}

	public boolean isDisplayXY()
	{return displayxy;}

	public boolean isDisplayZ()
	{return displayz;}

	public boolean isDisplayGrids()
	{return displaygrid;}
	
	public void setCalcDivisions(int calcdivi )
	{calcdiv=calcdivi;}	
	public int getCalcDivisions()
	{return calcdiv;}	
    public void setDispDivisions(int dispdivi )
	{dispdiv=dispdivi;}	
	public int getDispDivisions()
	{return dispdiv;}
    public void setXMin(double xmini)
	{xmin=(float)xmini;}
	public float getXMin()
	{return xmin;}
    public void setXMax(double xmaxi)
	{xmax=(float)xmaxi;}
	public float getXMax()
	{return xmax;}
    public void setYMin(double ymini)
	{ymin=(float)ymini;}
	public float getYMin()
	{return ymin;}
    public void setYMax(double ymaxi)
	{ymax=(float)ymaxi;}
	public float getYMax()
	{return ymax;}
	public void setZMin(double zmini)
	{zmin=(float)zmini;}
	public float getZMin()
	{return zmin;}
	public void setZMax(double zmaxi)
	{zmax=(float)zmaxi;}
	public float getZMax()
	{return zmax;}
	public void setXAxisLabel(String xlabeli)
	{xlabel=xlabeli;}
	public String getXAxisLabel()
	{return xlabel;}
	public void setYAxisLabel(String ylabeli)
	{ylabel=ylabeli;}
	public String getYAxisLabel()
	{return ylabel;}
	public void setZAxisLabel(String zlabeli)
	{zlabel=zlabeli;}
	public String getZAxisLabel()
	{return zlabel;}
}