Regina Calculation Engine
Classes | Typedefs | Functions | Friends
2-Manifold Triangulations

Details for implementing triangulations of 2-manifolds. More...

Classes

class  regina::Component< 2 >
 Represents a connected component of a 2-manifold triangulation. More...
 
class  regina::Face< 2, 2 >
 Represents a triangle within a 2-manifold triangulation. More...
 
class  regina::Triangulation< 2 >
 Represents a 2-manifold triangulation. More...
 

Typedefs

typedef BoundaryComponent< 2 > regina::Dim2BoundaryComponent
 Deprecated typedef for backward compatibility. More...
 
typedef Component< 2 > regina::Dim2Component
 Deprecated typedef for backward compatibility. More...
 
typedef Simplex< 2 > regina::Dim2Triangle
 Deprecated typedef for backward compatibility. More...
 
typedef std::vector< Triangle< 2 > * >::const_iterator regina::Triangulation< 2 >::TriangleIterator
 A dimension-specific alias for SimplexIterator, used to iterate through triangles. More...
 
typedef FaceList< 2, 1 >::Iterator regina::Triangulation< 2 >::EdgeIterator
 Used to iterate through edges. More...
 
typedef FaceList< 2, 0 >::Iterator regina::Triangulation< 2 >::VertexIterator
 Used to iterate through vertices. More...
 
typedef Triangulation< 2 > regina::Dim2Triangulation
 Deprecated typedef for backward compatibility. More...
 
typedef FaceEmbedding< 2, 0 > regina::Dim2VertexEmbedding
 Deprecated typedef for backward compatibility. More...
 
typedef FaceEmbedding< 2, 1 > regina::Dim2EdgeEmbedding
 Deprecated typedef for backward compatibility. More...
 
typedef Face< 2, 0 > regina::Dim2Vertex
 Deprecated typedef for backward compatibility. More...
 
typedef Face< 2, 1 > regina::Dim2Edge
 Deprecated typedef for backward compatibility. More...
 

Functions

template<int subdim>
size_t regina::Component< 2 >::countFaces () const
 Returns the number of subdim-faces in this component. More...
 
template<int subdim>
const std::vector< Face< 2, subdim > * > & regina::Component< 2 >::faces () const
 Returns a reference to the list of all subdim-faces in this component. More...
 
template<int subdim>
Face< 2, subdim > * regina::Component< 2 >::face (size_t index) const
 Returns the requested subdim-face in this component. More...
 
bool regina::Component< 2 >::isClosed () const
 Determines if this component is closed. More...
 
Simplex< 2 > * regina::Face< 2, 2 >::adjacentTriangle (int edge) const
 A dimension-specific alias for adjacentSimplex(). More...
 
int regina::Face< 2, 2 >::adjacentEdge (int edge) const
 A dimension-specific alias for adjacentFacet(). More...
 

Friends

class regina::Component< 2 >::Triangulation< 2 >
 
class regina::Component< 2 >::detail::TriangulationBase< 2 >
 
class regina::Face< 2, 2 >::Triangulation< 2 >
 
class regina::Face< 2, 2 >::detail::TriangulationBase< 2 >
 Allow access to private members. More...
 

Skeletal Transformations

class regina::Face< 2, 2 >
 
class regina::detail::SimplexBase< 2 >
 
class regina::detail::TriangulationBase< 2 >
 
bool regina::Triangulation< 2 >::threeOneMove (Vertex< 2 > *v, bool check=true, bool perform=true)
 Deprecated function that checks the eligibility of and/or performs a 3-1 Pachner move upon the given vertex. More...
 
bool regina::Triangulation< 2 >::twoTwoMove (Edge< 2 > *e, bool check=true, bool perform=true)
 Deprecated function that checks the eligibility of and/or performs a 2-2 Pachner move upon the given edge. More...
 
bool regina::Triangulation< 2 >::oneThreeMove (Triangle< 2 > *t, bool check=true, bool perform=true)
 Deprecated function that checks the eligibility of and/or performs a 1-3 Pachner move upon the given triangle. More...
 
