Regina 7.3 Calculation Engine
|
Helper class that provides core functionality for a boundary component of a dim-dimensional triangulation. More...
#include <triangulation/detail/boundarycomponent.h>
Public Member Functions | |
~BoundaryComponentBase () | |
Destroys this object. More... | |
size_t | index () const |
Returns the index of this boundary component in the underlying triangulation. More... | |
size_t | size () const |
Returns the number of (dim-1)-faces in this boundary component. More... | |
size_t | countRidges () const |
Returns the number of (dim-2)-faces in this boundary component. More... | |
template<int subdim> | |
size_t | countFaces () const |
Returns the number of subdim-faces in this boundary component. More... | |
size_t | countVertices () const |
A dimension-specific alias for countFaces<0>(). More... | |
size_t | countEdges () const |
A dimension-specific alias for countFaces<1>(). More... | |
size_t | countTriangles () const |
A dimension-specific alias for countFaces<2>(). More... | |
size_t | countTetrahedra () const |
A dimension-specific alias for countFaces<3>(). More... | |
size_t | countPentachora () const |
A dimension-specific alias for countFaces<4>(). More... | |
auto | facets () const |
Returns an object that allows iteration through and random access to all (dim-1)-faces in this boundary component. More... | |
template<int subdim> | |
auto | faces () const |
Returns an object that allows iteration through and random access to all subdim-faces in this boundary component. More... | |
auto | vertices () const |
A dimension-specific alias for faces<0>(). More... | |
auto | edges () const |
A dimension-specific alias for faces<1>(). More... | |
auto | triangles () const |
A dimension-specific alias for faces<2>(). More... | |
auto | tetrahedra () const |
A dimension-specific alias for faces<3>(). More... | |
auto | pentachora () const |
A dimension-specific alias for faces<4>(). More... | |
Face< dim, dim-1 > * | facet (size_t index) const |
Returns the requested (dim-1)-face in this boundary component. More... | |
template<int subdim> | |
Face< dim, subdim > * | face (size_t index) const |
Returns the requested subdim-face in this boundary component. More... | |
Face< dim, 0 > * | vertex (size_t index) const |
A dimension-specific alias for face<0>(). More... | |
Face< dim, 1 > * | edge (size_t index) const |
A dimension-specific alias for face<1>(). More... | |
Face< dim, 2 > * | triangle (size_t index) const |
A dimension-specific alias for face<2>(). More... | |
Face< dim, 3 > * | tetrahedron (size_t index) const |
A dimension-specific alias for face<3>(). More... | |
Face< dim, 4 > * | pentachoron (size_t index) const |
A dimension-specific alias for face<4>(). More... | |
Triangulation< dim > & | triangulation () const |
Returns the triangulation to which this boundary component belongs. More... | |
Component< dim > * | component () const |
Returns the connected component of the triangulation to which this boundary component belongs. More... | |
bool | isOrientable () const |
Determines if this boundary component is orientable. More... | |
long | eulerChar () const |
Returns the Euler characteristic of this boundary component. More... | |
bool | isReal () const |
Determines if this boundary component is real. More... | |
bool | isIdeal () const |
Determines if this boundary component is ideal. More... | |
bool | isInvalidVertex () const |
Determines if this boundary component consists of a single invalid vertex and nothing else. More... | |
const Triangulation< dim-1 > & | build () const |
Returns the full (dim-1)-dimensional triangulation of this boundary component. More... | |
void | writeTextShort (std::ostream &out) const |
Writes a short text representation of this object to the given output stream. More... | |
BoundaryComponentBase (const BoundaryComponentBase &)=delete | |
BoundaryComponentBase & | operator= (const BoundaryComponentBase &)=delete |
void | writeTextLong (std::ostream &out) const |
A default implementation for detailed output. More... | |
std::string | str () const |
Returns a short text representation of this object. More... | |
std::string | utf8 () const |
Returns a short text representation of this object using unicode characters. More... | |
std::string | detail () const |
Returns a detailed text representation of this object. More... | |
size_t | markedIndex () const |
Returns the index at which this object is stored in an MarkedVector. More... | |
Static Public Attributes | |
static constexpr int | dimension = dim |
A compile-time constant that gives the dimension of the triangulation that contains this boundary component. More... | |
static constexpr bool | allowVertex = standardDim(dim) && (dim > 2) |
A compile-time constant indicating whether ideal and/or invalid vertex boundary components are both possible and recognised by this boundary component class. More... | |
static constexpr bool | canBuild = (dim > 2) |
A compile-time constant indicating whether this boundary component class supports triangulating boundary components. More... | |
static constexpr bool | allFaces = standardDim(dim) |
A compile-time constant indicating whether this boundary component class stores all lower-dimensional faces (true ), or only faces of dimension dim-1 (false ). More... | |
Protected Member Functions | |
BoundaryComponentBase ()=default | |
Default constructor that leaves orientability uninitialised. More... | |
Protected Attributes | |
bool | orientable_ |
Is this boundary component orientable? More... | |
EnableIf< canBuild, Triangulation< dim-1 > *, nullptr > | boundary_ |
A full triangulation of the boundary component. More... | |
Friends | |
class | Triangulation< dim > |
class | TriangulationBase< dim > |
Allow access to private members. More... | |
Helper class that provides core functionality for a boundary component of a dim-dimensional triangulation.
Each boundary component is represented by the class BoundaryComponent<dim>, which uses this as a base class. End users should not need to refer to BoundaryComponentBase directly.
See the BoundaryComponent class notes for further information.
Neither this class nor the "end user" class BoundaryComponent<dim> support value semantics: they cannot be copied, swapped, or manually constructed. Their memory is managed by the Triangulation class, and their locations in memory define them. See BoundaryComponent<dim> for further details.
dim | the dimension of the underlying triangulation. This must be between 2 and 15 inclusive. |
regina::detail::BoundaryComponentBase< dim >::~BoundaryComponentBase | ( | ) |
Destroys this object.
The cached boundary component triangulation will be destroyed also.
|
protecteddefault |
Default constructor that leaves orientability uninitialised.
|
inline |
Returns the full (dim-1)-dimensional triangulation of this boundary component.
Note that this triangulation is read-only (though of course you can clone it and then operate upon the clone).
If this is a real boundary component (i.e., it is built from one or more (dim-1)-faces), then the triangulation of this boundary component is as follows:
facet(i)
of this boundary component, and its vertices 0,...,dim-1 are numbered in the same way. To relate these (dim-1)-face vertex numbers to the vertex numbers of top-dimensional simplices in the overall dim-dimensional triangulation, see Simplex<dim>::faceMapping<dim-1>().true
), then a similar correspondence holds for these lower-dimensional faces also: for each i, k-face i of the returned triangulation is a copy of face<k>(i)
of this boundary component, and its vertices are numbered in the same way. As an exception, this correspondence will not hold for dimensions k where there exist pinched k-faces on the boundary (i.e., faces where different sections of the boundary are pinched together, meaning that these faces must be duplicated when the boundary is triangulated).If this boundary component consists only of a single vertex (i.e., this is an ideal or invalid vertex boundary component), then this routine returns the triangulation of the corresponding vertex link. See Vertex::buildLink() for details.
This routine is fast, since it caches the boundary triangulation. Moreover, it is guaranteed that the full skeleton of this (dim-1)-dimensional triangulation will have been generated already.
|
inline |
Returns the connected component of the triangulation to which this boundary component belongs.
|
inline |
A dimension-specific alias for countFaces<1>().
This alias is available only when dim is one of Regina's standard dimensions.
See countFaces() for further information.
|
inline |
Returns the number of subdim-faces in this boundary component.
countFaces(subdim)
; that is, the template parameter subdim becomes the first argument of the function.subdim | the dimension of the faces to query. If dim is one of Regina's standard dimensions, then subdim must be between 0 and dim-1 inclusive. Otherwise, the only allowable values of subdim are the facet dimension (dim-1) and the ridge dimension (dim-2). |
|
inline |
A dimension-specific alias for countFaces<4>().
This alias is only available for dimensions dim = 5 and 6.
See countFaces() for further information.
|
inline |
Returns the number of (dim-2)-faces in this boundary component.
If this is an ideal or invalid vertex boundary component, then this routine will return 0.
|
inline |
A dimension-specific alias for countFaces<3>().
This alias is only available for dimensions dim = 4 and 5.
See countFaces() for further information.
|
inline |
A dimension-specific alias for countFaces<2>().
This alias is available only when dim is one of Regina's standard dimensions and dim ≥ 3.
See countFaces() for further information.
|
inline |
A dimension-specific alias for countFaces<0>().
This alias is available only when dim is one of Regina's standard dimensions.
See countFaces() for further information.
|
inherited |
Returns a detailed text representation of this object.
This text may span many lines, and should provide the user with all the information they could want. It should be human-readable, should not contain extremely long lines (which cause problems for users reading the output in a terminal), and should end with a final newline. There are no restrictions on the underlying character set.
|
inline |
A dimension-specific alias for face<1>().
This alias is available only when dim is one of Regina's standard dimensions.
See face() for further information.
|
inline |
A dimension-specific alias for faces<1>().
This alias is available only when dim is one of Regina's standard dimensions.
See faces() for further information.
|
inline |
Returns the Euler characteristic of this boundary component.
If the boundary component consists of a single vertex and nothing else (e.g., it is an ideal vertex), then the Euler characteristic of the vertex link will be returned.
This function is, in all "normal" cases, equivalent to triangulating the boundary component via build() and then calling Triangulation<dim-1>::eulerCharTri() on the result.
The exception comes from triangulations with "pinched" faces whose links have multiple boundary components (e.g., a vertex whose link is a multiply-punctured sphere, marking a point where different parts of the boundary are "pinched together"). If there are such faces, then this routine will return a well-defined but topologically meaningless result. Essentially, this routine only counts such faces once, even though they "should" be counted multiple times on the boundary since they can be "seen" from distinct sections of the (dim-1)-dimensional boundary. Of course such a triangulation cannot represent a dim-manifold anyway, and so if you do have pinched faces then you almost certainly have bigger problems to deal with.
|
inline |
Returns the requested subdim-face in this boundary component.
Note that the index of a face in the boundary component need not be the index of the same face in the overall triangulation. However, if this is a real boundary component (i.e., it is built from one or more (dim-1)-faces), then the index of each subdim-face in this boundary component will match the index of the corresponding subdim-face in the (dim-1)-manifold triangulation returned by build().
face(subdim, index)
; that is, the template parameter subdim becomes the first argument of the function.subdim | the dimension of the faces to query. If dim is one of Regina's standard dimensions, then subdim must be between 0 and dim-1 inclusive. Otherwise, the only allowable value of subdim is the facet dimension (dim-1). |
index | the index of the desired face, ranging from 0 to countFaces<subdim>()-1 inclusive. |
|
inline |
Returns an object that allows iteration through and random access to all subdim-faces in this boundary component.
The object that is returned is lightweight, and can be happily copied by value. The C++ type of the object is subject to change, so C++ users should use auto
(just like this declaration does).
The returned object is guaranteed to be an instance of ListView, which means it offers basic container-like functions and supports range-based for
loops. Note that the elements of the list will be pointers, so your code might look like:
The object that is returned will remain valid only for as long as this boundary component object exists. In particular, the object will become invalid any time that the triangulation changes (since all boundary component objects will be destroyed and others rebuilt in their place). Therefore it is best to treat this object as temporary only, and to call faces() again each time you need it.
faces(subdim)
.subdim | the dimension of the faces to query. If dim is one of Regina's standard dimensions, then subdim must be between 0 and dim-1 inclusive. Otherwise, the only allowable value of subdim is the facet dimension (dim-1). |
|
inline |
Returns the requested (dim-1)-face in this boundary component.
These are the top-dimensional faces for a real boundary component.
Note that the index of a face in the boundary component need not be the index of the same face in the overall triangulation. However, if this is a real boundary component (i.e., it is built from one or more (dim-1)-faces), then the index of each (dim-1)-face in this boundary component will match the index of the corresponding top-dimensional simplex in the (dim-1)-manifold triangulation returned by build().
index | the index of the desired face, ranging from 0 to size()-1 inclusive. |
|
inline |
Returns an object that allows iteration through and random access to all (dim-1)-faces in this boundary component.
The object that is returned is lightweight, and can be happily copied by value. The C++ type of the object is subject to change, so C++ users should use auto
(just like this declaration does).
The returned object is guaranteed to be an instance of ListView, which means it offers basic container-like functions and supports range-based for
loops. Note that the elements of the list will be pointers, so your code might look like:
The object that is returned will remain valid only for as long as this boundary component object exists. In particular, the object will become invalid any time that the triangulation changes (since all boundary component objects will be destroyed and others rebuilt in their place). Therefore it is best to treat this object as temporary only, and to call facets() again each time you need it.
|
inline |
Returns the index of this boundary component in the underlying triangulation.
|
inline |
Determines if this boundary component is ideal.
This is the case if and only if it consists of a single ideal vertex and no faces of any other dimensions.
See the BoundaryComponent class notes for an overview of ideal boundary components, which can only occur in dimensions ≥ 3, and which are only recognised where dim is one of Regina's standard dimensions.
Note that a boundary component formed from a single invalid vertex is not considered to be ideal. This means that, if a boundary component contains no faces of positive dimension, then one and only one of isIdeal() and isInvalidVertex() will return true
.
false
.true
if and only if this boundary component is ideal.
|
inline |
Determines if this boundary component consists of a single invalid vertex and nothing else.
In particular, such a boundary component must contain no faces of any positive dimension.
See the BoundaryComponent class notes for an overview of invalid vertex boundary components, which can only occur in dimensions ≥ 4, and which are only recognised where dim is one of Regina's standard dimensions.
An invalid vertex is only placed in its own boundary component if it does not already belong to some larger boundary component (for instance, if its link is an ideal (dim-1)-manifold triangulation). This means that, for a boundary component consisting of one or more (dim-1)-faces, this routine will return false
even if the boundary component also includes one or more invalid vertices.
Note that, if a boundary component contains no faces of positive dimension, then one and only one of isIdeal() and isInvalidVertex() will return true
.
false
.true
if and only if this boundary component consists of a single invalid vertex and nothing else.
|
inline |
Determines if this boundary component is orientable.
If this is an ideal or invalid vertex boundary component, then the orientability of the corresponding vertex link is returned.
This routine is fast; in particular, it is pre-computed and does not build a full triangulation of the boundary component.
true
if and only if this boundary component is orientable.
|
inline |
Determines if this boundary component is real.
This is the case if and only if it is formed from one or more (dim-1)-faces.
See the BoundaryComponent class notes for an overview of real, ideal, and invalid vertex boundary components.
true
.true
if and only if this boundary component is real.
|
inlineinherited |
Returns the index at which this object is stored in an MarkedVector.
If this object does not belong to an MarkedVector, the return value is undefined.
|
inline |
A dimension-specific alias for faces<4>().
This alias is only available for dimension dim = 5.
See faces() for further information.
|
inline |
|
inline |
Returns the number of (dim-1)-faces in this boundary component.
These are the top-dimensional faces for a real boundary component.
If this is an ideal or invalid vertex boundary component, then this routine will return 0.
|
inherited |
Returns a short text representation of this object.
This text should be human-readable, should use plain ASCII characters where possible, and should not contain any newlines.
Within these limits, this short text ouptut should be as information-rich as possible, since in most cases this forms the basis for the Python __str__()
and __repr__()
functions.
__str__()
will use precisely this function, and for most classes the Python __repr__()
function will incorporate this into its output.
|
inline |
A dimension-specific alias for faces<3>().
This alias is only available for dimension dim = 4.
See faces() for further information.
|
inline |
|
inline |
A dimension-specific alias for face<2>().
This alias is available only when dim is one of Regina's standard dimensions and dim ≥ 3.
See face() for further information.
|
inline |
A dimension-specific alias for faces<2>().
This alias is available only when dim is one of Regina's standard dimensions and dim ≥ 3.
See faces() for further information.
|
inline |
Returns the triangulation to which this boundary component belongs.
|
inherited |
Returns a short text representation of this object using unicode characters.
Like str(), this text should be human-readable, should not contain any newlines, and (within these constraints) should be as information-rich as is reasonable.
Unlike str(), this function may use unicode characters to make the output more pleasant to read. The string that is returned will be encoded in UTF-8.
|
inline |
A dimension-specific alias for face<0>().
This alias is available only when dim is one of Regina's standard dimensions.
See face() for further information.
|
inline |
A dimension-specific alias for faces<0>().
This alias is available only when dim is one of Regina's standard dimensions.
See faces() for further information.
|
inlineinherited |
A default implementation for detailed output.
This routine simply calls T::writeTextShort() and appends a final newline.
out | the output stream to which to write. |
|
inline |
Writes a short text representation of this object to the given output stream.
out | the output stream to which to write. |
|
friend |
Allow access to private members.
|
staticconstexpr |
A compile-time constant indicating whether this boundary component class stores all lower-dimensional faces (true
), or only faces of dimension dim-1 (false
).
|
staticconstexpr |
A compile-time constant indicating whether ideal and/or invalid vertex boundary components are both possible and recognised by this boundary component class.
|
protected |
A full triangulation of the boundary component.
This may be pre-computed when the triangulation skeleton is constructed, or it may be null
in which case it will be built on demand. For ideal or invalid vertices, this is always null
since the triangulation is cached by the vertex class instead. We keep this as pointer to avoid issues with cascading template instantiations (this allows us to work with forward declarations of lower-dimensional types instead).
|
staticconstexpr |
A compile-time constant indicating whether this boundary component class supports triangulating boundary components.
|
staticconstexpr |
A compile-time constant that gives the dimension of the triangulation that contains this boundary component.
|
protected |
Is this boundary component orientable?