regina::Dim2Triangulation Class Referenceabstract
2-Manifold Triangulations

Stores the triangulation of a 2-manifold along with its various cellular structures and other information. More...

`#include <dim2/dim2triangulation.h>`

Inheritance diagram for regina::Dim2Triangulation:

## Public Types

typedef std::vector< Dim2Triangle * >::const_iterator | TriangleIterator
| Used to iterate through triangles. More...
typedef std::vector< Dim2Edge * >::const_iterator | EdgeIterator
| Used to iterate through edges. More...
typedef std::vector< Dim2Vertex * >::const_iterator | VertexIterator
| Used to iterate through vertices. More...
typedef std::vector< Dim2Component * >::const_iterator | ComponentIterator
| Used to iterate through components. More...
typedef std::vector< Dim2BoundaryComponent * >::const_iterator | BoundaryComponentIterator
| Used to iterate through boundary components. More...
typedef ChangeEventSpan | ChangeEventBlock
| A deprecated typedef for ChangeEventSpan. More...
typedef void | Triangulation
| The main data type for a dim-manifold triangulation. More...
typedef void | Simplex
| The data type for a top-dimensional simplex in a dim-manifold triangulation. More...
typedef void | Isomorphism
| The data type for an isomorphism between two dim-manifold triangulations. More...
typedef void | FacetPairing
| The data type that represents a pairing of facets of top-dimensional simplices in a dim-manifold triangulation. More...
typedef void | Perm
| The permutation type used to describe gluings between top-dimensional simplices in a dim-manifold triangulation. More...

## Public Member Functions

template<>
unsigned long | getNumberOfFaces () const
template<>
unsigned long | getNumberOfFaces () const
template<>
unsigned long | getNumberOfFaces () const
Constructors and Destructors
| Dim2Triangulation ()
| Default constructor. More...
| Dim2Triangulation (const Dim2Triangulation &cloneMe)
| Copy constructor. More...
| Dim2Triangulation (const std::string &description)
| "Magic" constructor that tries to find some way to interpret the given string as a triangulation. More...
virtual | ~Dim2Triangulation ()
| Destroys this triangulation. More...
Packet Administration
virtual void | writeTextShort (std::ostream &out) const
| Writes this object in short text format to the given output stream. More...
virtual void | writeTextLong (std::ostream &out) const
| Writes this object in long text format to the given output stream. More...
virtual bool | dependsOnParent () const
| Determines if this packet depends upon its parent. More...
Triangles
unsigned long | getNumberOfTriangles () const
| Returns the number of triangular faces in the triangulation. More...
unsigned long | getNumberOfSimplices () const
| A dimension-agnostic alias for getNumberOfTriangles(). More...
const std::vector< Dim2Triangle * > & | getTriangles () const
| Returns all triangular faces in the triangulation. More...
const std::vector< Dim2Triangle * > & | getSimplices () const
| A dimension-agnostic alias for getTriangles(). More...
Dim2Triangle * | getTriangle (unsigned long index)
| Returns the triangle with the given index number in the triangulation. More...
Dim2Triangle * | getSimplex (unsigned long index)
| A dimension-agnostic alias for getTriangle(). More...
const Dim2Triangle * | getTriangle (unsigned long index) const
| Returns the triangle with the given index number in the triangulation. More...
const Dim2Triangle * | getSimplex (unsigned long index) const
| A dimension-agnostic alias for getTriangle(). More...
long | triangleIndex (const Dim2Triangle *tri) const
| Returns the index of the given triangle in the triangulation. More...
long | simplexIndex (const Dim2Triangle *tri) const
| A dimension-agnostic alias for triangleIndex(). More...
Dim2Triangle * | newTriangle ()
| Creates a new triangle and adds it to this triangulation. More...
Dim2Triangle * | newSimplex ()
| A dimension-agnostic alias for newTriangle(). More...
Dim2Triangle * | newTriangle (const std::string &desc)
| Creates a new triangle with the given description and adds it to this triangulation. More...
Dim2Triangle * | newSimplex (const std::string &desc)
| A dimension-agnostic alias for newTriangle(). More...
void | removeTriangle (Dim2Triangle *tri)
| Removes the given triangle from the triangulation. More...
void | removeSimplex (Dim2Triangle *tri)
| A dimension-agnostic alias for removeTriangle(). More...
void | removeTriangleAt (unsigned long index)
| Removes the triangle with the given index number from the triangulation. More...
void | removeSimplexAt (unsigned long index)
| A dimension-agnostic alias for removeTriangleAt(). More...
void | removeAllTriangles ()
| Removes all triangles from the triangulation. More...
void | removeAllSimplices ()
| A dimension-agnostic alias for removeAllTriangles(). More...
void | swapContents (Dim2Triangulation &other)
| Swaps the contents of this and the given triangulation. More...
void | moveContentsTo (Dim2Triangulation &dest)
| Moves the contents of this triangulation into the given destination triangulation, without destroying any pre-existing contents. More...
Skeletal Queries
unsigned long | getNumberOfBoundaryComponents () const
| Returns the number of boundary components in this triangulation. More...
unsigned long | getNumberOfComponents () const
| Returns the number of components in this triangulation. More...
unsigned long | getNumberOfVertices () const
| Returns the number of vertices in this triangulation. More...
unsigned long | getNumberOfEdges () const
| Returns the number of edges in this triangulation. More...
template<int dim>
unsigned long | getNumberOfFaces () const
| Returns the number of faces of the given dimension in this triangulation. More...
const std::vector< Dim2Component * > & | getComponents () const
| Returns all components of this triangulation. More...
const std::vector< Dim2BoundaryComponent * > & | getBoundaryComponents () const
| Returns all boundary components of this triangulation. More...
const std::vector< Dim2Vertex * > & | getVertices () const
| Returns all vertices of this triangulation. More...
const std::vector< Dim2Edge * > & | getEdges () const
| Returns all edges of this triangulation. More...
Dim2Component * | getComponent (unsigned long index) const
| Returns the requested triangulation component. More...
Dim2BoundaryComponent * | getBoundaryComponent (unsigned long index) const
| Returns the requested triangulation boundary component. More...
Dim2Vertex * | getVertex (unsigned long index) const
| Returns the requested triangulation vertex. More...
Dim2Edge * | getEdge (unsigned long index) const
| Returns the requested triangulation edge. More...
long | componentIndex (const Dim2Component *component) const
| Returns the index of the given component in the triangulation. More...
long | boundaryComponentIndex (const Dim2BoundaryComponent *bc) const
| Returns the index of the given boundary component in the triangulation. More...
long | vertexIndex (const Dim2Vertex *vertex) const
| Returns the index of the given vertex in the triangulation. More...
long | edgeIndex (const Dim2Edge *edge) const
| Returns the index of the given edge in the triangulation. More...
Basic Properties
bool | isValid () const
| Always returns `true`. More...
long | getEulerChar () const
| Returns the Euler characteristic of this triangulation. More...
bool | isClosed () const
| Determines if this triangulation is closed. More...
bool | hasBoundaryEdges () const
| Determines if this triangulation has any boundary edges. More...
unsigned long | getNumberOfBoundaryEdges () const
| Returns the number of boundary edges in this triangulation. More...
bool | isOrientable () const
| Determines if this triangulation is orientable. More...
bool | isConnected () const
| Determines if this triangulation is connected. More...
bool | isIdeal () const
| Always returns `false`. More...
bool | 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
bool | oneThreeMove (Dim2Triangle *t, bool check=true, bool perform=true)
| Checks the eligibility of and/or performs a 1-3 move upon the given triangle. More...
Building Triangulations
void | insertTriangulation (const Dim2Triangulation &source)
| Inserts a copy of the given triangulation into this triangulation. More...
void | insertConstruction (unsigned long nTriangles, const int adjacencies[][3], const int gluings[][3][3])
| Inserts into this triangulation a set of triangles and their gluings as described by the given integer arrays. More...
Exporting Triangulations
std::string | dumpConstruction () const
| Returns C++ code that can be used with insertConstruction() to reconstruct this triangulation. More...
Packet Identification
virtual PacketType | getPacketType () const =0
| Returns the unique integer ID representing this type of packet. More...
virtual std::string | getPacketTypeName () const =0
| Returns an English name for this type of packet. More...
const std::string & | getPacketLabel () const
| Returns the label associated with this individual packet. More...
std::string | getHumanLabel () const
| Returns the label associated with this individual packet, adjusted if necessary for human-readable output. More...
void | setPacketLabel (const std::string &newLabel)
| Sets the label associated with this individual packet. More...
std::string | getFullName () const
| Returns a descriptive text string for the packet. More...
std::string | makeUniqueLabel (const std::string &base) const
| Returns a new label that cannot be found anywhere in the entire tree structure. More...
bool | makeUniqueLabels (NPacket *reference)
| Ensures that all packet labels in both this and the given packet tree combined are distinct. More...
Tags
bool | hasTag (const std::string &tag) const
| Determines whether this packet has the given associated tag. More...
bool | hasTags () const
| Determines whether this packet has any associated tags at all. More...
bool | addTag (const std::string &tag)
| Associates the given tag with this packet. More...
bool | removeTag (const std::string &tag)
| Removes the association of the given tag with this packet. More...
void | removeAllTags ()
| Removes all associated tags from this packet. More...
const std::set< std::string > & | getTags () const
| Returns the set of all tags associated with this packet. More...
Event Handling
bool | listen (NPacketListener *listener)
| Registers the given packet listener to listen for events on this packet. More...
bool | isListening (NPacketListener *listener)
| Determines whether the given packet listener is currently listening for events on this packet. More...
bool | unlisten (NPacketListener *listener)
| Unregisters the given packet listener so that it no longer listens for events on this packet. More...
Tree Queries
NPacket * | getTreeParent () const
| Determines the parent packet in the tree structure. More...
NPacket * | getFirstTreeChild () const
| Determines the first child of this packet in the tree structure. More...
NPacket * | getLastTreeChild () const
| Determines the last child of this packet in the tree structure. More...
NPacket * | getNextTreeSibling () const
| Determines the next sibling of this packet in the tree structure. More...
NPacket * | getPrevTreeSibling () const
| Determines the previous sibling of this packet in the tree structure. More...
NPacket * | getTreeMatriarch () const
| Determines the matriarch (the root) of the tree to which this packet belongs. More...
unsigned | levelsDownTo (const NPacket *descendant) const
| Counts the number of levels between this packet and its given descendant in the tree structure. More...
unsigned | levelsUpTo (const NPacket *ancestor) const
| Counts the number of levels between this packet and its given ancestor in the tree structure. More...
bool | isGrandparentOf (const NPacket *descendant) const
| Determines if this packet is equal to or an ancestor of the given packet in the tree structure. More...
unsigned long | getNumberOfChildren () const
| Returns the number of immediate children of this packet. More...
unsigned long | getNumberOfDescendants () const
| Returns the total number of descendants of this packet. More...
unsigned long | getTotalTreeSize () const
| Determines the total number of packets in the tree or subtree for which this packet is matriarch. More...
Tree Manipulation
void | insertChildFirst (NPacket *child)
| Inserts the given packet as the first child of this packet. More...
void | insertChildLast (NPacket *child)
| Inserts the given packet as the last child of this packet. More...
void | insertChildAfter (NPacket *newChild, NPacket *prevChild)
| Inserts the given packet as a child of this packet at the given location in this packet's child list. More...
void | makeOrphan ()
| Cuts this packet away from its parent in the tree structure and instead makes it matriarch of its own tree. More...
void | reparent (NPacket *newParent, bool first=false)
| Cuts this packet away from its parent in the tree structure, and inserts it as a child of the given packet instead. More...
void | swapWithNextSibling ()
| Swaps this packet with its next sibling in the sequence of children beneath their common parent packet. More...
void | moveUp (unsigned steps=1)
| Moves this packet the given number of steps towards the beginning of its sibling list. More...
void | moveDown (unsigned steps=1)
| Moves this packet the given number of steps towards the end of its sibling list. More...
void | moveToFirst ()
| Moves this packet to be the first in its sibling list. More...
void | moveToLast ()
| Moves this packet to be the last in its sibling list. More...
void | sortChildren ()
| Sorts the immediate children of this packet according to their packet labels. More...
Searching and Iterating
NPacket * | nextTreePacket ()
| Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More...
const NPacket * | nextTreePacket () const
| Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs. More...
NPacket * | nextTreePacket (const std::string &type)
| Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure. More...
const NPacket * | nextTreePacket (const std::string &type) const
| Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure. More...
NPacket * | firstTreePacket (const std::string &type)
| Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More...
const NPacket * | firstTreePacket (const std::string &type) const
| Finds the first packet of the requested type in a complete depth-first iteration of the tree structure. More...
NPacket * | findPacketLabel (const std::string &label)
| Finds the packet with the requested label in the tree or subtree for which this packet is matriarch. More...
const NPacket * | findPacketLabel (const std::string &label) const
| Finds the packet with the requested label in the tree or subtree for which this packet is matriarch. More...
Packet Dependencies
bool | isPacketEditable () const
| Determines whether this packet can be altered without invalidating or otherwise upsetting any of its immediate children. More...
Cloning
NPacket * | clone (bool cloneDescendants=false, bool end=true) const
| Clones this packet (and possibly its descendants), assigns to it a suitable unused label and inserts the clone into the tree as a sibling of this packet. More...
File I/O
bool | save (const char *filename, bool compressed=true) const
| Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format. More...
void | writeXMLFile (std::ostream &out) const
| Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format. More...
std::string | internalID () const
| Returns a unique string ID that identifies this packet. More...
Input and Output
std::string | str () const
| Returns the output from writeTextShort() as a string. More...
std::string | toString () const
| A deprecated alias for str(), which returns the output from writeTextShort() as a string. More...
std::string | detail () const
| Returns the output from writeTextLong() as a string. More...
std::string | toStringLong () const
| A deprecated alias for detail(), which returns the output from writeTextLong() as a string. More...
Basic Properties
bool | isEmpty () const
| Determines whether this triangulation is empty. More...
Isomorphism Testing
bool | isIdenticalTo (const typename DimTraits< dim >::Triangulation &other) const
| Determines if this triangulation is combinatorially identical to the given triangulation. More...
std::auto_ptr< typename DimTraits< dim >::Isomorphism > | isIsomorphicTo (const typename DimTraits< dim >::Triangulation &other) const
| Determines if this triangulation is combinatorially isomorphic to the given triangulation. More...
std::auto_ptr< typename DimTraits< dim >::Isomorphism > | isContainedIn (const typename DimTraits< dim >::Triangulation &other) const
| Determines if an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components). More...
unsigned long | findAllIsomorphisms (const typename DimTraits< dim >::Triangulation &other, std::list< typename DimTraits< dim >::Isomorphism * > &results) const
| Finds all ways in which this triangulation is combinatorially isomorphic to the given triangulation. More...
unsigned long | findAllSubcomplexesIn (const typename DimTraits< dim >::Triangulation &other, std::list< typename DimTraits< dim >::Isomorphism * > &results) const
| Finds all ways in which an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components). More...
bool | makeCanonical ()
| Relabel the top-dimensional simplices and their vertices so that this triangulation is in canonical form. More...
Exporting Triangulations
std::string | isoSig (typename DimTraits< dim >::Isomorphism **relabelling=0) const
| Constructs the isomorphism signature for this triangulation. More...

