EgtInterface 1.6d2 :
- in Lua in tutte le operazioni con creazione di più entità restituisco Id prima e numero - in Lua aggiunto oggetto BBox3d (non ancora con tutte le funzionalità) - in Lua aggiunta creazione superficie da BBox3d - in Lua aggiunte funzioni per avere BBox3d di oggetti - in Lua aggiunta OutBox - in Lua aggiunte funzioni per MachMgr.
This commit is contained in:
+14
-17
@@ -1449,14 +1449,8 @@ EgtCreateCurveCompo( int nParentId, const INTVECTOR& vIds, bool bErase)
|
||||
int nId = MyCreateCurveCompo( nParentId, vIds, bErase) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sIds ;
|
||||
for ( size_t i = 0 ; i < vIds.size() ; ++ i) {
|
||||
if ( i > 0)
|
||||
sIds += "," ;
|
||||
sIds += ToString( vIds[i]) ;
|
||||
}
|
||||
string sLua = "EgtCurveCompo(" + ToString( nParentId) + ",{" +
|
||||
sIds + "}," +
|
||||
IdListToString( vIds) + "}," +
|
||||
( bErase ? "true" : "false") + ")" +
|
||||
" -- Id=" + ToString( nId) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
@@ -1475,13 +1469,13 @@ __stdcall EgtCreateCurveCompoByChain( int nParentId, int nNumId, const int nIds[
|
||||
for ( int i = 0 ; i < nNumId ; ++i) {
|
||||
vIds.push_back( nIds[i]) ;
|
||||
}
|
||||
return EgtCreateCurveCompoByChain( nParentId, vIds, ptNear, ( bErase != FALSE), nRefType) ;
|
||||
return EgtCreateCurveCompoByChain( nParentId, vIds, ptNear, ( bErase != FALSE), nRefType, nullptr) ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
MyCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds,
|
||||
const Point3d& ptNear, bool bErase, int nRefType)
|
||||
const Point3d& ptNear, bool bErase, int nRefType, int* pnCount)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
@@ -1525,6 +1519,7 @@ MyCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds,
|
||||
}
|
||||
// recupero i percorsi concatenati
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
int nCount = 0 ;
|
||||
Point3d ptNearL = GetPointLocal( pGeomDB, ptNear.v, nRefType, frDest) ;
|
||||
INTVECTOR vId2s ;
|
||||
while ( chainC.GetChainFromNear( ptNearL, false, vId2s)) {
|
||||
@@ -1581,6 +1576,7 @@ MyCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds,
|
||||
return GDB_ID_NULL ;
|
||||
if ( nFirstId == GDB_ID_NULL)
|
||||
nFirstId = nNewId ;
|
||||
++ nCount ;
|
||||
}
|
||||
// se richiesto e ok, cancello le curve originali
|
||||
if ( bErase && nFirstId != GDB_ID_NULL) {
|
||||
@@ -1594,29 +1590,30 @@ MyCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds,
|
||||
}
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
if ( pnCount != nullptr)
|
||||
*pnCount = nCount ;
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
int
|
||||
EgtCreateCurveCompoByChain( int nParentId, const INTVECTOR& vIds,
|
||||
const Point3d& ptNear, bool bErase, int nRefType)
|
||||
const Point3d& ptNear, bool bErase, int nRefType, int* pnCount)
|
||||
{
|
||||
// eseguo
|
||||
int nFirstId = MyCreateCurveCompoByChain( nParentId, vIds, ptNear, bErase, nRefType) ;
|
||||
int nCount = 0 ;
|
||||
int nFirstId = MyCreateCurveCompoByChain( nParentId, vIds, ptNear, bErase, nRefType, &nCount) ;
|
||||
if ( pnCount != nullptr)
|
||||
*pnCount = nCount ;
|
||||
EgtSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sIds ;
|
||||
for ( size_t i = 0 ; i < vIds.size() ; ++ i)
|
||||
sIds += ( vIds[i] != GDB_ID_SEL ? ToString( vIds[i]) : "GDB_ID_SEL") + "," ;
|
||||
sIds.pop_back() ;
|
||||
string sLua = "EgtCurveCompoByChain(" + ToString( nParentId) + ",{" +
|
||||
sIds + "},{" +
|
||||
IdListToString( vIds) + "},{" +
|
||||
ToString( ptNear) + "}," +
|
||||
( bErase ? "true" : "false") + "," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Id=" + ToString( nFirstId) ;
|
||||
" -- Id=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della prima nuova entità
|
||||
|
||||
Reference in New Issue
Block a user