Regina 7.4 Calculation Engine
regina::DiscType Struct Reference

Identifies a single normal or almost normal disc type within a triangulation. More...

#include <surface/disctype.h>

Public Member Functions

constexpr DiscType ()
 Creates a new null disc type, as described in the class notes.
 
constexpr DiscType (size_t newTetIndex, int newType)
 Creates a new disc type initialised with the given values.
 
constexpr DiscType (const DiscType &)=default
 Creates a copy of the given disc type.
 
constexpr operator bool () const
 Returns true if this disc type is non-null.
 
DiscTypeoperator= (const DiscType &)=default
 Sets this to a copy of the given disc type.
 
constexpr bool operator== (const DiscType &) const =default
 Determines if this and the given disc type are identical.
 
constexpr std::strong_ordering operator<=> (const DiscType &) const =default
 Compares two disc types.
 

Public Attributes

size_t tetIndex
 The index within the triangulation of the tetrahedron containing this disc type.
 
int type
 Identifies the disc type within the specified tetrahedron.
 

Detailed Description

Identifies a single normal or almost normal disc type within a triangulation.

A disc type is identified by a tetrahedron index (the data member tetIndex), and a disc type within that tetrahedron (the data member type). The latter could mean any number of things according to the application at hand. For instance, if we are tracking quad types then type might be an integer between 0 and 2 inclusive, or if we are tracking all normal discs in standard coordinates then type might be an integer between 0 and 6 inclusive. Ultimately, the specific meaning of type is left to the user.

It is however assumed that type will always be non-negative for "meaningful" disc types.

This class can also store a null disc type; this is obtained by calling the default constructor, and it will have a type of -1 and a tetrahedron index of 0. You can test for a null disc type by casting to bool.

Note that this class tracks disc types, not discs themselves. To track individual normal discs, see the DiscSpec class instead.

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.

Constructor & Destructor Documentation

◆ DiscType() [1/3]

regina::DiscType::DiscType ( )
inlineconstexpr

Creates a new null disc type, as described in the class notes.

◆ DiscType() [2/3]

regina::DiscType::DiscType ( size_t newTetIndex,
int newType )
inlineconstexpr

Creates a new disc type initialised with the given values.

Parameters
newTetIndexthe index within the triangulation of the tetrahedron containing this disc type.
newTypethe specific disc type within the given tetrahedron; see the class notes for the meaning of this field.

◆ DiscType() [3/3]

regina::DiscType::DiscType ( const DiscType & )
constexprdefault

Creates a copy of the given disc type.

Member Function Documentation

◆ operator bool()

regina::DiscType::operator bool ( ) const
inlineconstexpr

Returns true if this disc type is non-null.

The implementation will assume that a non-null disc type has non-negative type (as explained in the class notes).

Returns
true if and only if this is not a null disc type.

◆ operator<=>()

std::strong_ordering regina::DiscType::operator<=> ( const DiscType & ) const
constexprdefault

Compares two disc types.

Types are ordered first by tetrahedron and then by type. The null disc type is considered less than all "meaningful" disc types.

This generates all of the usual comparison operators, including <, <=, >, and >=.

Python
This spaceship operator x <=> y is not available, but the other comparison operators that it generates are available.
Returns
The result of the comparison between this and the given disc type.

◆ operator=()

DiscType & regina::DiscType::operator= ( const DiscType & )
default

Sets this to a copy of the given disc type.

Returns
a reference to this disc type.

◆ operator==()

bool regina::DiscType::operator== ( const DiscType & ) const
constexprdefault

Determines if this and the given disc type are identical.

Regarding null disc types: two null DiscType objects that were both created using the default constructor will be considered equal to each other, and will not be equal to any "meaningful" disc type (where type is non-negative).

Returns
true if this and the given disc type are identical, or false if they are different.

Member Data Documentation

◆ tetIndex

size_t regina::DiscType::tetIndex

The index within the triangulation of the tetrahedron containing this disc type.

This must be between 0 and Triangulation<3>::size()-1 inclusive.

◆ type

int regina::DiscType::type

Identifies the disc type within the specified tetrahedron.

The precise meaning of this member is left up to the user, though it must be non-negative for "meaningful" disc types. See the DiscType class notes for details.


The documentation for this struct was generated from the following file: