#include "cpa_std.h"
 
#include "MEC/mecmatca.h"
#include "MEC/dnmldmat.h"
#include "MEC/dnmlkmat.h"
 
#include "DPT.h"
#include "GEO.h"
 
#include "ldt.h"
 
 
#define lTagBaseSlide   'dilS'
#define lTagBaseRebound 'obeR'
 
int fn_iCreateMecMatCharacteristics( LDT_tdst_Link *pLink )
{
 
  DNM_tdxHandleToMecMatCharacteristics hMecMatCharacteristics = DNM_fn_xMatCharacteristicsCreate();    
 
  pLink->pObject = (void*)hMecMatCharacteristics;
 
 
  return 0;
}
 
 
int fn_iLoadMecMatCharacteristics( LDT_tdst_Link *pLink )
{
  LDT_tdeParseResult result=ParseResult_BeginSection;
  DNM_tdxHandleToMecMatCharacteristics hMecMatCharacteristics = (DNM_tdxHandleToMecMatCharacteristics)pLink->pObject;  
  char szLinkTableKey[_MAX_PATH];
	DNM_tdstMecMatCharacteristics *p_stMecMatCharacteristics;
 
  LDT_ComputeSectionName( pLink , szLinkTableKey);
  DNM_fn_vSetValueInLinkTableOfMecMatCharacteristics(szLinkTableKey,(unsigned long)(hMecMatCharacteristics));
 
  p_stMecMatCharacteristics = DNM_fn_p_stMecMatCharacteristicsGiveBackSemantic(hMecMatCharacteristics);
 
 
  while( result!=ParseResult_EndSection ) 
  {
  	result=LDT_GetNextEntry();
  	switch( result )
  	{
  	  case ParseResult_Entry: /* an entry */
  	  {
  	    char *szEntry=LDT_szGetEntryName();
  	    switch (*(long*)(szEntry+4))
  	    {
 
  	      case  lTagBaseSlide : /*  */
  	      {
            DNM_M_xMatCharacteristicsSetSlide(p_stMecMatCharacteristics, (float)atof(LDT_szGetParam(1)));
  	      }
  	      break;
  	      case  lTagBaseRebound : /*  */
  	      {
            DNM_M_xMatCharacteristicsSetRebound(p_stMecMatCharacteristics, (float)atof(LDT_szGetParam(1)));
  	      }
  	      break;
  	    }
  	  }
  	}
  }
 
 
  return 0;
}
 
