From bf76f6e9b56f3bb123883c768ddfcdcc91b48b49 Mon Sep 17 00:00:00 2001 From: Marco Callieri mcallieri Date: Thu, 10 Feb 2011 16:45:30 +0000 Subject: [PATCH] added ALT modifier when clicking on mesh in layer window to set ALL layers visible --- src/meshlab/layerDialog.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/meshlab/layerDialog.cpp b/src/meshlab/layerDialog.cpp index 247e63369..6b9aff0ef 100644 --- a/src/meshlab/layerDialog.cpp +++ b/src/meshlab/layerDialog.cpp @@ -93,10 +93,10 @@ void LayerDialog::meshItemClicked (QTreeWidgetItem * item , int col) { //the user has clicked on one of the eyes MeshDocument *md= mw->meshDoc(); + // NICE TRICK. // If the user has pressed ctrl when clicking on the eye icon, only that layer will remain visible // Very useful for comparing meshes - if(QApplication::keyboardModifiers() == Qt::ControlModifier) { foreach(MeshModel *mp, md->meshList) @@ -104,8 +104,21 @@ void LayerDialog::meshItemClicked (QTreeWidgetItem * item , int col) mw->GLA()->meshSetVisibility(mp, false); } } + //Toggle visibility of current mesh mw->GLA()->meshSetVisibility(md->getMesh(clickedId), !md->getMesh(clickedId)->visible); + + // EVEN NICER TRICK. + // If the user has pressed alt when clicking on the eye icon, all layers will get visible + // Very useful after you turned all layer invis using the previous option and want to avoid + // clicking on all of them... + if(QApplication::keyboardModifiers() == Qt::AltModifier) + { + foreach(MeshModel *mp, md->meshList) + { + mw->GLA()->meshSetVisibility(mp, true); + } + } } break; case 1 :