EgtInterface 1.5j7 :
- migliorate API per modifica e snap
This commit is contained in:
+39
-2
@@ -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) ;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user