EgtExecutor 1.6n1 :
- aggiunta ExeVerifyCutAsSplitting - aggiunta LuaVerifyMachining.
This commit is contained in:
+6
-80
@@ -16,6 +16,7 @@
|
||||
#include "EXE.h"
|
||||
#include "EXE_Const.h"
|
||||
#include "EXE_Macro.h"
|
||||
#include "EXE_Nst.h"
|
||||
#include "/EgtDev/Include/EXeExecutor.h"
|
||||
#include "/EgtDev/Include/EXeConst.h"
|
||||
#include "/EgtDev/Include/EGkCurveLine.h"
|
||||
@@ -25,7 +26,6 @@
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EMkMachiningGeoConst.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
#include <functional>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -44,7 +44,7 @@ struct SCollInfoEx : public SCollInfo
|
||||
} ;
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
int
|
||||
GetFlatPartRegion( IGeomDB* pGeomDB, int nId)
|
||||
{
|
||||
// recupero regione del pezzo (è la prima del sottogruppo di nome Region)
|
||||
@@ -59,7 +59,7 @@ GetFlatPartRegion( IGeomDB* pGeomDB, int nId)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static bool
|
||||
bool
|
||||
GetFlatPartCutRegions( IGeomDB* pGeomDB, int nId, bool bReduced, INTVECTOR& vCrId)
|
||||
{
|
||||
// recupero gruppo preview lavorazioni del pezzo
|
||||
@@ -84,7 +84,7 @@ GetFlatPartCutRegions( IGeomDB* pGeomDB, int nId, bool bReduced, INTVECTOR& vCrI
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
int
|
||||
GetFlatPartFromRegion( IGeomDB* pGeomDB, int nId)
|
||||
{
|
||||
// verifico che il layer di appartenenza sia una regione
|
||||
@@ -97,7 +97,7 @@ GetFlatPartFromRegion( IGeomDB* pGeomDB, int nId)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
int
|
||||
GetFlatPartFromCut( IGeomDB* pGeomDB, int nId)
|
||||
{
|
||||
// verifico appartenga al gruppo PreView (padre di padre di padre)
|
||||
@@ -110,7 +110,7 @@ GetFlatPartFromCut( IGeomDB* pGeomDB, int nId)
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
int
|
||||
GetGeometryFromCut( IGeomDB* pGeomDB, IMachMgr* pMachMgr, int nId)
|
||||
{
|
||||
// verifico appartenga ad una lavorazione
|
||||
@@ -1236,77 +1236,3 @@ ExeGetPartClusterCenterGlob( const INTVECTOR& vIds, Point3d& ptCen)
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeVerifyMachining( int nMchId, bool bReduced, int nRawId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
|
||||
// Flag per calcolo box
|
||||
const int BBF_MY_FLAG = BBF_ONLY_VISIBLE | BBF_IGNORE_TEXT | BBF_IGNORE_DIM ;
|
||||
|
||||
// Recupero il box e le regioni della lavorazione
|
||||
BBox3d b3Mch ;
|
||||
INTVECTOR vMchReg ;
|
||||
// recupero gruppo preview lavorazioni nella lavorazione
|
||||
int nPVGrp = pGeomDB->GetFirstNameInGroup( nMchId, MCH_PV) ;
|
||||
if ( nPVGrp == GDB_ID_NULL)
|
||||
return false ;
|
||||
// se vuoto, cerco il rimando al preview nel pezzo
|
||||
if ( pGeomDB->GetGroupObjs( nPVGrp) == 0 &&
|
||||
! pGeomDB->GetInfo( nPVGrp, "PvId", nPVGrp))
|
||||
return false ;
|
||||
// ciclo sui percorsi utensile (CL)
|
||||
int nClId = pGeomDB->GetFirstGroupInGroup( nPVGrp) ;
|
||||
while ( nClId != GDB_ID_NULL) {
|
||||
int nCrId = pGeomDB->GetFirstNameInGroup( nClId, ( bReduced ? MCH_PV_RRCUT : MCH_PV_RCUT)) ;
|
||||
while ( nCrId != GDB_ID_NULL) {
|
||||
BBox3d b3Reg ;
|
||||
if ( ! pGeomDB->GetGlobalBBox( nCrId, b3Reg, BBF_MY_FLAG))
|
||||
return false ;
|
||||
b3Mch.Add( b3Reg) ;
|
||||
vMchReg.emplace_back( nCrId) ;
|
||||
nCrId = pGeomDB->GetNextName( nCrId, ( bReduced ? MCH_PV_RRCUT : MCH_PV_RCUT)) ;
|
||||
}
|
||||
nClId = pGeomDB->GetNextGroup( nClId) ;
|
||||
}
|
||||
|
||||
// Recupero il pezzo cui è associata la lavorazione
|
||||
int nMchPartId = GDB_ID_NULL ;
|
||||
SELVECTOR vIds ;
|
||||
if ( ExeSetCurrMachining( nMchId) && ExeGetMachiningGeometry( vIds) && ! vIds.empty())
|
||||
nMchPartId = pGeomDB->GetParentId( pGeomDB->GetParentId( vIds[0].nId)) ;
|
||||
|
||||
// Determino le regioni di tutti gli altri pezzi compresi nella regione della lavorazione
|
||||
INTVECTOR vOthReg ;
|
||||
int nId = ExeGetFirstGroupInGroup( nRawId) ;
|
||||
while ( nId != GDB_ID_NULL) {
|
||||
if ( nId != nMchPartId) {
|
||||
BBox3d b3Part ;
|
||||
if ( pGeomDB->GetGlobalBBox( nId, b3Part, BBF_MY_FLAG) &&
|
||||
b3Mch.OverlapsXY( b3Part)) {
|
||||
// recupero regione del pezzo
|
||||
int nRegId = GetFlatPartRegion( pGeomDB, nId) ;
|
||||
if ( nRegId != GDB_ID_NULL)
|
||||
vOthReg.emplace_back( nRegId) ;
|
||||
else
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
nId = ExeGetNextGroup( nId) ;
|
||||
}
|
||||
|
||||
// Eseguo verifiche
|
||||
bool bOk = true ;
|
||||
// confronto la regione della lavorazione con le regioni degli altri pezzi
|
||||
for ( int nMchRegId : vMchReg) {
|
||||
for ( int nOthRegId : vOthReg) {
|
||||
if ( ExeSurfFrChunkSimpleClassify( nMchRegId, 0, nOthRegId, 0) != REGC_OUT)
|
||||
bOk = false ;
|
||||
}
|
||||
}
|
||||
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user