EgtGraphics 1.5j6 :
- aggiunta gestione griglia.
This commit is contained in:
+25
-4
@@ -52,8 +52,8 @@ Scene::Scene( void)
|
||||
m_nViewportW = 0 ;
|
||||
m_nViewportH = 0 ;
|
||||
// Sfondo
|
||||
m_colBackTop.Set( 128, 128, 128) ;
|
||||
m_colBackBottom.Set( 128, 128, 128) ;
|
||||
m_colBackTop.Set( 176, 176, 176) ;
|
||||
m_colBackBottom.Set( 176, 176, 176) ;
|
||||
// Modalità di visualizzazione
|
||||
m_nShowMode = SM_WIREFRAME ;
|
||||
// Selezione
|
||||
@@ -67,6 +67,16 @@ Scene::Scene( void)
|
||||
// Extension
|
||||
SetExtension( BBox3d( -MIN_EXTENSION, -MIN_EXTENSION, -MIN_EXTENSION,
|
||||
MIN_EXTENSION, MIN_EXTENSION, MIN_EXTENSION)) ;
|
||||
// Grid
|
||||
m_bShowGrid = false ;
|
||||
m_bShowFrame = false ;
|
||||
m_frGrid = GLOB_FRM ;
|
||||
m_dSnapStep = 1 ;
|
||||
m_nMinLineSstep = 10 ;
|
||||
m_nMajLineSstep = 100 ;
|
||||
m_nExtSstep = 500 ;
|
||||
m_colMinLine.Set( 160, 160, 160) ;
|
||||
m_colMajLine.Set( 160, 160, 160) ;
|
||||
// Direct
|
||||
m_colorGL.Set( 255, 0, 0) ;
|
||||
m_bGeoLine = false ;
|
||||
@@ -649,6 +659,10 @@ Scene::Draw( void)
|
||||
glDepthFunc( GL_LEQUAL) ;
|
||||
glEnable( GL_DEPTH_TEST) ;
|
||||
|
||||
// disegno griglia
|
||||
glDisable( GL_LIGHTING) ;
|
||||
DrawGrid() ;
|
||||
|
||||
// aggiorno il colore di default
|
||||
if ( m_pGeomDB != nullptr)
|
||||
m_pGeomDB->GetDefaultMaterial( m_colDef) ;
|
||||
@@ -761,10 +775,17 @@ Scene::Select( const Point3d& ptSelCenter, int nW, int nH, int& nSel)
|
||||
// inizializzo selezione
|
||||
m_bSelect = true ;
|
||||
m_ptSelCent = ptSelCenter ;
|
||||
m_nSelW = nW ;
|
||||
m_nSelH = nH ;
|
||||
m_nSelW = abs( nW) ;
|
||||
m_nSelH = abs( nH) ;
|
||||
m_nSelNbr = 0 ;
|
||||
|
||||
// se una delle due dimensioni è nulla, non posso selezionare alcunché
|
||||
if ( m_nSelW == 0 || m_nSelH == 0) {
|
||||
m_bSelect = false ;
|
||||
nSel = m_nSelNbr ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
// sfondo e Zbuffer non interessano
|
||||
|
||||
// imposto la camera, riducendo la viewport all'area di selezione
|
||||
|
||||
Reference in New Issue
Block a user