/*
------------------------------------------------------------------------------------------
HEADER FILE FOR :
 Prototype of waypoints, links and ways exported functions
------------------------------------------------------------------------------------------
File Name :
 WP_F_nc.h
------------------------------------------------------------------------------------------
Creation :
  * Date : 
   March 14,1997
  * Author : 
   Albert Pais
------------------------------------------------------------------------------------------
Contents :
  defines prototype and functions used for waypoints, links and
  ways
------------------------------------------------------------------------------------------
*/
 
/****************************************/
#if !defined(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 /*CPA_WANTS_IMPORT || CPA_WANTS_EXPORT*/
#endif /*CPA_EXPORT*/
/****************************************/
 
 
 
#if !defined(ONLY_TYPES)
/*
------------------------------------------------------------------------------------------
WAYPOINT FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
#ifdef _WP_D_DEFINE_WAYPOINTS_
 
#if !defined (__WP_WAYPOINTS_FUNCTIONS_PROTOS__)
#define __WP_WAYPOINTS_FUNCTIONS_PROTOS__
 
/* creation function :*/
CPA_EXPORT WP_tdhWayPoint WP_fnh_WayPoint_Create(void);
/* destruction */
CPA_EXPORT void WP_fnv_WayPoint_Destroy(WP_tdhWayPoint);
/* add reference and release */
CPA_EXPORT void WP_fnv_WayPoint_AddRef(WP_tdhWayPoint);
CPA_EXPORT void WP_fnv_WayPoint_Release(WP_tdhWayPoint);
 
/* "constructor" : */
CPA_EXPORT WP_tdhWayPoint WP_fnh_WayPoint_Build(MTH3D_tdstVector*,MTH_tdxReal,HIE_tdxHandleToSuperObject);
/* duplicate : */ 
CPA_EXPORT WP_tdhWayPoint WP_fnh_WayPoint_Duplicate(WP_tdhWayPoint);
/* copy */
CPA_EXPORT void WP_fnv_WayPoint_Copy(WP_tdhWayPoint,WP_tdhWayPoint);
/* sizeof */
CPA_EXPORT unsigned short WP_fnuw_WayPoint_SizeOf(void);
/* accessing to members :*/
CPA_EXPORT void WP_fnv_WayPoint_GetVertex(WP_tdhWayPoint,MTH3D_tdstVector*);
CPA_EXPORT void WP_fnv_WayPoint_SetVertex(WP_tdhWayPoint,MTH3D_tdstVector*);
 
CPA_EXPORT MTH_tdxReal WP_fnx_WayPoint_GetRadius(WP_tdhWayPoint);
CPA_EXPORT void WP_fnv_WayPoint_SetRadius(WP_tdhWayPoint,MTH_tdxReal);
 
CPA_EXPORT HIE_tdxHandleToSuperObject WP_fnh_WayPoint_GetSuperObject(WP_tdhWayPoint);
CPA_EXPORT void WP_fnv_WayPoint_SetSuperObject(WP_tdhWayPoint,HIE_tdxHandleToSuperObject);
 
/* validity of handles : */
CPA_EXPORT void WP_fnv_WayPoint_Invalidate(WP_tdhWayPoint*);
CPA_EXPORT ACP_tdxBool WP_fnb_WayPoint_IsValid(WP_tdhWayPoint);
CPA_EXPORT ACP_tdxBool WP_fnb_WayPoint_IsInvalid(WP_tdhWayPoint);
 
CPA_EXPORT ACP_tdxBool WP_fnb_WayPoint_IsDynamic(WP_tdhWayPoint);
CPA_EXPORT ACP_tdxBool WP_fnb_WayPoint_IsStatic(WP_tdhWayPoint);
 
CPA_EXPORT SCR_tdst_Link_Table* WP_fnp_WayPoint_GetLinkTable (void);
 
/* loading waypoints */
CPA_EXPORT SCR_tde_Anl_ReturnValue WP_fne_WayPoint_ScriptCallBackLoad
(SCR_tdst_File_Description *,char *,char **, SCR_tde_Anl_Action);
/* tools */
CPA_EXPORT void WP_fnv_WayPoint_ComputeLocation(WP_tdhWayPoint,MTH3D_tdstVector*);
 
#endif /*__WP_WAYPOINTS_FUNCTIONS_PROTOS__ */
 
#endif /* _WP_D_DEFINE_WAYPOINTS_ */
 
