.. _cpp-rule/GraphInterface: ********************************************************** rule/GraphInterface.hpp ********************************************************** .. default-domain:: cpp .. default-role:: cpp:expr .. py:currentmodule:: mod .. cpp:namespace:: mod This header contains the definitions for the graph interface for :cpp:class:`rule::Rule`. ======================================================================== Left ======================================================================== Class ``rule::Rule::LeftGraph`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph A proxy object representing the left graph of the rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::LeftGraph .. function:: friend bool operator==(const LeftGraph &a, const LeftGraph &b) friend bool operator!=(const LeftGraph &a, const LeftGraph &b) friend bool operator<(const LeftGraph &a, const LeftGraph &b) friend std::ostream &operator<<(std::ostream &s, const LeftGraph &g) .. function:: std::size_t numVertices() const :returns: the number of vertices in the graph. .. function:: VertexRange vertices() const :returns: a range of all vertices in the graph. .. function:: std::size_t numEdges() const :returns: the number of edges in the graph. .. function:: EdgeRange edges() const :returns: a range of all edges in the graph. .. function:: std::shared_ptr getRule() const :returns: the rule where the graph belongs to. .. cpp:namespace-pop:: Class ``rule::Rule::LeftGraph::Vertex`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::Vertex A descriptor of either a vertex in a rule, or a null vertex. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::Vertex :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::LeftGraph::Vertex .. function:: Vertex() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: std::size_t getId() const :returns: the index of the vertex. It will be in the range :math:`[0, numVertices[`. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: LeftGraph getGraph() const :returns: the graph the vertex belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::size_t getDegree() const :returns: the degree of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: IncidentEdgeRange incidentEdges() const :returns: a range of incident edges to this vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: const std::string &getStringLabel() const :returns: the string label of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: AtomId getAtomId() const :returns: the atom id of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Isotope getIsotope() const :returns: the isotope of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Charge getCharge() const :returns: the charge of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: bool getRadical() const :returns: the radical status of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::string printStereo() const std::string printStereo(const graph::Printer &p) const Print the stereo configuration for the vertex. :returns: the name of the PDF-file that will be compiled in post-processing. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Rule::Vertex getCore() const :returns: the descriptor for this vertex in the core graph. .. function:: std::shared_ptr getRule() const :returns: the rule the vertex belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. cpp:namespace-pop:: Class ``rule::Rule::LeftGraph::Edge`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::Edge A descriptor of either an edge in a rule, or a null edge. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::Edge :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::LeftGraph::Edge .. function:: Edge() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: LeftGraph getGraph() const :returns: the graph the edge belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex source() const :returns: the source vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex target() const :returns: the target vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: const std::string &getStringLabel() const :returns: the string label of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: BondType getBondType() const :returns: the bond type of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Rule::Edge getCore() const :returns: the descriptor for this edge in the core graph. .. function:: std::shared_ptr getRule() const :returns: the rule the edge belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. cpp:namespace-pop:: Class ``rule::Rule::LeftGraph::VertexIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::VertexIterator An iterator for traversing all vertices in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::VertexIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::LeftGraph::VertexIterator .. function:: VertexIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::LeftGraph::VertexRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::VertexRange A range of all vertices in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::VertexRange :maxdepth: 2 :noroot: Class ``rule::Rule::LeftGraph::EdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::EdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::EdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::LeftGraph::EdgeIterator .. function:: EdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::LeftGraph::EdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::EdgeRange A range of all edges in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::EdgeRange :maxdepth: 2 :noroot: Class ``rule::Rule::LeftGraph::IncidentEdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::IncidentEdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::IncidentEdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::LeftGraph::IncidentEdgeIterator .. function:: IncidentEdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::LeftGraph::IncidentEdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::LeftGraph::IncidentEdgeRange A range of all incident edges to a vertex in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::LeftGraph::IncidentEdgeRange :maxdepth: 2 :noroot: ======================================================================== Context ======================================================================== Class ``rule::Rule::ContextGraph`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph A proxy object representing the context graph of the rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::ContextGraph .. function:: friend bool operator==(const ContextGraph &a, const ContextGraph &b) .. function:: std::size_t numVertices() const :returns: the number of vertices in the graph. .. function:: VertexRange vertices() const :returns: a range of all vertices in the graph. .. function:: std::size_t numEdges() const :returns: the number of edges in the graph. .. function:: EdgeRange edges() const :returns: a range of all edges in the graph. .. function:: std::shared_ptr getRule() const :returns: the rule where the graph belongs to. .. cpp:namespace-pop:: Class ``rule::Rule::ContextGraph::Vertex`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::Vertex A descriptor of either a vertex in a rule, or a null vertex. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::Vertex :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::ContextGraph::Vertex .. function:: Vertex() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: std::size_t getId() const :returns: the index of the vertex. It will be in the range :math:`[0, numVertices[`. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: ContextGraph getGraph() const :returns: the graph the vertex belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::size_t getDegree() const :returns: the degree of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: IncidentEdgeRange incidentEdges() const :returns: a range of incident edges to this vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Rule::Vertex getCore() const :returns: the descriptor for this vertex in the core graph. .. function:: std::shared_ptr getRule() const :returns: the rule the vertex belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. cpp:namespace-pop:: Class ``rule::Rule::ContextGraph::Edge`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::Edge A descriptor of either an edge in a rule, or a null edge. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::Edge :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::ContextGraph::Edge .. function:: Edge() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: ContextGraph getGraph() const :returns: the graph the edge belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex source() const :returns: the source vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex target() const :returns: the target vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::shared_ptr getRule() const :returns: the rule the edge belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Rule::Edge getCore() const :returns: the descriptor for this edge in the core graph. .. cpp:namespace-pop:: Class ``rule::Rule::ContextGraph::VertexIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::VertexIterator An iterator for traversing all vertices in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::VertexIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::ContextGraph::VertexIterator .. function:: VertexIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::ContextGraph::VertexRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::VertexRange A range of all vertices in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::VertexRange :maxdepth: 2 :noroot: Class ``rule::Rule::ContextGraph::EdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::EdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::EdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::ContextGraph::EdgeIterator .. function:: EdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::ContextGraph::EdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::EdgeRange A range of all edges in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::EdgeRange :maxdepth: 2 :noroot: Class ``rule::Rule::ContextGraph::IncidentEdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::IncidentEdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::IncidentEdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::ContextGraph::IncidentEdgeIterator .. function:: IncidentEdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::ContextGraph::IncidentEdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::ContextGraph::IncidentEdgeRange A range of all incident edges to a vertex in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::ContextGraph::IncidentEdgeRange :maxdepth: 2 :noroot: ======================================================================== Right ======================================================================== Class ``rule::Rule::RightGraph`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph A proxy object representing the right graph of the rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::RightGraph .. function:: friend bool operator==(const RightGraph &a, const RightGraph &b) friend bool operator!=(const RightGraph &a, const RightGraph &b) friend bool operator<(const RightGraph &a, const RightGraph &b) friend std::ostream &operator<<(std::ostream &s, const RightGraph &g); .. function:: std::size_t numVertices() const :returns: the number of vertices in the graph. .. function:: VertexRange vertices() const :returns: a range of all vertices in the graph. .. function:: std::size_t numEdges() const :returns: the number of edges in the graph. .. function:: EdgeRange edges() const :returns: a range of all edges in the graph. .. function:: std::shared_ptr getRule() const :returns: the rule where the graph belongs to. .. cpp:namespace-pop:: Class ``rule::Rule::RightGraph::Vertex`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::Vertex A descriptor of either a vertex in a rule, or a null vertex. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::Vertex :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::RightGraph::Vertex .. function:: Vertex() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: std::size_t getId() const :returns: the index of the vertex. It will be in the range :math:`[0, numVertices[`. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: RightGraph getGraph() const :returns: the graph the vertex belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::size_t getDegree() const :returns: the degree of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: IncidentEdgeRange incidentEdges() const :returns: a range of incident edges to this vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: const std::string &getStringLabel() const :returns: the string label of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: AtomId getAtomId() const :returns: the atom id of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Isotope getIsotope() const :returns: the isotope of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Charge getCharge() const :returns: the charge of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: bool getRadical() const :returns: the radical status of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::string printStereo() const std::string printStereo(const graph::Printer &p) const Print the stereo configuration for the vertex. :returns: the name of the PDF-file that will be compiled in post-processing. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Rule::Vertex getCore() const :returns: the descriptor for this vertex in the core graph. .. function:: std::shared_ptr getRule() const :returns: the rule the vertex belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. cpp:namespace-pop:: Class ``rule::Rule::RightGraph::Edge`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::Edge A descriptor of either an edge in a rule, or a null edge. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::Edge :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::RightGraph::Edge .. function:: Edge() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: RightGraph getGraph() const :returns: the rule the edge belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex source() const :returns: the source vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex target() const :returns: the target vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: const std::string &getStringLabel() const :returns: the string label of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: BondType getBondType() const :returns: the bond type of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::shared_ptr getRule() const :returns: the rule the edge belongs to. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Rule::Edge getCore() const :returns: the descriptor for this edge in the core graph. .. cpp:namespace-pop:: Class ``rule::Rule::RightGraph::VertexIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::VertexIterator An iterator for traversing all vertices in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::VertexIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::RightGraph::VertexIterator .. function:: VertexIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::RightGraph::VertexRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::VertexRange A range of all vertices in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::VertexRange :maxdepth: 2 :noroot: Class ``rule::Rule::RightGraph::EdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::EdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::EdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::RightGraph::EdgeIterator .. function:: EdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::RightGraph::EdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::EdgeRange A range of all edges in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::EdgeRange :maxdepth: 2 :noroot: Class ``rule::Rule::RightGraph::IncidentEdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::IncidentEdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::IncidentEdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::RightGraph::IncidentEdgeIterator .. function:: IncidentEdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::RightGraph::IncidentEdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::RightGraph::IncidentEdgeRange A range of all incident edges to a vertex in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::RightGraph::IncidentEdgeRange :maxdepth: 2 :noroot: ======================================================================== Core ======================================================================== Class ``rule::Rule::Vertex`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::Vertex A descriptor of either a vertex in a rule, or a null vertex. Synopsis ^^^^^^^^ .. alias:: rule::Rule::Vertex :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::Vertex .. function:: Vertex() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: std::size_t getId() const :returns: the index of the vertex. It will be in the range :math:`[0, numVertices[`. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: std::shared_ptr getGraph() const std::shared_ptr getRule() const :returns: the graph the vertex belongs to, which happens to be the rule object it self. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: LeftGraph::Vertex getLeft() const :returns: a null descriptor if this vertex is not in the left graph, otherwise the descriptor of this vertex in the left graph. .. function:: ContextGraph::Vertex getContext() const :returns: a null descriptor if this vertex is not in the context graph, otherwise the descriptor of this vertex in the context graph. .. function:: RightGraph::Vertex getRight() const :returns: a null descriptor if this vertex is not in the right graph, otherwise the descriptor of this vertex in the right graph. .. function:: std::size_t getDegree() const :returns: the degree of the vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: IncidentEdgeRange incidentEdges() const :returns: a range of incident edges to this vertex. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: double get2DX(bool withHydrogens=true) :returns: the x-coordinate in a 2D depiction of the rule. Different sets of coordinates exists for rendering with and without certain hydrogens. :throws: :cpp:class:`LogicError` if it is a null descriptor, or if `withHydrogens` is `true` and the vertex is a "clean" hydrogen. .. function:: double get2DY(bool withHydrogens=true) :returns: the y-coordinate in a 2D depiction of the rule. Different sets of coordinates exists for rendering with and without certain hydrogens. :throws: :cpp:class:`LogicError` if it is a null descriptor, or if `withHydrogens` is `true` and the vertex is a "clean" hydrogen. .. cpp:namespace-pop:: Class ``rule::Rule::Edge`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::Edge A descriptor of either an edge in a rule, or a null edge. Synopsis ^^^^^^^^ .. alias:: rule::Rule::Edge :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::Edge .. function:: Edge() Constructs a null descriptor. .. function:: explicit operator bool() const :returns: :cpp:expr:`!isNull()` .. function:: bool isNull() const :returns: whether this is a null descriptor or not. .. function:: std::shared_ptr getGraph() const std::shared_ptr getRule() const :returns: the rule the edge belongs to, which happens to be the rule object it self. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: LeftGraph::Edge getLeft() const :returns: a null descriptor if this edge is not in the left graph, otherwise the descriptor of this edge in the left graph. .. function:: ContextGraph::Edge getContext() const :returns: a null descriptor if this edge is not in the context graph, otherwise the descriptor of this edge in the context graph. .. function:: RightGraph::Edge getRight() const :returns: a null descriptor if this edge is not in the right graph, otherwise the descriptor of this edge in the right graph. .. function:: Vertex source() const :returns: the source vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. function:: Vertex target() const :returns: the target vertex of the edge. :throws: :cpp:class:`LogicError` if it is a null descriptor. .. cpp:namespace-pop:: Class ``rule::Rule::VertexIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::VertexIterator An iterator for traversing all vertices in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::VertexIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::VertexIterator .. function:: VertexIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::VertexRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::VertexRange A range of all vertices in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::VertexRange :maxdepth: 2 :noroot: Class ``rule::Rule::EdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::EdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::EdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::EdgeIterator .. function:: EdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::EdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::EdgeRange A range of all edges in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::EdgeRange :maxdepth: 2 :noroot: Class ``rule::Rule::IncidentEdgeIterator`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::IncidentEdgeIterator An iterator for traversing all edges in a rule. It models a forward iterator. Synopsis ^^^^^^^^ .. alias:: rule::Rule::IncidentEdgeIterator :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: rule::Rule::IncidentEdgeIterator .. function:: IncidentEdgeIterator() Construct a past-the-end iterator. .. cpp:namespace-pop:: Class ``rule::Rule::IncidentEdgeRange`` -------------------------------------------------------------------------------------------------------------------------------- .. class:: rule::Rule::IncidentEdgeRange A range of all incident edges to a vertex in a rule. Synopsis ^^^^^^^^ .. alias:: rule::Rule::IncidentEdgeRange :maxdepth: 2 :noroot: