EgtInterface 1.5j7 :

- migliorate API per modifica e snap
This commit is contained in:
Dario Sassi
2014-11-05 17:03:47 +00:00
parent e4d952bf32
commit 0e648470ed
12 changed files with 916 additions and 543 deletions
+39 -2
View File
@@ -236,9 +236,46 @@ __stdcall EgtSetColor( int nId, const int ObjCol[4])
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// assegno il colore
// sistemo il colore
Color cCol( ObjCol) ;
return ( pGeomDB->SetMaterial( nId, cCol) ? TRUE : FALSE) ;
// assegno il colore a un singolo oggetto
if ( nId != GDB_ID_SEL) {
return ( pGeomDB->SetMaterial( nId, cCol) ? TRUE : FALSE) ;
}
// assegno il colore ai selezionati
else {
bool bOk = true ;
int nI = pGeomDB->GetFirstSelectedObj() ;
while ( nI != GDB_ID_NULL && bOk) {
if ( ! pGeomDB->SetMaterial( nI, cCol))
bOk = false ;
nI = pGeomDB->GetNextSelectedObj() ;
}
return ( bOk ? TRUE : FALSE) ;
}
}
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtResetColor( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, FALSE)
// tolgo il colore a un singolo oggetto
if ( nId != GDB_ID_SEL) {
return ( pGeomDB->SetMaterial( nId, GDB_MT_PARENT) ? TRUE : FALSE) ;
}
// tolgo il colore ai selezionati
else {
bool bOk = true ;
int nI = pGeomDB->GetFirstSelectedObj() ;
while ( nI != GDB_ID_NULL && bOk) {
if ( ! pGeomDB->SetMaterial( nI, GDB_MT_PARENT))
bOk = false ;
nI = pGeomDB->GetNextSelectedObj() ;
}
return ( bOk ? TRUE : FALSE) ;
}
}
//-----------------------------------------------------------------------------