Commit d661d367 authored by Jan Möbius's avatar Jan Möbius

Implement shift + C to clear all selections

parent b6ba729a
......@@ -265,8 +265,10 @@ void MeshObjectSelectionPlugin::pluginsInitialized() {
// Select (a)ll
emit registerKeyShortcut(Qt::Key_A, Qt::ControlModifier);
// (C)lear selection
// (C)lear selection (Only current selection)
emit registerKeyShortcut(Qt::Key_C, Qt::NoModifier);
// (C)lear all selections
emit registerKeyShortcut(Qt::Key_C, Qt::ShiftModifier);
// (I)nvert selection
emit registerKeyShortcut(Qt::Key_I, Qt::NoModifier);
// Delete selected entities
......@@ -1851,24 +1853,34 @@ void MeshObjectSelectionPlugin::slotKeyShortcutEvent(int _key, Qt::KeyboardModif
emit updatedObject(o_it->id(), UPDATE_SELECTION);
emit createBackup(o_it->id(), "Select All", UPDATE_SELECTION);
}
} else if (_key == Qt::Key_C && _modifiers == Qt::NoModifier) {
for (PluginFunctions::ObjectIterator o_it(restriction, DataType(DATA_TRIANGLE_MESH | DATA_POLY_MESH));
o_it != PluginFunctions::objectsEnd(); ++o_it) {
if (o_it->visible()) {
if(type & vertexType_)
clearVertexSelection(o_it->id());
if(type & edgeType_)
clearEdgeSelection(o_it->id());
if(type & halfedgeType_)
clearHalfedgeSelection(o_it->id());
if(type & faceType_)
clearFaceSelection(o_it->id());
}
emit updatedObject(o_it->id(), UPDATE_SELECTION);
emit createBackup(o_it->id(), "Clear Selection", UPDATE_SELECTION);
} else if (_key == Qt::Key_C && ( _modifiers == Qt::NoModifier || _modifiers == Qt::ShiftModifier) ) {
for (PluginFunctions::ObjectIterator o_it(restriction, DataType(DATA_TRIANGLE_MESH | DATA_POLY_MESH));
o_it != PluginFunctions::objectsEnd(); ++o_it) {
if (o_it->visible()) {
if ( _modifiers == Qt::NoModifier ) {
if( type & vertexType_ )
clearVertexSelection(o_it->id());
if(type & edgeType_)
clearEdgeSelection(o_it->id());
if(type & halfedgeType_)
clearHalfedgeSelection(o_it->id());
if(type & faceType_)
clearFaceSelection(o_it->id());
} else { // Shift -> Clear All
clearVertexSelection(o_it->id());
clearEdgeSelection(o_it->id());
clearHalfedgeSelection(o_it->id());
clearFaceSelection(o_it->id());
}
emit updatedObject(o_it->id(), UPDATE_SELECTION);
emit createBackup(o_it->id(), "Clear Selection", UPDATE_SELECTION);
}
}
} else if(_key == Qt::Key_I && _modifiers == Qt::NoModifier) {
for (PluginFunctions::ObjectIterator o_it(restriction, DataType(DATA_TRIANGLE_MESH | DATA_POLY_MESH));
......
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