## Static Public Member Functions

static NXMLPacketReader * | getXMLReader (NPacket *parent, NXMLTreeResolver &resolver)
Importing Triangulations
static DimTraits< dim >::Triangulation * | fromIsoSig (const std::string &sig)
| Recovers a full triangulation from an isomorphism signature. More...
static size_t | isoSigComponentSize (const std::string &sig)
| Deduces the number of top-dimensional simplices in a connected triangulation from its isomorphism signature. More...

## Protected Member Functions

virtual NPacket * | internalClonePacket (NPacket *parent) const
| Makes a newly allocated copy of this packet. More...
virtual void | writeXMLPacketData (std::ostream &out) const
| Writes a chunk of XML containing the data for this packet only. More...
void | cloneFrom (const Dim2Triangulation &from)
| Turns this triangulation into a clone of the given triangulation. More...
void | writeXMLPacketTree (std::ostream &out) const
| Writes a chunk of XML containing the subtree with this packet as matriarch. More...

## Friends

class | regina::NGenericTriangulation< 2 >
class | regina::Dim2Triangle
class | regina::NXMLDim2TriangulationReader

## Detailed Description

Stores the triangulation of a 2-manifold along with its various cellular structures and other information.

A 2-manifold triangulation is built from triangular faces.

When the triangulation is deleted, the corresponding triangles, the cellular structure and all other properties will be deallocated.

Elements of the 1- and 0-skeletons (edges and vertices respectively) are always temporary, as are components and boundary components. Whenever a change occurs with the triangulation, these objects will all be deleted and a new skeletal structure will be calculated. The same is true of various other triangulation properties.

## Member Typedef Documentation

typedef std::vector<Dim2BoundaryComponent*>::const_iterator regina::Dim2Triangulation::BoundaryComponentIterator

Used to iterate through boundary components.

typedef ChangeEventSpan regina::NPacket::ChangeEventBlock

inherited

