EgtExecutor 2.2g1 :
- aggiunta funzione Exe e Lua VolZmapGetPartMinDist.
This commit is contained in:
@@ -64,3 +64,27 @@ ExeVolZmapPartVolume( int nId, int nPart, double& dVol)
|
||||
// restituisco il volume della eventuale parte richiesta
|
||||
return ( pVZM != nullptr && pVZM->GetPartVolume( nPart, dVol)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapGetPartMinDist( int nId, const Point3d ptNear, int nRefType, int& nPart)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// verifico il parametro
|
||||
if ( &nPart == nullptr)
|
||||
return false ;
|
||||
// recupero il solido Zmap
|
||||
const IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pVZM == nullptr)
|
||||
return false ;
|
||||
// recupero il riferimento del solido
|
||||
Frame3d frVol ;
|
||||
if ( ! pGeomDB->GetGlobFrame( nId, frVol))
|
||||
return false ;
|
||||
// porto il punto Near nel riferimento dell'entità
|
||||
Point3d ptNearL = GetPointLocal( pGeomDB, ptNear, nRefType, frVol) ;
|
||||
// restituisco il volume della eventuale parte richiesta
|
||||
nPart = pVZM->GetPartMinDistFromPoint( ptNearL) ;
|
||||
return ( nPart >= 0) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user