#ifndef _DNMKINET_H_
#define _DNMKINET_H_
 
/*#include "DNMMove.h"*/
#include "DNMMth.h"
 
#ifdef __cplusplus
extern "C" {
#endif
 
/* Define the type DNM_tdstKinetic */
typedef struct DNM_stKinetic
{
  MTH_tdxReal m_xTime;
  MTH_tdstMove m_stAcceleration;
  MTH_tdstMove m_stSpeed;
  MTH3D_tdstVector m_stLinearPosition0;
  MTH3D_tdstVector m_stLinearPositionI;
  MTH3D_tdstVector m_stLinearPosition1;
  MTH_tdstMove m_stPosition;
} DNM_tdstKinetic;
 
/* Methods */
 
/* Accessors */
#define DNM_M_xKineticGetTime(_p_stKinetic) ((_p_stKinetic)->m_xTime)
#define DNM_M_p_stKineticGetAcceleration(_p_stKinetic) (&(_p_stKinetic)->m_stAcceleration)
#define DNM_M_p_stKineticGetSpeed(_p_stKinetic) (&(_p_stKinetic)->m_stSpeed)
#define DNM_M_p_stKineticGetLinearPosition0(_p_stKinetic) (&(_p_stKinetic)->m_stLinearPosition0)
#define DNM_M_p_stKineticGetLinearPositionI(_p_stKinetic) (&(_p_stKinetic)->m_stLinearPositionI)
#define DNM_M_p_stKineticGetLinearPosition1(_p_stKinetic) (&(_p_stKinetic)->m_stLinearPosition1)
#define DNM_M_p_stKineticGetPosition(_p_stKinetic) (&(_p_stKinetic)->m_stPosition)
 
#define DNM_M_xKineticSetTime(_p_stKinetic,_xValue) (DNM_M_xKineticGetTime(_p_stKinetic) = (_xValue))
#define DNM_M_KineticSetAcceleration(_p_stKinetic,_p_stMove) DNM_M_MoveCopyClone(&(_p_stKinetic)->m_stAcceleration,_p_stMove)
#define DNM_M_KineticSetSpeed(_p_stKinetic,_p_stMove) DNM_M_MoveCopyClone(&(_p_stKinetic)->m_stSpeed,_p_stMove)
#define DNM_M_KineticSetLinearPosition0(_p_stKinetic,_p_stPoint) DNM_M_PointCopyClone(DNM_M_p_stKineticGetLinearPosition0(_p_stKinetic),_p_stPoint)
#define DNM_M_KineticSetLinearPositionI(_p_stKinetic,_p_stPoint) DNM_M_PointCopyClone(DNM_M_p_stKineticGetLinearPositionI(_p_stKinetic),_p_stPoint)
#define DNM_M_KineticSetLinearPosition1(_p_stKinetic,_p_stPoint) DNM_M_PointCopyClone(DNM_M_p_stKineticGetLinearPosition1(_p_stKinetic),_p_stPoint)
#define DNM_M_KineticSetPosition(_p_stKinetic,_p_stMove) DNM_M_MoveCopyClone(DNM_M_p_stKineticGetPosition(_p_stKinetic),_p_stMove)
 
/* Clone */
#define DNM_M_KineticCopyClone(_p_stDst,_p_stSrc) {\
  DNM_M_xKineticSetTime(_p_stDst,DNM_M_xKineticGetTime(_p_stSrc));\
  MTH_M_MoveCopyClone(&(_p_stDst)->m_stAcceleration,&(_p_stSrc)->m_stAcceleration);\
  MTH_M_MoveCopyClone(&(_p_stDst)->m_stSpeed,&(_p_stSrc)->m_stSpeed);\
  MTH3D_M_vCopyVector(DNM_M_p_stKineticGetLinearPosition0(_p_stDst),DNM_M_p_stKineticGetLinearPosition0(_p_stSrc));\
  MTH3D_M_vCopyVector(DNM_M_p_stKineticGetLinearPositionI(_p_stDst),DNM_M_p_stKineticGetLinearPositionI(_p_stSrc));\
  MTH3D_M_vCopyVector(DNM_M_p_stKineticGetLinearPosition1(_p_stDst),DNM_M_p_stKineticGetLinearPosition1(_p_stSrc));\
  MTH_M_MoveCopyClone(&(_p_stDst)->m_stPosition,&(_p_stSrc)->m_stPosition);\
}
 
/* Initialisation */
DNM_tdstKinetic *DNM_p_stKineticInit(DNM_tdstKinetic *_p_stKinetic);
 
/* Specific initialisation for the platform */
/*void DNM_fn_vKineticPlatFormInit(DNM_tdstKinetic *_p_stKinetic);*/
 
#ifdef __cplusplus
}
#endif
 
#endif