A deprecated typedef for ChangeEventSpan.

Deprecated:
  ChangeEventSpan is now the correct way to fire a "packet changed" event. The class ChangeEventSpan is similar to the old ChangeEventBlock except that it fires both NPacketListener::packetToBeChanged() and NPacketListener::packetWasChanged() (on construction and destruction respectively), and the old boolean argument fireOnDestruction is gone (events are now fired always).

typedef std::vector<Dim2Component*>::const_iterator regina::Dim2Triangulation::ComponentIterator

Used to iterate through components.

typedef std::vector<Dim2Edge*>::const_iterator regina::Dim2Triangulation::EdgeIterator

Used to iterate through edges.

typedef std::vector<Dim2Triangle*>::const_iterator regina::Dim2Triangulation::TriangleIterator

Used to iterate through triangles.

typedef std::vector<Dim2Vertex*>::const_iterator regina::Dim2Triangulation::VertexIterator

Used to iterate through vertices.

## Constructor & Destructor Documentation

regina::Dim2Triangulation::Dim2Triangulation | ( |  | ) |

inline

Default constructor.

Creates an empty triangulation.

regina::Dim2Triangulation::Dim2Triangulation | ( | const Dim2Triangulation & | cloneMe | ) |

inline

Copy constructor.

Creates a new triangulation identical to the given triangulation. The packet tree structure and packet label are not copied.

Parameters

  cloneMe | the triangulation to clone.

regina::Dim2Triangulation::Dim2Triangulation | ( | 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.

regina::Dim2Triangulation::~Dim2Triangulation | ( |  | ) |

inline virtual

Destroys this triangulation.

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

## Member Function Documentation

bool regina::NPacket::addTag | ( | const std::string & | tag | ) |

inherited

Associates the given tag with this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Precondition
  The given tag is not the empty string.

Parameters

  tag | the tag to add.

Returns
  `true` if the given tag was successfully added, or `false` if the given tag was already present beforehand.

long regina::Dim2Triangulation::boundaryComponentIndex | ( | const Dim2BoundaryComponent * | bc | ) | const

inline

Returns the index of the given boundary component in the triangulation.

Precondition
  The given boundary component belongs to this triangulation.

Warning
  Passing a null pointer to this routine will probably crash your program.

Parameters

  bc | specifies which boundary component to find in the triangulation.

Returns
  the index of the specified boundary component, where 0 is the first boundary component, 1 is the second and so on.

NPacket* regina::NPacket::clone | ( | bool | cloneDescendants = `false`,
|  | bool | end = `true`
| ) |  | const

inherited

Clones this packet (and possibly its descendants), assigns to it a suitable unused label and inserts the clone into the tree as a sibling of this packet.

Note that any string tags associated with this packet will not be cloned.

If this packet has no parent in the tree structure, no clone will be created and 0 will be returned.

Parameters

  cloneDescendants | `true` if the descendants of this packet should also be cloned and inserted as descendants of the new packet. If this is passed as `false` (the default), only this packet will be cloned.
  end | `true` if the new packet should be inserted at the end of the parent's list of children (the default), or `false` if the new packet should be inserted as the sibling immediately after this packet.

Returns
  the newly inserted packet, or 0 if this packet has no parent.

void regina::Dim2Triangulation::cloneFrom | ( | const Dim2Triangulation & | from | ) |

protected

Turns this triangulation into a clone of the given triangulation.

The tree structure and label of this triangulation are not touched.

Parameters

  from | the triangulation from which this triangulation will be cloned.

long regina::Dim2Triangulation::componentIndex | ( | const Dim2Component * | component | ) | const

inline

Returns the index of the given component in the triangulation.

Precondition
  The given component belongs to this triangulation.

Warning
  Passing a null pointer to this routine will probably crash your program.

Parameters

  component | specifies which component to find in the triangulation.

Returns
  the index of the specified component, where 0 is the first component, 1 is the second and so on.

bool regina::Dim2Triangulation::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::NPacket.

std::string regina::ShareableObject::detail | ( |  | ) | const

inherited

Returns the output from writeTextLong() as a string.

Returns
  a long text representation of this object.

std::string regina::Dim2Triangulation::dumpConstruction | ( |  | ) | const

Returns C++ code that can be used with insertConstruction() to reconstruct this triangulation.

The code produced will consist of the following:

- the declaration and initialisation of two integer arrays, describing the triangle gluings in this trianguation;
- two additional lines that declare a new Dim2Triangulation and call insertConstruction() to rebuild this triangulation.

The main purpose of this routine is to generate the two integer arrays, which can be tedious and error-prone to code up by hand.

Note that the number of lines of code produced grows linearly with the number of triangles. If this triangulation is very large, the returned string will be very large as well.

Returns
  the C++ code that was generated.

long regina::Dim2Triangulation::edgeIndex | ( | const Dim2Edge * | edge | ) | const

inline

Returns the index of the given edge in the triangulation.

Precondition
  The given edge belongs to this triangulation.

Warning
  Passing a null pointer to this routine will probably crash your program.

Parameters

  edge | specifies which edge to find in the triangulation.

Returns
  the index of the specified edge, where 0 is the first edge, 1 is the second and so on.

unsigned long regina::NGenericTriangulation< dim >::findAllIsomorphisms | ( | const typename DimTraits< dim >::Triangulation & | other,
|  | std::list< typename DimTraits< dim >::Isomorphism * > & | results
| ) |  | const

inherited

Finds all ways in which this triangulation is combinatorially isomorphic to the given triangulation.

This routine behaves identically to isIsomorphicTo(), except that instead of returning just one isomorphism, all such isomorphisms are returned.

See the isIsomorphicTo() notes for additional information.

The isomorphisms that are found will be inserted into the given list. These isomorphisms will be newly created, and the caller of this routine is responsible for destroying them. The given list will not be emptied before the new isomorphisms are inserted.

Python:
  Not present.

Parameters

  other | the triangulation to compare with this one.
  results | the list in which any isomorphisms found will be stored.

Returns
  the number of isomorphisms that were found.

unsigned long regina::NGenericTriangulation< dim >::findAllSubcomplexesIn | ( | const typename DimTraits< dim >::Triangulation & | other,
|  | std::list< typename DimTraits< dim >::Isomorphism * > & | results
| ) |  | const

inherited

Finds all ways in which an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components).

This routine behaves identically to isContainedIn(), except that instead of returning just one isomorphism (which may be boundary incomplete and need not be onto), all such isomorphisms are returned.

See the isContainedIn() notes for additional information.

The isomorphisms that are found will be inserted into the given list. These isomorphisms will be newly created, and the caller of this routine is responsible for destroying them. The given list will not be emptied before the new isomorphisms are inserted.

Python:
  Not present.

Parameters

  other | the triangulation in which to search for isomorphic copies of this triangulation.
  results | the list in which any isomorphisms found will be stored.

Returns
  the number of isomorphisms that were found.

NPacket* regina::NPacket::findPacketLabel | ( | const std::string & | label | ) |

inherited

Finds the packet with the requested label in the tree or subtree for which this packet is matriarch.

Note that label comparisons are case sensitive.

Parameters

  label | the label to search for.

Returns
  the packet with the requested label, or 0 if there is no such packet.

const NPacket* regina::NPacket::findPacketLabel | ( | const std::string & | label | ) | const

inherited

Finds the packet with the requested label in the tree or subtree for which this packet is matriarch.

Note that label comparisons are case sensitive.

Parameters

  label | the label to search for.

Returns
  the packet with the requested label, or 0 if there is no such packet.

NPacket* regina::NPacket::firstTreePacket | ( | const std::string & | type | ) |

inherited

Finds the first packet of the requested type in a complete depth-first iteration of the tree structure.

Note that this packet must be the matriarch of the entire tree.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Parameters

  type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive.

Returns
  the first such packet, or 0 if there are no packets of the requested type.

const NPacket* regina::NPacket::firstTreePacket | ( | const std::string & | type | ) | const

inherited

Finds the first packet of the requested type in a complete depth-first iteration of the tree structure.

Note that this packet must be the matriarch of the entire tree.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Parameters

  type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive.

Returns
  the first such packet, or 0 if there are no packets of the requested type.

static DimTraits<dim>::Triangulation* regina::NGenericTriangulation< dim >::fromIsoSig | ( | const std::string & | sig | ) |

static inherited

Recovers a full triangulation from an isomorphism signature.

See isoSig() for more information on isomorphism signatures. It will be assumed that the signature describes a triangulation of dimension dim.

The triangulation that is returned will be newly created.

Calling isoSig() followed by fromIsoSig() is not guaranteed to produce an identical triangulation to the original, but it is guaranteed to produce a combinatorially isomorphic triangulation.

