Commit 4194d040 authored by Matthias Möller's avatar Matthias Möller

fix lasso selection: deselection deselects now

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@21067 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c6663834
...@@ -1886,7 +1886,10 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region, ...@@ -1886,7 +1886,10 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region,
elements.push_back(list[j].second); elements.push_back(list[j].second);
} }
} }
selectVertices(bod->id(), elements); if (!_deselection)
selectVertices(bod->id(), elements);
else
unselectVertices(bod->id(), elements);
alreadySelectedObjects.insert(list[i].first); alreadySelectedObjects.insert(list[i].first);
emit updatedObject(bod->id(), UPDATE_SELECTION); emit updatedObject(bod->id(), UPDATE_SELECTION);
emit createBackup(bod->id(), "Lasso Selection", UPDATE_SELECTION); emit createBackup(bod->id(), "Lasso Selection", UPDATE_SELECTION);
...@@ -1914,7 +1917,10 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region, ...@@ -1914,7 +1917,10 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region,
elements.push_back(list[j].second); elements.push_back(list[j].second);
} }
} }
selectEdges(bod->id(), elements); if (!_deselection)
selectEdges(bod->id(), elements);
else
unselectEdges(bod->id(), elements);
alreadySelectedObjects.insert(list[i].first); alreadySelectedObjects.insert(list[i].first);
emit updatedObject(bod->id(), UPDATE_SELECTION); emit updatedObject(bod->id(), UPDATE_SELECTION);
emit createBackup(bod->id(), "Lasso Selection", UPDATE_SELECTION); emit createBackup(bod->id(), "Lasso Selection", UPDATE_SELECTION);
...@@ -1944,8 +1950,25 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region, ...@@ -1944,8 +1950,25 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region,
} }
IdList oldEdgeSelection = getEdgeSelection(bod->id()); IdList oldEdgeSelection = getEdgeSelection(bod->id());
clearEdgeSelection(bod->id()); clearEdgeSelection(bod->id());
selectEdges(bod->id(), elements);
if (!_deselection)
{
//on selection: select picked edges, convert to halfedge selection
selectEdges(bod->id(), elements);
}
else
{
//on deselection: get current Halfedge Selection, unselect edge, convert back
if(bod->dataType() == DATA_TRIANGLE_MESH)
MeshSelection::convertHalfedgeToEdgeSelection(PluginFunctions::triMesh(bod));
else if(bod->dataType() == DATA_POLY_MESH)
MeshSelection::convertHalfedgeToEdgeSelection(PluginFunctions::polyMesh(bod));
clearHalfedgeSelection(bod->id());
unselectEdges(bod->id(), elements);
}
if(bod->dataType() == DATA_TRIANGLE_MESH) if(bod->dataType() == DATA_TRIANGLE_MESH)
MeshSelection::convertEdgeToHalfedgeSelection(PluginFunctions::triMesh(bod)); MeshSelection::convertEdgeToHalfedgeSelection(PluginFunctions::triMesh(bod));
else if(bod->dataType() == DATA_POLY_MESH) else if(bod->dataType() == DATA_POLY_MESH)
...@@ -1981,7 +2004,10 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region, ...@@ -1981,7 +2004,10 @@ void MeshObjectSelectionPlugin::lassoSelect(QRegion& _region,
elements.push_back(list[j].second); elements.push_back(list[j].second);
} }
} }
selectFaces(bod->id(), elements); if (!_deselection)
selectFaces(bod->id(), elements);
else
unselectFaces(bod->id(), elements);
alreadySelectedObjects.insert(list[i].first); alreadySelectedObjects.insert(list[i].first);
emit updatedObject(bod->id(), UPDATE_SELECTION); emit updatedObject(bod->id(), UPDATE_SELECTION);
emit createBackup(bod->id(), "Lasso Selection", UPDATE_SELECTION); emit createBackup(bod->id(), "Lasso Selection", UPDATE_SELECTION);
......
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