/*=========================================================================
*
* CPASpec.hpp
*
*
* Version			1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifdef ACTIVE_EDITOR
 
#ifndef __CPASPEC_HPP__
#define __CPASPEC_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
/****************************************/
 
#include "CPAEnum.hpp"
#include "CPAdStat.hpp"
 
class DEV_ViewPort3D;
 
/* display*/
typedef enum tdeDisplayMode_
{
	E_dm_DrawWorld, 
	E_dm_DrawCollisionMap,
	E_dm_DrawVisibleSectors, 
	E_dm_DrawOnlyCurrentSector
}
tdeDisplayMode;
 
class CPA_Interface;
class CPA_SuperObject;
 
/*===========================================================================
*		Description:	Class EDT_Specific
*		Creation date:
*		Author:			Shaitan
*---------------------------------------------------------------------------
*
*---------------------------------------------------------------------------
*		Revision date:                        Author:
*=========================================================================*/
class CPA_EXPORT CPA_SpecificInterface
{
protected:
	CPA_Interface	* m_pInterface;
 
	tdeDisplayMode	  m_eDisplayMode;
	BOOL			  m_bDisplayFog;
	CPA_SuperObject	* m_pCurrentSector;
	CComboBox		* m_pComboSector;
 
	tdeUserStatus	  m_eUserStatus;
	CPA_DialogStatus  m_oDialogStatus;
 
	CPA_List<CPA_SuperObject> m_stListOfSurfaces;
 
public:
 
	CPA_SpecificInterface (void);
	~CPA_SpecificInterface (void);
 
/* inits*/
	void fn_vSpecificInit	(void);
	void fn_vSpecificUpdate (BOOL bReinitDisplayMode = FALSE);	
 
/* parameters*/
	CPA_Interface * GetInterface (void)							{ return m_pInterface; }
	void			SetInterface (CPA_Interface *pInterface)	{ m_pInterface = pInterface; }
 
	CPA_SuperObject	* GetCurrentSector	(void)	{ return m_pCurrentSector; }
	void			  SetCurrentSector	(CPA_SuperObject *pNewSector);
 
/* hierarchy*/
	CPA_SuperObject * GetDynamicRoot (void);
	CPA_SuperObject * GetStaticRoot	 (void);
 
	BOOL fn_bHasValidWorld	(BOOL bCheckRoot = TRUE);
 
/* display mode*/
	tdeDisplayMode	 GetDisplayMode			 (void)	{ return m_eDisplayMode; }
	void			 SetDisplayMode			 (tdeDisplayMode eMode);
	void			 fn_vOnChangeDisplayMode (tdeDisplayMode eMode);
 
/* fog*/
	void fn_vChangeDisplayFog (BOOL bDisplay);
 
/* current sector*/
	void fn_vOnChangeCurrentSector	(void);
	void fn_vInitCurrentSector		(void);
 
	CPA_SuperObject * GetSuperObjectCurrentSector	(CPA_SuperObject *pEdObj);
	CPA_SuperObject * GetCurrentSectorFromPos		(MTH3D_tdstVector * p_stAbsolutePosition);
 
/* display world*/
	void fn_vDisplayWorld (DEV_ViewPort3D *pViewport, GLD_tdxHandleToViewportAttributes hVpt,
						   GLI_tdxHandleToLight hLight, CPA_SuperObject *pRoot);
 
	void fn_vInitLightsInViewport (DEV_ViewPort3D *pViewport, GLD_tdxHandleToViewportAttributes hVpt,
								   GLI_tdxHandleToLight hLight, HIE_tdxHandleToSuperObject hSector,
								   BOOL bUseStaticLights = TRUE);
 
/* parent*/
/*ANNECY Shaitan EmptySectors (25/02/98)*/
/*	CPA_SuperObject * GetDefaultParentFromPos	(tdstPosition *p_stPosition, tdeTypeSO eTypeInsert);*/
	CPA_SuperObject * GetDefaultParentFromPos	(tdstPosition *p_stPosition, tdeTypeSO eTypeInsert, tdeSaveStatus eStatus);
/*ENDANNECY Shaitan EmptySectors*/
 
/* user mode*/
	CPA_DialogStatus *	GetDialogStatus	(void)					{ return &m_oDialogStatus; }
	tdeUserStatus		GetUserStatus	(void)					{ return m_eUserStatus; }
	void				SetUserStatus	(tdeUserStatus eStatus)	{ m_eUserStatus = eStatus; }
 
	void			 fn_vInitUserStatus (void);
	void			 fn_vSaveUserStatus	(tdeUserStatus eStatus);
	void			 fn_vSetFrameTitle	(void);
 
/* surfaces*/
	BOOL fn_bIsSurfaceInList	(CPA_SuperObject *pSurface);
	void fn_vAddSurfaceInList	(CPA_SuperObject *pSurface);
	void fn_vReinitSurfaceList	(void);
	void fn_vUpdateSurfaces		(BOOL bDrawSurfaces);
 
protected:
 
/* visible sectors (display mode)*/
	BOOL fn_bIsSectorVisible (CPA_SuperObject *pSector);
 
/* current sector (display mode)*/
	CPA_SuperObject	* GetDefaultCurrentSector	(void);
 
};
 
#endif /* __CPASPEC_HPP__*/
#endif /* ACTIVE_EDITOR*/
 
