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
-6
@@ -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 ;
|
||||
|
||||
Reference in New Issue
Block a user