EgtGeomKernel 1.5c7 :
- migliorata gestione materiale (colore ora caso speciale) - si invalida rappresentazione grafica alla modifica del materiale - spostato comando COUNTER di TSC in EgtGeneral.
This commit is contained in:
+63
-24
@@ -37,7 +37,7 @@ CreateGeomDB( void)
|
||||
GeomDB::GeomDB( void)
|
||||
{
|
||||
m_GrpRadix.m_nId = GDB_ID_ROOT ;
|
||||
m_GrpRadix.SetColor( Color()) ;
|
||||
m_GrpRadix.SetMaterial( Color()) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -52,8 +52,8 @@ GeomDB::Init( void)
|
||||
{
|
||||
// imposto numero minimo buckets del map degli Id
|
||||
m_IdManager.Init( 1024) ;
|
||||
// imposto colore di default
|
||||
m_GrpRadix.SetColor( Color()) ;
|
||||
// imposto materiale di default
|
||||
m_GrpRadix.SetMaterial( Color()) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
@@ -128,8 +128,8 @@ GeomDB::LoadHeader( Scanner& TheScanner)
|
||||
// recupero la linea
|
||||
if ( ! TheScanner.GetLine( sLine))
|
||||
return false ;
|
||||
// deve essere il colore di default
|
||||
if ( sLine != "COL_DEF")
|
||||
// deve essere il materiale di default
|
||||
if ( sLine != "MAT_DEF")
|
||||
return false ;
|
||||
// recupero la riga successiva
|
||||
if ( ! TheScanner.GetLine( sLine))
|
||||
@@ -140,7 +140,7 @@ GeomDB::LoadHeader( Scanner& TheScanner)
|
||||
// 4 parametri
|
||||
if ( vsParams.size() != 4)
|
||||
return false ;
|
||||
// leggo il colore
|
||||
// leggo il materiale come colore
|
||||
int nRed ;
|
||||
if ( ! FromString( vsParams[0], nRed))
|
||||
return false ;
|
||||
@@ -154,7 +154,7 @@ GeomDB::LoadHeader( Scanner& TheScanner)
|
||||
if ( ! FromString( vsParams[3], nAlpha))
|
||||
return false ;
|
||||
Color colDef( nRed, nGreen, nBlue, nAlpha) ;
|
||||
return SetDefaultColor( colDef) ;
|
||||
return SetDefaultMaterial( colDef) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -247,12 +247,12 @@ GeomDB::SaveHeader( ostream& osOut) const
|
||||
{
|
||||
// intestazione
|
||||
osOut << "START" << endl ;
|
||||
osOut << "GeomDB,1.5.3.5;" << endl ;
|
||||
osOut << "GeomDB,1.5.3.7;" << endl ;
|
||||
|
||||
// colore di default
|
||||
osOut << "COL_DEF" << endl ;
|
||||
// materiale di default come colore
|
||||
osOut << "MAT_DEF" << endl ;
|
||||
Color colDef( 0, 0, 0, 0) ;
|
||||
GetDefaultColor( colDef) ;
|
||||
GetDefaultMaterial( colDef) ;
|
||||
osOut << ToString( colDef.GetIntRed()) ;
|
||||
osOut << "," << ToString( colDef.GetIntGreen()) ;
|
||||
osOut << "," << ToString( colDef.GetIntBlue()) ;
|
||||
@@ -946,7 +946,7 @@ GeomDB::GetCalcStatus( int nId, int& nStat) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::SetDefaultColor( Color cCol)
|
||||
GeomDB::SetDefaultMaterial( Color cCol)
|
||||
{
|
||||
// recupero l'oggetto
|
||||
GdbObj* pGdbObj ;
|
||||
@@ -954,12 +954,12 @@ GeomDB::SetDefaultColor( Color cCol)
|
||||
return false ;
|
||||
|
||||
// assegno il colore
|
||||
return pGdbObj->SetColor( cCol) ;
|
||||
return pGdbObj->SetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetDefaultColor( Color& cCol) const
|
||||
GeomDB::GetDefaultMaterial( Color& cCol) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
@@ -967,46 +967,85 @@ GeomDB::GetDefaultColor( Color& cCol) const
|
||||
return false ;
|
||||
|
||||
// recupero il colore
|
||||
return pGdbObj->GetColor( cCol) ;
|
||||
return pGdbObj->GetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::SetColor( int nId, Color cCol)
|
||||
GeomDB::SetMaterial( int nId, int nMat)
|
||||
{
|
||||
// recupero l'oggetto
|
||||
GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// assegno il colore
|
||||
return pGdbObj->SetColor( cCol) ;
|
||||
// assegno il materiale tramite indice
|
||||
return pGdbObj->SetMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetColor( int nId, Color& cCol) const
|
||||
GeomDB::SetMaterial( int nId, Color cCol)
|
||||
{
|
||||
// recupero l'oggetto
|
||||
GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// assegno il materiale tramite colore
|
||||
return pGdbObj->SetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetMaterial( int nId, int& nMat) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore
|
||||
return pGdbObj->GetColor( cCol) ;
|
||||
// recupero l'indice del materiale
|
||||
return pGdbObj->GetMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetCalcColor( int nId, Color& cCol) const
|
||||
GeomDB::GetMaterial( int nId, Color& cCol) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore calcolato
|
||||
return pGdbObj->GetCalcColor( cCol) ;
|
||||
// recupero il colore del materiale
|
||||
return pGdbObj->GetMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetCalcMaterial( int nId, int& nMat) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero l'indice del materiale calcolato
|
||||
return pGdbObj->GetCalcMaterial( nMat) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::GetCalcMaterial( int nId, Color& cCol) const
|
||||
{
|
||||
// recupero l'oggetto
|
||||
const GdbObj* pGdbObj ;
|
||||
if ( ( pGdbObj = (const_cast<GeomDB*>(this))->GetGdbObj( nId)) == nullptr)
|
||||
return false ;
|
||||
|
||||
// recupero il colore del materiale calcolato
|
||||
return pGdbObj->GetCalcMaterial( cCol) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user