Regina 7.0 Calculation Engine
|
Indicates precisely how a normal surface is encoded by an integer vector. More...
#include <surface/normalcoords.h>
Public Member Functions | |
constexpr | NormalEncoding (NormalCoords coords) |
Returns an encoding that precisely describes the given normal or almost normal coordinate system. More... | |
constexpr | NormalEncoding (const NormalEncoding &)=default |
Creates a new copy of the given encoding. More... | |
NormalEncoding & | operator= (const NormalEncoding &)=default |
Sets this to be a copy of the given encoding. More... | |
constexpr bool | operator== (const NormalEncoding &other) const |
Determines whether this and the given encoding are identical. More... | |
constexpr bool | operator!= (const NormalEncoding &other) const |
Determines whether this and the given encoding are different. More... | |
constexpr bool | valid () const |
Returns whether this describes a vector encoding of normal or almost normal surfaces. More... | |
constexpr int | block () const |
Returns the number of coordinates stored for each tetrahedron. More... | |
constexpr bool | storesTriangles () const |
Returns whether this encoding explicitly stores triangle coordinates. More... | |
constexpr bool | storesOctagons () const |
Returns whether this encoding explicitly stores octagon coordinates. More... | |
constexpr bool | storesAngles () const |
Identifies whether this is the special angle structure encoding. More... | |
constexpr bool | couldBeVertexLink () const |
Returns whether it is possible for a surface using this encoding to include one or more vertex linking components. More... | |
constexpr bool | couldBeNonCompact () const |
Returns whether it is possible for a surface using this encoding to be non-compact. More... | |
constexpr NormalEncoding | withTriangles () const |
Returns an extension of this encoding that explicitly stores triangle coordinates. More... | |
constexpr NormalEncoding | operator+ (NormalEncoding rhs) const |
Returns an encoding that could hold the sum of surfaces that use this and the given encoding. More... | |
constexpr int | intValue () const |
Exports this encoding as an integer. More... | |
Static Public Member Functions | |
constexpr static NormalEncoding | fromIntValue (int value) |
Reconstructs an encoding from an integer value. More... | |
Indicates precisely how a normal surface is encoded by an integer vector.
Normal surfaces do not always store their internal vectors in the same coordinate system that was used to enumerate the surfaces, and indeed an isolated surface does not know how it was originally created.
Therefore each normal surface keeps a small amount of data, represented by this class, so that it knows how to interpret its internal integer vector. This data also remembers properties of the enumeration process that can be used for optimisations (e.g., the knowledge that, even if the vector stores triangle coordinates, the surface cannot contain any vertex linking components).
For convenience, there is also a special encoding that identifies an angle structure vector; this can be created via NormalEncoding(NS_ANGLE)
, and can be recognised via storesAngles(). However, like NS_ANGLE itself, this special angle structure encoding does not represent a normal surface, cannot be combined with other encodings, and must not be used with any of Regina's routines unless the documentation explicitly allows it. Specifically, any code that accepts a NormalEncoding argument may silently assume that the encoding is not the special angle structure encoding, unless the documentation explicitly says otherwise.
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.
|
inlineconstexpr |
Returns an encoding that precisely describes the given normal or almost normal coordinate system.
This is the encoding that you would use with a "pen and paper" enumeration of surfaces in the given coordinate system, with no further conversion, optimisation, or post-processing.
Note that, when Regina enumerates surfaces in the given coordinate system, it might choose to post-process the resulting vectors to use a different encoding. For example, when enumerating surfaces in quad or quad-oct coordinates, Regina computes and stores triangle coordinates also, and so for its own internal choice of encoding, storesTriangles() will return true
. In contrast, if you simply create a NormalEncoding(NS_QUAD)
, then the resulting encoding will have storesTriangles() return false
.
If coords is not one of the coordinate systems that Regina can use to enumerate or reconstruct surfaces (or NS_ANGLE, as discussed below), then the resulting encoding will be invalid, and valid() will return false
. (Here "reconstruct" refers to the special case of NS_AN_LEGACY, which is used only when reading surfaces from very old data files).
As a special case, you may pass NS_ANGLE to this constructor; however, the resulting encoding does not represent a normal surface and must not be used anywhere in Regina unless the documentation explicitly allows it. See the class notes for further details.
coords | one of Regina's normal or almost normal coordinate systems. |
|
constexprdefault |
Creates a new copy of the given encoding.
|
inlineconstexpr |
Returns the number of coordinates stored for each tetrahedron.
|
inlineconstexpr |
Returns whether it is possible for a surface using this encoding to be non-compact.
Here "non-compact" refers to a surface with infinitely many discs, such as a spun-normal surface. See NormalSurface::isCompact() for details.
This is typically information that is inherited from whoever enumerated or created the normal surface that uses this encoding.
If this returns true
, it does not mean that the surface does actually contain infinitely many discs; it simply means that the user will need to test this themselves. If this returns false
, however, it is guaranteed that the surface is compact, with no further testing required.
For the special angle structure encoding (described in the class notes), this routine will return false
.
true
if it is possible that the surface might be non-compact.
|
inlineconstexpr |
Returns whether it is possible for a surface using this encoding to include one or more vertex linking components.
This is typically information that is inherited from whoever enumerated or created the normal surface that uses this encoding.
If this returns true
, it does not mean that the surface does actually contain vertex linking components; it simply means that the user will need to test this themselves. If this returns false
, however, it is guaranteed that the surface does not contain any vertex linking components, with no further testing required.
For the special angle structure encoding (described in the class notes), this routine will return false
.
true
if it is possible that the surface might contain one or more vertex linking components.
|
inlinestaticconstexpr |
Reconstructs an encoding from an integer value.
This is a partner routine to intValue(): for any encoding enc, the encoding fromIntValue(enc.intValue())
is always equal to enc.
The main purpose of intValue() and fromIntValue() is to support reading and writing surfaces to/from Regina's XML file format.
value | an integer that represents an encoding, typically obtained by calling intValue(). |
|
inlineconstexpr |
Exports this encoding as an integer.
The exact value of the integer is meant to be opaque, in the sense that it can only be used with fromIntValue(). End users are not meant to pull it apart and analyse it (this is what the other query routines in this class are for).
The main purpose of intValue() and fromIntValue() is to support reading and writing surfaces to/from Regina's XML file format.
It is guaranteed that 0 will never be the integer value of a (correctly constructed) encoding.
|
inlineconstexpr |
Determines whether this and the given encoding are different.
other | the encoding to compare with this. |
true
if and only if both encodings are different.
|
inlineconstexpr |
Returns an encoding that could hold the sum of surfaces that use this and the given encoding.
More precisely, the encoding that is returned is the "simplest" possible encoding that is capable of holding the sum of two surfaces that use this and the given encoding respectively.
rhs | the encoding to combine with this. |
|
default |
Sets this to be a copy of the given encoding.
|
inlineconstexpr |
Determines whether this and the given encoding are identical.
other | the encoding to compare with this. |
true
if and only if both encodings are identical.
|
inlineconstexpr |
Identifies whether this is the special angle structure encoding.
This routine is used to recognise the "special case" encoding NormalEncoding(NS_ANGLE)
. Such an encoding does not represent a normal surface, and cannot be used anywhere in Regina unless explicitly allowed in the documentation. See the class notes for further details.
|
inlineconstexpr |
Returns whether this encoding explicitly stores octagon coordinates.
For the special angle structure encoding (described in the class notes), this routine will return false
.
true
if octagon coordinates are stored.
|
inlineconstexpr |
Returns whether this encoding explicitly stores triangle coordinates.
For the special angle structure encoding (described in the class notes), this routine will return false
.
true
if triangle coordinates are stored.
|
inlineconstexpr |
Returns whether this describes a vector encoding of normal or almost normal surfaces.
The only case where this would be false
is if you create an encoding using either (1) a coordinate system that Regina does not use for enumeration or reconstruction; or (2) another invalid encoding.
For the special angle structure encoding (described in the class notes), this routine will return true
.
true
if and only if this is a valid encoding.
|
inlineconstexpr |
Returns an extension of this encoding that explicitly stores triangle coordinates.
All other properties of the encoding will be copied across without changes (including "theoretical" properties such as whether the surface could have vertex linking components, or whether it could be spun-normal).
If this encoding already stores triangle coordinates, then the result will be identical to this.