//---------------------------------------------------------------------------- // EgalTech 2020-2020 //---------------------------------------------------------------------------- // File : API_BeamMgr.cpp Data : 02.09.20 Versione : 2.2i2 // Contenuto : Funzioni Beam Manager per API. // // // // Modifiche : 02.09.20 DS Creazione modulo. // // //---------------------------------------------------------------------------- //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "API.h" #include "/EgtDev/Include/EInAPI.h" #include "/EgtDev/Include/EXeExecutor.h" #include "/EgtDev/Include/EgtStringConverter.h" using namespace std ; //----------------------------------------------------------------------------- BOOL __stdcall EgtInitBeamMgr( int nFlag) { return ( ExeInitBeamMgr( nFlag) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- 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 __stdcall EgtBeamCalcSolid( int nPartId, BOOL bRecalc) { return ( ExeBeamCalcSolid( nPartId, ( bRecalc != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- int __stdcall EgtBeamGetSolid( int nPartId) { return ExeBeamGetSolid( nPartId) ; } //----------------------------------------------------------------------------- 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) ; }