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 8bebbd2e authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Selection tool display improved.

parent 4924d2a5
......@@ -67,6 +67,7 @@ void SelectionTool::displaySelectionState() const
{
// Backup the current OpenGL state.
GLboolean depthTestEnabled = glIsEnabled( GL_DEPTH_TEST );
GLboolean multisampleEnabled = glIsEnabled( GL_MULTISAMPLE );
GLfloat currentColor[4];
glGetFloatv( GL_CURRENT_COLOR, currentColor );
......@@ -88,13 +89,15 @@ void SelectionTool::displaySelectionState() const
glPushMatrix();
glLoadIdentity();
glDisable( GL_DEPTH_TEST );
//glDisable( GL_MULTISAMPLE );
// Display the "+" or "-" sign indicating what is the current selection update mode.
QPoint cursor = m_Viewer.mapFromGlobal( m_Viewer.cursor().pos() );
cursor.setY( m_Viewer.height() - 1 - cursor.y() );
glDisable( GL_MULTISAMPLE );
glColor3ub( 0, 0, 0 );
if( m_Context.selectionMode != SelectionTool::SELECTION_MODE_SET )
......@@ -114,13 +117,26 @@ void SelectionTool::displaySelectionState() const
// Display the label indicating which entity is currently selected.
QString entityName;
switch( m_Context.entityToSelect )
{
case SELECTABLE_ENTITY_VERTEX: m_Viewer.renderText( cursor.x()+10, cursor.y()-15, 0.0, "Vertex" ); break;
case SELECTABLE_ENTITY_FACE : m_Viewer.renderText( cursor.x()+10, cursor.y()-15, 0.0, "Face" ); break;
case SELECTABLE_ENTITY_TEXEL : m_Viewer.renderText( cursor.x()+10, cursor.y()-15, 0.0, "Texel" ); break;
case SELECTABLE_ENTITY_VERTEX: entityName = "Vertex"; break;
case SELECTABLE_ENTITY_FACE : entityName = "Face" ; break;
case SELECTABLE_ENTITY_TEXEL : entityName = "Texel" ; break;
}
int entityNameX = cursor.x() + 10;
int entityNameY = m_Viewer.height() - 1 - cursor.y() + 15;
glColor4ub( 255, 255, 255, 192 );
m_Viewer.renderText( entityNameX, entityNameY-1, entityName );
m_Viewer.renderText( entityNameX, entityNameY+1, entityName );
m_Viewer.renderText( entityNameX-1, entityNameY, entityName );
m_Viewer.renderText( entityNameX+1, entityNameY, entityName );
glColor3ub( 0, 0, 0 );
m_Viewer.renderText( entityNameX, entityNameY, entityName );
// Restore OpenGL matrices.
......@@ -132,6 +148,7 @@ void SelectionTool::displaySelectionState() const
// Restore the backuped OpenGL state.
depthTestEnabled? glEnable( GL_DEPTH_TEST ) : glDisable( GL_DEPTH_TEST );
multisampleEnabled? glEnable( GL_MULTISAMPLE ) : glDisable( GL_MULTISAMPLE );
glColor4fv( currentColor );
glLineWidth( lineWidth );
......
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