#ifndef _TPG_OENV_HPP_
#define _TPG_OENV_HPP_


#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "ACP_Base.h"
#include "ITF.h"
#include "PRT.h"
#include "CTL.h"

class CPA_PartGen_MyDocument;
class CPA_PartGen_Generator;

/////////////////////////////////////////////////////
// Environement Class

class CPA_PartGen_Environment : public CPA_SaveObject
{
public:
	CPA_PartGen_Environment(CString, PRT_tdstParticlesEnvironment *_p_stEnv = NULL, BOOL _bIsLoaded = TRUE );
	~CPA_PartGen_Environment();

	//virtual functions
	virtual long GetDataType(void);
	virtual void *GetData(void);
	virtual CString fn_csComputeReferencedSectionName(const CString _csNewName);

	static void m_s_fn_vCallBackSaveEnv( SCR_tdst_File_Description *_p_stFile,
																	     char *_p_szSectionName,
																			 void *_p_vData,
																			 SCR_tde_Ntfy_Action _eAction );

	BOOL m_pub_fn_vLoadIfUnloaded();

	PRT_tdstParticlesEnvironment * m_pub_fn_p_stGetEnv() {return m_pri_p_stEnv;}
	void m_pub_fn_vSetEnv( PRT_tdstParticlesEnvironment* );

	void m_pub_fn_vSetEnvType( short );
	short m_pub_fn_wGetEnvType();

	void m_pub_fn_vSetBoxMin( double, double, double );
	double m_pub_fn_dGetBoxMinX();
	double m_pub_fn_dGetBoxMinY();
	double m_pub_fn_dGetBoxMinZ();
	void m_pub_fn_vSetBoxMax( double, double, double );
	double m_pub_fn_dGetBoxMaxX();
	double m_pub_fn_dGetBoxMaxY();
	double m_pub_fn_dGetBoxMaxZ();
	void m_pub_fn_vSetSphereCenter( double, double, double );
	double m_pub_fn_dGetSphereCenterX();
	double m_pub_fn_dGetSphereCenterY();
	double m_pub_fn_dGetSphereCenterZ();
	//void m_pub_fn_vSetSphereRadius( double );
	double m_pub_fn_dGetSphereRadius();

	void m_pub_fn_vSetAcceleration( double, double, double );
	double m_pub_fn_dGetAccelerX();
	double m_pub_fn_dGetAccelerY();
	double m_pub_fn_dGetAccelerZ();
	void m_pub_fn_vSetRange( double );
	double m_pub_fn_dGetRange();

	void m_pub_fn_vSetGenerator( CPA_PartGen_Generator* );

	CPA_PartGen_MyDocument * m_pub_fn_p_clGetDocument();

public:
	CTL_Editor_DataList m_pub_clDataList;

private:
	PRT_tdstParticlesEnvironment *m_pri_p_stEnv;
	MTH3D_tdstVector m_pri_stMinPoint;
	MTH3D_tdstVector m_pri_stMaxPoint;
	MTH3D_tdstVector m_pri_stSphereCenter;

	CPA_PartGen_Generator *m_pri_p_clGenerator;

private:
	void m_pri_fn_vSetInternalPoints();

	void m_pri_fn_vSaveEnv( SCR_tdst_File_Description* );
	void m_pri_fn_vFillDataList();

	friend void g_fn_vModificationWriteEnvBox( CTL_Editor_Data* );
	friend void g_fn_vModificationWriteEnvSphere( CTL_Editor_Data* );
};

#endif //_TPG_OENV_HPP_
