 
#ifndef __CPASOBJ_BASE_HPP__
#define __CPASOBJ_BASE_HPP__
 
#ifdef ACTIVE_EDITOR
 
#pragma warning(disable:4786)
 
#include "stdafx.h"
#include <afxtempl.h>
#include "geo.h"
#include "gli.h"
#define HieFriend
#include "lst.hpp"
#undef HieFriend
 
#include "itf/devvp3d.hpp"
#include "itf/CPAEnum.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
/****************************************/
 
typedef enum tdeLocalColor_
{
	E_lc_NoColor	= 0,
	E_lc_Red		= 1,
	E_lc_Green		= 2,
	E_lc_Blue		= 3,
	E_lc_Yellow		= 4,
	E_lc_Violet		= 5,
	E_lc_LightBlue	= 6
}
tdeLocalColor;
 
/*NZO, provisoire, pour faire plus propre*/
typedef struct GLI_tdstLight_* GLI_tdxHandleToLight;
typedef struct GLD_tdstViewportAttributes_* GLD_tdxHandleToViewportAttributes;
 
#pragma warning(disable : 4250)
 
 
/*ANNECY TQ 27/02/98{*/
static	ACP_tdxHandleOfObject s_hBoxGeomObj;
static	ACP_tdxHandleOfObject s_hSphereGeomObj;
/*ENDANNECY TQ}*/
 
 
class CPA_EXPORT CPA_SuperObjectBase:
	public CPA_EdNode<CPA_SuperObjectBase,HIE_tdxHandleToSuperObject,HIE_tdxHandleToSuperObject>
{
 
protected:
 
	tdeDrawingFlag	m_eDrawingFlag;
	tdeLocalColor	m_eColor;
	BOOL			m_bMustDraw;
	BOOL			m_bDrawBV;
	float			m_fOldTransparency;
	BOOL			m_bHasALinkedZDM;
 
 
public:
 
    CPA_SuperObjectBase ();
	CPA_SuperObjectBase (HIE_tdxHandleToSuperObject hEngineSO);
	~CPA_SuperObjectBase() { }
 
/*ANNECY TQ 26/02/98{*/
static	void CreateParallelBoxGeometricObject();
static void CreateBoundingSphereGeometricObject();
static	void DestroyParallelBoxGeometricObject();
static void DestroyBoundingSphereGeometricObject();
/*ENDANNECY TQ}*/
 
 
	/* engine structure*/
	virtual void SetSuperObjectStruct (HIE_tdxHandleToSuperObject hSupObj) { SetStruct(hSupObj); }
	void *GetSuperObjectStruct(void) { return GetStruct(); }
 
	/* local flag*/
	tdeDrawingFlag	GetDrawingFlag (void)						 { return m_eDrawingFlag; }
	virtual void	SetDrawingFlag (tdeDrawingFlag eNewFlag)	 { m_eDrawingFlag = eNewFlag; }
 
	/* local color*/
	tdeLocalColor	GetLocalColor (void)					{ return m_eColor; }
	/* FBF 01 04 98 {*/
	/*void			SetLocalColor (tdeLocalColor eNewColor) { m_eColor = eNewColor; }*/
	void			SetLocalColor (tdeLocalColor eNewColor);
	/* FBF 01 04 98}*/
 
/*ANNECY Shaitan NewInterface 24/03/98 {*/
	/* bounding volume*/
	BOOL fn_bDisplayBV (void)			{ return m_bDrawBV; }
	void fn_vDisplayBV (BOOL bDisplay)	{ m_bDrawBV = bDisplay; }
/*ENDANNECY Shaitan NewInterface }*/
/*ANNECY TQ 29/04/98{*/
	BOOL fn_bHasALinkedZDM (void)			{ return m_bHasALinkedZDM; }
	void fn_vHasALinkedZDM(BOOL bZDM)	{ m_bHasALinkedZDM = bZDM; }
/*ENDANNECY TQ}*/
	
	/* Draw*/
	void SetDisplayFlag (BOOL bMustDraw) { m_bMustDraw = bMustDraw; }
 
	BOOL fn_bMustDraw (void) { return m_bMustDraw; }
 
	void Display(GLD_tdxHandleToViewportAttributes hVpt, long DrawMask,
				 tdstSaveLight a_tdxhArrayOfLights[], long	lNbLights,
				 HIE_tdxHandleToSuperObject pWorld, 
				 BOOL bUseLocalFlag = TRUE);
 
	void DisplayWorld(GLD_tdxHandleToViewportAttributes hVpt, 	
					  tdstSaveLight a_tdxhArrayOfLights[], long	lNbLights,
					  BOOL bUseLocalFlag = TRUE);
};
 
/*#####################################################################*/
 
#endif /*ACTIVE_EDITOR*/
 
#endif /* __CPASOBJ_BASE_HPP__*/
