EgtExecutor :
- funzione Exe e Lua CAvGetToolOutline con parametro bApprox in più - aggiunta funzione Exe e Lua VolZmapGetToolOutline.
This commit is contained in:
@@ -319,6 +319,49 @@ ExeVolZmapSetChiselTool( int nId, const string& sToolName,
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
MyVolZmapGetToolOutline( int nId, int nDestGrpId, bool bApprox)
|
||||
{
|
||||
// verifico DB geometrico
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero lo Zmap e recupero il profilo dell'utensile
|
||||
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pVZM == nullptr)
|
||||
return GDB_ID_NULL ;
|
||||
// recupero outline dell'utensile
|
||||
const ICurveComposite& CC = pVZM->GetToolOutline( bApprox) ;
|
||||
if ( ! CC.IsValid())
|
||||
return GDB_ID_NULL ;
|
||||
// ne faccio una copia
|
||||
PtrOwner<ICurveComposite> pCopy( CC.Clone()) ;
|
||||
if ( IsNull( pCopy))
|
||||
return GDB_ID_NULL ;
|
||||
// inserisco la copia nel DB geometrico
|
||||
int nNewId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, Release( pCopy)) ;
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
int
|
||||
ExeVolZmapGetToolOutline( int nId, int nDestGrpId, bool bApprox)
|
||||
{
|
||||
int nNewId = MyVolZmapGetToolOutline( nId, nDestGrpId, bApprox) ;
|
||||
if ( nNewId != GDB_ID_NULL)
|
||||
ExeSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtVolZmapGetToolOutline(" + IdToString( nId) + "," +
|
||||
IdToString( nDestGrpId) + "," +
|
||||
( bApprox ? "true" : "false") + ")" +
|
||||
" -- Id=" + IdToString( nNewId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return nNewId ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs,
|
||||
|
||||
Reference in New Issue
Block a user