Regina 7.0 Calculation Engine
Public Member Functions | Static Public Member Functions | List of all members
regina::PillowTwoSphere Class Reference

Represents a 2-sphere made from two triangles glued together along their three edges. More...

#include <subcomplex/pillowtwosphere.h>

Inheritance diagram for regina::PillowTwoSphere:
regina::ShortOutput< PillowTwoSphere > regina::Output< T, supportsUtf8 >

Public Member Functions

 PillowTwoSphere (const PillowTwoSphere &)=default
 Creates a new copy of this structure. More...
 
PillowTwoSphereoperator= (const PillowTwoSphere &)=default
 Sets this to be a copy of the given structure. More...
 
PillowTwoSphereclone () const
 Deprecated routine that returns a new copy of this structure. More...
 
Triangle< 3 > * triangle (int index) const
 Returns one of the two triangles whose boundaries are joined. More...
 
Perm< 4 > triangleMapping () const
 Returns a permutation describing how the boundaries of the two triangles are joined. More...
 
bool operator== (const PillowTwoSphere &other) const
 Determines whether this and the given object represent the same specific presentation of a pillow 2-sphere. More...
 
bool operator!= (const PillowTwoSphere &other) const
 Determines whether this and the given object represent different specific presentations of a pillow 2-sphere. More...
 
void writeTextShort (std::ostream &out) const
 Writes a short text representation of this object to the given output stream. More...
 
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...
 

Static Public Member Functions

static std::unique_ptr< PillowTwoSphererecognise (Triangle< 3 > *tri1, Triangle< 3 > *tri2)
 Determines if the two given triangles together form a pillow 2-sphere. More...
 
static std::unique_ptr< PillowTwoSphereformsPillowTwoSphere (Triangle< 3 > *tri1, Triangle< 3 > *tri2)
 A deprecated alias to recognise if two triangles together form a pillow 2-sphere. More...
 

Detailed Description

Represents a 2-sphere made from two triangles glued together along their three edges.

The two triangles must be distinct and the three edges of each triangle must also be distinct. Neither of the triangles may be boundary triangles. These two triangless together form an embedded 2-sphere in the triangulation (with the exception that two or three points of the sphere corresponding to the triangles vertices may be identified).

This 2-sphere can be cut along and the two resulting 2-sphere boundaries filled in with 3-balls, and the resulting triangulation has the same number of tetrahedra as the original. If the original 2-sphere was separating, the resulting triangulation will contain the two terms of the corresponding connected sum.

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. However, the only way to create them (aside from copying or moving) is via the static member function recognise().

Constructor & Destructor Documentation

◆ PillowTwoSphere()

regina::PillowTwoSphere::PillowTwoSphere ( const PillowTwoSphere )
default

Creates a new copy of this structure.

Member Function Documentation

◆ clone()

PillowTwoSphere * regina::PillowTwoSphere::clone ( ) const
inline

Deprecated routine that returns a new copy of this structure.

Deprecated:
Just use the copy constructor instead.
Returns
a newly created clone.

◆ detail()

template<class T , bool supportsUtf8 = false>
std::string regina::Output< T, supportsUtf8 >::detail ( ) const
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.

Returns
a detailed text representation of this object.

◆ formsPillowTwoSphere()

std::unique_ptr< PillowTwoSphere > regina::PillowTwoSphere::formsPillowTwoSphere ( Triangle< 3 > *  tri1,
Triangle< 3 > *  tri2 
)
inlinestatic

A deprecated alias to recognise if two triangles together form a pillow 2-sphere.

Deprecated:
This function has been renamed to recognise(). See recognise() for details on the parameters and return value.

◆ operator!=()

bool regina::PillowTwoSphere::operator!= ( const PillowTwoSphere other) const
inline

Determines whether this and the given object represent different specific presentations of a pillow 2-sphere.

Specifically, two pillow 2-spheres will compare as equal if and only if they join the same two numbered triangles, presented in the same order, using the same mapping of triangle vertices.

Since this test looks at triangle numbers and not the specific Triangle objects, it is meaningful to compare pillow 2-spheres within different triangulations.

Parameters
otherthe pillow 2-sphere to compare with this.
Returns
true if and only if this and the given object represent different specific presentations of a pillow 2-sphere.

◆ operator=()

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

Sets this to be a copy of the given structure.

Returns
a reference to this structure.

◆ operator==()

bool regina::PillowTwoSphere::operator== ( const PillowTwoSphere other) const
inline

Determines whether this and the given object represent the same specific presentation of a pillow 2-sphere.

Specifically, two pillow 2-spheres will compare as equal if and only if they join the same two numbered triangles, presented in the same order, using the same mapping of triangle vertices.

Since this test looks at triangle numbers and not the specific Triangle objects, it is meaningful to compare pillow 2-spheres within different triangulations.

Parameters
otherthe pillow 2-sphere to compare with this.
Returns
true if and only if this and the given object represent the same specific presentation of a pillow 2-sphere.

◆ recognise()

static std::unique_ptr< PillowTwoSphere > regina::PillowTwoSphere::recognise ( Triangle< 3 > *  tri1,
Triangle< 3 > *  tri2 
)
static

Determines if the two given triangles together form a pillow 2-sphere.

Even though PillowTwoSphere is a two-dimensional class and so does not inherit from StandardTriangulation, this routine nevertheless returns by (smart) pointer for consistency with the StandardTriangulation recognition routines (which use pointers because of the polymorphic StandardTriangulation class hierarchy).

Precondition
The two given triangles are distinct.
Parameters
tri1the first triangle to examine.
tri2the second triangle to examine.
Returns
a structure containing details of the pillow 2-sphere, or null if the given triangles do not form a pillow 2-sphere.

◆ str()

template<class T , bool supportsUtf8 = false>
std::string regina::Output< T, supportsUtf8 >::str ( ) const
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.

Python
The Python "stringification" function str() will use precisely this function, and for most classes the Python repr() function will incorporate this into its output.
Returns
a short text representation of this object.

◆ triangle()

Triangle< 3 > * regina::PillowTwoSphere::triangle ( int  index) const
inline

Returns one of the two triangles whose boundaries are joined.

Parameters
indexspecifies which of the two triangles to return; this must be either 0 or 1.
Returns
the corresponding triangle.

◆ triangleMapping()

Perm< 4 > regina::PillowTwoSphere::triangleMapping ( ) const
inline

Returns a permutation describing how the boundaries of the two triangles are joined.

The permutation will map vertices (0,1,2) of triangle(0) to vertices (0,1,2) of triangle(1). The map will represent how the vertices of the triangles are identified by the three edge gluings.

Returns
a permutation describing how the triangle boundaries are joined.

◆ utf8()

template<class T , bool supportsUtf8 = false>
std::string regina::Output< T, supportsUtf8 >::utf8 ( ) const
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.

Returns
a short text representation of this object.

◆ writeTextLong()

void regina::ShortOutput< PillowTwoSphere , false >::writeTextLong ( std::ostream &  out) const
inlineinherited

A default implementation for detailed output.

This routine simply calls T::writeTextShort() and appends a final newline.

Python
Not present; instead you can call detail() from the subclass T, which returns this output as a string.
Parameters
outthe output stream to which to write.

◆ writeTextShort()

void regina::PillowTwoSphere::writeTextShort ( std::ostream &  out) const

Writes a short text representation of this object to the given output stream.

Python
Not present; use str() instead.
Parameters
outthe output stream to which to write.

The documentation for this class 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).