aacdc8cfc7
- aggiunta gestione Flag Utensile per VirtualMilling in Exe e Lua.
471 lines
20 KiB
C++
471 lines
20 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2015-2016
|
|
//----------------------------------------------------------------------------
|
|
// File : EXE_ModifyVol.cpp Data : 27.10.16 Versione : 1.6v7
|
|
// Contenuto : Funzioni di modifica dei solidi per EXE.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 27.10.16 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
//--------------------------- Include ----------------------------------------
|
|
#include "stdafx.h"
|
|
#include "EXE.h"
|
|
#include "EXE_Macro.h"
|
|
#include "AuxTools.h"
|
|
#include "GeoTools.h"
|
|
#include "/EgtDev/Include/EXeExecutor.h"
|
|
#include "/EgtDev/Include/EXeConst.h"
|
|
#include "/EgtDev/Include/EGkVolZmap.h"
|
|
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
|
|
|
using namespace std ;
|
|
|
|
//-------------------------------------------------------------------------------
|
|
static int
|
|
MyExplodeVolZmap( int nId, int* pnCount)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
|
// recupero il solido VolZmap
|
|
const IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
if ( pVZM == nullptr)
|
|
return GDB_ID_NULL ;
|
|
// recupero il numero di parti connesse
|
|
int nPart = pVZM->GetPartCount() ;
|
|
// se c'è una sola parte o non definibile, non devo fare alcunché
|
|
if ( nPart == 1 || nPart == - 1) {
|
|
if ( pnCount != nullptr)
|
|
*pnCount = 1 ;
|
|
return nId ;
|
|
}
|
|
// copio tutti i componenti connessi (parti)
|
|
int nFirstId = GDB_ID_NULL ;
|
|
int nCount = 0 ;
|
|
for ( int i = 0 ; i < nPart ; ++ i) {
|
|
IVolZmap* pPrt = pVZM->ClonePart( i) ;
|
|
if ( pPrt == nullptr)
|
|
continue ;
|
|
// inserisco il solido nello stesso gruppo e nello stesso posto del GeomDB
|
|
int nNewId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nId, GDB_BEFORE, pPrt) ;
|
|
if ( nNewId == GDB_ID_NULL)
|
|
return GDB_ID_NULL ;
|
|
// copio gli attributi
|
|
if ( ! pGeomDB->CopyAttributes( nId, nNewId))
|
|
return GDB_ID_NULL ;
|
|
// aggiorno contatori
|
|
if ( nFirstId == GDB_ID_NULL)
|
|
nFirstId = nNewId ;
|
|
++ nCount ;
|
|
}
|
|
// elimino il solido originale
|
|
pGeomDB->Erase( nId) ;
|
|
// restituisco risultati
|
|
if ( pnCount != nullptr)
|
|
*pnCount = nCount ;
|
|
return nFirstId ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
ExeExplodeVolume( int nId, int* pnCount)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
|
// recupero il tipo di solido
|
|
int nFirstId = GDB_ID_NULL ;
|
|
int nCount = 0 ;
|
|
switch ( pGeomDB->GetGeoType( nId)) {
|
|
case VOL_ZMAP :
|
|
nFirstId = MyExplodeVolZmap( nId, &nCount) ;
|
|
break ;
|
|
}
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtExplodeVolume(" + ToString( nId) + ")" +
|
|
" -- Id1=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultati
|
|
if ( pnCount != nullptr)
|
|
*pnCount = nCount ;
|
|
return nFirstId ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
int
|
|
ExeCopyVolZmapPart( int nId, int nPart, int nDestGrpId)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
|
// recupero lo Zmap e copio la parte indicata
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
if ( pVZM == nullptr)
|
|
return GDB_ID_NULL ;
|
|
// recupero il suo riferimento globale
|
|
Frame3d frVZM ;
|
|
if ( ! pGeomDB->GetGlobFrame( nId, frVZM))
|
|
return GDB_ID_NULL ;
|
|
// recupero il riferimento del gruppo di destinazione
|
|
Frame3d frDest ;
|
|
if ( ! pGeomDB->GetGroupGlobFrame( nDestGrpId, frDest))
|
|
return GDB_ID_NULL ;
|
|
// copio la parte connessa
|
|
PtrOwner<IVolZmap> pPart( pVZM->ClonePart( nPart)) ;
|
|
if ( IsNull( pPart))
|
|
return GDB_ID_NULL ;
|
|
pPart->LocToLoc( frVZM, frDest) ;
|
|
// inserisco nel DB
|
|
int nVZMId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nDestGrpId, GDB_LAST_SON, Release( pPart)) ;
|
|
if ( nVZMId == GDB_ID_NULL)
|
|
return GDB_ID_NULL ;
|
|
// copio gli attributi
|
|
if ( ! pGeomDB->CopyAttributes( nId, nVZMId))
|
|
return GDB_ID_NULL ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "ExeCopyVolZmapPart(" + ToString( nId) + "," +
|
|
ToString( nPart) + "," +
|
|
ToString( nDestGrpId) + ")" +
|
|
" -- Id=" + ToString( nVZMId) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
return nVZMId ;
|
|
}
|
|
|
|
//-------------------------------------------------------------------------------
|
|
bool
|
|
ExeRemoveVolZmapPart( int nId, int nPart)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero lo Zmap e rimuovo la parte indicata
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
bool bOk = ( pVZM != nullptr && pVZM->RemovePart( nPart)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtRemoveVolZmapPart(" + ToString( nId) + "," +
|
|
ToString( nPart) + ")" +
|
|
" -- Ok=" + ToString( bOk) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
ExeVolZmapSetStdTool( int nId, const string& sToolName, double dLen, double dDiam, double dCornR, int nFlag)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero lo Zmap e assegno i dati dell'utensile
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
bool bOk = ( pVZM != nullptr && pVZM->SetStdTool( sToolName, dLen, 0.5 * dDiam, dCornR, nFlag)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapSetStdTool(" + IdToString( nId) + "," +
|
|
sToolName + "," +
|
|
ToString( dLen) + "," +
|
|
ToString( dDiam) + "," +
|
|
ToString( dCornR) + "," +
|
|
ToString( nFlag) + ")" +
|
|
" -- Ok=" + ToString( bOk) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
ExeVolZmapSetAdvTool( int nId, const string& sToolName,
|
|
double dLen, double dDiam, double dTipLen, double dTipDiam, double dCornR, int nFlag)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero lo Zmap e assegno i dati dell'utensile
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
bool bOk = ( pVZM != nullptr &&
|
|
pVZM->SetAdvTool( sToolName, dLen, dDiam / 2, dTipLen, dTipDiam / 2, dCornR, nFlag)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapSetAdvTool(" + IdToString( nId) + "," +
|
|
sToolName + "," +
|
|
ToString( dLen) + "," +
|
|
ToString( dDiam) + "," +
|
|
ToString( dTipLen) + "," +
|
|
ToString( dTipDiam) + "," +
|
|
ToString( dCornR) + "," +
|
|
ToString( nFlag) + ")" +
|
|
" -- Ok=" + ToString( bOk) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
ExeVolZmapSetMortiserTool( int nId, const string& sToolName,
|
|
double dLen, double dWidth, double dThick, double dCornR, int nFlag)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero lo Zmap e assegno i dati dell'utensile
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
bool bOk = ( pVZM != nullptr &&
|
|
pVZM->SetMortiserTool( sToolName, dLen, dWidth, dThick, dCornR, nFlag)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapSetMortiserTool(" + IdToString( nId) + "," +
|
|
sToolName + "," +
|
|
ToString( dLen) + "," +
|
|
ToString( dWidth) + "," +
|
|
ToString( dThick) + "," +
|
|
ToString( dCornR) + "," +
|
|
ToString( nFlag) + ")" +
|
|
" -- Ok=" + ToString( bOk) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
ExeVolZmapSetChiselTool( int nId, const string& sToolName,
|
|
double dLen, double dWidth, double dThick, int nFlag)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero lo Zmap e assegno i dati dell'utensile
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
bool bOk = ( pVZM != nullptr &&
|
|
pVZM->SetChiselTool( sToolName, dLen, dWidth, dThick, nFlag)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapSetChiselTool(" + IdToString( nId) + "," +
|
|
sToolName + "," +
|
|
ToString( dLen) + "," +
|
|
ToString( dWidth) + "," +
|
|
ToString( dThick) + "," +
|
|
ToString( nFlag) + ")" +
|
|
" -- Ok=" + ToString( bOk) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs,
|
|
const Point3d& ptPe, const Vector3d& vtDe, int nRefType)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero il riferimento locale
|
|
Frame3d frLoc ;
|
|
bool bOk = pGeomDB->GetGlobFrame( nId, frLoc) ;
|
|
// porto in locale i punti e i vettori
|
|
Point3d ptPsL = GetPointLocal( pGeomDB, ptPs, nRefType, frLoc) ;
|
|
Vector3d vtDsL = GetVectorLocal( pGeomDB, vtDs, nRefType, frLoc) ;
|
|
Point3d ptPeL = GetPointLocal( pGeomDB, ptPe, nRefType, frLoc) ;
|
|
Vector3d vtDeL = GetVectorLocal( pGeomDB, vtDe, nRefType, frLoc) ;
|
|
// recupero lo Zmap e eseguo movimento di fresatura con l'utensile già associato
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
bOk = bOk && ( pVZM != nullptr && pVZM->MillingStep( ptPsL, vtDsL, ptPeL, vtDeL)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapMillingStep(" + IdToString( nId) + ",{" +
|
|
ToString( ptPs) + "},{" +
|
|
ToString( vtDs) + "},{" +
|
|
ToString( ptPe) + "},{" +
|
|
ToString( vtDe) + "}," +
|
|
RefTypeToString( nRefType) + ")" +
|
|
" -- Ok=" + ToString( bOk) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs, const Vector3d& vtAs,
|
|
const Point3d& ptPe, const Vector3d& vtDe, const Vector3d& vtAe, int nRefType)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero il riferimento locale
|
|
Frame3d frLoc ;
|
|
bool bOk = pGeomDB->GetGlobFrame( nId, frLoc) ;
|
|
// porto in locale i punti e i vettori
|
|
Point3d ptPsL = GetPointLocal( pGeomDB, ptPs, nRefType, frLoc) ;
|
|
Vector3d vtDsL = GetVectorLocal( pGeomDB, vtDs, nRefType, frLoc) ;
|
|
Vector3d vtAsL = GetVectorLocal( pGeomDB, vtAs, nRefType, frLoc) ;
|
|
Point3d ptPeL = GetPointLocal( pGeomDB, ptPe, nRefType, frLoc) ;
|
|
Vector3d vtDeL = GetVectorLocal( pGeomDB, vtDe, nRefType, frLoc) ;
|
|
Vector3d vtAeL = GetVectorLocal( pGeomDB, vtAe, nRefType, frLoc) ;
|
|
// recupero lo Zmap e eseguo movimento di fresatura con l'utensile già associato
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
bOk = bOk && ( pVZM != nullptr && pVZM->MillingStep( ptPsL, vtDsL, vtAsL, ptPeL, vtDeL, vtAeL)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapMillingStep(" + IdToString( nId) + ",{" +
|
|
ToString( ptPs) + "},{" +
|
|
ToString( vtDs) + "},{" +
|
|
ToString( vtAs) + "},{" +
|
|
ToString( ptPe) + "},{" +
|
|
ToString( vtDe) + "},{" +
|
|
ToString( vtAe) + "}," +
|
|
RefTypeToString( nRefType) + ")" +
|
|
" -- Ok=" + ToString( bOk) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
bool
|
|
ExeVolZmapGetDepth( int nId, const Point3d& ptP, const Vector3d& vtDir, int nRefType, bool bExact,
|
|
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, bExact)) ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapGetDepth(" + IdToString( nId) + ",{" +
|
|
ToString( ptP) + "},{" +
|
|
ToString( vtDir) + "}," +
|
|
( bExact ? "true" : "false") + "," +
|
|
RefTypeToString( nRefType) + ")" +
|
|
" -- Ok=" + ToString( bOk) + "," + ToString( dInLen) + "," + ToString( dOutLen) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco risultato
|
|
return bOk ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
int
|
|
MyVolZmapIntersPlane( int nId, const Plane3d& plPlane, int nDestGrpId, int nRefType, int* pnCount)
|
|
{
|
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
|
VERIFY_GEOMDB( pGeomDB, false)
|
|
// recupero il riferimento locale
|
|
Frame3d frLoc ;
|
|
if ( ! pGeomDB->GetGlobFrame( nId, frLoc))
|
|
return GDB_ID_NULL ;
|
|
// recupero il riferimento destinazione
|
|
Frame3d frDest ;
|
|
if ( ! pGeomDB->GetGlobFrame( nDestGrpId, frDest))
|
|
return GDB_ID_NULL ;
|
|
// porto in locale il piano
|
|
Plane3d plPlaneL = GetPlaneLocal( pGeomDB, plPlane, nRefType, frLoc) ;
|
|
// recupero lo Zmap e calcolo l'intersezione
|
|
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
|
|
POCRVVECTOR vpLoop ;
|
|
if ( pVZM == nullptr || ! pVZM->GetPlaneIntersection( plPlaneL, vpLoop))
|
|
return GDB_ID_NULL ;
|
|
// inserisco le curve nel gruppo destinazione
|
|
int nFirstId = GDB_ID_NULL ;
|
|
int nCount = 0 ;
|
|
for ( size_t i = 0 ; i < vpLoop.size() ; ++ i) {
|
|
PtrOwner<ICurve> pCrv( Release( vpLoop[i])) ;
|
|
if ( IsNull( pCrv))
|
|
continue ;
|
|
pCrv->ToLoc( frDest) ;
|
|
// inserisco la curva composita nel gruppo destinazione
|
|
int nNewId = pGeomDB->AddGeoObj( GDB_ID_NULL, nDestGrpId, ::Release( pCrv)) ;
|
|
if ( nNewId == GDB_ID_NULL)
|
|
return GDB_ID_NULL ;
|
|
if ( nFirstId == GDB_ID_NULL)
|
|
nFirstId = nNewId ;
|
|
++ nCount ;
|
|
}
|
|
// aggiorno contatore
|
|
if ( pnCount != nullptr)
|
|
*pnCount = nCount ;
|
|
// restituisco l'identificativo della prima nuova entità
|
|
return nFirstId ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
int
|
|
ExeVolZmapIntersPlane( int nId, const Plane3d& plPlane, int nDestGrpId, int nRefType, int* pnCount)
|
|
{
|
|
// eseguo
|
|
int nCount = 0 ;
|
|
int nFirstId = MyVolZmapIntersPlane( nId, plPlane, nDestGrpId, nRefType, &nCount) ;
|
|
if ( pnCount != nullptr)
|
|
*pnCount = nCount ;
|
|
ExeSetModified() ;
|
|
// se richiesto, salvo il comando Lua equivalente
|
|
if ( IsCmdLog()) {
|
|
string sLua = "EgtVolZmapIntersPlane(" + IdToString( nId) + ",{" +
|
|
ToString( ORIG + plPlane.GetVersN() * plPlane.GetDist()) + "},{" +
|
|
ToString( plPlane.GetVersN()) + "},{" +
|
|
ToString( nDestGrpId) + "}," +
|
|
RefTypeToString( nRefType) + ")" +
|
|
" -- Id=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
|
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
|
}
|
|
// restituisco l'identificativo della prima nuova entità
|
|
return nFirstId ;
|
|
}
|
|
|
|
//----------------------------------------------------------------------------
|
|
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 ;
|
|
} |