Diffraction analysis of internal strain-stress fields in textured transverserly-isotropic thin films: theoretical basis and simulation