EgtGraphics 1.5c5 :

- nel disegno si tiene conto dello stato dell'oggetto (ON, SEL, OFF)
- gli oggetti selezionati vengono evidenziati.
This commit is contained in:
Dario Sassi
2014-03-14 18:40:18 +00:00
parent 46df22d5ed
commit ec813123d0
9 changed files with 73 additions and 27 deletions
+19 -1
View File
@@ -17,7 +17,11 @@
#include "Scene.h"
#include "GraphObjs.h"
#include "/EgtDev/Include/EGkPolyLine.h"
#include "/EgtDev/Include/EGkGdbConst.h"
//--------------------------- Macro ------------------------------------------
// Per funzioni glew dipendenti dal context
#define glewGetContext() (( m_pScene != nullptr) ? m_pScene->glewGetContext() : nullptr)
@@ -129,11 +133,19 @@ ObjNewGraphics::AddPolyLine( const PolyLine& PL)
//----------------------------------------------------------------------------
bool
ObjNewGraphics::Draw( void)
ObjNewGraphics::Draw( int nStat)
{
if ( m_pScene == nullptr || ! m_pScene->MakeCurrent())
return false ;
// gestione stato di visualizzazione
if ( nStat == GDB_ST_OFF)
return true ;
if ( nStat == GDB_ST_SEL) {
glPointSize( 5) ;
glLineWidth( 3) ;
}
// ciclo di disegno
NGALIST::iterator iIter ;
for ( iIter = m_ngaList.begin() ; iIter != m_ngaList.end() ; ++ iIter) {
@@ -151,6 +163,12 @@ ObjNewGraphics::Draw( void)
}
}
// se necessario, ripristino la normale visualizzazione
if ( nStat == GDB_ST_SEL) {
glPointSize( 3) ;
glLineWidth( 1) ;
}
return true ;
}