/*ROMTEAM WorldEditor*/
/*//////////////////////////////////////////////////////////////////////////////////////*/
/* File        : ITSphere3D.hpp: interface for the ITSphere3D class.*/
/* Author      : Ionut Grozea*/
/* Date        : 97.11*/
/* Description :*/
/*//////////////////////////////////////////////////////////////////////////////////////*/
#ifndef __ITSphere3D_HPP__
#define __ITSphere3D_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 ITSphere3D;
 
class CPA_EXPORT ITSphereUndo : public CPA_Modif
{
	float m_fRadius;
	int m_Ns, m_Nt;
	ITSphere3D *m_pSphere;
	BOOL m_bFirst;
public:
	ITSphereUndo(ITSphere3D *sphere);
/*	~ITSphereUndo(){};*/
	BOOL Do(){ return m_bFirst ? TRUE : Undo();}
	BOOL Undo();
};
 
 
 
class CPA_EXPORT ITSphere3D : public ParamSurface3D
{
private:
	float m_fRadius;
	ACP_tdxHandleOfElement	m_hElement;
	int m_Ns, m_Nt;
	MTH3D_tdstVector    m_stCenterInMousePlane;
 
 
private:
	void CommonITSphere3D(float radius, 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);
	void SetSamplingRate(int Ns, int Nt);
	void GetSamplingRate(int &Ns, int &Nt);
	GLI_tdxValue GetRadius();
	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*/
	ITSphere3D (CPA_EditorBase *_p_oEditor, float radius = 1.f , const CString _csName = "", tdeSaveStatus _eStatus = E_ss_NoSave);
	ITSphere3D (CPA_EditorBase *_p_oEditor, float radius = 1.f , int ns = 10, int nt = 10, const CString _csName = "", tdeSaveStatus _eStatus = E_ss_NoSave);
	~ITSphere3D();
	CPA_Modif *GetUndoData(){ return new ITSphereUndo(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 /* */