For a full and precise description of the isomorphism signature format for 3-manifold triangulations, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, `arXiv:1110.6080`. The format for other dimensions is essentially the same, but with minor dimension-specific adjustments.

Warning
  Do not mix isomorphism signatures between dimensions! It is possible that the same string could corresponding to both a p-dimensional triangulation and a q-dimensional triangulation for different p and q.

Parameters

  sig | the isomorphism signature of the triangulation to construct. Note that, unlike dehydration strings for 3-manifold triangulations, case is important for isomorphism signatures.

Returns
  a newly allocated triangulation if the reconstruction was successful, or null if the given string was not a valid isomorphism signature.

Dim2BoundaryComponent * regina::Dim2Triangulation::getBoundaryComponent | ( | unsigned long | index | ) | const

inline

Returns the requested triangulation boundary component.

Bear in mind that each time the triangulation changes, the boundary components will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters

  index | the index of the desired boundary component, ranging from 0 to getNumberOfBoundaryComponents()-1 inclusive.

Returns
  the requested boundary component.

const std::vector< Dim2BoundaryComponent * > & regina::Dim2Triangulation::getBoundaryComponents | ( |  | ) | const

inline

Returns all boundary components of this triangulation.

Bear in mind that each time the triangulation changes, the boundary components will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however will remain valid and up-to-date for as long as the triangulation exists.

Python:
  This routine returns a python list.

Returns
  the list of all boundary components.

Dim2Component * regina::Dim2Triangulation::getComponent | ( | unsigned long | index | ) | const

inline

Returns the requested triangulation component.

Bear in mind that each time the triangulation changes, the components will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters

  index | the index of the desired component, ranging from 0 to getNumberOfComponents()-1 inclusive.

Returns
  the requested component.

const std::vector< Dim2Component * > & regina::Dim2Triangulation::getComponents | ( |  | ) | const

inline

Returns all components of this triangulation.

Bear in mind that each time the triangulation changes, the components will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however will remain valid and up-to-date for as long as the triangulation exists.

Python:
  This routine returns a python list.

Returns
  the list of all components.

Dim2Edge * regina::Dim2Triangulation::getEdge | ( | unsigned long | index | ) | const

inline

Returns the requested triangulation edge.

Bear in mind that each time the triangulation changes, the edges will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters

  index | the index of the desired edge, ranging from 0 to getNumberOfEdges()-1 inclusive.

Returns
  the requested edge.

const std::vector< Dim2Edge * > & regina::Dim2Triangulation::getEdges | ( |  | ) | const

inline

Returns all edges of this triangulation.

Bear in mind that each time the triangulation changes, the edges will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however will remain valid and up-to-date for as long as the triangulation exists.

Python:
  This routine returns a python list.

Returns
  the list of all edges.

long regina::Dim2Triangulation::getEulerChar | ( |  | ) | const

inline

Returns the Euler characteristic of this triangulation.

This will be evaluated as V-E+F.

Returns
  the Euler characteristic of this triangulation.

NPacket * regina::NPacket::getFirstTreeChild | ( |  | ) | const

inline inherited

Determines the first child of this packet in the tree structure.

This routine takes small constant time.

Returns
  the first child packet, or 0 if there is none.

std::string regina::NPacket::getFullName | ( |  | ) | const

inherited

Returns a descriptive text string for the packet.

The string is of the form label (packet-type).

The packet label will be adjusted for human-readable output according to the behaviour of getHumanLabel().

Returns
  the descriptive text string.

std::string regina::NPacket::getHumanLabel | ( |  | ) | const

inline inherited

Returns the label associated with this individual packet, adjusted if necessary for human-readable output.

In particular, if the packet has no label assigned then this routine will return "(no label)", not the empty string.

Warning
  The method by which this routine adjusts packet labels is subject to change in future versions of Regina.

Returns
  this individual packet's label.

NPacket * regina::NPacket::getLastTreeChild | ( |  | ) | const

inline inherited

Determines the last child of this packet in the tree structure.

This routine takes small constant time.

Returns
  the last child packet, or 0 if there is none.

NPacket * regina::NPacket::getNextTreeSibling | ( |  | ) | const

inline inherited

Determines the next sibling of this packet in the tree structure.

This is the child of the parent that follows this packet.

This routine takes small constant time.

Returns
  the next sibling of this packet, or 0 if there is none.

unsigned long regina::Dim2Triangulation::getNumberOfBoundaryComponents | ( |  | ) | const

inline

Returns the number of boundary components in this triangulation.

Returns
  the number of boundary components.

unsigned long regina::Dim2Triangulation::getNumberOfBoundaryEdges | ( |  | ) | const

inline

Returns the number of boundary edges in this triangulation.

Returns
  the total number of boundary edges.

unsigned long regina::NPacket::getNumberOfChildren | ( |  | ) | const

inherited

Returns the number of immediate children of this packet.

Grandchildren and so on are not counted.

Returns
  the number of immediate children.

unsigned long regina::Dim2Triangulation::getNumberOfComponents | ( |  | ) | const

inline

Returns the number of components in this triangulation.

Returns
  the number of components.

unsigned long regina::NPacket::getNumberOfDescendants | ( |  | ) | const

inline inherited

Returns the total number of descendants of this packet.

This includes children, grandchildren and so on. This packet is not included in the count.

Returns
  the total number of descendants.

unsigned long regina::Dim2Triangulation::getNumberOfEdges | ( |  | ) | const

inline

Returns the number of edges in this triangulation.

Returns
  the number of edges.

template<int dim>

unsigned long regina::Dim2Triangulation::getNumberOfFaces | ( |  | ) | const

Returns the number of faces of the given dimension in this triangulation.

This template function is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Precondition
  the template argument dim is between 0 and 2 inclusive.

Python:
  Not present.

Returns
  the number of faces of the given dimension.

unsigned long regina::Dim2Triangulation::getNumberOfSimplices | ( |  | ) | const

inline

A dimension-agnostic alias for getNumberOfTriangles().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See getNumberOfTriangles() for further information.

unsigned long regina::Dim2Triangulation::getNumberOfTriangles | ( |  | ) | const

inline

Returns the number of triangular faces in the triangulation.

Returns
  the number of triangles.

unsigned long regina::Dim2Triangulation::getNumberOfVertices | ( |  | ) | const

inline

Returns the number of vertices in this triangulation.

Returns
  the number of vertices.

const std::string & regina::NPacket::getPacketLabel | ( |  | ) | const

inline inherited

Returns the label associated with this individual packet.

An example is `MyTriangulation`. Each individual packet in the overall tree structure must have a unique label.

Returns
  this individual packet's label.

virtual PacketType regina::NPacket::getPacketType | ( |  | ) | const

pure virtual inherited

Returns the unique integer ID representing this type of packet.

This is the same for all packets of this class.

Returns
  the packet type ID.

virtual std::string regina::NPacket::getPacketTypeName | ( |  | ) | const

pure virtual inherited

Returns an English name for this type of packet.

An example is `NTriangulation`. This is the same for all packets of this class.

Returns
  the packet type name.

NPacket * regina::NPacket::getPrevTreeSibling | ( |  | ) | const

inline inherited

Determines the previous sibling of this packet in the tree structure.

This is the child of the parent that precedes this packet.

This routine takes small constant time.

Returns
  the previous sibling of this packet, or 0 if there is none.

Dim2Triangle * regina::Dim2Triangulation::getSimplex | ( | unsigned long | index | ) |

inline

A dimension-agnostic alias for getTriangle().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See getTriangle() for further information.

const Dim2Triangle * regina::Dim2Triangulation::getSimplex | ( | unsigned long | index | ) | const

inline

A dimension-agnostic alias for getTriangle().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See getTriangle() for further information.

const std::vector< Dim2Triangle * > & regina::Dim2Triangulation::getSimplices | ( |  | ) | const

inline

A dimension-agnostic alias for getTriangles().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See getTriangles() for further information.

const std::set< std::string > & regina::NPacket::getTags | ( |  | ) | const

inline inherited

Returns the set of all tags associated with this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Python:
  This routine returns a python list of strings.

Returns
  the set of all tags associated with this packet.

unsigned long regina::NPacket::getTotalTreeSize | ( |  | ) | const

inherited

Determines the total number of packets in the tree or subtree for which this packet is matriarch.

This packet is included in the count.

Returns
  the total tree or subtree size.

NPacket* regina::NPacket::getTreeMatriarch | ( |  | ) | const

inherited

Determines the matriarch (the root) of the tree to which this packet belongs.

Returns
  the matriarch of the packet tree.

NPacket * regina::NPacket::getTreeParent | ( |  | ) | const

inline inherited

Determines the parent packet in the tree structure.

