Regina 7.3 Calculation Engine
|
Represents a pair of tetrahedron face numbers. More...
#include <triangulation/facepair.h>
Public Member Functions | |
FacePair () | |
Creates a new face pair (0,1). More... | |
FacePair (int first, int second) | |
Creates a new face pair from the two given face numbers. More... | |
FacePair (const FacePair &)=default | |
Creates a new face pair that is a clone of the given pair. More... | |
int | lower () const |
Returns the smaller of the two face numbers in this pair. More... | |
int | upper () const |
Returns the larger of the two face numbers in this pair. More... | |
bool | isBeforeStart () const |
Determines if this face pair represents a before-the-start value. More... | |
bool | isPastEnd () const |
Determines if this face pair represents a past-the-end value. More... | |
FacePair | complement () const |
Returns the complement of this face pair. More... | |
FacePair & | operator= (const FacePair &cloneMe)=default |
Sets this face pair to be a copy of the given pair. More... | |
bool | operator== (const FacePair &other) const |
Determines if this and the given face pair are equal. More... | |
bool | operator!= (const FacePair &other) const |
Determines if this and the given face pair are not equal. More... | |
bool | operator< (const FacePair &other) const |
Determines if this is less than the given face pair. More... | |
bool | operator> (const FacePair &other) const |
Determines if this is greater than the given face pair. More... | |
bool | operator<= (const FacePair &other) const |
Determines if this is less than or equal to the given face pair. More... | |
bool | operator>= (const FacePair &other) const |
Determines if this is greater than or equal to the given face pair. More... | |
FacePair & | operator++ () |
Increments this face pair. More... | |
FacePair | operator++ (int) |
Increments this face pair. More... | |
FacePair & | operator-- () |
Decrements this face pair. More... | |
FacePair | operator-- (int) |
Decrements this face pair. More... | |
int | commonEdge () const |
Identifies the tetrahedron edge that is common to both faces in this pair. More... | |
int | oppositeEdge () const |
Identifies the tetrahedron edge that belongs to neither of the two faces in this pair. More... | |
Represents a pair of tetrahedron face numbers.
Note that we are not storing triangle numbers in a triangulation skeleton, but merely face numbers 0, 1, 2 and 3 in a single tetrahedron. Thus there are only six possible face pairs; this class merely makes working with such pairs more convenient.
As well as providing the six possible face pairs, there is also a before-the-start and a past-the-end value; this (combined with the increment operator) allows for iteration through face pairs.
When iterating through face pairs, the ordering will be the lexicographical ordering (0,1), (0,2), (0,3), (1,2), (1,3), (2,3).
The before-the-start and past-the-end values are internally represented as (0,0) and (3,3) respectively.
These objects are small enough to pass by value and swap with std::swap(), with no need for any specialised move operations or swap functions.
|
inline |
Creates a new face pair (0,1).
|
inline |
Creates a new face pair from the two given face numbers.
The two given numbers need not be in any particular order.
first | the first face number in the new pair. |
second | the second face number in the new pair. |
|
default |
Creates a new face pair that is a clone of the given pair.
|
inline |
Identifies the tetrahedron edge that is common to both faces in this pair.
This will be a tetrahedron edge number, between 0 and 5 inclusive. Note that edges commonEdge() and oppositeEdge() will be opposite edges in the tetrahedron.
|
inline |
Returns the complement of this face pair.
The complement is the pair containing the two faces not included in this face pair.
|
inline |
Determines if this face pair represents a before-the-start value.
true
if and only if this face pair is before-the-start.
|
inline |
Determines if this face pair represents a past-the-end value.
true
if and only if this face pair is past-the-end.
|
inline |
Returns the smaller of the two face numbers in this pair.
|
inline |
Determines if this and the given face pair are not equal.
other | the pair to compare with this. |
true
if and only if this and the given pair are not equal. FacePair & regina::FacePair::operator++ | ( | ) |
Increments this face pair.
It will be set to the following face pair in the lexicographical ordering, or to a past-the-end value if there are no more face pairs.
This is a preincrement operator: the object will be changed, and then a reference to it will be returned.
|
inline |
Increments this face pair.
It will be set to the following face pair in the lexicographical ordering, or to a past-the-end value if there are no more face pairs.
This is a postincrement operator: the object will be changed, but a copy of the original reference will be returned.
FacePair & regina::FacePair::operator-- | ( | ) |
Decrements this face pair.
It will be set to the previous face pair in the lexicographical ordering, or to a before-the-start value if there are no previous face pairs.
This is a predecrement operator: the object will be changed, and then a reference to it will be returned.
|
inline |
Decrements this face pair.
It will be set to the previous face pair in the lexicographical ordering, or to a before-the-start value if there are no previous face pairs.
This is a postdecrement operator: the object will be changed, but a copy of the original reference will be returned.
|
inline |
Determines if this is less than the given face pair.
other | the pair to compare with this. |
true
if and only if this is less than other.
|
inline |
Determines if this is less than or equal to the given face pair.
other | the pair to compare with this. |
true
if and only if this is less than or equal to other. Sets this face pair to be a copy of the given pair.
cloneMe | the face pair to clone. |
|
inline |
Determines if this and the given face pair are equal.
other | the pair to compare with this. |
true
if and only if this and the given pair are equal.
|
inline |
Determines if this is greater than the given face pair.
other | the pair to compare with this. |
true
if and only if this is greater than other.
|
inline |
Determines if this is greater than or equal to the given face pair.
other | the pair to compare with this. |
true
if and only if this is greater than or equal to other.
|
inline |
Identifies the tetrahedron edge that belongs to neither of the two faces in this pair.
This will be a tetrahedron edge number, between 0 and 5 inclusive. Note that edges commonEdge() and oppositeEdge() will be opposite edges in the tetrahedron.
|
inline |
Returns the larger of the two face numbers in this pair.