Details for implementing triangulations of 2-manifolds.
More...
Details for implementing triangulations of 2-manifolds.
◆ EdgeIterator
Used to iterate through edges.
◆ TriangleIterator
A dimension-specific alias for SimplexIterator, used to iterate through triangles.
◆ VertexIterator
Used to iterate through vertices.
◆ adjacentEdge()
◆ adjacentTriangle()
◆ countFaces()
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()
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()
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()
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
-
- Returns
- the requested face.
◆ faces()
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()
|
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
-
parent | the parent beneath which the new packet will eventually be inserted. |
- Returns
- the newly allocated packet.
Implements regina::Packet.
◆ isClosed() [1/2]
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]
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()
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()
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()
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]
◆ newTriangle() [2/2]
◆ oneThreeMove()
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
-
t | the triangle about which to perform the move. |
check | this argument is ignored, since this move is always legal. |
perform | true if we are to perform the move (defaults to true ). |
- Returns
true
always.
◆ removeAllTriangles()
◆ removeTriangle()
◆ removeTriangleAt()
◆ threeOneMove()
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
-
v | the vertex about which to perform the move. |
check | true if we are to check whether the move is allowed (defaults to true ). |
perform | true 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]
"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
-
description | a string that describes a 2-manifold triangulation. |
◆ Triangulation() [3/4]
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]
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. |
◆ twoTwoMove()
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
-
e | the edge about which to perform the move. |
check | true if we are to check whether the move is allowed (defaults to true ). |
perform | true 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()
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()
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()
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()
Destroys this triangulation.
The constituent triangles, the cellular structure and all other properties will also be destroyed.
◆ detail::TriangulationBase< 2 >
Allow access to private members.