171ca72ed9
- aggiunte interfacce per EgtSetSelInfo, EgtGetLastSelInfo e EgtGetPrevSelInfo.
153 lines
4.4 KiB
C++
153 lines
4.4 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2014-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : API_GdbObjects.cpp Data : 02.09.14 Versione : 1.5i1
|
|
// Contenuto : Funzioni iterazione di DB geometrico per API.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 02.09.14 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 EgtSetObjFilterForSelect( BOOL bZerodim, BOOL bCurve, BOOL bSurf, BOOL bVolume, BOOL bExtra)
|
|
{
|
|
return ( ExeSetObjFilterForSelect( ( bZerodim != FALSE), ( bCurve != FALSE), ( bSurf != FALSE),
|
|
( bVolume != FALSE), ( bExtra != FALSE)) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtSelectObj( int nId)
|
|
{
|
|
return ( ExeSelectObj( nId) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtDeselectObj( int nId)
|
|
{
|
|
return ( ExeDeselectObj( nId) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtSelectAll( BOOL bOnlyIfVisible)
|
|
{
|
|
return ( ExeSelectAll( ( bOnlyIfVisible != FALSE)) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtDeselectAll( void)
|
|
{
|
|
return ( ExeDeselectAll() ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtSelectGroupObjs( int nGroupId)
|
|
{
|
|
return ( ExeSelectGroupObjs( nGroupId) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtDeselectGroupObjs( int nGroupId)
|
|
{
|
|
return ( ExeDeselectGroupObjs( nGroupId) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtIsSelectedObj( int nId)
|
|
{
|
|
return ( ExeIsSelectedObj( nId) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtGetSelectedObjCount( void)
|
|
{
|
|
return ExeGetSelectedObjCount() ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtGetFirstSelectedObj( void)
|
|
{
|
|
return ExeGetFirstSelectedObj() ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtGetNextSelectedObj( void)
|
|
{
|
|
return ExeGetNextSelectedObj() ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtGetLastSelectedObj( void)
|
|
{
|
|
return ExeGetLastSelectedObj() ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
int
|
|
__stdcall EgtGetPrevSelectedObj( void)
|
|
{
|
|
return ExeGetPrevSelectedObj() ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtSetSelInfo( int nId, int nSub, const double ptSel[3])
|
|
{
|
|
return ( ExeSetSelInfo( nId, nSub, ptSel) ? TRUE : FALSE) ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtGetLastSelInfo( int* pnLastId, int* pnLastSub, double ptLastSel[3])
|
|
{
|
|
// verifica parametri
|
|
if ( pnLastId == nullptr || pnLastSub == nullptr || ptLastSel == nullptr)
|
|
return FALSE ;
|
|
// recupero i dati
|
|
Point3d ptTmp ;
|
|
if ( ! ExeGetLastSelInfo( *pnLastId, *pnLastSub, ptTmp))
|
|
return FALSE ;
|
|
// assegno risultati
|
|
VEC_FROM_3D( ptLastSel, ptTmp)
|
|
return TRUE ;
|
|
}
|
|
|
|
//-----------------------------------------------------------------------------
|
|
BOOL
|
|
__stdcall EgtGetPrevSelInfo( int* pnPrevId, int* pnPrevSub, double ptPrevSel[3])
|
|
{
|
|
// verifica parametri
|
|
if ( pnPrevId == nullptr || pnPrevSub == nullptr || ptPrevSel == nullptr)
|
|
return FALSE ;
|
|
// recupero i dati
|
|
Point3d ptTmp ;
|
|
if ( ! ExeGetPrevSelInfo( *pnPrevId, *pnPrevSub, ptTmp))
|
|
return FALSE ;
|
|
// assegno risultati
|
|
VEC_FROM_3D( ptPrevSel, ptTmp)
|
|
return TRUE ;
|
|
}
|