.. _py-graph/GraphInterface: ********************************************************** graph/GraphInterface ********************************************************** .. default-domain:: py .. py:currentmodule:: mod .. cpp:namespace:: mod Class ``GraphVertex`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: GraphVertex A descriptor of either a vertex in a graph, or a null vertex. .. py:function:: __init__(self) Constructs a null descriptor. .. py::method:: __bool__(self) :returns: ``not isNull()`` :rtype: bool .. py:method:: isNull() :returns: whether this is a null descriptor or not. :rtype: bool .. py:attribute:: id (Read-only) The index of the vertex. It will be in the range :math:`[0, numVertices[`. :type: int :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: graph (Read-only) The graph the vertex belongs to. :type: Graph :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: degree (Read-only) The degree of the vertex. :type: int :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: incidentEdges (Read-only) A range of incident edges to this vertex. :type: GraphIncidentEdgeRange :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: stringLabel (Read-only) The string label of the vertex. :type: str :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: atomId (Read-only) The atom id of the vertex. :type: AtomId :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: isotope (Read-only) The isotope of the vertex. :type: Isotope :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: charge (Read-only) The charge of the vertex. :type: Charge :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: radical (Read-only) The radical status of the vertex. :type: bool :raises: :py:class:`LogicError` if it is a null descriptor. .. py:method:: printStereo() printStereo(p) Print the stereo configuration for the vertex. :param GraphPrinter p: the printing options used for the depiction. :returns: the name of the PDF-file that will be compiled in post-processing. :rtype: str :raises: :py:class:`LogicError` if it is a null descriptor. Class ``GraphEdge`` -------------------------------------------------------------------------------------------------------------------------------- .. py:class:: GraphEdge A descriptor of either an edge in a graph, or a null edge. .. py:function:: __init__(self) Constructs a null descriptor. .. py::method:: __bool__(self) :returns: ``not isNull()`` :rtype: bool .. py:method:: isNull() :returns: whether this is a null descriptor or not. :rtype: bool .. py:attribute:: graph (Read-only) The graph the edge belongs to. :type: Graph :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: source (Read-only) The source vertex of the edge. :type: GraphVertex :raises: :py:class:`LogicError` if it is a null descriptor. .. attribute:: target (Read-only) The target vertex of the edge. :type: GraphVertex :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: stringLabel (Read-only) The string label of the edge. :type: str :raises: :py:class:`LogicError` if it is a null descriptor. .. py:attribute:: bondType (Read-only) The bond type of the edge. :type: BondType :raises: :py:class:`LogicError` if it is a null descriptor.