static XMLPacketReaderregina::Triangulation< 2 >::xmlReader (Packet *parent, XMLTreeResolver &resolver)
 
virtual Packetregina::Triangulation< 2 >::internalClonePacket (Packet *parent) const override
 Makes a newly allocated copy of this packet. More...
 
virtual void regina::Triangulation< 2 >::writeXMLPacketData (std::ostream &out) const override
 Writes a chunk of XML containing the data for this packet only. More...
 

Constructors and Destructors

 regina::Triangulation< 2 >::Triangulation ()
 Default constructor. More...
 
 regina::Triangulation< 2 >::Triangulation (const Triangulation &copy)
 Creates a new copy of the given triangulation. More...
 
 regina::Triangulation< 2 >::Triangulation (const Triangulation &copy, bool cloneProps)
 Creates a new copy of the given triangulation, with the option of whether or not to clone its computed properties also. More...
 
 regina::Triangulation< 2 >::Triangulation (const std::string &description)
 "Magic" constructor that tries to find some way to interpret the given string as a triangulation. More...
 
virtual regina::Triangulation< 2 >::~Triangulation ()
 Destroys this triangulation. More...
 

Packet Administration

virtual void regina::Triangulation< 2 >::writeTextShort (std::ostream &out) const override
 Writes a short text representation of this object to the given output stream. More...
 
virtual void regina::Triangulation< 2 >::writeTextLong (std::ostream &out) const override
 Writes a detailed text representation of this object to the given output stream. More...
 
virtual bool regina::Triangulation< 2 >::dependsOnParent () const override
 Determines if this packet depends upon its parent. More...
 

Triangles

Triangle< 2 > * regina::Triangulation< 2 >::newTriangle ()
 A dimension-specific alias for newSimplex(). More...
 
Triangle< 2 > * regina::Triangulation< 2 >::newTriangle (const std::string &desc)
 A dimension-specific alias for newSimplex(). More...
 
void regina::Triangulation< 2 >::removeTriangle (Triangle< 2 > *tri)
 A dimension-specific alias for removeSimplex(). More...
 
void regina::Triangulation< 2 >::removeTriangleAt (size_t index)
 A dimension-specific alias for removeSimplexAt(). More...
 
void regina::Triangulation< 2 >::removeAllTriangles ()
 A dimension-specific alias for removeAllSimplices(). More...
 

Basic Properties

bool regina::Triangulation< 2 >::isValid () const
 Always returns true. More...
 
long regina::Triangulation< 2 >::eulerChar () const
 Returns the Euler characteristic of this triangulation. More...
 
bool regina::Triangulation< 2 >::isClosed () const
 Determines if this triangulation is closed. More...
 
bool regina::Triangulation< 2 >::isIdeal () const
 Always returns false. More...
 
bool regina::Triangulation< 2 >::isMinimal () const
 Determines whether this is a minimal triangulation of the underlying 2-manifold; that is, it uses the fewest possible triangles. More...
 

Detailed Description

Details for implementing triangulations of 2-manifolds.

Typedef Documentation

◆ Dim2BoundaryComponent

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2BoundaryComponent, you should use the real class name BoundaryComponent<2>.

◆ Dim2Component

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2Component, you should use the real class name Component<2>.

◆ Dim2Edge

typedef Face<2, 1> regina::Dim2Edge

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2Edge, you should use either the new alias Edge<2>, or the full class name Face<2, 1>.

◆ Dim2EdgeEmbedding

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2EdgeEmbedding, you should use either the new alias EdgeEmbedding<2>, or the full class name FaceEmbedding<2, 1>.

◆ Dim2Triangle

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2Triangle, you should use the new alias Simplex<2> (or, if you prefer, the full class name Face<2, 2>).

◆ Dim2Triangulation

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2Triangulation, you should use the templated class name Triangulation<2>.

◆ Dim2Vertex

typedef Face<2, 0> regina::Dim2Vertex

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2Vertex, you should use either the new alias Vertex<2>, or the full class name Face<2, 0>.