/*
------------------------------------------------------------------------------------------
LINK FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
#ifdef _WP_D_DEFINE_LINKS_
 
#if !defined (__WP_LINKS_FUNCTIONS_PROTOS__)
#define __WP_LINKS_FUNCTIONS_PROTOS__
 
/* creation function :*/
CPA_EXPORT WP_tdhLink WP_fnh_Link_Create(void);
/* destruction */
CPA_EXPORT void WP_fnv_Link_Destroy(WP_tdhLink);
/* add reference and release */
CPA_EXPORT void WP_fnv_Link_AddRef(WP_tdhLink);
CPA_EXPORT void WP_fnv_Link_Release(WP_tdhLink);
/* "constructor" : */
CPA_EXPORT WP_tdhLink WP_fnh_Link_Build(void *,ACP_tdstDynaParam*,WP_tde_ucConnectionType,WP_tde_ucConnectionDynamicType,WP_tduc_SamplingRate);
/* duplicate : */ 
CPA_EXPORT WP_tdhLink WP_fnh_Link_Duplicate(WP_tdhLink);
/* copy */
CPA_EXPORT void WP_fnv_Link_Copy(WP_tdhLink,WP_tdhLink);
/* sizeof */
CPA_EXPORT unsigned short WP_fnuw_Link_SizeOf(void);
/* accessing to members :*/
CPA_EXPORT void WP_fnv_Link_GetDynamicParameter(WP_tdhLink,ACP_tdstDynaParam*);
CPA_EXPORT void WP_fnv_Link_SetDynamicParameter(WP_tdhLink,ACP_tdstDynaParam*);
CPA_EXPORT WP_tde_ucConnectionType WP_fneuc_Link_GetConnectionType(WP_tdhLink);
CPA_EXPORT void WP_fnv_Link_SetConnectionType(WP_tdhLink,WP_tde_ucConnectionType);
 
CPA_EXPORT WP_tde_ucConnectionDynamicType WP_fneuc_Link_GetConnectionDynamicType(WP_tdhLink);
CPA_EXPORT void WP_fnv_Link_SetConnectionDynamicType(WP_tdhLink,WP_tde_ucConnectionDynamicType);
 
CPA_EXPORT unsigned char WP_fnuc_Link_GetCurrentSample(WP_tdhLink);
CPA_EXPORT void WP_fnv_Link_SetCurrentSample(WP_tdhLink,unsigned char);
 
/* validity of handles : */
CPA_EXPORT void WP_fnv_Link_Invalidate(WP_tdhLink*);
CPA_EXPORT ACP_tdxBool WP_fnb_Link_IsValid(WP_tdhLink);
CPA_EXPORT ACP_tdxBool WP_fnb_Link_IsInvalid(WP_tdhLink);
 
/* allocate fields :*/
CPA_EXPORT void WP_fnv_Link_Allocate(WP_tdhLink,WP_tde_ucConnectionType,WP_tde_ucConnectionDynamicType);
/* free structures : */
CPA_EXPORT void WP_fnv_Link_Free(WP_tdhLink);
 
/* changing connection type :*/
CPA_EXPORT void WP_fnv_Link_ChangeConnectionTypeBezier(WP_tdhLink,MTH3D_tdhBezierCurve);
CPA_EXPORT MTH3D_tdhBezierCurve WP_fnv_Link_GetConnectionTypeBezierCurve(WP_tdhLink);
CPA_EXPORT void WP_fnv_Link_ChangeConnectionTypeCircleArc(WP_tdhLink,MTH3D_tdhCircleArcCurve);
CPA_EXPORT MTH3D_tdhCircleArcCurve WP_fnv_Link_GetConnectionTypeCircleArcCurve(WP_tdhLink);
CPA_EXPORT void WP_fnv_Link_ChangeConnectionTypeStaticLineObject(WP_tdhLink,WP_tdhWayPoint);
CPA_EXPORT WP_tdhWayPoint WP_fnv_Link_GetConnectionTypeStaticLineObjectWayPoint(WP_tdhLink);
CPA_EXPORT void WP_fnv_Link_ChangeConnectionTypeDynamicLine(WP_tdhLink,WP_tdhWayPoint);
CPA_EXPORT WP_tdhWayPoint WP_fnv_Link_GetConnectionTypeDynamicLineWayPoint(WP_tdhLink);
 
CPA_EXPORT void WP_fnv_Link_UpdateDynamicInfo(WP_tdhLink);
 
#endif /*__WP_LINKS_FUNCTIONS_PROTOS__ */
 
#endif /* _WP_D_DEFINE_LINKS_ */
 
/*
------------------------------------------------------------------------------------------
WAY FUNCTIONS DECLARATION:
------------------------------------------------------------------------------------------
*/
#ifdef _WP_D_DEFINE_WAYS_
 
#if !defined (__WP_WAYS_FUNCTIONS_PROTOS__)
#define __WP_WAYS_FUNCTIONS_PROTOS__
 
/* creation function :*/
CPA_EXPORT WP_tdhWay WP_fnh_Way_Create(void);
/* destruction */
CPA_EXPORT void WP_fnv_Way_Destroy(WP_tdhWay);
/* add reference and release */
CPA_EXPORT void WP_fnv_Way_AddRef(WP_tdhWay);
CPA_EXPORT void WP_fnv_Way_Release(WP_tdhWay);
/* current wp index : */
CPA_EXPORT void WP_fnv_Way_SetCurrentWPIndex(WP_tdhWay,WP_tduc_WPIndex);
 