This routine takes small constant time.

Returns
  the parent packet, or 0 if there is none.

Dim2Triangle * regina::Dim2Triangulation::getTriangle | ( | unsigned long | index | ) |

inline

Returns the triangle with the given index number in the triangulation.

Note that triangle indexing may change when a triangle is added or removed from the triangulation.

Parameters

  index | specifies which triangle to return; this value should be between 0 and getNumberOfTriangles()-1 inclusive.

Returns
  the `index`th triangle in the triangulation.

const Dim2Triangle * regina::Dim2Triangulation::getTriangle | ( | unsigned long | index | ) | const

inline

Returns the triangle with the given index number in the triangulation.

Note that triangle indexing may change when a triangle is added or removed from the triangulation.

Parameters

  index | specifies which triangle to return; this value should be between 0 and getNumberOfTriangles()-1 inclusive.

Returns
  the `index`th triangle in the triangulation.

const std::vector< Dim2Triangle * > & regina::Dim2Triangulation::getTriangles | ( |  | ) | const

inline

Returns all triangular faces in the triangulation.

The reference returned will remain valid for as long as the triangulation exists, always reflecting the triangles currently in the triangulation.

Python:
  This routine returns a python list.

Returns
  the list of all triangles.

Dim2Vertex * regina::Dim2Triangulation::getVertex | ( | unsigned long | index | ) | const

inline

Returns the requested triangulation vertex.

Bear in mind that each time the triangulation changes, the vertices will be deleted and replaced with new ones. Thus this object should be considered temporary only.

Parameters

  index | the index of the desired vertex, ranging from 0 to getNumberOfVertices()-1 inclusive.

Returns
  the requested vertex.

const std::vector< Dim2Vertex * > & regina::Dim2Triangulation::getVertices | ( |  | ) | const

inline

Returns all vertices of this triangulation.

Bear in mind that each time the triangulation changes, the vertices will be deleted and replaced with new ones. Thus the objects contained in this list should be considered temporary only.

This reference to the list however will remain valid and up-to-date for as long as the triangulation exists.

Python:
  This routine returns a python list.

Returns
  the list of all vertices.

bool regina::Dim2Triangulation::hasBoundaryEdges | ( |  | ) | const

inline

Determines if this triangulation has any boundary edges.

This routine is redundant in dimension two, since it returns `true` if and only if isClosed() returns `false`. It is provided simply for compatibility with higher-dimensional triangulation classes.

Returns
  `true` if and only if there are boundary edges.

bool regina::NPacket::hasTag | ( | const std::string & | tag | ) | const

inline inherited

Determines whether this packet has the given associated tag.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Parameters

  tag | the tag to search for.

Returns
  `true` if the given tag is found, `false` otherwise.

bool regina::NPacket::hasTags | ( |  | ) | const

inline inherited

Determines whether this packet has any associated tags at all.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Returns
  `true` if this packet has any tags, `false` otherwise.

void regina::NPacket::insertChildAfter | ( | NPacket * | newChild,
|  | NPacket * | prevChild
| ) |  |

inherited

Inserts the given packet as a child of this packet at the given location in this packet's child list.

This routine takes small constant time.

Precondition
  Parameter newChild has no parent packet.
  Parameter prevChild is already a child of this packet.
  This packet is not a descendant of newChild.

Python:
  Since this packet takes ownership of the given child packet, the python object containing the given child packet becomes a null object and should no longer be used. See reparent() for a way of avoiding these problems in some cases.

Parameters

  newChild | the child to insert.
  prevChild | the preexisting child of this packet after which newChild will be inserted, or 0 if newChild is to be the first child of this packet.

void regina::NPacket::insertChildFirst | ( | NPacket * | child | ) |

inherited

Inserts the given packet as the first child of this packet.

This routine takes small constant time.

Precondition
  The given child has no parent packet.
  This packet is not a descendant of the given child.

Python:
  Since this packet takes ownership of the given child packet, the python object containing the given child packet becomes a null object and should no longer be used. See reparent() for a way of avoiding these problems in some cases.

Parameters

  child | the child to insert.

void regina::NPacket::insertChildLast | ( | NPacket * | child | ) |

inherited

Inserts the given packet as the last child of this packet.

This routine takes small constant time.

Precondition
  The given child has no parent packet.
  This packet is not a descendant of the given child.

Python:
  Since this packet takes ownership of the given child packet, the python object containing the given child packet becomes a null object and should no longer be used. See reparent() for a way of avoiding these problems in some cases.

Parameters

  child | the child to insert.

void regina::Dim2Triangulation::insertConstruction | ( | unsigned long | nTriangles,
|  | const int | adjacencies[][3],
|  | const int | gluings[][3][3]
| ) |  |

Inserts into this triangulation a set of triangles and their gluings as described by the given integer arrays.

This routine is provided to make it easy to hard-code a medium-sized triangulation in a C++ source file. All of the pertinent data can be hard-coded into a pair of integer arrays at the beginning of the source file, avoiding an otherwise tedious sequence of many joinTo() calls.

An additional nTriangles triangles will be inserted into this triangulation. The relationships between these triangles should be stored in the two arrays as follows. Note that the new triangles are numbered from 0 to (nTriangles - 1), and individual triangle edges are numbered from 0 to 2.

The adjacencies array describes which triangle edges are joined to which others. Specifically, `adjacencies[f][e]` should contain the number of the triangle joined to edge e of triangle f. If this edge is to be left as a boundary edge, `adjacencies[f][e]` should be -1.

The gluings array describes the particular gluing permutations used when joining these triangle edges together. Specifically, `gluings[f][e][0..2]` should describe the permutation used to join edge e of triangle f to its adjacent triangle. These three integers should be 0, 1 and 2 in some order, so that `gluings[f][e][i]` contains the image of i under this permutation. If edge e of triangle f is to be left as a boundary edge, `gluings[f][e][0..2]` may contain anything (and will be duly ignored).

It is the responsibility of the caller of this routine to ensure that the given arrays are correct and consistent. No error checking will be performed by this routine.

Note that, for an existing triangulation, dumpConstruction() will output a pair of C++ arrays that can be copied into a source file and used to reconstruct the triangulation via this routine.

Python:
  Not present.

Parameters

  nTriangles | the number of additional triangles to insert.
  adjacencies | describes which of the new triangle edges are to be identified. This array must have initial dimension at least nTriangles.
  gluings | describes the specific gluing permutations by which these new triangle edges should be identified. This array must also have initial dimension at least nTriangles.

void regina::Dim2Triangulation::insertTriangulation | ( | const Dim2Triangulation & | source | ) |

Inserts a copy of the given triangulation into this triangulation.

The new triangles will be inserted into this triangulation in the order in which they appear in the given triangulation, and the numbering of their vertices (0-2) will not change. They will be given the same descriptions as appear in the given triangulation.

Parameters

  source | the triangulation whose copy will be inserted.