◆ Dim2VertexEmbedding

Deprecated typedef for backward compatibility.

This typedef will be removed in a future release of Regina.

Deprecated:
Instead of the old typedef Dim2VertexEmbedding, you should use either the new alias VertexEmbedding<2>, or the full class name FaceEmbedding<2, 0>.

◆ EdgeIterator

Used to iterate through edges.

◆ TriangleIterator

typedef std::vector<Triangle<2>*>::const_iterator regina::Triangulation< 2 >::TriangleIterator

A dimension-specific alias for SimplexIterator, used to iterate through triangles.

◆ VertexIterator

Used to iterate through vertices.

Function Documentation

◆ adjacentEdge()

int regina::Face< 2, 2 >::adjacentEdge ( int  edge) const
inline

A dimension-specific alias for adjacentFacet().

See adjacentFacet() for further information.

◆ adjacentTriangle()

Simplex< 2 > * regina::Face< 2, 2 >::adjacentTriangle ( int  edge) const
inline

A dimension-specific alias for adjacentSimplex().

See adjacentSimplex() for further information.

◆ countFaces()

template<int subdim>
size_t regina::Component< 2 >::countFaces ( ) const

Returns the number of subdim-faces in this component.

Precondition
The template argument subdim is either 0 or 1.
Python
Python does not support templates. Instead, Python users should call this function in the form countFaces(subdim); that is, the template parameter subdim becomes the first argument of the function.
Returns
the number of subdim-faces.

◆ dependsOnParent()

bool regina::Triangulation< 2 >::dependsOnParent ( ) const
inlineoverridevirtual

Determines if this packet depends upon its parent.

This is true if the parent cannot be altered without invalidating or otherwise upsetting this packet.

Returns
true if and only if this packet depends on its parent.

Implements regina::Packet.

◆ eulerChar()

long regina::Triangulation< 2 >::eulerChar ( ) const
inline

Returns the Euler characteristic of this triangulation.

This will be evaluated as V-E+F.

This returns the same result as eulerCharTri().

Returns
the Euler characteristic of this triangulation.

◆ face()

template<int subdim>
Face<2, subdim>* regina::Component< 2 >::face ( size_t  index) const

Returns the requested subdim-face in this component.

Note that the index of a face in the component need not be the index of the same face in the overall triangulation.

Precondition
The template argument subdim is either 0 or 1.
Python
Python does not support templates. Instead, Python users should call this function in the form face(subdim, index); that is, the template parameter subdim becomes the first argument of the function.
Parameters
indexthe index of the desired face, ranging from 0 to countFaces<subdim>()-1 inclusive.
Returns
the requested face.

◆ faces()

template<int subdim>
const std::vector<Face<2, subdim>*>& regina::Component< 2 >::faces ( ) const

Returns a reference to the list of all subdim-faces in this component.

Precondition
The template argument subdim is either 0 or 1.
Python
Python users should call this function in the form faces(subdim). It will then return a Python list containing all the subdim-faces of the triangulation.
Returns
the list of all subdim-faces.

◆ internalClonePacket()

Packet * regina::Triangulation< 2 >::internalClonePacket ( Packet parent) const
inlineoverrideprotectedvirtual

Makes a newly allocated copy of this packet.

This routine should not insert the new packet into the tree structure, clone the packet's associated tags or give the packet a label. It should also not clone any descendants of this packet.

You may assume that the new packet will eventually be inserted into the tree beneath either the same parent as this packet or a clone of that parent.

Parameters
parentthe parent beneath which the new packet will eventually be inserted.
Returns
the newly allocated packet.

Implements regina::Packet.

◆ isClosed() [1/2]

bool regina::Component< 2 >::isClosed ( ) const
inline

Determines if this component is closed.

This is the case if and only if it has no boundary.

Returns
true if and only if this component is closed.

◆ isClosed() [2/2]

bool regina::Triangulation< 2 >::isClosed ( ) const
inline

Determines if this triangulation is closed.

