Analysis of the generalized (2+1)-dimensional Nizhnik–Novikov–Veselov equations with variable coefficients in an inhomogeneous medium