From dbf5cf4e48da260896d822fc239b1fecac410fa8 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 21 Jan 2020 11:00:13 +0000 Subject: [PATCH] EgtExecutor : - migliorie a ExeAdjustFlatPartLayer per propagare le Info. --- EXE_GdbCreateCurve.cpp | 2 +- EXE_NstCreateFlatParts.cpp | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/EXE_GdbCreateCurve.cpp b/EXE_GdbCreateCurve.cpp index 06759a7..4a04cd7 100644 --- a/EXE_GdbCreateCurve.cpp +++ b/EXE_GdbCreateCurve.cpp @@ -1755,7 +1755,7 @@ MyCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds, ++ nCount ; // assegno nota con curve originali if ( ! bErase) - pGeomDB->SetInfo( nNewId, "ORIG", vOrig) ; + pGeomDB->SetInfo( nNewId, CRV_ORIG, vOrig) ; } // se ok e richiesta cancellazione curve originali if ( nFirstId != GDB_ID_NULL && bErase) { diff --git a/EXE_NstCreateFlatParts.cpp b/EXE_NstCreateFlatParts.cpp index e3883cd..f8d1734 100644 --- a/EXE_NstCreateFlatParts.cpp +++ b/EXE_NstCreateFlatParts.cpp @@ -1056,10 +1056,36 @@ ExeAdjustFlatPartLayer( int nLayerId) } nId = pGeomDB->GetNext( nId) ; } - if ( vAccwIds.size() > 1) - bOk = bOk && ExeCreateCurveCompoByReorder( nLayerId, vAccwIds, ORIG, true, RTY_GLOB, nullptr) != GDB_ID_NULL ; - if ( vAcwIds.size() > 1) - bOk = bOk && ExeCreateCurveCompoByReorder( nLayerId, vAcwIds, ORIG, true, RTY_GLOB, nullptr) != GDB_ID_NULL ; + if ( bOk && vAccwIds.size() > 1) { + int nCount = 0 ; + int nFirstId = ExeCreateCurveCompoByReorder( nLayerId, vAccwIds, ORIG, false, RTY_GLOB, &nCount) ; + for ( int i = 0 ; i < nCount ; ++ i) { + int nCurrId = nFirstId + i ; + INTVECTOR vOrigId ; + pGeomDB->GetInfo( nCurrId, CRV_ORIG, vOrigId) ; + for ( int j = 0 ; j < int( vOrigId.size()) ; ++ j) { + if ( j == 0) + pGeomDB->CopyAttributes( vOrigId[j], nCurrId) ; + pGeomDB->Erase( vOrigId[j]) ; + } + } + bOk = bOk && ( nCount > 0) ; + } + if ( bOk && vAcwIds.size() > 1) { + int nCount = 0 ; + int nFirstId = ExeCreateCurveCompoByReorder( nLayerId, vAcwIds, ORIG, false, RTY_GLOB, &nCount) ; + for ( int i = 0 ; i < nCount ; ++ i) { + int nCurrId = nFirstId + i ; + INTVECTOR vOrigId ; + pGeomDB->GetInfo( nCurrId, CRV_ORIG, vOrigId) ; + for ( int j = 0 ; j < int( vOrigId.size()) ; ++ j) { + if ( j == 0) + pGeomDB->CopyAttributes( vOrigId[j], nCurrId) ; + pGeomDB->Erase( vOrigId[j]) ; + } + } + bOk = bOk && ( nCount > 0) ; + } // spezzo le curve composite con discontinuitą nId = pGeomDB->GetFirstInGroup( nLayerId) ; while ( nId != GDB_ID_NULL && bOk) {