This is the case if and only if it has no boundary components.

Returns
true if and only if this triangulation is closed.

◆ isIdeal()

bool regina::Triangulation< 2 >::isIdeal ( ) const
inline

Always returns false.

This routine determines if this triangulation is ideal (has a non-trivial vertex link); however, every vertex link in a 2-manifold triangulation is either the interval or the circle, and so ideal triangulations cannot exist. Therefore this routine always returns false.

This no-op routine is provided for consistency with higher dimensional triangulations, and to assist with writing dimension-agnostic code.

Returns
false.

◆ isMinimal()

bool regina::Triangulation< 2 >::isMinimal ( ) const

Determines whether this is a minimal triangulation of the underlying 2-manifold; that is, it uses the fewest possible triangles.

Testing for minimality is simple in two dimensions (unlike higher dimensions, where it becomes extremely difficult). With the exception of the sphere, disc and projective plane (which require a minimum of 2, 1 and 2 triangles respectively), a closed triangulation is minimal if and only if it has one vertex, and a bounded triangulation is minimal if and only if it has one vertex per boundary component and no internal vertices.

The proof is based on a simple Euler characteristic calculation, whereby the number of triangles T is T = 2Vi + Vb - 2C, where Vi and Vb are the number of internal and boundary vertices respectively, and where C is the Euler characteristic of the underlying manifold.

Returns
true if and only if this is a minimal triangulation.

◆ isValid()

bool regina::Triangulation< 2 >::isValid ( ) const
inline

Always returns true.

This routine determines if this triangulation is valid; however, there is nothing that can go wrong with vertex links in 2-manifold triangulations, and so this routine always returns true.

This no-op routine is provided for consistency with higher dimensional triangulations, and to assist with writing dimension-agnostic code.

Returns
true.

◆ newTriangle() [1/2]

Triangle< 2 > * regina::Triangulation< 2 >::newTriangle ( )
inline

A dimension-specific alias for newSimplex().

See newSimplex() for further information.

◆ newTriangle() [2/2]

Triangle< 2 > * regina::Triangulation< 2 >::newTriangle ( const std::string &  desc)
inline

A dimension-specific alias for newSimplex().

See newSimplex() for further information.

◆ oneThreeMove()

bool regina::Triangulation< 2 >::oneThreeMove ( Triangle< 2 > *  t,
bool  check = true,
bool  perform = true 
)
inline

Deprecated function that checks the eligibility of and/or performs a 1-3 Pachner move upon the given triangle.

This differs from pachner(Simplex<2>*, bool, bool) in the labelling of the new triangles:

  • pachner() will create the new vertex as simplices().back()->vertex(0), for consistency with Pachner moves on faces of other dimensions;
  • oneThreeMove() will create the new vertex as simplices().back()->vertex(2), for consistency with earlier versions of Regina.
Precondition
The given triangle is a triangle of this triangulation.
Deprecated:
You should use the new routine pachner() instead (though note that this changes the labelling of the new triangles).
Parameters
tthe triangle about which to perform the move.
checkthis argument is ignored, since this move is always legal.
performtrue if we are to perform the move (defaults to true).
Returns
true always.

◆ removeAllTriangles()

void regina::Triangulation< 2 >::removeAllTriangles ( )
inline

A dimension-specific alias for removeAllSimplices().

See removeAllSimplices() for further information.

◆ removeTriangle()

void regina::Triangulation< 2 >::removeTriangle ( Triangle< 2 > *  tri)
inline

A dimension-specific alias for removeSimplex().

See removeSimplex() for further information.

◆ removeTriangleAt()

void regina::Triangulation< 2 >::removeTriangleAt ( size_t  index)
inline

A dimension-specific alias for removeSimplexAt().

See removeSimplexAt() for further information.

◆ threeOneMove()

bool regina::Triangulation< 2 >::threeOneMove ( Vertex< 2 > *  v,
bool  check = true,
bool  perform = true 
)
inline

Deprecated function that checks the eligibility of and/or performs a 3-1 Pachner move upon the given vertex.

