OpenMesh has a quite flexible way of storing custom properties on mesh elements so that they are persistent (i.e. can be written to and restored from a file), as shown here.