Characterizing generic global rigidity