This is an alias for pachner(Vertex<2>*, bool, bool); see that routine for further details.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given vertex is a vertex of this triangulation.
Deprecated:
You should use the identical routine pachner() instead.
Parameters
vthe vertex about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

◆ Triangulation() [1/4]

Default constructor.

Creates an empty triangulation.

◆ Triangulation() [2/4]

regina::Triangulation< 2 >::Triangulation ( const std::string &  description)

"Magic" constructor that tries to find some way to interpret the given string as a triangulation.

At present, Regina understands the following types of strings (and attempts to parse them in the following order):

This list may grow in future versions of Regina.

Regina will also set the packet label accordingly.

If Regina cannot interpret the given string, this will be left as the empty triangulation.

Parameters
descriptiona string that describes a 2-manifold triangulation.

◆ Triangulation() [3/4]

regina::Triangulation< 2 >::Triangulation ( const Triangulation< 2 > &  copy)
inline

Creates a new copy of the given triangulation.

The packet tree structure and packet label are not copied.

This will clone any computed properties (such as homology, fundamental group, and so on) of the given triangulation also. If you want a "clean" copy that resets all properties to unknown, you can use the two-argument copy constructor instead.

Parameters
copythe triangulation to copy.

◆ Triangulation() [4/4]

regina::Triangulation< 2 >::Triangulation ( const Triangulation< 2 > &  copy,
bool  cloneProps 
)
inline

Creates a new copy of the given triangulation, with the option of whether or not to clone its computed properties also.

Parameters
copythe triangulation to copy.
clonePropstrue if this should also clone any computed properties of the given triangulation (such as homology, fundamental group, and so on), or false if the new triangulation should have all properties marked as unknown.

◆ twoTwoMove()

bool regina::Triangulation< 2 >::twoTwoMove ( Edge< 2 > *  e,
bool  check = true,
bool  perform = true 
)
inline

Deprecated function that checks the eligibility of and/or performs a 2-2 Pachner move upon the given edge.

This is an alias for pachner(Edge<2>*, bool, bool); see that routine for further details.

Precondition
If the move is being performed and no check is being run, it must be known in advance that the move is legal.
The given edge is an edge of this triangulation.
Deprecated:
You should use the identical routine pachner() instead.
Parameters
ethe edge about which to perform the move.
checktrue if we are to check whether the move is allowed (defaults to true).
performtrue if we are to perform the move (defaults to true).
Returns
If check is true, the function returns true if and only if the requested move may be performed without changing the topology of the manifold. If check is false, the function simply returns true.

◆ writeTextLong()

virtual void regina::Triangulation< 2 >::writeTextLong ( std::ostream &  out) const
overridevirtual

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

This may be reimplemented by subclasses, but the parent Packet class offers a reasonable default implementation.

Python
Not present.
Parameters
outthe output stream to which to write.

Reimplemented from regina::Packet.

◆ writeTextShort()

void regina::Triangulation< 2 >::writeTextShort ( std::ostream &  out) const
inlineoverridevirtual

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

This must be reimplemented by subclasses.

Python
Not present.
Parameters
outthe output stream to which to write.

Implements regina::Packet.

◆ writeXMLPacketData()

virtual void regina::Triangulation< 2 >::writeXMLPacketData ( std::ostream &  out) const
overrideprotectedvirtual

Writes a chunk of XML containing the data for this packet only.

You may assume that the packet opening tag (including the packet type and label) has already been written, and that all child packets followed by the corresponding packet closing tag will be written immediately after this routine is called. This routine need only write the internal data stored in this specific packet.

Parameters
outthe output stream to which the XML should be written.

Implements regina::Packet.

◆ ~Triangulation()

regina::Triangulation< 2 >::~Triangulation ( )
inlinevirtual

Destroys this triangulation.

The constituent triangles, the cellular structure and all other properties will also be destroyed.

Friends

◆ detail::TriangulationBase< 2 >

friend class detail::TriangulationBase< 2 >
friend

Allow access to private members.


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