Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 685e2162 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Bug fix in selection processing when the selection don't have to be reset.

parent 4d9951de
......@@ -452,7 +452,7 @@ bool GLViewer::addDisplayable( GenericUIData *m )
//}
void GLViewer::updateDisplayable( GenericUIData *m )
void GLViewer::updateDisplayable( GenericUIData *m, bool resetSelectionManagers )
{
DisplayableMap::iterator d = m_Displayables.find( m );
if( d != m_Displayables.end() )
......@@ -474,22 +474,25 @@ void GLViewer::updateDisplayable( GenericUIData *m )
dinfo->SetUserTransform( tr );
// Re-generate the selection managers.
dinfo->currentSelectionMgr = NULL;
for( auto mngr : dinfo->selectionMgr )
delete mngr;
dinfo->selectionMgr.clear();
dinfo->displayable->selectionManagers( dinfo->selectionMgr );
if( isSelectionEnabled() )
{
for( auto mngr : dinfo->selectionMgr )
if( mngr->selectableEntity() == m_SelectionCurrentTool->entityToSelect() )
{
dinfo->currentSelectionMgr = mngr;
mngr->onRecompilingSelectionShader( m_SelectionCurrentTool );
break;
}
}
if( resetSelectionManagers )
{
dinfo->currentSelectionMgr = NULL;
for( auto mngr : dinfo->selectionMgr )
delete mngr;
dinfo->selectionMgr.clear();
dinfo->displayable->selectionManagers( dinfo->selectionMgr );
if( isSelectionEnabled() )
{
for( auto mngr : dinfo->selectionMgr )
if( mngr->selectableEntity() == m_SelectionCurrentTool->entityToSelect() )
{
dinfo->currentSelectionMgr = mngr;
mngr->onRecompilingSelectionShader( m_SelectionCurrentTool );
break;
}
}
}
updatePrimitiveCounts();
update();
......@@ -1434,14 +1437,13 @@ void GLViewer::processSelection( DisplayableInfo &dInfo, BaseSelectionProcessor
d->processSelection( mgr, proc );
proc.release( m );
if( proc.isSelectionResetRequired() )
mgr->clearSelection();
if( proc.isDisplayableUpdateRequired() )
{
updateDisplayable( m );
updateDisplayable( m, proc.isSelectionResetRequired() );
updateSelectionZBuffer();
}
else if( proc.isSelectionResetRequired() )
mgr->clearSelection();
}
}
......@@ -2127,8 +2129,8 @@ void GLViewer::keyPressEvent( QKeyEvent *evt )
break;
}
case Qt::Key_N: m_ChangeNearPlaneMode = true; break;
case Qt::Key_F: m_ChangeFarPlaneMode = true; break;
case Qt::Key_PageDown: m_ChangeNearPlaneMode = true; break;
case Qt::Key_PageUp: m_ChangeFarPlaneMode = true; break;
default: emit keyPressed( evt );
}
......@@ -2143,11 +2145,11 @@ void GLViewer::keyPressEvent( QKeyEvent *evt )
void GLViewer::keyReleaseEvent( QKeyEvent *evt )
{
if( evt->key() == Qt::Key_N )
if( evt->key() == Qt::Key_PageDown )
m_ChangeNearPlaneMode = false;
if( evt->key() == Qt::Key_F )
m_ChangeFarPlaneMode = false;
if( evt->key() == Qt::Key_PageUp )
m_ChangeFarPlaneMode = false;
if( !m_SelectionCurrentTool->isSelecting() )
{
......
......@@ -307,7 +307,7 @@ public:
inline const DisplayableFactoryInterface* getFactory( const QString &type ) const { FactoryMap::const_iterator f=m_Factories.find(type); return f==m_Factories.end()? NULL : f->second; }
inline DisplayableInterface* getDisplayable( const GenericUIData* m ) { DisplayableMap::iterator d=m_Displayables.find(m); return d==m_Displayables.end()? NULL : d->second.displayable; }
inline DisplayableInterface* getDisplayable( const GenericUIData* m ) const { DisplayableMap::const_iterator d=m_Displayables.find(m); return d==m_Displayables.end()? NULL : d->second.displayable; }
virtual void updateDisplayable( GenericUIData *m );
virtual void updateDisplayable( GenericUIData *m, bool resetSelectionManagers = true );
inline const DisplayableMap& getDisplayables() const { return m_Displayables; }
inline DisplayableMap& getDisplayables() { return m_Displayables; }
void setTransform( GenericUIData *m, const QMatrix4x4 &xf );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment