Heteroclinic cycles and modulated traveling waves in systems with O(2) symmetry