All-optical switching during quasi-collinear second harmonic generation