Regina 7.0 Calculation Engine
|
Stores data of type T
for every normal disc inside a single tetrahedron.
More...
#include <surface/disc.h>
Public Types | |
using | Data = T |
The type of data being stored alongside each normal disc. More... | |
using | DataPtr = T * |
A pointer to the type of data stored alongside each normal disc. More... | |
Public Member Functions | |
DiscSetTetData (const NormalSurface &surface, size_t tetIndex) | |
Creates a new disc set corresponding to the discs of the given normal surface that lie within the given tetrahedron. More... | |
DiscSetTetData (const NormalSurface &surface, size_t tetIndex, const T &initValue) | |
Creates a new disc set corresponding to the discs of the given normal surface that lie within the given tetrahedron. More... | |
DiscSetTetData (unsigned long tri0, unsigned long tri1, unsigned long tri2, unsigned long tri3, unsigned long quad0, unsigned long quad1, unsigned long quad2, unsigned long oct0=0, unsigned long oct1=0, unsigned long oct2=0) | |
Creates a new disc set where the number of discs of each type is explicitly given. More... | |
DiscSetTetData (const DiscSetTetData &src) | |
Creates a new copy of the given set of normal discs. More... | |
DiscSetTetData (DiscSetTetData &&src) noexcept | |
Moves the contents of the given disc set into this new disc set. More... | |
~DiscSetTetData () | |
Destroys this disc set and deallocates all data arrays. More... | |
DiscSetTetData & | operator= (const DiscSetTetData &src) |
Sets this to be a copy of the given set of normal discs. More... | |
DiscSetTetData & | operator= (DiscSetTetData &&src) noexcept |
Moves the contents of the given disc set into this disc set. More... | |
bool | operator== (const DiscSetTetData &other) const |
Determines whether this and the given set have the same number of discs of each type, and contain the same data for corresponding discs. More... | |
bool | operator!= (const DiscSetTetData &other) const |
Determines whether this and the given set either do not have the same number of discs of each type, or do not contain the same data for corresponding discs. More... | |
void | swap (DiscSetTetData &other) noexcept |
Swaps the contents of this and the given disc set. More... | |
T & | data (int discType, unsigned long discNumber) |
Retrieves a reference to the data corresponding to the given normal disc. More... | |
bool | operator== (const DiscSetTet &other) const |
Determines whether this and the given set have the same number of discs of each type. More... | |
bool | operator!= (const DiscSetTet &other) const |
Determines whether this and the given set do not have the same number of discs of each type. More... | |
unsigned long | nDiscs (int type) const |
Determines the number of discs of the given type inside this tetrahedron. More... | |
unsigned long | arcFromDisc (int arcFace, int arcVertex, int discType, unsigned long discNumber) const |
Determines which normal arc of a given type on a given face of this tetrahedron corresponds to the given normal disc. More... | |
std::pair< int, unsigned long > | discFromArc (int arcFace, int arcVertex, unsigned long arcNumber) const |
Determines which normal disc in this tetrahedron meets the given normal arc on the given face. More... | |
Protected Attributes | |
T * | data_ [10] |
Stores the data corresponding to each normal disc. More... | |
unsigned long | discs_ [10] |
The number of discs of each type. More... | |
Stores data of type T
for every normal disc inside a single tetrahedron.
This class implements C++ move semantics and adheres to the C++ Swappable requirement. It is designed to avoid deep copies wherever possible, even when passing or returning objects by value.
unsigned long
. See the precondition below.a
and b
are of type T, then a
can be declared with no parameters and can then receive the value of b
using a=b
.using regina::DiscSetTetData< T >::Data = T |
The type of data being stored alongside each normal disc.
using regina::DiscSetTetData< T >::DataPtr = T* |
A pointer to the type of data stored alongside each normal disc.
Data*
instead.
|
inline |
Creates a new disc set corresponding to the discs of the given normal surface that lie within the given tetrahedron.
The data for each disc will be initialised using its default constructor.
surface | the normal surface whose discs we shall use. |
tetIndex | the index in the triangulation of the tetrahedron that our discs must lie in; this must be between 0 and tri.size()-1 inclusive, where tri is the triangulation containing the given normal surface. |
|
inline |
Creates a new disc set corresponding to the discs of the given normal surface that lie within the given tetrahedron.
The data for each disc will be initialised to the given value.
surface | the normal surface whose discs we shall use. |
tetIndex | the index in the triangulation of the tetrahedron that our discs must lie in; this must be between 0 and tri.size()-1 inclusive, where tri is the triangulation containing the given normal surface. |
initValue | the value with which to initialise the data corresponding to each disc. |
|
inline |
Creates a new disc set where the number of discs of each type is explicitly given.
The data for each disc will be initialised using its default constructor.
tri0 | the number of triangular discs surrounding vertex 0. |
tri1 | the number of triangular discs surrounding vertex 1. |
tri2 | the number of triangular discs surrounding vertex 2. |
tri3 | the number of triangular discs surrounding vertex 3. |
quad0 | the number of quadrilateral discs of type 0. |
quad1 | the number of quadrilateral discs of type 1. |
quad2 | the number of quadrilateral discs of type 2. |
oct0 | the number of octahedral discs of type 0. |
oct1 | the number of octahedral discs of type 1. |
oct2 | the number of octahedral discs of type 2. |
|
inline |
Creates a new copy of the given set of normal discs.
The data for each disc will be copied using the copy assignment operator for type T.
src | the disc set to copy. |
|
inlinenoexcept |
Moves the contents of the given disc set into this new disc set.
This is a fast (constant time) operation.
The disc set that was passed (src) will no longer be usable.
src | the disc set to move from. |
|
inline |
Destroys this disc set and deallocates all data arrays.
Note that no assumption is made about type T
, so if data elements are pointers to dynamically allocated objects, these will not be destroyed.
|
inherited |
Determines which normal arc of a given type on a given face of this tetrahedron corresponds to the given normal disc.
arcFace | the face of this tetrahedron containing the normal arc (between 0 and 3 inclusive). |
arcVertex | the vertex of this tetrahedron about which the normal arc runs (between 0 and 3 inclusive); arcFace and arcVertex should not be the same. |
discType | the disc type of the given normal disc; this should be between 0 and 9 inclusive, as described in the DiscSpec class notes. |
discNumber | indicates which normal disc of the given disc type is referred to (between 0 and nDiscs(discType)-1 inclusive). |
|
inline |
Retrieves a reference to the data corresponding to the given normal disc.
discType | the disc type of the given normal disc; this should be between 0 and 9 inclusive, as described in the DiscSpec class notes. |
discNumber | indicates which normal disc of the given disc type is referred to; this should be between 0 and nDiscs(discType)-1 inclusive. |
|
inherited |
Determines which normal disc in this tetrahedron meets the given normal arc on the given face.
arcFace | the face of this tetrahedron containing the normal arc (between 0 and 3 inclusive). |
arcVertex | the vertex of this tetrahedron about which the normal arc runs (between 0 and 3 inclusive); arcFace and arcVertex should not be the same. |
arcNumber | indicates which normal arc of the given type is referred to. Arcs of a given type (where arcFace and arcVertex together define the arc type) are numbered starting at 0 from the tetrahedron vertex outwards. |
discType
) meets the given normal arc (between 0 and nDiscs(discType)-1
inclusive).
|
inlineinherited |
Determines the number of discs of the given type inside this tetrahedron.
type | the disc type to examine; this should be between 0 and 9 inclusive. Disc types are outlined in the DiscSpec class notes |
|
inlineinherited |
Determines whether this and the given set do not have the same number of discs of each type.
This routine does not consider whether the two underlying tetrahedra are the same; it merely compares the ten disc counts in each set.
true
if and only if both sets are not the same, as described above.
|
inline |
Determines whether this and the given set either do not have the same number of discs of each type, or do not contain the same data for corresponding discs.
This routine does not consider whether the two underlying tetrahedra are the same; it merely compares the disc counts and associated data within each set.
The associated data (of type T) will be compared using the equality operator (==).
true
if and only if both sets are not the same, as described above.
|
inline |
Sets this to be a copy of the given set of normal discs.
The data for each disc will be copied using the copy assignment operator for type T.
src | the disc set to copy. |
|
inlinenoexcept |
Moves the contents of the given disc set into this disc set.
This is a fast (constant time) operation.
The disc set that was passed (src) will no longer be usable.
src | the disc set to move from. |
|
inlineinherited |
Determines whether this and the given set have the same number of discs of each type.
This routine does not consider whether the two underlying tetrahedra are the same; it merely compares the ten disc counts in each set.
true
if and only if both sets are the same, as described above.
|
inline |
Determines whether this and the given set have the same number of discs of each type, and contain the same data for corresponding discs.
This routine does not consider whether the two underlying tetrahedra are the same; it merely compares the disc counts and associated data within each set.
The associated data (of type T) will be compared using the equality operator (==).
true
if and only if both sets are the same, as described above.
|
inlinenoexcept |
Swaps the contents of this and the given disc set.
other | the disc set whose contents should be swapped with this. |
|
protected |
Stores the data corresponding to each normal disc.
|
protectedinherited |
The number of discs of each type.