EgtInterface 1.5i5 :
- aggiunto interprete Lua - portate in interfaccia API molte funzioni di base.
This commit is contained in:
+128
-13
@@ -177,7 +177,7 @@ __stdcall EgtResetMark( int nGseCtx, int nId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// imposto l'evidenziazione
|
||||
// cancello l'evidenziazione
|
||||
return ( pGeomDB->ResetMark( nId) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
@@ -207,30 +207,117 @@ __stdcall EgtGetCalcMark( int nGseCtx, int nId, BOOL* pbMark)
|
||||
return ( pGeomDB->GetCalcMark( nId, *pbMark) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtStdColor( const wchar_t* wsName, int& nRed, int& nGreen, int& nBlue, int& nAlpha)
|
||||
{
|
||||
return EgtStdColor( wstrztoA( wsName), nRed, nGreen, nBlue, nAlpha) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtStdColor( const string& sName, int& nRed, int& nGreen, int& nBlue, int& nAlpha)
|
||||
{
|
||||
// recupero il colore standard
|
||||
Color cCol ;
|
||||
if ( GetStdColor( sName, cCol)) {
|
||||
nRed = cCol.GetIntRed() ;
|
||||
nGreen = cCol.GetIntGreen() ;
|
||||
nBlue = cCol.GetIntBlue() ;
|
||||
nAlpha = cCol.GetIntAlpha() ;
|
||||
return TRUE ;
|
||||
}
|
||||
else
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSetColor( int nGseCtx, int nId, int nRed, int nGreen, int nBlue, int nAlpha)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// assegno il colore
|
||||
Color cCol( nRed, nGreen, nBlue, nAlpha) ;
|
||||
return ( pGeomDB->SetMaterial( nId, cCol) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtGetColor( int nGseCtx, int nId, int& nRed, int& nGreen, int& nBlue, int& nAlpha)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// recupero il colore
|
||||
Color cCol ;
|
||||
if ( pGeomDB->GetMaterial( nId, cCol)) {
|
||||
nRed = cCol.GetIntRed() ;
|
||||
nGreen = cCol.GetIntGreen() ;
|
||||
nBlue = cCol.GetIntBlue() ;
|
||||
nAlpha = cCol.GetIntAlpha() ;
|
||||
return TRUE ;
|
||||
}
|
||||
else
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtGetCalcColor( int nGseCtx, int nId, int& nRed, int& nGreen, int& nBlue, int& nAlpha)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// recupero il colore
|
||||
Color cCol ;
|
||||
if ( pGeomDB->GetCalcMaterial( nId, cCol)) {
|
||||
nRed = cCol.GetIntRed() ;
|
||||
nGreen = cCol.GetIntGreen() ;
|
||||
nBlue = cCol.GetIntBlue() ;
|
||||
nAlpha = cCol.GetIntAlpha() ;
|
||||
return TRUE ;
|
||||
}
|
||||
else
|
||||
return FALSE ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSetName( int nGseCtx, int nId, const wchar_t* wsName)
|
||||
{
|
||||
return EgtSetName( nGseCtx, nId, wstrztoA( wsName)) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSetName( int nGseCtx, int nId, const string& sName)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// assegno il nome
|
||||
return ( pGeomDB->SetName( nId, wstrztoA( wsName)) ? TRUE : FALSE) ;
|
||||
return ( pGeomDB->SetName( nId, sName) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtGetName( int nGseCtx, int nId, wchar_t*& wsName)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// recupero il nome
|
||||
string sName ;
|
||||
if ( ! pGeomDB->GetName( nId, sName))
|
||||
if ( ! EgtGetName( nGseCtx, nId, sName))
|
||||
return FALSE ;
|
||||
wsName = _wcsdup( stringtoW( sName)) ;
|
||||
return (( wsName == nullptr) ? FALSE : TRUE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtGetName( int nGseCtx, int nId, string& sName)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// recupero il nome
|
||||
return pGeomDB->GetName( nId, sName) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtExistsName( int nGseCtx, int nId)
|
||||
@@ -254,43 +341,71 @@ __stdcall EgtRemoveName( int nGseCtx, int nId)
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSetInfo( int nGseCtx, int nId, const wchar_t* wsKey, const wchar_t* wsInfo)
|
||||
{
|
||||
return EgtSetInfo( nGseCtx, nId, wstrztoA( wsKey), wstrztoA( wsInfo)) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSetInfo( int nGseCtx, int nId, const string& sKey, const string& sInfo)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// assegno la info
|
||||
return ( pGeomDB->SetInfo( nId, wstrztoA( wsKey), string( wstrztoA( wsInfo))) ? TRUE : FALSE) ;
|
||||
return ( pGeomDB->SetInfo( nId, sKey, sInfo) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtGetInfo( int nGseCtx, int nId, const wchar_t* wsKey, wchar_t*& wsInfo)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// recupero la info
|
||||
string sInfo ;
|
||||
if ( ! pGeomDB->GetInfo( nId, wstrztoA( wsKey), sInfo))
|
||||
if ( ! EgtGetInfo( nGseCtx, nId, wstrztoA( wsKey), sInfo))
|
||||
return FALSE ;
|
||||
wsInfo = _wcsdup( stringtoW( sInfo)) ;
|
||||
return (( wsInfo == nullptr) ? FALSE : TRUE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtGetInfo( int nGseCtx, int nId, const string& sKey, string& sInfo)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// recupero la info
|
||||
return pGeomDB->GetInfo( nId, sKey, sInfo) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtExistsInfo( int nGseCtx, int nId, const wchar_t* wsKey)
|
||||
{
|
||||
return EgtExistsInfo( nGseCtx, nId, wstrztoA( wsKey)) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtExistsInfo( int nGseCtx, int nId, const string& sKey)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// verifico esistenza info
|
||||
return ( pGeomDB->ExistsInfo( nId, wstrztoA( wsKey)) ? TRUE : FALSE) ;
|
||||
return ( pGeomDB->ExistsInfo( nId, sKey) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtRemoveInfo( int nGseCtx, int nId, const wchar_t* wsKey)
|
||||
{
|
||||
return EgtRemoveInfo( nGseCtx, nId, wstrztoA( wsKey)) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtRemoveInfo( int nGseCtx, int nId, const string& sKey)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetGeomDB( nGseCtx) ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
// rimuovo la info
|
||||
return ( pGeomDB->RemoveInfo( nId, wstrztoA( wsKey)) ? TRUE : FALSE) ;
|
||||
return ( pGeomDB->RemoveInfo( nId, sKey) ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user