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:
+48
-35
@@ -68,11 +68,11 @@ EgtChangeGroupFrame( int nId, const Frame3d& frNewRef, int nRefType)
|
||||
EgtSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtChangeGroupFrame(" + ToString( nId) + ",{" +
|
||||
string sLua = "EgtChangeGroupFrame(" + ToString( nId) + ",{{" +
|
||||
ToString( frNewRef.Orig()) + "},{" +
|
||||
ToString( frNewRef.VersX()) + "},{" +
|
||||
ToString( frNewRef.VersY()) + "},{" +
|
||||
ToString( frNewRef.VersZ()) + "}," +
|
||||
ToString( frNewRef.VersZ()) + "}}," +
|
||||
RefTypeToString( nRefType) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
@@ -182,81 +182,94 @@ __stdcall EgtMirrorText( int nId, BOOL bOnL)
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtExplodeText( int nId)
|
||||
int
|
||||
__stdcall EgtExplodeText( int nId, int* pnCount)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
bool bOk = true ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero il testo
|
||||
IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pTXT == nullptr)
|
||||
bOk = false ;
|
||||
bool bOk = ( pTXT != nullptr) ;
|
||||
// recupero l'outline del testo
|
||||
ICURVEPLIST lstPCRV ;
|
||||
bOk = bOk && pTXT->GetOutline( lstPCRV) ;
|
||||
// inserisco le curve nella stessa posizione del testo
|
||||
ICURVEPLIST::iterator iIter ;
|
||||
for ( iIter = lstPCRV.begin() ; iIter != lstPCRV.end() ; ++ iIter) {
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
int nCount = 0 ;
|
||||
for ( ICURVEPLIST::iterator iIter = lstPCRV.begin() ; iIter != lstPCRV.end() ; ++ iIter) {
|
||||
// inserisco la curva nello stesso gruppo e nello stesso posto del GeomDB
|
||||
int nCrvId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nId, GDB_BEFORE, (*iIter)) ;
|
||||
if ( nCrvId == GDB_ID_NULL)
|
||||
bOk = false ;
|
||||
bOk = bOk && ( nCrvId != GDB_ID_NULL) ;
|
||||
// copio gli attributi
|
||||
if ( ! pGeomDB->CopyAttributes( nId, nCrvId))
|
||||
bOk = false ;
|
||||
bOk = bOk && pGeomDB->CopyAttributes( nId, nCrvId) ;
|
||||
// aggiorno contatori
|
||||
if ( bOk) {
|
||||
if ( nFirstId == GDB_ID_NULL)
|
||||
nFirstId = nCrvId ;
|
||||
++ nCount ;
|
||||
}
|
||||
}
|
||||
nFirstId = ( bOk ? nFirstId : GDB_ID_NULL) ;
|
||||
// elimino il testo originale
|
||||
bOk = bOk && pGeomDB->Erase( nId) ;
|
||||
EgtSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtExplodeText(" + ToString( nId) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
" -- Id1=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return ( bOk ? TRUE : FALSE) ;
|
||||
// restituisco risultati
|
||||
if ( pnCount != nullptr)
|
||||
*pnCount = nCount ;
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtSplitText( int nId)
|
||||
int
|
||||
__stdcall EgtSplitText( int nId, int* pnCount)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, FALSE)
|
||||
bool bOk = true ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// recupero il testo
|
||||
IExtText* pTXT = GetExtText( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pTXT == nullptr)
|
||||
bOk = false ;
|
||||
bool bOk = ( pTXT != nullptr) ;
|
||||
// recupero l'esplosione del testo in linee singole
|
||||
IEXTTEXTPVECTOR vTxt ;
|
||||
bOk = bOk && pTXT->SplitOnLineBreak( vTxt) ;
|
||||
// inserisco i nuovi testi nella stessa posizione del testo
|
||||
for ( int i = 0 ; bOk && i < int( vTxt.size()) ; ++ i) {
|
||||
int nFirstId = GDB_ID_NULL ;
|
||||
int nCount = 0 ;
|
||||
for ( int i = 0 ; i < int( vTxt.size()) ; ++ i) {
|
||||
// inserimento
|
||||
int nCrvId = pGeomDB->InsertGeoObj( GDB_ID_NULL, nId, GDB_BEFORE, vTxt[i]) ;
|
||||
// se errore
|
||||
if ( nCrvId == GDB_ID_NULL) {
|
||||
delete vTxt[i] ;
|
||||
bOk = false ;
|
||||
int nCrvId = ( bOk ? pGeomDB->InsertGeoObj( GDB_ID_NULL, nId, GDB_BEFORE, vTxt[i]) : GDB_ID_NULL) ;
|
||||
if ( nCrvId != GDB_ID_NULL) {
|
||||
// copio gli attributi
|
||||
bOk = bOk && pGeomDB->CopyAttributes( nId, nCrvId) ;
|
||||
// aggiorno contatori
|
||||
if ( bOk) {
|
||||
if ( nFirstId == GDB_ID_NULL)
|
||||
nFirstId = nCrvId ;
|
||||
++ nCount ;
|
||||
}
|
||||
}
|
||||
// altrimenti copio gli attributi
|
||||
else {
|
||||
if ( ! pGeomDB->CopyAttributes( nId, nCrvId))
|
||||
bOk = false ;
|
||||
bOk = false ;
|
||||
delete vTxt[i] ;
|
||||
}
|
||||
}
|
||||
nFirstId = ( bOk ? nFirstId : GDB_ID_NULL) ;
|
||||
// elimino il testo originale
|
||||
bOk = bOk && pGeomDB->Erase( nId) ;
|
||||
EgtSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtSplitText(" + ToString( nId) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
" -- Id1=" + ToString( nFirstId) + ",Nbr=" + ToString( nCount) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return ( bOk ? TRUE : FALSE) ;
|
||||
// restituisco risultati
|
||||
if ( pnCount != nullptr)
|
||||
*pnCount = nCount ;
|
||||
return nFirstId ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user