//---------------------------------------------------------------------------- // EgalTech 2015-2015 //---------------------------------------------------------------------------- // File : API_GdbPartLayers.cpp Data : 29.01.15 Versione : 1.6a7 // Contenuto : Funzioni di gestione pezzi e layer relativi. // // // // Modifiche : 29.01.15 DS Creazione modulo. // // //---------------------------------------------------------------------------- //--------------------------- Include ---------------------------------------- #include "stdafx.h" #include "API.h" #include "/EgtDev/Include/EInAPI.h" #include "/EgtDev/Include/EXeExecutor.h" using namespace std ; //------------------------------------------------------------------------------- BOOL __stdcall EgtIsPart( int nPartId) { return ( ExeIsPart( nPartId) ? TRUE : FALSE) ; } //------------------------------------------------------------------------------- BOOL __stdcall EgtIsLayer( int nLayerId) { return ( ExeIsLayer( nLayerId) ? TRUE : FALSE) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetCurrPart( void) { return ExeGetCurrPart() ; } //------------------------------------------------------------------------------- int __stdcall EgtGetCurrLayer( void) { return ExeGetCurrLayer() ; } //------------------------------------------------------------------------------- BOOL __stdcall EgtSetCurrPartLayer( int nPartId, int nLayerId) { return ( ExeSetCurrPartLayer( nPartId, nLayerId) ? TRUE : FALSE) ; } //------------------------------------------------------------------------------- BOOL __stdcall EgtResetCurrPartLayer( void) { return ( ExeResetCurrPartLayer() ? TRUE : FALSE) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetPartCount( BOOL bOnlyVisible) { return ExeGetPartCount( ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetFirstPart( BOOL bOnlyVisible) { return ExeGetFirstPart( ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetNextPart( int nId, BOOL bOnlyVisible) { return ExeGetNextPart( nId, ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetLastPart( BOOL bOnlyVisible) { return ExeGetLastPart( ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetPrevPart( int nId, BOOL bOnlyVisible) { return ExeGetPrevPart( nId, ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetFirstLayer( int nPartId, BOOL bOnlyVisible) { return ExeGetFirstLayer( nPartId, ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetNextLayer( int nId, BOOL bOnlyVisible) { return ExeGetNextLayer( nId, ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetLastLayer( int nPartId, BOOL bOnlyVisible) { return ExeGetLastLayer( nPartId, ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetPrevLayer( int nId, BOOL bOnlyVisible) { return ExeGetPrevLayer( nId, ( bOnlyVisible != FALSE)) ; } //------------------------------------------------------------------------------- int __stdcall EgtGetFirstGhostPart( void) { return ExeGetFirstGhostPart() ; } //------------------------------------------------------------------------------- int __stdcall EgtGetNextGhostPart( int nId) { return ExeGetNextGhostPart( nId) ; } //------------------------------------------------------------------------------- BOOL __stdcall EgtEraseEmptyParts( void) { return ( ExeEraseEmptyParts() ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSelectPartObjs( int nPartId) { return ( ExeSelectPartObjs( nPartId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDeselectPartObjs( int nPartId) { return ( ExeDeselectPartObjs( nPartId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSelectLayerObjs( int nLayerId) { return ( ExeSelectLayerObjs( nLayerId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDeselectLayerObjs( int nLayerId) { return ( ExeDeselectLayerObjs( nLayerId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtSelectPathObjs( int nId, BOOL bHaltOnFork) { return ( ExeSelectPathObjs( nId, ( bHaltOnFork != FALSE)) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- int __stdcall EgtDuploNew( int nSouId) { return ExeDuploNew( nSouId) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploCount( int nSouId, int* pnCount) { if ( pnCount == nullptr) return FALSE ; return ( ExeDuploCount( nSouId, *pnCount) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploList( int nSouId, int*& vInd, int* pnCount) { if ( &vInd == nullptr || pnCount == nullptr) return FALSE ; INTVECTOR vnRef ; if ( ! ExeDuploList( nSouId, vnRef)) return FALSE ; int nDim = int( vnRef.size()) ; if ( nDim == 0) { vInd = nullptr ; } else { vInd = (int*) malloc( nDim * sizeof( int)) ; if ( vInd == nullptr) return FALSE ; for ( int i = 0 ; i < nDim ; ++ i) vInd[i] = vnRef[i] ; } *pnCount = nDim ; return TRUE ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploInRawCount( int nSouId, int* pnCount) { if ( pnCount == nullptr) return FALSE ; return ( ExeDuploInRawCount( nSouId, *pnCount) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploWithoutRawList( int*& vInd, int* pnCount) { if ( &vInd == nullptr || pnCount == nullptr) return FALSE ; INTVECTOR vnDup ; if ( ! ExeDuploWithoutRawList( vnDup)) return FALSE ; int nDim = int( vnDup.size()) ; if ( nDim == 0) { vInd = nullptr ; } else { vInd = (int*) malloc( nDim * sizeof( int)) ; if ( vInd == nullptr) return FALSE ; for ( int i = 0 ; i < nDim ; ++ i) vInd[i] = vnDup[i] ; } *pnCount = nDim ; return TRUE ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploSetModified( int nSouId) { return ( ExeDuploSetModified( nSouId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploGetModified( int nSouId, BOOL* pbModif) { if ( pbModif == nullptr) return FALSE ; bool bModif ; if ( ExeDuploGetModified( nSouId, bModif)) { *pbModif = ( bModif ? TRUE : FALSE) ; return TRUE ; } return FALSE ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploSetLocked( int nDupId) { return ( ExeDuploSetLocked( nDupId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploResetLocked( int nDupId) { return ( ExeDuploResetLocked( nDupId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploGetLocked( int nDupId, BOOL* pbModif) { if ( pbModif == nullptr) return FALSE ; bool bModif ; if ( ExeDuploGetLocked( nDupId, bModif)) { *pbModif = ( bModif ? TRUE : FALSE) ; return TRUE ; } return FALSE ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtDuploUpdate( int nSouId) { return ( ExeDuploUpdate( nSouId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- BOOL __stdcall EgtIsDuplo( int nDupId) { return ( ExeIsDuplo( nDupId) ? TRUE : FALSE) ; } //----------------------------------------------------------------------------- int __stdcall EgtDuploGetOriginal( int nDupId) { return ExeDuploGetOriginal( nDupId) ; }