Regina 7.0 Calculation Engine
|
Represents a single node in a model graph for a knot or link. More...
#include <link/modellinkgraph.h>
Public Member Functions | |
int | index () const |
Returns the index of this node within the overall graph. More... | |
ModelLinkGraphArc | arc (int which) |
Returns a reference to one of the four arcs of the graph that exit this node. More... | |
const ModelLinkGraphArc & | adj (int which) const |
Returns the arc at the other end of the given graph edge that exits this node. More... | |
void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this node to the given output stream. More... | |
ModelLinkGraphNode (const ModelLinkGraphNode &)=delete | |
ModelLinkGraphNode & | operator= (const ModelLinkGraphNode &)=delete |
size_t | markedIndex () const |
Returns the index at which this object is stored in an MarkedVector. More... | |
void | writeTextLong (std::ostream &out) const |
A default implementation for detailed output. More... | |
std::string | str () const |
Returns a short text representation of this object. More... | |
std::string | utf8 () const |
Returns a short text representation of this object using unicode characters. More... | |
std::string | detail () const |
Returns a detailed text representation of this object. More... | |
Friends | |
class | ModelLinkGraph |
Represents a single node in a model graph for a knot or link.
If a graph has n nodes, then these are numbered 0,...,n-1. The number assigned to this node can be accessed by calling index(). Note that nodes may be reindexed when other nodes are added or removed - if you wish to track a particular node through such operations then you should use a pointer to the relevant ModelLinkGraphNode instead.
Graph nodes do not support value semantics: they cannot be copied, swapped, or manually constructed. Their location in memory defines them, and they are often passed and compared by pointer. End users are never responsible for their memory management; this is all taken care of by the ModelLinkGraph to which they belong.
|
inline |
Returns the arc at the other end of the given graph edge that exits this node.
Let e be the undirected edge of the underlying model graph that corresponds to the given outgoing arc from this node. Recall that there are two ModelLinkGraphArc objects corresponding to e, one for each of its endpoints. One of these will be ModelLinkGraphArc(this
, which); this routine returns the other object, which is the ModelLinkGraphArc describing the other endpoint of e.
Note that for a node n, calling n.adj(i)
is equivalent to calling n.arc(i).traverse()
.
which | an integer in the range 0 to 3 inclusive, indicating which of the four arcs exiting this node we should examine. |
|
inline |
Returns a reference to one of the four arcs of the graph that exit this node.
This is equivalent to directly constructing ModelLinkGraphArc(this
, which).
The four arcs exiting this node are numbered 0,1,2,3 in a clockwise order around the node.
which | an integer in the range 0 to 3 inclusive, indicating which of the four arcs exiting this node we should return. |
|
inherited |
Returns a detailed text representation of this object.
This text may span many lines, and should provide the user with all the information they could want. It should be human-readable, should not contain extremely long lines (which cause problems for users reading the output in a terminal), and should end with a final newline. There are no restrictions on the underlying character set.
|
inline |
Returns the index of this node within the overall graph.
If the graph contains n nodes, then the index will be a number between 0 and n-1 inclusive.
|
inlineinherited |
Returns the index at which this object is stored in an MarkedVector.
If this object does not belong to an MarkedVector, the return value is undefined.
|
inherited |
Returns a short text representation of this object.
This text should be human-readable, should use plain ASCII characters where possible, and should not contain any newlines.
Within these limits, this short text ouptut should be as information-rich as possible, since in most cases this forms the basis for the Python str()
and repr()
functions.
str()
will use precisely this function, and for most classes the Python repr()
function will incorporate this into its output.
|
inherited |
Returns a short text representation of this object using unicode characters.
Like str(), this text should be human-readable, should not contain any newlines, and (within these constraints) should be as information-rich as is reasonable.
Unlike str(), this function may use unicode characters to make the output more pleasant to read. The string that is returned will be encoded in UTF-8.
|
inlineinherited |
A default implementation for detailed output.
This routine simply calls T::writeTextShort() and appends a final newline.
out | the output stream to which to write. |
|
inline |
Writes a short text representation of this node to the given output stream.
out | the output stream to which to write. |