#if !defined(TCTHEIGHTFIELD_H)
#define TCTHEIGHTFIELD_H

#include"MLRHeightField.hpp"
#include"ImageLib\image.h"
#include"ExportInfo.h"

class TCTHeightField :
	public MLRHeightField
{
protected:
	int Attached;
	int StateCount;
	
	void BuildModel();
public:
	void SetScale(Scalar xs,Scalar ys,Scalar zs);
	void SetSize(Scalar xs,Scalar zs);
	void SetPara(ExportInfo &einf);
	
	TCTHeightField();
	/*
	TCTHeightField(ElementRenderer::ListElement *parent,
				MidLevelRenderer::MLRTexture *texture,
				MidLevelRenderer::MLRState& s0,
				MidLevelRenderer::MLRState& s1) 
				{ MLRHeightField(parent,texture,state0,state1); }
				
				  TCTHeightField(ElementRenderer::ListElement *parent,
				  Image &image,
				  MidLevelRenderer::MLRState& s0, 
				  MidLevelRenderer::MLRState& s1) 
				  {Create(parent,image,state0,state1);}
	*/
	
	void Attach(ElementRenderer::ListElement *parent,int index);
	void SetState(MidLevelRenderer::MLRState &state,int sn);
	void Create(Image &image);
	void Create(TCTHeightField &hf);
	void Clone(TCTHeightField &hf);
	
	~TCTHeightField(); 
};

#endif