#include "cpa_std.h" #include "MEC/MecMatCa.h" #include "MMG.h" /*--------------------------------------*/ /* Memory management of Geometry Module */ /*--------------------------------------*/ #include "GEO.h" /* Invalidate the handle */ /* Author : JM Soudagne */ /* Date : 1996-01-07 */ /* Version : 1.00 */ /* Modify : yyyy-mm-dd */ void DNM_fn_vInvalidateMatCharacteristics(DNM_tdxHandleToMecMatCharacteristics *_p_hMatCharacteristics) { #ifdef DNM_DEBUG if(_p_hMatCharacteristics == NULL) return ; #endif *_p_hMatCharacteristics = NULL; } /* Handle is valid ? */ /* Author : JM Soudagne */ /* Date : 1996-01-07 */ /* Version : 1.00 */ /* Modify : yyyy-mm-dd */ CPA_EXPORT ACP_tdxBool DNM_fn_bIsMatCharacteristicsValid(DNM_tdxHandleToMecMatCharacteristics _hMatCharacteristics) { return _hMatCharacteristics != NULL; } /*----------------------*/ /* Create a handle */ /*----------------------*/ /* Author : JM Soudagne */ /* Date : 1996-01-17 */ /* Version : 1.01 */ /* Modify : 1997-05-12 */ /*----------------------*/ DNM_tdxHandleToMecMatCharacteristics DNM_fn_xMatCharacteristicsCreate() { void *p_stResult = NULL; MMG_fn_vAddMemoryInfo (MMG_C_lTypeMEC , MMG_C_lSubTypeMecMatCharacteristic , NULL); GEO_M_CPAMalloc(p_stResult, void * , sizeof(DNM_tdstMecMatCharacteristics),E_uwGEONotEnoughtMemory); return (DNM_tdxHandleToMecMatCharacteristics)p_stResult; } /*----------------------*/ /* Destroy a handle */ /*----------------------*/ /* Author : JM Soudagne */ /* Date : 1996-01-17 */ /* Version : 1.00 */ /* Modify : 1997-02-10 */ /*----------------------*/ #ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */ void DNM_fn_vMatCharacteristicsDestroy(DNM_tdxHandleToMecMatCharacteristics _hOld) { GEO_M_CPAFree((void *)_hOld); } /* Copy a handle */ /* Author : JM Soudagne */ /* Date : 1996-01-17 */ /* Version : 1.00 */ /* Modify : yyyy-mm-dd */ void DNM_fn_vMatCharacteristicsCopy(DNM_tdxHandleToMecMatCharacteristics _hDst,DNM_tdxHandleToMecMatCharacteristics _hSrc) { /*FB030898 */ /*DNM_M_MatCharacteristicsCopyClone(DNM_fn_p_stMecMatCharacteristicsGiveBackSemantic(_hDst),DNM_fn_p_stMecMatCharacteristicsGiveBackSemantic(_hSrc));*/ DNM_M_MatCharacteristicsCopyClone((DNM_tdstMecMatCharacteristics *)(_hDst),(DNM_tdstMecMatCharacteristics *)(_hSrc)); /*END FB*/ } /* Accessor */ /* Author : J Thénoz */ /* Date : 1997-31-12 */ /* Version : 1.00 */ /* Modify : yyyy-mm-dd */ MTH_tdxReal DNM_fn_xMatCharacteristicsGetSlide (DNM_tdxHandleToMecMatCharacteristics _hMatCharacteristics) { #ifdef DNM_DEBUG if(!DNM_fn_bIsMatCharacteristicsValid(_hMatCharacteristics)) return MTH_M_xDoubleToReal(0.); /* Default value */ #endif /*FB030898*/ /*return DNM_M_xMatCharacteristicsGetSlide(DNM_fn_p_stMecMatCharacteristicsGiveBackSemantic(_hMatCharacteristics));*/ return DNM_M_xMatCharacteristicsGetSlide((DNM_tdstMecMatCharacteristics *)(_hMatCharacteristics)); /*END FB*/ } /* Accessor */ /* Author : J Thénoz */ /* Date : 1997-31-12 */ /* Version : 1.00 */ /* Modify : yyyy-mm-dd */ MTH_tdxReal DNM_fn_xMatCharacteristicsSetSlide(DNM_tdxHandleToMecMatCharacteristics _hMatCharacteristics, MTH_tdxReal _xValue) { #ifdef DNM_DEBUG if(!DNM_fn_bIsMatCharacteristicsValid(_hMatCharacteristics)) return MTH_M_xDoubleToReal(0.); /* Default value */ #endif /*FB030898*/ /*return DNM_M_xMatCharacteristicsSetSlide(DNM_fn_p_stMecMatCharacteristicsGiveBackSemantic(_hMatCharacteristics),_xValue);*/ return DNM_M_xMatCharacteristicsSetSlide((DNM_tdstMecMatCharacteristics *)(_hMatCharacteristics),_xValue); /*END FB*/ } /* Accessor */ /* Author : J Thénoz */ /* Date : 1997-31-12 */ /* Version : 1.00 */ /* Modify : yyyy-mm-dd */ MTH_tdxReal DNM_fn_xMatCharacteristicsGetRebound (DNM_tdxHandleToMecMatCharacteristics _hMatCharacteristics) { #ifdef DNM_DEBUG if(!DNM_fn_bIsMatCharacteristicsValid(_hMatCharacteristics)) return MTH_M_xDoubleToReal(1.); /* Default value */ #endif /*FB030898*/ /*return DNM_M_xMatCharacteristicsGetRebound(DNM_fn_p_stMecMatCharacteristicsGiveBackSemantic(_hMatCharacteristics));*/ return DNM_M_xMatCharacteristicsGetRebound((DNM_tdstMecMatCharacteristics *)(_hMatCharacteristics)); /*END FB*/ } /* Accessor */ /* Author : J Thénoz */ /* Date : 1997-31-12 */ /* Version : 1.00 */ /* Modify : yyyy-mm-dd */ MTH_tdxReal DNM_fn_xMatCharacteristicsSetRebound(DNM_tdxHandleToMecMatCharacteristics _hMatCharacteristics, MTH_tdxReal _xValue) { #ifdef DNM_DEBUG if(!DNM_fn_bIsMatCharacteristicsValid(_hMatCharacteristics)) return MTH_M_xDoubleToReal(1.); /* Default value */ #endif /*FB030898*/ /*return DNM_M_xMatCharacteristicsSetRebound(DNM_fn_p_stMecMatCharacteristicsGiveBackSemantic(_hMatCharacteristics),_xValue);*/ return DNM_M_xMatCharacteristicsSetRebound((DNM_tdstMecMatCharacteristics *)(_hMatCharacteristics),_xValue); /*END FB*/ } #endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */