EgtExecutor 1.6w2 :
- aggiunte funzioni Exe e Lua per Zmap - corretta fnzione disegno sfera.
This commit is contained in:
@@ -80,4 +80,65 @@ ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs,
|
||||
}
|
||||
// restituisco risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapGetDepth( int nId, const Point3d& ptP, const Vector3d& vtDir, int nRefType,
|
||||
double& dInLen, double& dOutLen)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
bool bOk = pGeomDB->GetGlobFrame( nId, frLoc) ;
|
||||
// porto in locale il punto e il vettore
|
||||
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
|
||||
Vector3d vtVL = GetVectorLocal( pGeomDB, vtDir, nRefType, frLoc) ;
|
||||
// recupero lo Zmap e calcolo profondità
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bOk = bOk && ( pVZM != nullptr && pVZM->GetDepth( ptP, vtDir, dInLen, dOutLen)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapGetDepth(" + IdToString( nId) + ",{" +
|
||||
ToString( ptP) + "},{" +
|
||||
ToString( vtDir) + "}," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) + "," + ToString( dInLen) + "," + ToString( dOutLen) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapAvoidBox( int nId, const Frame3d& frBox, const Vector3d& vtDiag, int nRefType)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
bool bOk = pGeomDB->GetGlobFrame( nId, frLoc) ;
|
||||
// porto in locale il riferimento (il vettore è già in locale a questo stesso riferimento)
|
||||
Frame3d frBoxL = GetFrameLocal( pGeomDB, frBox, nRefType, frLoc) ;
|
||||
// recupero lo Zmap e calcolo collisione
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
bOk = bOk && ( pVZM != nullptr && pVZM->AvoidBox( frBoxL, vtDiag)) ;
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapAvoidBox(" + IdToString( nId) + ",{" +
|
||||
ToString( frBox.Orig()) + "},{" +
|
||||
ToString( frBox.VersX()) + "},{" +
|
||||
ToString( frBox.VersY()) + "},{" +
|
||||
ToString( frBox.VersZ()) + "}},{" +
|
||||
ToString( vtDiag) + "}," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return bOk ;
|
||||
}
|
||||
Reference in New Issue
Block a user