Regina 7.0 Calculation Engine
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
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. More...
 
constexpr DiscType (size_t newTetIndex, int newType)
 Creates a new disc type initialised with the given values. More...
 
constexpr DiscType (const DiscType &cloneMe)=default
 Creates a copy of the given disc type. More...
 
constexpr operator bool () const
 Returns true if this disc type is non-null. More...
 
DiscTypeoperator= (const DiscType &cloneMe)=default
 Sets this to a copy of the given disc type. More...
 
constexpr bool operator== (const DiscType &compare) const
 Determines if this and the given disc type are identical. More...
 
constexpr bool operator!= (const DiscType &compare) const
 Determines if this and the given disc type are different. More...
 
constexpr bool operator< (const DiscType &compare) const
 Provides an ordering of disc types. More...
 

Public Attributes

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

Static Public Attributes

static const DiscType NONE
 Represents a null disc type, as described in the class notes. More...
 

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]

constexpr regina::DiscType::DiscType ( )
inlineconstexpr

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

◆ DiscType() [2/3]

constexpr 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]

constexpr regina::DiscType::DiscType ( const DiscType cloneMe)
constexprdefault

Creates a copy of the given disc type.

Parameters
cloneMethe disc type to clone.

Member Function Documentation

◆ operator bool()

constexpr 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).

Python
This is not available to python users. Instead you can simply test whether type is negative.
Returns
true if and only if this is not a null disc type.

◆ operator!=()

constexpr bool regina::DiscType::operator!= ( const DiscType compare) const
inlineconstexpr

Determines if this and the given disc type are different.

This is the negation of the equality test; see operator == for further details.

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

◆ operator<()

constexpr bool regina::DiscType::operator< ( const DiscType compare) const
inlineconstexpr

Provides an ordering of disc types.

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

Returns
true if this disc type appears before the given disc type in the ordering, or false if not.

◆ operator=()

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

Sets this to a copy of the given disc type.

Parameters
cloneMethe disc type to clone.
Returns
a reference to this disc type.

◆ operator==()

constexpr bool regina::DiscType::operator== ( const DiscType compare) const
inlineconstexpr

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

◆ NONE

const DiscType regina::DiscType::NONE
static

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

Deprecated:
You can create a new null disc type using the default constructor, and you can test for null disc types by casting to bool.

◆ 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:

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).