Regina Calculation Engine
|
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... | |
Constructors and Destructors | |
regina::Triangulation< 2 >::Triangulation () | |
Default constructor. More... | |
regina::Triangulation< 2 >::Triangulation (const Triangulation ©) | |
Creates a new copy of the given triangulation. More... | |
regina::Triangulation< 2 >::Triangulation (const Triangulation ©, 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... | |
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 XMLPacketReader * | regina::Triangulation< 2 >::xmlReader (Packet *parent, XMLTreeResolver &resolver) |
virtual Packet * | regina::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... | |
Details for implementing triangulations of 2-manifolds.
typedef BoundaryComponent<2> regina::Dim2BoundaryComponent |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Component<2> regina::Dim2Component |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Face<2, 1> regina::Dim2Edge |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef FaceEmbedding<2, 1> regina::Dim2EdgeEmbedding |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Simplex<2> regina::Dim2Triangle |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Triangulation<2> regina::Dim2Triangulation |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef Face<2, 0> regina::Dim2Vertex |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef FaceEmbedding<2, 0> regina::Dim2VertexEmbedding |
Deprecated typedef for backward compatibility.
This typedef will be removed in a future release of Regina.
typedef FaceList<2, 1>::Iterator regina::Triangulation< 2 >::EdgeIterator |
Used to iterate through edges.
typedef std::vector<Triangle<2>*>::const_iterator regina::Triangulation< 2 >::TriangleIterator |
A dimension-specific alias for SimplexIterator, used to iterate through triangles.
typedef FaceList<2, 0>::Iterator regina::Triangulation< 2 >::VertexIterator |
Used to iterate through vertices.
|
inline |
A dimension-specific alias for adjacentFacet().
See adjacentFacet() for further information.
|
inline |
A dimension-specific alias for adjacentSimplex().
See adjacentSimplex() for further information.
size_t regina::Component< 2 >::countFaces | ( | ) | const |
Returns the number of subdim-faces in this component.
countFaces(subdim)
; that is, the template parameter subdim becomes the first argument of the function.
|
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.
true
if and only if this packet depends on its parent. Implements regina::Packet.
|
inline |
Returns the Euler characteristic of this triangulation.
This will be evaluated as V-E+F.
This returns the same result as eulerCharTri().
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.
face(subdim, index)
; that is, the template parameter subdim becomes the first argument of the function.index | the index of the desired face, ranging from 0 to countFaces<subdim>()-1 inclusive. |
const std::vector<Face<2, subdim>*>& regina::Component< 2 >::faces | ( | ) | const |
Returns a reference to the list of all subdim-faces in this component.
faces(subdim)
. It will then return a Python list containing all the subdim-faces of the triangulation.
|
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.
parent | the parent beneath which the new packet will eventually be inserted. |
Implements regina::Packet.
|
inline |
Determines if this component is closed.
This is the case if and only if it has no boundary.
true
if and only if this component is closed.
|
inline |
Determines if this triangulation is closed.
This is the case if and only if it has no boundary components.
true
if and only if this triangulation is closed.
|
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.
false
. 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.
true
if and only if this is a minimal triangulation.
|
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.
true
.
|
inline |
A dimension-specific alias for newSimplex().
See newSimplex() for further information.
|
inline |
A dimension-specific alias for newSimplex().
See newSimplex() for further information.
|
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:
simplices().back()->vertex(0)
, for consistency with Pachner moves on faces of other dimensions;simplices().back()->vertex(2)
, for consistency with earlier versions of Regina.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 ). |
true
always.
|
inline |
A dimension-specific alias for removeAllSimplices().
See removeAllSimplices() for further information.
|
inline |
A dimension-specific alias for removeSimplex().
See removeSimplex() for further information.
|
inline |
A dimension-specific alias for removeSimplexAt().
See removeSimplexAt() for further information.
|
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.
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 ). |
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
.
|
inline |
Default constructor.
Creates an empty triangulation.
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.
description | a string that describes a 2-manifold triangulation. |
|
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.
copy | the triangulation to copy. |
|
inline |
Creates a new copy of the given triangulation, with the option of whether or not to clone its computed properties also.
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. |
|
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.
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 ). |
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
.
|
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.
out | the output stream to which to write. |
Reimplemented from regina::Packet.
|
inlineoverridevirtual |
Writes a short text representation of this object to the given output stream.
This must be reimplemented by subclasses.
out | the output stream to which to write. |
Implements regina::Packet.
|
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.
out | the output stream to which the XML should be written. |
Implements regina::Packet.
|
inlinevirtual |
Destroys this triangulation.
The constituent triangles, the cellular structure and all other properties will also be destroyed.
|
friend |
Allow access to private members.