/*ROMTEAM WorldEditor*/
/*//////////////////////////////////////////////////////////////////////////////////////*/
/* File        : ITCon3D.hpp: interface for the ITCon3D  class.*/
/* Author      : Ionut Grozea*/
/* Date        : 97.11*/
/* Description :*/
/*//////////////////////////////////////////////////////////////////////////////////////*/
#ifndef __ITCon3D_HPP__
#define __ITCon3D_HPP__
 
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
 
 
class ITCon3D;
 
class CPA_EXPORT ITConUndo : public CPA_Modif
{
	float m_fRadius;
	float m_fHeight;
	int m_Ns, m_Nt;
 
	ITCon3D *m_pCon;
	BOOL m_bFirst;
public:
	ITConUndo(ITCon3D *con);
/*	~ITSphereUndo(){};*/
	BOOL Do(){ return m_bFirst ? TRUE : Undo();}
	BOOL Undo();
};
 
 
class CPA_EXPORT ITCon3D : public ParamSurface3D
{
private:
	int m_Flag1,m_Flag2,m_Flag3;
	BOOL m_Flag;
	float m_fGlobal;
	float m_fRadius;
	float m_fHeight;
	float m_fRadiusold;
	float m_fHeightold;
	float resultold;
	int i;
	ACP_tdxHandleOfElement	m_hElement;
	int m_Ns, m_Nt;
	MTH3D_tdstVector    m_stCenterInMousePlane;
 
 
private:
	void CommonITCon3D(float radius , float height, int ns, int nt);
 
public:
	float x(float s, float t);
	float y(float s, float t);
	float z(float s, float t);
	ACP_tdxHandleOfElement GetHElement();
	BOOL SetRadius(GLI_tdxValue Radius);
	BOOL SetHeight(GLI_tdxValue Radius);
	void SetSamplingRate(int Ns, int Nt);
	void GetSamplingRate(int &Ns, int &Nt);
	GLI_tdxValue GetRadius();
	GLI_tdxValue GetHeight();
	BOOL _OnLButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *p_stPickInfo);
	BOOL _OnMouseMove(UINT nFlags, tdstMousePos * p_stPos, MTH3D_tdstVector * pDeplacement);
	BOOL _OnLButtonDown(UINT nFlags, tdstMousePos * p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo * p_stObject);
 
	/* constructors & destructors*/
	ITCon3D (CPA_EditorBase *_p_oEditor, float radius = 1.f  , float height = 1.f, const CString _csName = "", tdeSaveStatus _eStatus = E_ss_NoSave);
	ITCon3D (CPA_EditorBase *_p_oEditor, float radius = 1.f  , float height = 1.f, int ns = 10, int nt = 10, const CString _csName = "", tdeSaveStatus _eStatus = E_ss_NoSave);
	~ITCon3D();
	CPA_Modif *GetUndoData(){ return new ITConUndo(this); }
/*ROMTEAM WorldEditor (Cristian Stegaru 01/98)*/
	virtual void mfn_vSave (CString csEPOFile, CString csEPOName, int iIdx);
	virtual void mfn_vLoad (CString csEPOFile, CString csEPOName);
/*ENDROMTEAM WorldEditor (Cristian Stegaru)*/
};
#endif /* */
