# ****************************************************************************# This file is part of sage-flatsurf.## Copyright (C) 2013-2019 Vincent Delecroix# 2013-2019 W. Patrick Hooper# 2022-2023 Julian Rüth## sage-flatsurf is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, either version 2 of the License, or# (at your option) any later version.## sage-flatsurf is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with sage-flatsurf. If not, see <https://www.gnu.org/licenses/>.# ****************************************************************************fromsage.plot.pointimportpoint2d
[docs]classGraphicalSurfacePoint:def__init__(self,surface_point,graphical_surface=None):r""" Create a graphical segment from SurfacePoint. If a graphical_surface is provided the point is created on the graphical surface. Otherwise, we create it on the default graphical surface. """ifgraphical_surfaceisNone:self._gs=surface_point.surface().graphical_surface()else:ifsurface_point.surface()!=graphical_surface.get_surface():raiseValueErrorself._gs=graphical_surfaceself._sp=surface_point
[docs]defsurface_point(self):r""" Return the underlying SurfacePoint. """returnself._sp
[docs]defpoints(self):r"""Return the list of points as RDF vectors."""point_list=[]forlabelinself._sp.labels():ifself._gs.is_visible(label):forcoordinself._sp.coordinates(label):point_list.append(self._gs.graphical_polygon(label).transform(coord))returnpoint_list
[docs]defplot(self,**options):r""" Plot the point (which might involve drawing several dots). The options are passed to point2d. If no "zorder" option is provided then we set "zorder" to 50. """if"zorder"notinoptions:options["zorder"]=50returnpoint2d(points=self.points(),**options)