2-Manifold Triangulations

## Classes

class | regina::Component< 2 >
| Represents a connected component of a 2-manifold triangulation. More...
class | regina::Face< 2, 2 >
| Represents a tetrahedron 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...

## 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
| Writes a short text representation of this object to the given output stream. More...
virtual void | regina::Triangulation< 2 >::writeTextLong (std::ostream &out) const
| Writes a detailed text representation of this object to the given output stream. More...
virtual bool | regina::Triangulation< 2 >::dependsOnParent () const
| 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...

## Skeletal Transformations

class | regina::Face< 2, 2 >
class | regina::detail::SimplexBase< 2 >
class | regina::detail::TriangulationBase< 2 >
bool | regina::Triangulation< 2 >::oneThreeMove (Triangle< 2 > *t, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 1-3 move upon the given triangle. More...
static XMLPacketReader * | regina::Triangulation< 2 >::xmlReader (Packet *parent, XMLTreeResolver &resolver)
virtual Packet * | regina::Triangulation< 2 >::internalClonePacket (Packet *parent) const
| Makes a newly allocated copy of this packet. More...
virtual void | regina::Triangulation< 2 >::writeXMLPacketData (std::ostream &out) const
| Writes a chunk of XML containing the data for this packet only. More...

## Detailed Description

Details for implementing triangulations of 2-manifolds.

## Typedef Documentation

## Dim2BoundaryComponent

typedef BoundaryComponent<2> regina::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

typedef Component<2> regina::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

typedef FaceEmbedding<2, 1> regina::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

typedef Simplex<2> regina::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

typedef Triangulation<2> regina::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

typedef FaceEmbedding<2, 0> regina::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

typedef FaceList<2, 1>::Iterator regina::Triangulation< 2 >::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

typedef FaceList<2, 0>::Iterator regina::Triangulation< 2 >::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:\n 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

inline virtual

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:\n 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

  index | the 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:\n 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

inline protected virtual

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

  parent | the 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`
| ) |  |

Checks the eligibility of and/or performs a 1-3 move upon the given triangle.

This involves replacing one triangle with three triangles: each new triangle runs from one edge of the original triangle to a new common internal degree three vertex.

This move can always be performed. The check argument is present (as for other moves), but is simply ignored (since the move is always legal). The perform argument is also present for consistency with other moves, but if it is set to `false` then this routine does nothing and returns no useful information.

Note that after performing this move, all skeletal objects (edges, components, etc.) will be reconstructed, which means any pointers to old skeletal objects (such as the argument t) can no longer be used.

Precondition
  The given triangle is a triangle of this triangulation.

Parameters

  t | the triangle about which to perform the move.
  check | this argument is ignored, since this move is always legal (see the notes above).
  perform | `true` 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.

## Triangulation() [1/4]

regina::Triangulation< 2 >::Triangulation | ( |  | ) |

inline

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

- isomorphism signatures (see fromIsoSig()).

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

  description | a 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

  copy | the 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

  copy | the triangulation to copy.
  cloneProps | `true` 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.

## writeTextLong()

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

virtual

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:\n Not present.

Parameters

  out | the output stream to which to write.

Reimplemented from regina::Packet.

## writeTextShort()

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

inline virtual

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

This must be reimplemented by subclasses.

Python:\n Not present.

Parameters

  out | the output stream to which to write.

Implements regina::Packet.

## writeXMLPacketData()

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

protected virtual

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

  out | the output stream to which the XML should be written.

Implements regina::Packet.

## ~Triangulation()

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

inline virtual

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