Role of structural factors in the nonlinear optical properties of phthalocyanines and related compounds.