EgtInterface 1.6b6 :

- aggiornamenti vari
- introdotto comando per merge (cucitura) di superfici
- migliorata gestione oggetti selezionati in comandi.
This commit is contained in:
Dario Sassi
2015-03-11 09:06:35 +00:00
parent 5e3c729190
commit b0389f3fda
28 changed files with 1168 additions and 614 deletions
+24 -18
View File
@@ -34,38 +34,44 @@ using namespace std ;
//----------------------------------------------------------------------------
BOOL
__stdcall EgtInvertCurve( int nId)
{
INTVECTOR vIds ;
vIds.push_back( nId) ;
return ( EgtInvertCurve( vIds) ? TRUE : FALSE) ;
}
//----------------------------------------------------------------------------
bool
EgtInvertCurve( const INTVECTOR& vIds)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
VERIFY_GEOMDB( pGeomDB, false)
// eseguo inversione
bool bOk = true ;
// eseguo inversione singola
if ( nId != GDB_ID_SEL) {
// recupero la curva e la inverto
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve != nullptr && ! pCurve->Invert())
bOk = false ;
}
// eseguo inversione dei selezionati
else {
int nI = pGeomDB->GetFirstSelectedObj() ;
while ( nI != GDB_ID_NULL && bOk) {
for ( size_t i = 0 ; i < vIds.size() && bOk ; ++ i) {
int nId = (( vIds[i] != GDB_ID_SEL) ? vIds[i] : pGeomDB->GetFirstSelectedObj()) ;
while ( nId != GDB_ID_NULL && bOk) {
// recupero la curva e la inverto
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nI)) ;
ICurve* pCurve = GetCurve( pGeomDB->GetGeoObj( nId)) ;
if ( pCurve != nullptr && ! pCurve->Invert())
bOk = false ;
// passo alla successiva
nI = pGeomDB->GetNextSelectedObj() ;
nId = (( vIds[i] != GDB_ID_SEL) ? GDB_ID_NULL : pGeomDB->GetNextSelectedObj()) ;
}
}
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtInvertCurve(" + ( nId != GDB_ID_SEL ? ToString( nId): "GDB_ID_SEL") + ")" +
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 = "EgtInvertCurve({" + sIds + "})" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
return bOk ;
}
//----------------------------------------------------------------------------
@@ -203,7 +209,7 @@ __stdcall EgtModifyCurveExtrusion( int nId, const double vtExtr[3], int nRefType
//----------------------------------------------------------------------------
bool
EgtModifyCurveExtrusion( INTVECTOR& vIds, const Vector3d& vtExtr, int nRefType)
EgtModifyCurveExtrusion( const INTVECTOR& vIds, const Vector3d& vtExtr, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -285,7 +291,7 @@ __stdcall EgtModifyCurveThickness( int nId, double dThick)
//----------------------------------------------------------------------------
bool
EgtModifyCurveThickness( INTVECTOR& vIds, double dThick)
EgtModifyCurveThickness( const INTVECTOR& vIds, double dThick)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)