EgtExecutor :
- aggiunte ExeGetPhotoDimensions e ExeGetPhotoPixels - in import piccole modifiche in aggiornamento FilePath progetto corrente.
This commit is contained in:
@@ -151,3 +151,36 @@ ExeGetPhotoMMxPixel( int nId, double& dMMxPixel)
|
||||
dMMxPixel = ( dDimX / nWidth + dDimY / nHeight) / 2 ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetPhotoDimensions( int nId, double& dDimX, double& dDimY)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero il gestore dei dati della fotografia dell'oggetto
|
||||
PhotoObj* pPhoto = dynamic_cast<PhotoObj*>( pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pPhoto == nullptr)
|
||||
return false ;
|
||||
// recupero le dimensioni fisiche della fotografia
|
||||
return pPhoto->GetDimensions( dDimX, dDimY) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeGetPhotoPixels( int nId, int& nPixelX, int& nPixelY)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
IEGrScene* pScene = GetCurrScene() ;
|
||||
VERIFY_SCENE( pScene, false)
|
||||
// recupero il gestore dei dati della fotografia dell'oggetto
|
||||
PhotoObj* pPhoto = dynamic_cast<PhotoObj*>( pGeomDB->GetUserObj( nId)) ;
|
||||
if ( pPhoto == nullptr)
|
||||
return false ;
|
||||
// recupero le dimensioni in pixels della fotografia
|
||||
string sName ;
|
||||
if ( ! pPhoto->GetName( sName))
|
||||
return false ;
|
||||
return ( pScene->GetTexturePixels( sName, nPixelX, nPixelY) && nPixelX > 0 && nPixelY > 0) ;
|
||||
}
|
||||
Reference in New Issue
Block a user