| [6253ed] | 1 | #
 | 
|---|
 | 2 | #    MoleCuilder - creates and alters molecular systems
 | 
|---|
 | 3 | #    Copyright (C) 2008-2012 University of Bonn
 | 
|---|
 | 4 | #
 | 
|---|
 | 5 | #    This program is free software: you can redistribute it and/or modify
 | 
|---|
 | 6 | #    it under the terms of the GNU General Public License as published by
 | 
|---|
 | 7 | #    the Free Software Foundation, either version 3 of the License, or
 | 
|---|
 | 8 | #    (at your option) any later version.
 | 
|---|
 | 9 | #
 | 
|---|
 | 10 | #    This program is distributed in the hope that it will be useful,
 | 
|---|
 | 11 | #    but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
|---|
 | 12 | #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
|---|
 | 13 | #    GNU General Public License for more details.
 | 
|---|
 | 14 | #
 | 
|---|
 | 15 | #    You should have received a copy of the GNU General Public License
 | 
|---|
 | 16 | #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
|---|
 | 17 | #
 | 
|---|
| [e69c87] | 18 | ### Removing atoms inside and outside of sphere
 | 
|---|
| [d445e4] | 19 | 
 | 
|---|
| [e69c87] | 20 | AT_SETUP([Atoms - Removing sphere of atoms])
 | 
|---|
| [e611dc] | 21 | AT_KEYWORDS([atoms remove-atom])
 | 
|---|
| [23b0c2] | 22 | 
 | 
|---|
 | 23 | file=test-withoutsphere.xyz
 | 
|---|
| [7db9bd] | 24 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/test.xyz $file], 0)
 | 
|---|
| [23b0c2] | 25 | AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [842aac] | 26 | AT_CHECK([../../molecuilder -i $file --create-shape --shape-name "sphere1" --shape-type "sphere" --translation "7.283585982, 3.275186040, 3.535886037" --stretch "7., 7., 7." --angle-x 0. --angle-y 0. --angle-z 0. --select-shape-by-name "sphere1" --select-atoms-inside-volume -r], 0, [stdout], [stderr])
 | 
|---|
| [23b0c2] | 27 | AT_CHECK([sort -n $file | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [7db9bd] | 28 | AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/post/test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [23b0c2] | 29 | 
 | 
|---|
 | 30 | file=test-sphere.xyz
 | 
|---|
| [7db9bd] | 31 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/test.xyz $file], 0)
 | 
|---|
| [23b0c2] | 32 | AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [842aac] | 33 | AT_CHECK([../../molecuilder -i $file --select-all-atoms --create-shape --shape-name "sphere1" --shape-type "sphere" --translation "7.283585982, 3.275186040, 3.535886037" --stretch "7., 7., 7." --angle-x 0. --angle-y 0. --angle-z 0. --select-shape-by-name "sphere1" --unselect-atoms-inside-volume -r], 0, [stdout], [stderr])
 | 
|---|
| [23b0c2] | 34 | AT_CHECK([sort -n $file | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [7db9bd] | 35 | AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/post/test-sphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [d445e4] | 36 | AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [7db9bd] | 37 | AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/post/test.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [e69c87] | 38 | 
 | 
|---|
 | 39 | AT_CLEANUP
 | 
|---|
 | 40 | 
 | 
|---|
 | 41 | 
 | 
|---|
 | 42 | AT_SETUP([Atoms - Removing sphere of atoms with Undo])
 | 
|---|
| [e611dc] | 43 | AT_KEYWORDS([atoms remove-atom undo])
 | 
|---|
| [23b0c2] | 44 | 
 | 
|---|
 | 45 | file=test.xyz
 | 
|---|
| [7db9bd] | 46 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/test.xyz $file], 0)
 | 
|---|
| [23b0c2] | 47 | AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [842aac] | 48 | AT_CHECK([../../molecuilder -i $file --create-shape --shape-name "sphere1" --shape-type "sphere" --translation "7.283585982, 3.275186040, 3.535886037" --stretch "7., 7., 7." --angle-x 0. --angle-y 0. --angle-z 0. --select-shape-by-name "sphere1" --select-atoms-inside-volume -r --undo], 0, [stdout], [stderr])
 | 