/* "constructor" : */
CPA_EXPORT WP_tdhWay WP_fnh_Way_Build(WP_tduc_WPIndex);
/* "Destructor" */
CPA_EXPORT void WP_fnv_Way_Free(WP_tdhWay);
/* allocate : */
CPA_EXPORT void WP_fnv_Way_Alloc(WP_tdhWay,WP_tduc_WPIndex);
/* re-size the way : */
CPA_EXPORT void WP_fnv_Way_Realloc(WP_tdhWay,WP_tduc_WPIndex);
/* duplicate : */ 
CPA_EXPORT WP_tdhWay WP_fnh_Way_Duplicate(WP_tdhWay);
/* copy */
CPA_EXPORT void WP_fnv_Way_Copy(WP_tdhWay,WP_tdhWay);
/* sizeof */
CPA_EXPORT unsigned short WP_fnuw_Way_SizeOf(void);
/* accessing to members :*/
CPA_EXPORT WP_tdhWayPoint* WP_fnd_h_Way_GetWayPointArray(WP_tdhWay);
CPA_EXPORT void WP_fnv_Way_SetWayPointArray(WP_tdhWay,WP_tdhWayPoint*);
 
CPA_EXPORT WP_tdhLink* WP_fnd_h_Way_GetLinkArray(WP_tdhWay);
CPA_EXPORT void WP_fnv_Way_SetLinkArray(WP_tdhWay,WP_tdhLink*);
 
CPA_EXPORT WP_tduc_WPIndex WP_fnuc_Way_GetSizeWay(WP_tdhWay);
CPA_EXPORT void WP_fnv_Way_SetSizeWay(WP_tdhWay,WP_tduc_WPIndex);
 
CPA_EXPORT WP_tduc_WPIndex WP_fnuc_Way_GetCurrentWPIndex(WP_tdhWay);
CPA_EXPORT void WP_fnv_Way_SetCurrentWPIndex(WP_tdhWay,WP_tduc_WPIndex);
 
CPA_EXPORT unsigned char WP_fnuc_Way_GetUsedCount(WP_tdhWay);
CPA_EXPORT void WP_fnv_Way_SetUsedCount(WP_tdhWay,unsigned char);
 
CPA_EXPORT WP_tdhWayPoint WP_fnh_Way_GetElementFromWayPointArray(WP_tdhWay,WP_tduc_WPIndex);
CPA_EXPORT void WP_fnv_Way_SetElementFromWayPointArray(WP_tdhWay,WP_tduc_WPIndex,WP_tdhWayPoint);
 
CPA_EXPORT WP_tdhLink WP_fnh_Way_GetElementFromLinkArray(WP_tdhWay,WP_tduc_WPIndex);
CPA_EXPORT void WP_fnv_Way_SetElementFromLinkArray(WP_tdhWay,WP_tduc_WPIndex,WP_tdhLink);
 
/* validity of handles : */
CPA_EXPORT void WP_fnv_Way_Invalidate(WP_tdhWay*);
CPA_EXPORT ACP_tdxBool WP_fnb_Way_IsValid(WP_tdhWay);
CPA_EXPORT ACP_tdxBool WP_fnb_Way_IsInvalid(WP_tdhWay);
 
/* adding and removing waypoints : */
CPA_EXPORT void WP_fnv_Way_InsertWayPoint(WP_tdhWay,WP_tdhWayPoint, WP_tdhLink,WP_tdhLink,WP_tduc_WPIndex);
CPA_EXPORT void WP_fnv_Way_DeleteWayPoint(WP_tdhWay,WP_tduc_WPIndex,WP_tdhLink);
 
/* retrieving waypoints : */
CPA_EXPORT WP_tduc_WPIndex WP_fnuc_Way_PositionWayPoint(WP_tdhWay,WP_tdhWayPoint);
CPA_EXPORT WP_tdhWayPoint WP_fnh_Way_NextWayPoint(WP_tdhWay);
CPA_EXPORT WP_tdhWayPoint WP_fnh_Way_PrevWayPoint(WP_tdhWay);
CPA_EXPORT WP_tdhWayPoint WP_fnh_Way_CurrentWayPoint(WP_tdhWay);
 
CPA_EXPORT SCR_tdst_Link_Table* WP_fnp_Way_GetLinkTable (void);
 
/* load*/
CPA_EXPORT SCR_tde_Anl_ReturnValue WP_fne_Way_ScriptCallBackLoad
(SCR_tdst_File_Description*,char*,char**,SCR_tde_Anl_Action);
/* Tools :*/
CPA_EXPORT void WP_fnv_Way_InitBeforeFollowing(HIE_tdxHandleToSuperObject,WP_tdhWay);
/* function called when the specific vertex has been reached */
CPA_EXPORT unsigned char WP_fnuc_Way_CurrentVertexReached(HIE_tdxHandleToSuperObject,WP_tdhWay);
/* function called to get the speed : */
CPA_EXPORT MTH_tdxReal WP_fnx_Way_GetCurrentSpeed(HIE_tdxHandleToSuperObject,WP_tdhWay);
/* function called to get the vertex to reach */
CPA_EXPORT void WP_fnv_Way_GetNextPoint(HIE_tdxHandleToSuperObject,WP_tdhWay,MTH3D_tdstVector*,MTH_tdxReal*);
 
 
#endif /* __WP_WAYS_FUNCTIONS_PROTOS__ */
 
#endif /* _WP_D_DEFINE_WAYS_ */
 
#endif /* !ONLY_TYPES */
