EgtGraphics 1.5j1 :

- aggiunta gestione selezione con mouse
- aggiunta gestione selezione punti notevoli (snap points).
This commit is contained in:
Dario Sassi
2014-10-10 06:36:30 +00:00
parent 13bf590449
commit 3c0d573c46
8 changed files with 386 additions and 32 deletions
+17 -12
View File
@@ -80,6 +80,10 @@ Scene::DrawGroup( int nId, int nPass, MdStMk cParent)
bool
Scene::DrawGroup( const IGdbIterator& iIter, int nPass, MdStMk cParent)
{
// creo un iteratore
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
if ( IsNull( pIter))
return false ;
// recupero il riferimento del gruppo
Frame3d frFrame ;
if ( ! iIter.GetGroupFrame( frFrame))
@@ -92,13 +96,10 @@ Scene::DrawGroup( const IGdbIterator& iIter, int nPass, MdStMk cParent)
if ( FrameToOpenGlMatrix( frFrame, Matrix))
glMultMatrixd( Matrix) ;
}
// creo un iteratore
PtrOwner<IGdbIterator> pIter( CreateGdbIterator( m_pGeomDB)) ;
if ( IsNull( pIter))
return false ;
// scandisco il gruppo
bool bOk = true ;
for ( bool bNext = pIter->GoToFirstInGroup( iIter) ;
bNext ;
bNext && bOk ;
bNext = pIter->GoToNext()) {
// leggo il tipo di oggetto
int nGdbType = pIter->GetGdbType() ;
@@ -120,7 +121,7 @@ Scene::DrawGroup( const IGdbIterator& iIter, int nPass, MdStMk cParent)
// se non nascosto, lo disegno
if ( nStat != GDB_ST_OFF) {
if ( ! DrawGeoObj( *pIter, nPass, MdStMk( nMode, nStat, nMark)))
return false ;
bOk = false ;
}
}
// se gruppo
@@ -128,7 +129,7 @@ Scene::DrawGroup( const IGdbIterator& iIter, int nPass, MdStMk cParent)
// se non nascosto, lo disegno
if ( nStat != GDB_ST_OFF) {
if ( ! DrawGroup( *pIter, nPass, MdStMk( nMode, nStat, nMark)))
return false ;
bOk = false ;
}
}
}
@@ -136,7 +137,7 @@ Scene::DrawGroup( const IGdbIterator& iIter, int nPass, MdStMk cParent)
if ( bMatrix)
glPopMatrix() ;
return true ;
return bOk ;
}
//----------------------------------------------------------------------------
@@ -293,15 +294,15 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, MdStMk siObj)
}
}
// se hiddenline
if ( m_nShowMode == SM_HIDDENLINE) {
// se hiddenline e non selezione
if ( m_nShowMode == SM_HIDDENLINE && ! m_bSelect) {
// in prima passata disegno solo le superfici
if ( nPass == 1 && ( nGeoType & GEO_SURF) == 0)
return true ;
}
// se shading
if ( m_nShowMode == SM_SHADING) {
// se shading e non selezione
if ( m_nShowMode == SM_SHADING && ! m_bSelect) {
// in prima passata disegno solo le superfici
if ( nPass == 1 && ( nGeoType & GEO_SURF) == 0)
return true ;
@@ -310,6 +311,10 @@ Scene::DrawGeoObj( const IGdbIterator& iIter, int nPass, MdStMk siObj)
return true ;
}
// se in selezione, carico il nome
if ( m_bSelect)
glLoadName( iIter.GetId()) ;
// se richiesto, visualizzo la grafica associata
bool bShowAux = false ;
if ( ( nGeoType & GEO_CURVE) != 0 && m_bShowCurveDirection)