Mechanism of linear and nonlinear optical effects of chalcopyrite AgGaX2 (X=S, Se, and Te) crystals.