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:
Dario Sassi
2014-03-18 08:49:25 +00:00
parent e2c8e72e22
commit dedb4f23cf
14 changed files with 252 additions and 87 deletions
+63 -6
View File
@@ -439,20 +439,58 @@ GdbObj::GetCalcStatus( int& nStat, int nLev) const
//----------------------------------------------------------------------------
bool
GdbObj::SetColor( Color cCol)
GdbObj::SetMaterial( int nMat)
{
// per ora ammesso solo da padre (da colore si imposta con la SetColor)
if ( nMat != GDB_MT_PARENT)
return false ;
// verifico esistenza (con eventuale creazione) degli attributi
if ( GetSafeAttribs() == nullptr)
return false ;
// assegno il colore
m_pAttribs->SetColor( cCol) ;
// assegno il materiale
m_pAttribs->SetMaterial( nMat) ;
// notifico l'oggetto vero
OnSetMaterial() ;
return true ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetColor( Color& cCol) const
GdbObj::SetMaterial( Color cCol)
{
// verifico esistenza (con eventuale creazione) degli attributi
if ( GetSafeAttribs() == nullptr)
return false ;
// assegno il colore (e imposto il materiale da colore)
m_pAttribs->SetColor( cCol) ;
// notifico l'oggetto vero
OnSetMaterial() ;
return true ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetMaterial( int& nMat) const
{
// se non ci sono attributi
if ( m_pAttribs == nullptr)
return false ;
// il materiale è definito
nMat = m_pAttribs->GetMaterial() ;
return true ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetMaterial( Color& cCol) const
{
// se non ci sono attributi o ci si deve riferire al padre
if ( m_pAttribs == nullptr ||
@@ -466,13 +504,32 @@ GdbObj::GetColor( Color& cCol) const
//----------------------------------------------------------------------------
bool
GdbObj::GetCalcColor( Color& cCol) const
GdbObj::GetCalcMaterial( int& nMat) const
{
// se non ci sono attributi o ci si deve riferire al padre
if ( m_pAttribs == nullptr ||
m_pAttribs->GetMaterial() == GDB_MT_PARENT) {
if ( GetParent() != nullptr)
GetParent()->GetCalcColor( cCol) ;
GetParent()->GetCalcMaterial( nMat) ;
else
nMat = GDB_MT_COLOR ;
return true ;
}
// il materiale è definito
nMat = m_pAttribs->GetMaterial() ;
return true ;
}
//----------------------------------------------------------------------------
bool
GdbObj::GetCalcMaterial( Color& cCol) const
{
// se non ci sono attributi o ci si deve riferire al padre
if ( m_pAttribs == nullptr ||
m_pAttribs->GetMaterial() == GDB_MT_PARENT) {
if ( GetParent() != nullptr)
GetParent()->GetCalcMaterial( cCol) ;
else
cCol.Set() ;
return true ;