NPacket * regina::Dim2Triangulation::internalClonePacket | ( | NPacket * | 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::NPacket.

std::string regina::NPacket::internalID | ( |  | ) | const

inherited

Returns a unique string ID that identifies this packet.

The user has no control over this ID, and it is not human readable. It is guaranteed to remain fixed throughout the lifetime of the program for a given packet, and it is guaranteed not to clash with the ID of any other packet.

If you change the contents of a packet, its ID will not change.

If you clone a packet, the new clone will receive a different ID. If you save and then load a packet to/from file, the ID will change. These behaviours are necessary to ensure that IDs remain unique (since, for instance, you could load several copies of the same data file into memory simultaneously).

The ID is implemented as an encoding of the underlying C++ pointer. This encoding is subject to change in later versions of Regina.

Returns
  a unique ID that identifies this packet.

bool regina::Dim2Triangulation::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.

bool regina::Dim2Triangulation::isConnected | ( |  | ) | const

inline

Determines if this triangulation is connected.

Returns
  `true` if and only if this triangulation is connected.

std::auto_ptr<typename DimTraits<dim>::Isomorphism> regina::NGenericTriangulation< dim >::isContainedIn | ( | const typename DimTraits< dim >::Triangulation & | other | ) | const

inherited

Determines if an isomorphic copy of this triangulation is contained within the given triangulation, possibly as a subcomplex of some larger component (or components).

Specifically, this routine determines if there is a boundary incomplete combinatorial isomorphism from this triangulation to other. Boundary incomplete isomorphisms are described in detail in the Isomorphism class notes.

In particular, note that facets of top-dimensional simplices that lie on the boundary of this triangulation need not correspond to boundary facets of other, and that other may contain more top-dimensional simplices than this triangulation.

If a boundary incomplete isomorphism is found, the details of this isomorphism are returned. The isomorphism is newly constructed, and so to assist with memory management is returned as a std::auto_ptr. Thus, to test whether an isomorphism exists without having to explicitly deal with the isomorphism itself, you can call `if (isContainedIn(other).get())` and the newly created isomorphism (if it exists) will be automatically destroyed.

If more than one such isomorphism exists, only one will be returned. For a routine that returns all such isomorphisms, see findAllSubcomplexesIn().

Parameters

  other | the triangulation in which to search for an isomorphic copy of this triangulation.

Returns
  details of the isomorphism if such a copy is found, or a null pointer otherwise.

bool regina::NGenericTriangulation< dim >::isEmpty | ( |  | ) | const

inherited

Determines whether this triangulation is empty.

An empty triangulation is one with no simplices at all.

Returns
  `true` if and only if this triangulation is empty.

bool regina::NPacket::isGrandparentOf | ( | const NPacket * | descendant | ) | const

inherited

Determines if this packet is equal to or an ancestor of the given packet in the tree structure.

Parameters

  descendant | the other packet whose relationships we are examining.

Returns
  `true` if and only if this packet is equal to or an ancestor of `descendant`.

bool regina::Dim2Triangulation::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`.

bool regina::NGenericTriangulation< dim >::isIdenticalTo | ( | const typename DimTraits< dim >::Triangulation & | other | ) | const

inherited

Determines if this triangulation is combinatorially identical to the given triangulation.

Here "identical" means that the triangulations have the same number of top-dimensional simplices, with gluings between the same pairs of numbered simplices using the same gluing permutations. In other words, "identical" means that the triangulations are isomorphic via the identity isomorphism.

To test for the less strict combinatorial isomorphism (which allows relabelling of the top-dimensional simplices and their vertices), see isIsomorphicTo() instead.

This test does not examine the textual simplex descriptions, as seen in Simplex::getDescription(); these may still differ. It also does not test the numbering of vertices, edges and so on, as used by getVertex(), getEdge() and so on; although at the time of writing these will always be numbered the same for identical triangulations, it is conceivable that in future versions of Regina there may be situations in which identical triangulations can acquire different numberings for vertices, edges, etc.

Parameters

  other | the triangulation to compare with this one.

Returns
  `true` if and only if the two triangulations are combinatorially identical.

std::auto_ptr<typename DimTraits<dim>::Isomorphism> regina::NGenericTriangulation< dim >::isIsomorphicTo | ( | const typename DimTraits< dim >::Triangulation & | other | ) | const

inherited

Determines if this triangulation is combinatorially isomorphic to the given triangulation.

Specifically, this routine determines if there is a one-to-one and onto boundary complete combinatorial isomorphism from this triangulation to other. Boundary complete isomorphisms are described in detail in the Isomorphism class notes.

In particular, note that this triangulation and other must contain the same number of top-dimensional simplices for such an isomorphism to exist.

If you need to ensure that top-dimensional simplices are labelled the same in both triangulations, see the stricter test isIdenticalTo() instead.

If a boundary complete isomorphism is found, the details of this isomorphism are returned. The isomorphism is newly constructed, and so to assist with memory management is returned as a std::auto_ptr. Thus, to test whether an isomorphism exists without having to explicitly deal with the isomorphism itself, you can call `if (isIsomorphicTo(other).get())` and the newly created isomorphism (if it exists) will be automatically destroyed.

If more than one such isomorphism exists, only one will be returned. For a routine that returns all such isomorphisms, see findAllIsomorphisms().

Todo:
  Optimise: Improve the complexity by choosing a simplex mapping from each component and following gluings to determine the others.

Parameters

  other | the triangulation to compare with this one.

Returns
  details of the isomorphism if the two triangulations are combinatorially isomorphic, or a null pointer otherwise.

bool regina::NPacket::isListening | ( | NPacketListener * | listener | ) |

inline inherited

Determines whether the given packet listener is currently listening for events on this packet.

See the NPacketListener class notes for details.

Python:
  Not present.

Parameters

  listener | the listener to search for.

Returns
  `true` if the given listener is currently registered with this packet, or `false` otherwise.

bool regina::Dim2Triangulation::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.

bool regina::Dim2Triangulation::isOrientable | ( |  | ) | const

inline

Determines if this triangulation is orientable.

Returns
  `true` if and only if this triangulation is orientable.

std::string regina::NGenericTriangulation< dim >::isoSig | ( | typename DimTraits< dim >::Isomorphism ** | relabelling = `0` | ) | const

inherited

Constructs the isomorphism signature for this triangulation.

An isomorphism signature is a compact text representation of a triangulation. Unlike dehydrations for 3-manifold triangulations, an isomorphism signature uniquely determines a triangulation up to combinatorial isomorphism (assuming the dimension is known in advance). That is, two triangulations of dimension dim are combinatorially isomorphic if and only if their isomorphism signatures are the same.

The isomorphism signature is constructed entirely of printable characters, and has length proportional to `n log n`, where n is the number of top-dimenisonal simplices.

Isomorphism signatures are more general than dehydrations: they can be used with any triangulation (including closed, bounded and/or disconnected triangulations, as well as triangulations with large numbers of triangles).

The time required to construct the isomorphism signature of a triangulation is `O(n^2 log^2 n)`.

The routine fromIsoSig() can be used to recover a triangulation from an isomorphism signature. The triangulation recovered might not be identical to the original, but it will be combinatorially isomorphic.

If relabelling is non-null (i.e., it points to some Isomorphism pointer p), then it will be modified to point to a new isomorphism that describes the precise relationship between this triangulation and the reconstruction from fromIsoSig(). Specifically, the triangulation that is reconstructed from fromIsoSig() will be combinatorially identical to `relabelling.apply(this)`.

For a full and precise description of the isomorphism signature format for 3-manifold triangulations, see Simplification paths in the Pachner graphs of closed orientable 3-manifold triangulations, Burton, 2011, `arXiv:1110.6080`. The format for other dimensions is essentially the same, but with minor dimension-specific adjustments.

Python:
  The isomorphism argument is not present. Instead there are two routines: fromIsoSig(), which returns a string only, and fromIsoSigDetail(), which returns a pair (signature, relabelling).

Precondition
  If relabelling is non-null, then this triangulation must be non-empty and connected. The facility to return a relabelling for disconnected triangulations may be added to Regina in a later release.

Warning
  Do not mix isomorphism signatures between dimensions! It is possible that the same string could corresponding to both a p-dimensional triangulation and a q-dimensional triangulation for different p and q.

Parameters

  relabelling | if non-null, this will be modified to point to a new isomorphism describing the relationship between this triangulation and that reconstructed from fromIsoSig(), as described above.

Returns
  the isomorphism signature of this triangulation.

static size_t regina::NGenericTriangulation< dim >::isoSigComponentSize | ( | const std::string & | sig | ) |

static inherited

Deduces the number of top-dimensional simplices in a connected triangulation from its isomorphism signature.

See isoSig() for more information on isomorphism signatures. It will be assumed that the signature describes a triangulation of dimension dim.

If the signature describes a connected triangulation, this routine will simply return the size of that triangulation (e.g., the number of tetrahedra in the case dim = 3). You can also pass an isomorphism signature that describes a disconnected triangulation; however, this routine will only return the number of simplices in the first connected component. If you need the total number of simplices in a disconnected triangulation, you will need to reconstruct the full triangulation by calling fromIsoSig() instead.

This routine is very fast, since it only examines the first few characters of the isomorphism signature (in which the size of the first component is encoded). However, it is therefore possible to pass an invalid isomorphism signature and still receive a positive result. If you need to test whether a signature is valid or not, you must call fromIsoSig() instead, which will examine the entire signature in full.

Warning
  Do not mix isomorphism signatures between dimensions! It is possible that the same string could corresponding to both a p-dimensional triangulation and a q-dimensional triangulation for different p and q.

Parameters

  sig | an isomorphism signature of a dim-dimensional triangulation. Note that, unlike dehydration strings for 3-manifold triangulations, case is important for isomorphism signatures.

Returns
  the number of top-dimensional simplices in the first connected component, or 0 if this could not be determined because the given string was not a valid isomorphism signature.

bool regina::NPacket::isPacketEditable | ( |  | ) | const

inherited

Determines whether this packet can be altered without invalidating or otherwise upsetting any of its immediate children.

Descendants further down the packet tree are not (and should not need to be) considered.

Returns
  `true` if and only if this packet may be edited.

bool regina::Dim2Triangulation::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`.

unsigned regina::NPacket::levelsDownTo | ( | const NPacket * | descendant | ) | const

inherited

Counts the number of levels between this packet and its given descendant in the tree structure.

If `descendant` is this packet, the number of levels is zero.

Precondition
  This packet is equal to `descendant`, or can be obtained from `descendant` using only child-to-parent steps.

Parameters

  descendant | the packet whose relationship with this packet we are examining.

Returns
  the number of levels difference.

unsigned regina::NPacket::levelsUpTo | ( | const NPacket * | ancestor | ) | const

inline inherited

Counts the number of levels between this packet and its given ancestor in the tree structure.

If `ancestor` is this packet, the number of levels is zero.

Precondition
  This packet is equal to `ancestor`, or can be obtained from `ancestor` using only parent-to-child steps.

Parameters

  ancestor | the packet whose relationship with this packet we are examining.

Returns
  the number of levels difference.

bool regina::NPacket::listen | ( | NPacketListener * | listener | ) |

inherited

Registers the given packet listener to listen for events on this packet.

See the NPacketListener class notes for details.

Python:
  Not present.

Parameters

  listener | the listener to register.

Returns
  `true` if the given listener was successfully registered, or `false` if the given listener was already registered beforehand.

bool regina::NGenericTriangulation< dim >::makeCanonical | ( |  | ) |

inherited

Relabel the top-dimensional simplices and their vertices so that this triangulation is in canonical form.

This is essentially the lexicographically smallest labelling when the facet gluings are written out in order.

Two triangulations are isomorphic if and only if their canonical forms are identical.

The lexicographic ordering assumes that the facet gluings are written in order of simplex index and then facet number. Each gluing is written as the destination simplex index followed by the gluing permutation (which in turn is written as the images of 0,1,...,dim in order).

Precondition
  This routine currently works only when the triangulation is connected. It may be extended to work with disconnected triangulations in later versions of Regina.

Returns
  `true` if the triangulation was changed, or `false` if the triangulation was in canonical form to begin with.

void regina::NPacket::makeOrphan | ( |  | ) |

inherited

Cuts this packet away from its parent in the tree structure and instead makes it matriarch of its own tree.

The tree information for both this packet and its parent will be updated.

This routine takes small constant time.

Precondition
  This packet has a parent.
  This packet does not depend on its parent; see dependsOnParent() for details.

Python:
  As of Regina 4.6.1, this routine returns the packet itself, and the ownership of this packet becomes the responsibility of whoever takes this return value. In particular, if you call makeOrphan() and ignore the return value then the entire packet subtree is automatically destroyed. The reason for this behaviour is to avoid memory leaks where subtrees are orphaned and then silently forgotten.

std::string regina::NPacket::makeUniqueLabel | ( | const std::string & | base | ) | const

inherited

Returns a new label that cannot be found anywhere in the entire tree structure.

This packet need not be the tree matriarch; this routine will search the entire tree to which this packet belongs.

The new label will consist of the given base, possibly followed by a space and a number.

Deprecated:
  This routine is deprecated, since (as of Regina 4.95) packet labels in a data file are no longer required to be distinct.

Parameters

  base | a string upon which the new label will be based.

Returns
  a new unique label.

bool regina::NPacket::makeUniqueLabels | ( | NPacket * | reference | ) |

inherited

Ensures that all packet labels in both this and the given packet tree combined are distinct.

If two packets have the same label, one will be renamed by adding a space and a number.

Packets in the given packet tree will be given priority over the labels; that is, if a packet in this tree has the same label as a packet in the given tree, it will be the packet in this tree that is renamed.

The given packet tree may be `null`, in which case only this tree will be examined.

Deprecated:
  This routine is deprecated, since (as of Regina 4.95) packet labels in a data file are no longer required to be distinct.

Precondition
  This and the given packet belong to different packet trees, and are each matriarchs in their respective trees.

Parameters

  reference | the packet tree with which to compare this tree.

Returns
  `true` if and only if any of the packets were relabelled.

void regina::Dim2Triangulation::moveContentsTo | ( | Dim2Triangulation & | dest | ) |

Moves the contents of this triangulation into the given destination triangulation, without destroying any pre-existing contents.

That is, all triangles that currently belong to dest will remain there, and all triangles that belong to this triangulation will be moved across as additional triangles in dest.

All Dim2Triangle pointers or references will remain valid. After this operation, this triangulation will be empty.

Parameters

  dest | the triangulation to which triangles should be moved.

void regina::NPacket::moveDown | ( | unsigned | steps = `1` | ) |

inherited

Moves this packet the given number of steps towards the end of its sibling list.

If the number of steps is larger than the greatest possible movement, the packet will be moved to the very end of its sibling list.

This routine takes time proportional to the number of steps.

Precondition
  The given number of steps is strictly positive.

void regina::NPacket::moveToFirst | ( |  | ) |

inherited

Moves this packet to be the first in its sibling list.

This routine takes small constant time.

void regina::NPacket::moveToLast | ( |  | ) |

inherited

Moves this packet to be the last in its sibling list.

This routine takes small constant time.

void regina::NPacket::moveUp | ( | unsigned | steps = `1` | ) |

inherited

Moves this packet the given number of steps towards the beginning of its sibling list.

If the number of steps is larger than the greatest possible movement, the packet will be moved to the very beginning of its sibling list.

This routine takes time proportional to the number of steps.

Precondition
  The given number of steps is strictly positive.

Dim2Triangle * regina::Dim2Triangulation::newSimplex | ( |  | ) |

inline

A dimension-agnostic alias for newTriangle().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See newTriangle() for further information.

Dim2Triangle * regina::Dim2Triangulation::newSimplex | ( | const std::string & | desc | ) |

inline

A dimension-agnostic alias for newTriangle().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See newTriangle() for further information.

Dim2Triangle * regina::Dim2Triangulation::newTriangle | ( |  | ) |

inline

Creates a new triangle and adds it to this triangulation.

The new triangle will have an empty description. All three edges of the new triangle will be boundary edges.

The new triangle will become the last triangle in this triangulation.

Returns
  the new triangle.

Dim2Triangle * regina::Dim2Triangulation::newTriangle | ( | const std::string & | desc | ) |

inline

Creates a new triangle with the given description and adds it to this triangulation.

All three edges of the new triangle will be boundary edges.

Parameters

  desc | the description to assign to the new triangle.

Returns
  the new triangle.

NPacket* regina::NPacket::nextTreePacket | ( |  | ) |

inherited

Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs.

Note that this packet need not be the tree matriarch.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Returns
  the next packet, or 0 if this is the last packet in such an iteration.

const NPacket* regina::NPacket::nextTreePacket | ( |  | ) | const

inherited

Finds the next packet after this in a complete depth-first iteration of the entire tree structure to which this packet belongs.

Note that this packet need not be the tree matriarch.

A parent packet is always reached before its children. The tree matriarch will be the first packet visited in a complete depth-first iteration.

Returns
  the next packet, or 0 if this is the last packet in such an iteration.

NPacket* regina::NPacket::nextTreePacket | ( | const std::string & | type | ) |

inherited

Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure.

Note that this packet need not be the tree matriarch. The order of tree searching is described in firstTreePacket().

Parameters

  type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive.

Returns
  the next such packet, or 0 if this is the last packet of the requested type in such an iteration.

const NPacket* regina::NPacket::nextTreePacket | ( | const std::string & | type | ) | const

inherited

Finds the next packet after this of the requested type in a complete depth-first iteration of the entire tree structure.

Note that this packet need not be the tree matriarch. The order of tree searching is described in firstTreePacket().

Parameters

  type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive.

Returns
  the next such packet, or 0 if this is the last packet of the requested type in such an iteration.

bool regina::Dim2Triangulation::oneThreeMove | ( | Dim2Triangle * | 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.

void regina::Dim2Triangulation::removeAllSimplices | ( |  | ) |

inline

A dimension-agnostic alias for removeAllTriangles().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See removeAllTriangles() for further information.

void regina::NPacket::removeAllTags | ( |  | ) |

inherited

Removes all associated tags from this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

void regina::Dim2Triangulation::removeAllTriangles | ( |  | ) |

inline

Removes all triangles from the triangulation.

All triangles will be deallocated.

void regina::Dim2Triangulation::removeSimplex | ( | Dim2Triangle * | tri | ) |

inline

A dimension-agnostic alias for removeTriangle().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See removeTriangle() for further information.

void regina::Dim2Triangulation::removeSimplexAt | ( | unsigned long | index | ) |

inline

A dimension-agnostic alias for removeTriangleAt().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See removeTriangleAt() for further information.

bool regina::NPacket::removeTag | ( | const std::string & | tag | ) |

inherited

Removes the association of the given tag with this packet.

Each packet can have an arbitrary set of string tags associated with it. The tags are not used by this calculation engine; the feature is provided for whatever use a developer or user chooses to make of it.

Tags are case-sensitive. Tags associated with a single packet must be distinct, i.e., a particular tag cannot be associated more than once with the same packet.

Parameters

  tag | the tag to remove.

Returns
  `true` if the given tag was removed, or `false` if the given tag was not actually associated with this packet.

void regina::Dim2Triangulation::removeTriangle | ( | Dim2Triangle * | tri | ) |

inline

Removes the given triangle from the triangulation.

All triangles glued to this triangle will be unglued. The triangle will be deallocated.

Precondition
  The given triangle exists in the triangulation.

Parameters

  tri | the triangle to remove.

void regina::Dim2Triangulation::removeTriangleAt | ( | unsigned long | index | ) |

inline

Removes the triangle with the given index number from the triangulation.

Note that triangle indexing may change when a triangle is added or removed from the triangulation.

All triangles glued to this triangle will be unglued. The triangle will be deallocated.

Parameters

  index | specifies which triangle to remove; this should be between 0 and getNumberOfTriangles()-1 inclusive.

void regina::NPacket::reparent | ( | NPacket * | newParent,
|  | bool | first = `false`
| ) |  |

inherited

Cuts this packet away from its parent in the tree structure, and inserts it as a child of the given packet instead.

This routine is essentially a combination of makeOrphan() followed by either insertChildFirst() or insertChildLast().

This routine takes small constant time. It is safe to use regardless of whether this packet has a parent or not.

Precondition
  This packet does not depend on its parent; see dependsOnParent() for details.
  The given parent is not a descendant of this packet.

Python:
  This routine is much simpler than combinations of makeOrphan() and insertChildFirst() / insertChildLast(), since there are no unpleasant ownership issues to deal with. However, if this packet currently has no parent then the ownership issues are unavoidable; in this case reparent() will do nothing, and one of the insertChild...() routines must be used instead.

Parameters

  newParent | the new parent of this packet, i.e., the packet beneath which this packet will be inserted.
  first | `true` if this packet should be inserted as the first child of the given parent, or `false` (the default) if it should be inserted as the last child.

bool regina::NPacket::save | ( | const char * | filename,
|  | bool | compressed = `true`
| ) |  | const

inherited

Saves the subtree rooted at this packet to the given Regina data file, using Regina's native XML file format.

The XML file may be optionally compressed (Regina can happily read both compressed and uncompressed XML).

This is the preferred way of saving a Regina data file. Typically this will be called from the root of the packet tree, which will save the entire packet tree to file.

Precondition
  The given packet does not depend on its parent.

Internationalisation:
  This routine makes no assumptions about the character encoding used in the given file name, and simply passes it through unchanged to low-level C/C++ file I/O routines. The contents of the file will be written usign UTF-8.

Parameters

  filename | the pathname of the file to write to.
  compressed | `true` if the XML data should be compressed, or `false` if it should be written as plain text.

Returns
  `true` if and only if the file was successfully written.

void regina::NPacket::setPacketLabel | ( | const std::string & | newLabel | ) |

inherited

Sets the label associated with this individual packet.

Precondition
  No other packet in the overall tree structure has the same label.

Parameters

  newLabel | the new label to give this packet.

long regina::Dim2Triangulation::simplexIndex | ( | const Dim2Triangle * | tri | ) | const

inline

A dimension-agnostic alias for triangleIndex().

This is to assist with writing dimension-agnostic code that can be reused to work in different dimensions.

Here "simplex" refers to a top-dimensional simplex (which for 2-manifold triangulations means a triangle).

See triangleIndex() for further information.

void regina::NPacket::sortChildren | ( |  | ) |

inherited

Sorts the immediate children of this packet according to their packet labels.

Note that this routine is not recursive (for instance, grandchildren will not be sorted within each child packet).

This routine takes quadratic time in the number of immediate children (and it's slow quadratic at that).

std::string regina::ShareableObject::str | ( |  | ) | const

inherited

Returns the output from writeTextShort() as a string.

Python:
  This implements the `__str__()` function.

Returns
  a short text representation of this object.

void regina::Dim2Triangulation::swapContents | ( | Dim2Triangulation & | other | ) |

Swaps the contents of this and the given triangulation.

That is, all triangles that belong to this triangulation will be moved to other, and all triangles that belong to other will be moved to this triangulation.

All Dim2Triangle pointers or references will remain valid.

Parameters

  other | the triangulation whose contents should be swapped with this.

void regina::NPacket::swapWithNextSibling | ( |  | ) |

inherited

Swaps this packet with its next sibling in the sequence of children beneath their common parent packet.

Calling this routine is equivalent to calling moveDown().

This routine takes small constant time.

If this packet has no next sibling then this routine does nothing.

std::string regina::ShareableObject::toString | ( |  | ) | const

inline inherited

A deprecated alias for str(), which returns the output from writeTextShort() as a string.

Deprecated:
  This routine has (at long last) been deprecated; use the simpler-to-type str() instead.

Returns
  a short text representation of this object.

std::string regina::ShareableObject::toStringLong | ( |  | ) | const

inline inherited

A deprecated alias for detail(), which returns the output from writeTextLong() as a string.

Deprecated:
  This routine has (at long last) been deprecated; use the simpler-to-type detail() instead.

Returns
  a long text representation of this object.

long regina::Dim2Triangulation::triangleIndex | ( | const Dim2Triangle * | tri | ) | const

inline

Returns the index of the given triangle in the triangulation.

Note that triangle indexing may change when a triangle is added or removed from the triangulation.

Precondition
  The given triangle is contained in this triangulation.

Warning
  Passing a null pointer to this routine will probably crash your program. If you are passing the result of some other routine that might return null (such as Dim2Triangle::adjacentTriangle), it might be worth explicitly testing for null beforehand.

Parameters

  tri | specifies which triangle to find in the triangulation.

Returns
  the index of the specified triangle, where 0 is the first triangle, 1 is the second and so on.

bool regina::NPacket::unlisten | ( | NPacketListener * | listener | ) |

inherited

Unregisters the given packet listener so that it no longer listens for events on this packet.

See the NPacketListener class notes for details.

Python:
  Not present.

Parameters

  listener | the listener to unregister.

Returns
  `true` if the given listener was successfully unregistered, or `false` if the given listener was not registered in the first place.

long regina::Dim2Triangulation::vertexIndex | ( | const Dim2Vertex * | vertex | ) | const

inline

Returns the index of the given vertex in the triangulation.

Precondition
  The given vertex belongs to this triangulation.

Warning
  Passing a null pointer to this routine will probably crash your program.

Parameters

  vertex | specifies which vertex to find in the triangulation.

Returns
  the index of the specified vertex, where 0 is the first vertex, 1 is the second and so on.

virtual void regina::Dim2Triangulation::writeTextLong | ( | std::ostream & | out | ) | const

virtual

Writes this object in long text format to the given output stream.

The output should provide the user with all the information they could want. The output should be human-readable, should not contain extremely long lines (so users can read the output in a terminal), and should end with a final newline.

The default implementation of this routine merely calls writeTextShort() and adds a newline.

Python:
  The parameter out does not exist; standard output will be used.

Parameters

  out | the output stream to which to write.

Reimplemented from regina::ShareableObject.

void regina::Dim2Triangulation::writeTextShort | ( | std::ostream & | out | ) | const

inline virtual

Writes this object in short text format to the given output stream.

The output should be human-readable, should fit on a single line, and should not end with a newline.

Python:
  The parameter out does not exist; standard output will be used.

Parameters

  out | the output stream to which to write.

Implements regina::ShareableObject.

void regina::NPacket::writeXMLFile | ( | std::ostream & | out | ) | const

inherited

Writes the subtree rooted at this packet to the given output stream in Regina's native XML file format.

Ths is similar to calling save(), except that (i) the user has a more flexible choice of output stream, and (ii) the XML will always be written in plain text (i.e., it will not be compressed).

If you simply wish to save your data to a file on the filesystem, you should call save() instead.

Typically this will be called from the root of the packet tree, which will write the entire packet tree to the output stream.

The output from this routine cannot be used as a piece of an XML file; it must be the entire XML file. For a piece of an XML file, see routine writeXMLPacketTree() instead.

Precondition
  This packet does not depend upon its parent.

Python:
  Not present.

Parameters

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

virtual void regina::Dim2Triangulation::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::NPacket.

void regina::NPacket::writeXMLPacketTree | ( | std::ostream & | out | ) | const

protected inherited

Writes a chunk of XML containing the subtree with this packet as matriarch.

This is the preferred way of writing a packet tree to file.

The output from this routine is only a piece of XML; it should not be used as a complete XML file. For a complete XML file, see routine writeXMLFile() instead.

Parameters

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

The documentation for this class was generated from the following file:

- dim2/dim2triangulation.h

Copyright © 1999-2014, 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@debian.org).