Swift-Hohenberg equation for optical parametric oscillators