|
int | 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...
|
|
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.
template<class T , bool supportsUtf8 = false>
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.
- Returns
- a detailed text representation of this object.
template<class T , bool supportsUtf8 = false>
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.
- Python
- The Python "stringification" function
str()
will use precisely this function, and for most classes the Python repr()
function will incorporate this into its output.
- Returns
- a short text representation of this object.
template<class T , bool supportsUtf8 = false>
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.
- Returns
- a short text representation of this object.