diff --git a/EgtGraphics.rc b/EgtGraphics.rc index e60fd05..bbc3e2b 100644 Binary files a/EgtGraphics.rc and b/EgtGraphics.rc differ diff --git a/SceneGeom.cpp b/SceneGeom.cpp index c45fe9f..9877f84 100644 --- a/SceneGeom.cpp +++ b/SceneGeom.cpp @@ -164,6 +164,9 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj) return false ; int nGeoType = pGeoObj->GetType() ; + // recupero eventuale parte custom + const IUserObj* pUserObj = iIter.GetUserObj() ; + // se non esiste grafica associata, la creo if ( pGeoObj->GetObjGraphics() == nullptr) { // nuova modalità grafica solo per superfici con molti triangoli @@ -315,15 +318,22 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, const MdStMkCol& siObj) pTXT->ApproxWithLines( 0.01, 5, lstPL) ; pGraphics->Clear() ; pGraphics->AddColor( siObj.colObj) ; - POLYLINELIST::iterator Iter ; - for ( Iter = lstPL.begin() ; Iter != lstPL.end() ; ++ Iter) - pGraphics->AddPolyLine( *Iter) ; + for ( const auto& PL : lstPL) + pGraphics->AddPolyLine( PL) ; + } + // se esiste parte custom + if ( pUserObj != nullptr) { + POLYLINELIST lstPL ; + if ( pUserObj->GetDrawPolyLines( lstPL)) { + for ( const auto& PL : lstPL) + pGraphics->AddPolyLine( PL, true) ; + } } } // se richiesto, visualizzo la grafica associata bool bShowAux = false ; - if ( ( nGeoType & GEO_CURVE) != 0 && m_bShowCurveDirection) + if ( (( nGeoType & GEO_CURVE) != 0 || pUserObj != nullptr) && m_bShowCurveDirection) bShowAux = true ; // recupero il valore di opacità (solo per le superfici può esserci trasparenza) @@ -390,15 +400,15 @@ Scene::DrawAlphaSurfVector( void) []( const AlphaSurf& a, const AlphaSurf&b) { return a.dZmax < b.dZmax ; }) ; // eseguo visualizzazione - for ( int i = 0 ; i < int( m_vAlphaSurf.size()) ; ++i) { + for ( const auto& AlphaSurf : m_vAlphaSurf) { // imposto matrice MODELVIEW double Matrix[OGLMAT_DIM] ; - FrameToOpenGlMatrix( m_vAlphaSurf[i].frModView, Matrix) ; + FrameToOpenGlMatrix( AlphaSurf.frModView, Matrix) ; glPushMatrix() ; glLoadMatrixd( Matrix) ; // eseguo visualizzazione - bool bOk = m_vAlphaSurf[i].pGraph->Draw( m_vAlphaSurf[i].nStat, m_vAlphaSurf[i].nMark, true, - m_vAlphaSurf[i].nAlpha, m_vAlphaSurf[i].bShowAux) ; + bool bOk = AlphaSurf.pGraph->Draw( AlphaSurf.nStat, AlphaSurf.nMark, true, + AlphaSurf.nAlpha, AlphaSurf.bShowAux) ; // ripristino matrice glPopMatrix() ; // in caso di errore, esco