Spatiotemporal patterns in nonlinear optics