package pothos_tegaki;


import java.awt.geom.Point2D;
import java.util.ArrayList;

import jp.ac.kyutech.mns.ist.ShortStroke;

/**
 * １つの認識要求タスクをあらわすオブジェクト
 * 
 * @author miuramo
 *
 */
public class TegakiRecogTask {// TegakiRecognizer のキューに入れられ，認識が終わるとmodelに通知されるオブジェクト
	public String result;
	TegakiCallBack model; // 結果報告用
	ArrayList<ShortStroke> ssvec;
	public TegakiRecogTask(TegakiCallBack m){
		model = m;
	}
	public void callback(){
		model.callback(this);
	}
	public String getResult(){
		return result;
	}
	public void setSSVec(ArrayList<ShortStroke> tempssvec2){
		ssvec = tempssvec2;
	}
	public void setPointArray(ArrayList<ArrayList<Point2D>> aap){
		ssvec = new ArrayList<ShortStroke>();
		for(ArrayList<Point2D> ap : aap){
			ShortStroke ss = new ShortStroke();
			float sx[] = new float[ap.size()];
			float sy[] = new float[ap.size()];
			for(int i=0;i<ap.size();i++){
				sx[i] = (float) ap.get(i).getX();
				sy[i] = (float) ap.get(i).getY();
			}
			ss.sx = sx;
			ss.sy = sy;
			ssvec.add(ss);
		}
	}
}