EgtExecutor :

- piccole migliorie stilistiche.
This commit is contained in:
Dario Sassi
2019-08-06 09:31:57 +00:00
parent dc0396f6af
commit 93c77cb786
2 changed files with 54 additions and 54 deletions
+30 -30
View File
@@ -510,7 +510,7 @@ ExeVolZmapAvoidBox( int nId, const Frame3d& frBox, const Vector3d& vtDiag, doubl
// 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)) ;
const IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pVZM != nullptr && pVZM->AvoidBox( frBoxL, vtDiag, dSafeDist)) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
@@ -529,34 +529,6 @@ ExeVolZmapAvoidBox( int nId, const Frame3d& frBox, const Vector3d& vtDiag, doubl
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapAvoidSphere( int nId, const Point3d& ptCen, double dRad, double dSafeDist, 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 centro della sfera
Point3d ptCenL = GetPointLocal( pGeomDB, ptCen, nRefType, frLoc) ;
// recupero lo Zmap e calcolo collisione
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pVZM != nullptr && pVZM->AvoidSphere( ptCenL, dRad, dSafeDist)) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtVolZmapAvoidSphere(" + IdToString( nId) + ",{" +
ToString( ptCen) + "}," +
ToString( dRad) + "," +
ToString( dSafeDist) + "," +
RefTypeToString( nRefType) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapAvoidCylinder( int nId, const Frame3d& frCyl, double dL, double dR, double dSafeDist, int nRefType)
@@ -569,7 +541,7 @@ ExeVolZmapAvoidCylinder( int nId, const Frame3d& frCyl, double dL, double dR, do
// porto in locale il riferimento
Frame3d frBoxL = GetFrameLocal( pGeomDB, frCyl, nRefType, frLoc) ;
// recupero lo Zmap e calcolo collisione
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
const IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pVZM != nullptr && pVZM->AvoidCylinder( frBoxL, dL, dR, dSafeDist)) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
@@ -589,6 +561,34 @@ ExeVolZmapAvoidCylinder( int nId, const Frame3d& frCyl, double dL, double dR, do
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapAvoidSphere( int nId, const Point3d& ptCen, double dRad, double dSafeDist, 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 centro della sfera
Point3d ptCenL = GetPointLocal( pGeomDB, ptCen, nRefType, frLoc) ;
// recupero lo Zmap e calcolo collisione
const IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pVZM != nullptr && pVZM->AvoidSphere( ptCenL, dRad, dSafeDist)) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtVolZmapAvoidSphere(" + IdToString( nId) + ",{" +
ToString( ptCen) + "}," +
ToString( dRad) + "," +
ToString( dSafeDist) + "," +
RefTypeToString( nRefType) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeCutVolZmapPlane( int nId, const Point3d& ptOn, const Vector3d& vtN, int nRefType)