Improve logic for automatic selection names
authorTeemu Murtola <teemu.murtola@gmail.com>
Tue, 16 Jun 2015 09:53:02 +0000 (12:53 +0300)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 17 Jun 2015 15:35:35 +0000 (17:35 +0200)
commit52d658d50e8e77ca1c92e70801b44e179cb1f647
tree3c7cdbef066ee78e383d0275d128fa8c2eaea771
parent66a0ae9d666811dada6df6f39e6f5c8d5f19f11f
Improve logic for automatic selection names

If a selection is directly provided from an external index group, the
name of the selection is set to be the name of the group, irrespective
of the exact way the group is selected.  The code that did this was a
bit too eager, and used the name of the group that appeared around the
beginning of a more complex selection in some other cases, leading to
confusion.

Make the code only use the name of the group if the group is really used
as-is, and otherwise use the selection text.  Add explicit tests for
this behavior.

Change-Id: Ic7fe2626a07cfd3cac3773046ed9f83484ba4368
src/gromacs/selection/keywords.h
src/gromacs/selection/selelem.cpp
src/gromacs/selection/sm_position.cpp
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesIndexGroupsInSelections.xml
src/gromacs/selection/tests/refdata/SelectionCollectionDataTest_HandlesUnsortedIndexGroupsInSelections.xml
src/gromacs/selection/tests/selectioncollection.cpp