Shape coexistence and shape transitions in even-even Pt and Hg isotopes