/* (c) Ubi Studios 1996-97*/
/* See Vincent Greco for any comment or question*/
 
#ifndef __HIEMACRO_H__
#define __HIEMACRO_H__
 
#ifdef  __cplusplus
extern "C" {
#endif
 
/* For DLL using these function :*/
#include "cpa_expt.h"
#include "SPO/hiespobj.h"
/*JMD*/
extern CPA_EXPORT HIE_tdxHandleToSuperObject HIE_fn_hGetElementFormFixViewport ( ACP_tdxIndex xIndex ) ;
/*extern CPA_EXPORT ACP_tdxIndex HIE_fn_xGetNumberOfElementInFixViewport () ;*/
 
#define HIE_fn_bIsSuperObjectValid(hSuperObject) ((hSuperObject)!=HIE_C_InvalidSuperObject)
/*the cast to HIE_tdeTypeOfObject is to avoid a very strange editor bug*/
#define HIE_fn_vSetSuperObjectObjectAndType(_hSprObj, _hObj, _lType) \
{\
  HIE_M_vSetSuperObjectMember(_hSprObj, ulTypeOfLinkedObject, _hObj ? _lType : HIE_C_ulSuperObject);\
	HIE_M_vSetSuperObjectMember(_hSprObj, hLinkedObject.p_Void, _hObj);\
}
/*#define HIE_fn_vInvalidateSuperObject(hSuperObject) {(*hSuperObject)=HIE_C_InvalidSuperObject;}*/
/*function accessors definition*/
/*#define HIE_fn_hGetSuperObjectFather(_hSprObj) HIE_M_hGetSuperObjectFather(_hSprObj)*/
/*#define HIE_fn_hGetSuperObjectNextBrother(_hSprObj) HIE_M_hNextChild(_hSprObj)*/
/*#define HIE_fn_hGetSuperObjectFirstChild(_hSprObj) HIE_M_hFirstChild(_hSprObj)*/
#define HIE_fn_hGetSuperObjectPrevBrother(_hSprObj) HIE_M_hPrevChild(_hSprObj)
#define HIE_fn_hGetSuperObjectLastChild(_hSprObj) HIE_M_hLastChild(_hSprObj)
/*#define HIE_fn_vSuperObjectAddTail(_hNewFather, _hSprObj)	HIE_M_vAddTail(_hNewFather, _hSprObj)*/
/*#define HIE_fn_vSuperObjectAddHead(_hNewFather, _hSprObj)	HIE_M_vAddHead(_hNewFather, _hSprObj)*/
/*#define HIE_fn_lGetNumberOfChildren(_hSprObj) HIE_M_lGetNumberOfChildren(_hSprObj)*/
 
/*#define HIE_fn_lGetSuperObjectType(_hSprObj) HIE_M_xGetSuperObjectMember(_hSprObj,lTypeOfLinkedObject)*/
/*#define HIE_fn_hGetSuperObjectObject(_hSprObj) HIE_M_xGetSuperObjectMember(_hSprObj,hLinkedObject.p_Void)*/
 
/*#define HIE_fn_hGetSuperObjectGlobalMatrix(_hSprObj) HIE_M_xGetSuperObjectMember(_hSprObj,hGlobalMatrix)*/
 
/*#define HIE_fn_hGetSuperObjectMatrix(_hSprObj) HIE_M_xGetSuperObjectMember(_hSprObj,hLocalMatrix)*/
/*#define HIE_fn_vSetSuperObjectMatrix(_hSprObj, _hMatrix) HIE_M_vSetSuperObjectMember(_hSprObj,hLocalMatrix,_hMatrix)*/
 
/*#define HIE_fn_lGetSuperObjectDrawMask(_hSprObj) HIE_M_xGetSuperObjectMember(_hSprObj, lDrawModeMask)*/
/*#define HIE_fn_vSetSuperObjectDrawMask(_hSprObj, _lDrawMask) HIE_M_vSetSuperObjectMember(_hSprObj,lDrawModeMask, _lDrawMask)*/
 
/*ANNECY VL SPOFLAG 05/12/97{*/
/*#define HIE_fn_SO_ulGetFlags( _hSO ) HIE_M_xGetSuperObjectMember( _hSO, ulFlags )*/
/*#define HIE_fn_SO_vSetFlags( _hSO, _ulFlags ) HIE_M_vSetSuperObjectMember( _hSO, ulFlags, _ulFlags )*/
/*#define HIE_fn_SO_bIsNotPickable( _hSO ) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulNotPickable)*/
/*#define HIE_fn_SO_bIsHidden( _hSO ) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulHidden)*/
/*ANNECY TQ 17/02/98{*/
/* Macro for the friends modules ...*/
/*#define HIE_fn_SO_bHasABoxBoundingVolume(_hSO) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulTypeOfBoundingVolume)*/
/*#define HIE_fn_SO_bCheckChildren(_hSO) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulCheckChildren)*/
/*ENDANNECY TQ}*/
 
/*ANNECY TQ 02/03/98{*/
/*#define HIE_fn_SO_bIsSuperimposed(_hSO) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulSuperimposed)*/
/*#define HIE_fn_SO_bIsNotHangable(_hSO) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulNotHangable)*/
/*this one is required to remain declared as a function, even when HieFriend is defined by including modules!!!*/
extern CPA_EXPORT void  HIE_fn_SO_vSetSuperimposedFlag (HIE_tdxHandleToSuperObject _hSO) ;
extern CPA_EXPORT void HIE_fn_SO_vClearSuperimposedFlag(HIE_tdxHandleToSuperObject _hSO) ;
extern CPA_EXPORT void HIE_fn_SO_SwitchSuperImposedTab (long lParam) ;
/*extern CPA_EXPORT void  HIE_fn_SO_vSetSemiLookAtFlag (HIE_tdxHandleToSuperObject _hSO) ;*/
/*extern CPA_EXPORT void  HIE_fn_SO_vSetLookAtFlag (HIE_tdxHandleToSuperObject _hSO) ;*/
/*extern CPA_EXPORT ACP_tdxBool HIE_fn_SO_bIsSemiLookAt (HIE_tdxHandleToSuperObject _hSO) ;*/
/*extern CPA_EXPORT ACP_tdxBool HIE_fn_SO_bIsLookAt (HIE_tdxHandleToSuperObject _hSO) ;*/
extern CPA_EXPORT void HIE_fn_v_TurnSemiLookAt ( GLD_tdxHandleToViewportAttributes	hVpt, HIE_tdxHandleToSuperObject hSprObj ) ;
extern CPA_EXPORT void HIE_fn_v_TurnLookAt ( GLD_tdxHandleToViewportAttributes	hVpt, HIE_tdxHandleToSuperObject hSprObj ) ;
/*XB980824*/
#ifndef D_THROW_MGT
extern CPA_EXPORT void HIE_fn_vSetMagnetModification(HIE_tdxHandleToSuperObject _hSprObj, ACP_tdxBool xModified);
extern CPA_EXPORT ACP_tdxBool HIE_fn_bGetMagnetModification(HIE_tdxHandleToSuperObject _hSprObj);
#endif /* D_THROW_MGT */
/*End XB*/
 
 
/*ENDANNECY TQ}*/
 
/* ANNECY AV {*/
/*#define HIE_fn_SO_bHasNoTransformationMatrix( _hSO ) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulNoTransformationMatrix)*/
#define HIE_fn_SO_bHasZoomInsteadOfScale( _hSO ) (HIE_M_xGetSuperObjectMember( _hSO, ulFlags ) & HIE_C_Flag_ulZoomInsteadOfScale)
/* END ANNECY AV }*/
/*ENDANNECY VL SPOFLAG}*/
 
/*ANNECY CT 13/01/98 {  */
/*#define HIE_fn_bGetSuperObjectExcluLight(_hSprObj) (_hSprObj->ulFlags & HIE_C_Flag_ExcluLight ? TRUE : FALSE)*/
#define HIE_fn_vSetSuperObjectExcluLight(_hSprObj, _bExcluLight) 	{ if (_bExcluLight) {(_hSprObj)->ulFlags |= HIE_C_Flag_ExcluLight;} else {(_hSprObj)->ulFlags &= ~HIE_C_Flag_ExcluLight;}}
 
/*ENDANNECY CT}*/
 
/*#define HIE_fn_hGetSuperObjectBoundingVolume(_hSprObj) HIE_M_xGetSuperObjectMember(_hSprObj, hBoundingVolume)*/
/*#define HIE_fn_vSetSuperObjectBoundingVolume(_hSprObj, _hVolume) HIE_M_vSetSuperObjectMember(_hSprObj, hBoundingVolume, _hVolume)*/
 
/*#define HIE_fn_bIsGlobalMatrixValid(_hSprObj) ((HIE_M_xGetSuperObjectMember(_hSprObj,lLastComputeFrame)==HIE_gs_lCurrentFrame)||(HIE_M_xGetSuperObjectMember(_hSprObj,lLastComputeFrame)==HIE_C_lCounterNotValid))*/
 
/*#define HIE_fn_vValidateGlobalMatrix( _hSprObj) HIE_M_vSetSuperObjectMember(_hSprObj, lLastComputeFrame, HIE_gs_lCurrentFrame)*/
/*#define HIE_fn_lGetGlobalMatrixFrameCounter() (HIE_gs_lCurrentFrame)*/
 
#ifdef  __cplusplus
}/* extern "C" */
#endif
 
#endif /* __HIEMACRO_H__ */
