EgtGraphics :

- migliorie alle precedenti modifiche.
This commit is contained in:
Dario Sassi
2020-11-23 11:45:13 +00:00
parent 3a8cdff937
commit 12ee38faad
9 changed files with 23 additions and 22 deletions
+9 -9
View File
@@ -628,20 +628,20 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
bShowAux = true ;
// verifico se oggetto con superficie
bool bSurf = ( nGeoType & ( GEO_SURF | GEO_VOLUME)) != 0 ||
( nGeoType == EXT_TEXT && m_nShowText == TXT_FILL && GetExtText( pGeoObj)->GetAuxSurf() != nullptr) ;
bool bSurf = (( nGeoType & ( GEO_SURF | GEO_VOLUME)) != 0) ;
bool bGenSurf = ( bSurf || ( nGeoType == EXT_TEXT && m_nShowText == TXT_FILL && GetExtText( pGeoObj)->GetAuxSurf() != nullptr)) ;
// recupero il valore di opacità (solo per le superfici e i solidi può esserci trasparenza)
int nAlpha = siObj.colObj.GetIntAlpha() ;
// salto in ogni caso le superfici e i solidi completamente trasparenti
if ( nAlpha == 0 && bSurf)
if ( nAlpha == 0 && bGenSurf)
return true ;
// se hiddenline e non selezione
if ( m_nShowMode == SM_HIDDENLINE && ! m_bSelect) {
// in prima passata disegno solo le superfici opache
if ( nPass == 1 && ( ! bSurf || nAlpha <= ALPHA_LIM))
if ( nPass == 1 && ( ! bGenSurf || nAlpha <= ALPHA_LIM))
return true ;
}
@@ -650,7 +650,7 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
if ( m_nShowMode == SM_SHADING && ! m_bSelect) {
// in prima passata disegno solo le superfici opache e metto in un vettore quelle semitrasparenti
if ( nPass == 1) {
if ( ! bSurf)
if ( ! bGenSurf)
return true ;
else {
if ( nAlpha > ALPHA_LIM)
@@ -667,13 +667,13 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
b3Box.ToGlob( frModView) ;
// inserisco i dati nel vettore
m_vAlphaSurf.emplace_back( frModView, pGraphics, siObj.nStat, siObj.nMark,
nAlpha, bShowAux, b3Box.GetMin().z, b3Box.GetMax().z) ;
bSurf, nAlpha, bShowAux, b3Box.GetMin().z, b3Box.GetMax().z) ;
return true ;
}
}
}
// in seconda passata disegno solo dimensioni 0 e curve
if ( nPass == 2 && bSurf)
if ( nPass == 2 && bGenSurf)
return true ;
}
@@ -726,7 +726,7 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj)
}
// eseguo visualizzazione
bool bOk = pGraphics->Draw( siObj.nStat, siObj.nMark, bSurfSha, nAlpha, bShowAux) ;
bool bOk = pGraphics->Draw( siObj.nStat, siObj.nMark, bSurfSha, bSurf, nAlpha, bShowAux) ;
// disabilito textures
glDisable( GL_TEXTURE_GEN_S) ;
@@ -753,7 +753,7 @@ Scene::DrawAlphaSurfVector( void)
glLoadMatrixd( Matrix) ;
// eseguo visualizzazione
bool bOk = AlphaSurf.pGraph->Draw( AlphaSurf.nStat, AlphaSurf.nMark, true,
AlphaSurf.nAlpha, AlphaSurf.bShowAux) ;
AlphaSurf.bSurf, AlphaSurf.nAlpha, AlphaSurf.bShowAux) ;
// ripristino matrice
glPopMatrix() ;
// in caso di errore, esco