EgtInterface 1.6b6 :
- aggiornamenti vari - introdotto comando per merge (cucitura) di superfici - migliorata gestione oggetti selezionati in comandi.
This commit is contained in:
+24
-18
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user