From df8b3a0cb4c317414832aa19dd5c6c3ba3df4802 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 16 Dec 2020 07:25:11 +0000 Subject: [PATCH] EgtInterface : - aggiunte interfacce per nuove funzioni BeamMgr. --- API_BeamMgr.cpp | 117 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 114 insertions(+), 3 deletions(-) diff --git a/API_BeamMgr.cpp b/API_BeamMgr.cpp index 1b83228..f18dc80 100644 --- a/API_BeamMgr.cpp +++ b/API_BeamMgr.cpp @@ -27,7 +27,104 @@ __stdcall EgtInitBeamMgr( int nFlag) return ( ExeInitBeamMgr( nFlag) ? TRUE : FALSE) ; } -EXE_EXPORT int ExeBeamGetSolid( int nPartId) ; +//----------------------------------------------------------------------------- +int +__stdcall EgtBeamCreatePart( void) +{ + return ExeBeamCreatePart() ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamSetPart( int nPartId) +{ + return ( ExeBeamSetPart( nPartId) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamErasePart( void) +{ + return ( ExeBeamErasePart() ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamSetPartProdNbr( int nProdNbr) +{ + return ( ExeBeamSetPartProdNbr( nProdNbr) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamSetPartName( const wchar_t* wsName) +{ + return ( ExeBeamSetPartName( wstrztoA( wsName)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamSetPartCount( int nCount) +{ + return ( ExeBeamSetPartCount( nCount) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamSetPartBox( double dLength, double dHeight, double dWidth) +{ + return ( ExeBeamSetPartBox( dLength, dHeight, dWidth) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +int +__stdcall EgtBeamAddProcess( int nGroup, int nProc, int nSide, const wchar_t* wsDes, int nProcId, + const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3], + int nPar, const double vPar[], const wchar_t* wsPar, BOOL bUpdate) +{ + Frame3d frFrame ; + if ( ! frFrame.Set( ptOrig, vX, vY, vZ)) + return GDB_ID_NULL ; + DBLVECTOR vdPar ; + vdPar.reserve( nPar) ; + for ( int i = 0 ; i < nPar ; ++i) { + vdPar.push_back( vPar[i]) ; + } + return ExeBeamAddProcess( nGroup, nProc, nSide, wstrztoA( wsDes), nProcId, frFrame, + vdPar, wstrztoA( wsPar), ( bUpdate != FALSE)) ; +} + +//----------------------------------------------------------------------------- +int +__stdcall EgtBeamModifyProcess( int nGeomId, int nGroup, int nProc, int nSide, const wchar_t* wsDes, int nProcId, + const double ptOrig[3], const double vX[3], const double vY[3], const double vZ[3], + int nPar, const double vPar[], const wchar_t* wsPar, BOOL bUpdate) +{ + Frame3d frFrame ; + if ( ! frFrame.Set( ptOrig, vX, vY, vZ)) + return GDB_ID_NULL ; + DBLVECTOR vdPar ; + vdPar.reserve( nPar) ; + for ( int i = 0 ; i < nPar ; ++i) { + vdPar.push_back( vPar[i]) ; + } + return ExeBeamModifyProcess( nGeomId, nGroup, nProc, nSide, wstrztoA( wsDes), nProcId, frFrame, + vdPar, wstrztoA( wsPar), ( bUpdate != FALSE)) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamEraseProcess( int nGeomId, BOOL bUpdate) +{ + return ( ExeBeamEraseProcess( nGeomId, ( bUpdate != FALSE)) ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamEnableProcess( int nGeomId, BOOL bEnable, BOOL bUpdate) +{ + return ( ExeBeamEnableProcess( nGeomId, ( bEnable != FALSE), ( bUpdate != FALSE)) ? TRUE : FALSE) ; +} //----------------------------------------------------------------------------- BOOL @@ -44,8 +141,22 @@ __stdcall EgtBeamGetSolid( int nPartId) } //----------------------------------------------------------------------------- -BOOL __stdcall -EgtBeamShowSolid( int nPartId, BOOL bShow) +BOOL +__stdcall EgtBeamShowSolid( int nPartId, BOOL bShow) { return ( ExeBeamShowSolid( nPartId, ( bShow != FALSE)) ? TRUE : FALSE) ; } + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamGetBuildingIsOn( void) +{ + return ( ExeBeamGetBuildingIsOn() ? TRUE : FALSE) ; +} + +//----------------------------------------------------------------------------- +BOOL +__stdcall EgtBeamShowBuilding( BOOL bShow) +{ + return ( ExeBeamShowBuilding( ( bShow != FALSE)) ? TRUE : FALSE) ; +}