EgtGraphics 1.5c8 :
- gestione stato Mark con disegno alone attorno ad oggetto - modifiche ad esecutore.
This commit is contained in:
+34
-2
@@ -133,11 +133,15 @@ ObjNewGraphics::AddPolyLine( const PolyLine& PL)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
ObjNewGraphics::Draw( int nStat)
|
||||
ObjNewGraphics::Draw( int nStat, int nMark)
|
||||
{
|
||||
if ( m_pScene == nullptr || ! m_pScene->MakeCurrent())
|
||||
return false ;
|
||||
|
||||
// se vuoto non faccio alcunché
|
||||
if ( m_ngaList.size() == 0)
|
||||
return true ;
|
||||
|
||||
// gestione stato di visualizzazione
|
||||
if ( nStat == GDB_ST_OFF)
|
||||
return true ;
|
||||
@@ -163,8 +167,36 @@ ObjNewGraphics::Draw( int nStat)
|
||||
}
|
||||
}
|
||||
|
||||
// se marcato, disegno halo
|
||||
if ( nMark == GDB_MK_ON) {
|
||||
// dimensioni per halo
|
||||
glPointSize( 7) ;
|
||||
glLineWidth( 5) ;
|
||||
|
||||
// colore di marcatura
|
||||
Color colMark = ( ( GetScene() != nullptr) ? GetScene()->GetMark() : Color( 192, 192, 0)) ;
|
||||
glColor4f( colMark.GetRed(), colMark.GetGreen(), colMark.GetBlue(), colMark.GetAlpha()) ;
|
||||
|
||||
// ciclo di disegno
|
||||
NGALIST::iterator iIter ;
|
||||
for ( iIter = m_ngaList.begin() ; iIter != m_ngaList.end() ; ++ iIter) {
|
||||
switch ( iIter->m_nType) {
|
||||
case NewGrAtom::VERTS :
|
||||
if ( iIter->m_nCount > 0 && iIter->m_nVaoId != 0) {
|
||||
glBindVertexArray( iIter->m_nVaoId) ;
|
||||
glDrawArrays( iIter->m_nMode, 0, iIter->m_nCount) ;
|
||||
glBindVertexArray( 0) ;
|
||||
}
|
||||
break ;
|
||||
case NewGrAtom::COLOR :
|
||||
// si usa il colore di marcatura
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// se necessario, ripristino la normale visualizzazione
|
||||
if ( nStat == GDB_ST_SEL) {
|
||||
if ( nStat == GDB_ST_SEL || nMark == GDB_MK_ON) {
|
||||
glPointSize( 3) ;
|
||||
glLineWidth( 1) ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user