Regina 7.3 Calculation Engine
|
Represents a single crossing in a link diagram. More...
#include <link/link.h>
Public Member Functions | |
size_t | index () const |
Returns the index of this crossing within the overall link. More... | |
int | sign () const |
Returns the sign of this crossing. More... | |
StrandRef | upper () |
Returns a reference to the strand running over this crossing. More... | |
StrandRef | lower () |
Returns a reference to the strand running under this crossing. More... | |
StrandRef | over () |
Returns a reference to the strand running over this crossing. More... | |
StrandRef | under () |
Returns a reference to the strand running under this crossing. More... | |
StrandRef | strand (int which) |
Returns a reference to one of the two strands of the link that pass each other at this crossing. More... | |
StrandRef | next (int strand) const |
Returns the crossing reference that immediately follows this when walking forward in the direction of the link along one of the two strands that pass at this crossing. More... | |
StrandRef | prev (int strand) const |
Returns the crossing reference that immediately precedes this when walking backward against the direction of the link along one of the two strands that pass at this crossing. More... | |
void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
Crossing (const Crossing &)=delete | |
Crossing & | operator= (const Crossing &)=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 | Link |
class | ModelLinkGraph |
class | Tangle |
class | XMLLinkCrossingsReader |
class | XMLLinkConnectionsReader |
Represents a single crossing in a link diagram.
The two strands of the link that run over and under the crossing respectively can be accessed through routines such as over(), under(), upper(), lower(), and strand().
Each crossing has a sign, which is either positive (denoted by +1) or negative (denoted by -1):
-----\ /-----> \ -----/ \----->
-----\ /-----> / -----/ \----->
If a link has n crossings, then these are numbered 0,...,n-1. The number assigned to this crossing can be accessed by calling index(). Note that crossings in a link may be reindexed when other crossings are added or removed - if you wish to track a particular crossing through such operations then you should use a pointer to the relevant Crossing object instead.
Crossings 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 Link to which they belong.
|
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 crossing within the overall link.
If the link contains n crossings, then the index will be a number between 0 and n-1 inclusive.
|
inline |
|
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.
|
inline |
Returns the crossing reference that immediately follows this when walking forward in the direction of the link along one of the two strands that pass at this crossing.
Which strand we follow is indicated by the argument strand.
Note that for a crossing c, calling c.next(s)
is equivalent to calling c.strand(s).next()
.
strand | either 1 to walk forward along the upper strand, or 0 to walk forward along the lower strand. |
|
inline |
|
inline |
Returns the crossing reference that immediately precedes this when walking backward against the direction of the link along one of the two strands that pass at this crossing.
Which strand we follow is indicated by the argument strand.
Note that for a crossing c, calling c.prev(s)
is equivalent to calling c.strand(s).prev()
.
strand | either 1 to walk backward along the upper strand, or 0 to walk backward along the lower strand. |
|
inline |
Returns the sign of this crossing.
This will be +1 for a positive crossing, or -1 for a negative crossing.
See the Crossing class notes for diagrams of positive and negative crossings
|
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.
|
inline |
Returns a reference to one of the two strands of the link that pass each other at this crossing.
This is equivalent to directly constructing StrandRef(this
, which).
Note that upper() and over() are synonyms for strand(1), and lower() and under() are synonyms for strand(0).
which | either 1 to indicate the upper strand, or 0 to indicate the lower strand. |
|
inline |
|
inline |
|
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 object to the given output stream.
out | the output stream to which to write. |