|---|
| [7db9bd] | 49 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/$file], 0, [ignore], [ignore])
 | 
|---|
| [e69c87] | 50 | 
 | 
|---|
 | 51 | file=test.xyz
 | 
|---|
| [7db9bd] | 52 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/test.xyz $file], 0)
 | 
|---|
| [e69c87] | 53 | AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [842aac] | 54 | AT_CHECK([../../molecuilder -i $file --select-all-atoms --create-shape --shape-name "sphere1" --shape-type "sphere" --translation "7.283585982, 3.275186040, 3.535886037" --stretch "7., 7., 7." --angle-x 0. --angle-y 0. --angle-z 0. --select-shape-by-name "sphere1" --unselect-atoms-inside-volume -r --undo], 0, [stdout], [stderr])
 | 
|---|
| [7db9bd] | 55 | AT_CHECK([diff -I '.*Created by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/$file], 0, [ignore], [ignore])
 | 
|---|
| [e69c87] | 56 | 
 | 
|---|
 | 57 | AT_CLEANUP
 | 
|---|
 | 58 | 
 | 
|---|
 | 59 | 
 | 
|---|
 | 60 | AT_SETUP([Atoms - Removing sphere of atoms with Redo])
 | 
|---|
| [e611dc] | 61 | AT_KEYWORDS([atoms remove-atom redo])
 | 
|---|
| [23b0c2] | 62 | 
 | 
|---|
 | 63 | file=test-withoutsphere.xyz
 | 
|---|
| [7db9bd] | 64 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/test.xyz $file], 0)
 | 
|---|
| [23b0c2] | 65 | AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [842aac] | 66 | AT_CHECK([../../molecuilder -i $file --create-shape --shape-name "sphere1" --shape-type "sphere" --translation "7.283585982, 3.275186040, 3.535886037" --stretch "7., 7., 7." --angle-x 0. --angle-y 0. --angle-z 0. --select-shape-by-name "sphere1" --select-atoms-inside-volume -r --undo --redo], 0, [stdout], [stderr])
 | 
|---|
| [23b0c2] | 67 | AT_CHECK([sort -n $file | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [7db9bd] | 68 | AT_CHECK([file=test-withoutsphere.xyz-sorted; diff $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/post/test-withoutsphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [23b0c2] | 69 | 
 | 
|---|
 | 70 | file=test-sphere.xyz
 | 
|---|
| [7db9bd] | 71 | AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/pre/test.xyz $file], 0)
 | 
|---|
| [23b0c2] | 72 | AT_CHECK([chmod u+w $file], 0)
 | 
|---|
| [842aac] | 73 | AT_CHECK([../../molecuilder -i $file --select-all-atoms --create-shape --shape-name "sphere1" --shape-type "sphere" --translation "7.283585982, 3.275186040, 3.535886037" --stretch "7., 7., 7." --angle-x 0. --angle-y 0. --angle-z 0. --select-shape-by-name "sphere1" --unselect-atoms-inside-volume -r --undo --redo], 0, [stdout], [stderr])
 | 
|---|
| [23b0c2] | 74 | AT_CHECK([sort -n $file | grep -v -E "^[[[:digit:]]]+" | grep -v "Created by" >test-sphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [7db9bd] | 75 | AT_CHECK([file=test-sphere.xyz-sorted; diff $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/post/test-sphere.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [d445e4] | 76 | AT_CHECK([cat test-sphere.xyz-sorted test-withoutsphere.xyz-sorted | sort -n >test.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [7db9bd] | 77 | AT_CHECK([file=test.xyz-sorted; diff $file ${abs_top_srcdir}/tests/regression/Atoms/RemoveSphere/post/test.xyz-sorted], 0, [ignore], [ignore])
 | 
|---|
| [23b0c2] | 78 | 
 | 
|---|
| [d445e4] | 79 | AT_CLEANUP
 | 
|---|