Generation of any superposition of coherent states along a straight line via resonant atom—cavity interaction