Regina Calculation Engine
|
Stores the triangulation of a 2-manifold along with its various cellular structures and other information. More...
#include <dim2/dim2triangulation.h>
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 |
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.
typedef std::vector<Dim2BoundaryComponent*>::const_iterator regina::Dim2Triangulation::BoundaryComponentIterator |
Used to iterate through boundary components.
|
inherited |
A deprecated typedef for ChangeEventSpan.
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.
|
inline |
Default constructor.
Creates an empty triangulation.
|
inline |
Copy constructor.
Creates a new triangulation identical to the given triangulation. The packet tree structure and packet label are not copied.
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):
This list may grow in future versions of Regina.
Regina will also set the packet label accordingly.
If Regina cannot interpret the given string, this will be left as the empty triangulation.
description | a string that describes a 2-manifold triangulation. |
|
inlinevirtual |
Destroys this triangulation.
The constituent triangles, the cellular structure and all other properties will also be deallocated.
|
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.
tag | the tag to add. |
true
if the given tag was successfully added, or false
if the given tag was already present beforehand.
|
inline |
Returns the index of the given boundary component in the triangulation.
bc | specifies which boundary component to find in the triangulation. |
|
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.
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. |
|
protected |
Turns this triangulation into a clone of the given triangulation.
The tree structure and label of this triangulation are not touched.
from | the triangulation from which this triangulation will be cloned. |
|
inline |
Returns the index of the given component in the triangulation.
component | specifies which component to find in the triangulation. |
|
inlinevirtual |
Determines if this packet depends upon its parent.
This is true if the parent cannot be altered without invalidating or otherwise upsetting this packet.
true
if and only if this packet depends on its parent. Implements regina::NPacket.
|
inherited |
Returns the output from writeTextLong() as a string.
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 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.
|
inline |
Returns the index of the given edge in the triangulation.
edge | specifies which edge to find in the triangulation. |
|
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.
other | the triangulation to compare with this one. |
results | the list in which any isomorphisms found will be stored. |
|
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.
other | the triangulation in which to search for isomorphic copies of this triangulation. |
results | the list in which any isomorphisms found will be stored. |
|
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.
label | the label to search for. |
|
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.
label | the label to search for. |
|
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.
type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive. |
|
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.
type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive. |
|
staticinherited |
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.
sig | the isomorphism signature of the triangulation to construct. Note that, unlike dehydration strings for 3-manifold triangulations, case is important for isomorphism signatures. |
|
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.
index | the index of the desired boundary component, ranging from 0 to getNumberOfBoundaryComponents()-1 inclusive. |
|
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.
|
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.
index | the index of the desired component, ranging from 0 to getNumberOfComponents()-1 inclusive. |
|
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.
|
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.
index | the index of the desired edge, ranging from 0 to getNumberOfEdges()-1 inclusive. |
|
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.
|
inline |
Returns the Euler characteristic of this triangulation.
This will be evaluated as V-E+F.
|
inlineinherited |
Determines the first child of this packet in the tree structure.
This routine takes small constant time.
|
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().
|
inlineinherited |
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.
|
inlineinherited |
Determines the last child of this packet in the tree structure.
This routine takes small constant time.
|
inlineinherited |
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.
|
inline |
Returns the number of boundary components in this triangulation.
|
inline |
Returns the number of boundary edges in this triangulation.
|
inherited |
Returns the number of immediate children of this packet.
Grandchildren and so on are not counted.
|
inline |
Returns the number of components in this triangulation.
|
inlineinherited |
Returns the total number of descendants of this packet.
This includes children, grandchildren and so on. This packet is not included in the count.
|
inline |
Returns the number of edges in this triangulation.
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.
|
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.
|
inline |
Returns the number of triangular faces in the triangulation.
|
inline |
Returns the number of vertices in this triangulation.
|
inlineinherited |
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.
|
pure virtualinherited |
Returns the unique integer ID representing this type of packet.
This is the same for all packets of this class.
|
pure virtualinherited |
Returns an English name for this type of packet.
An example is NTriangulation
. This is the same for all packets of this class.
|
inlineinherited |
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.
|
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.
|
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.
|
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.
|
inlineinherited |
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.
|
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.
|
inherited |
Determines the matriarch (the root) of the tree to which this packet belongs.
|
inlineinherited |
Determines the parent packet in the tree structure.
This routine takes small constant time.
|
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.
index | specifies which triangle to return; this value should be between 0 and getNumberOfTriangles()-1 inclusive. |
index
th triangle in the triangulation.
|
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.
index | specifies which triangle to return; this value should be between 0 and getNumberOfTriangles()-1 inclusive. |
index
th triangle in the triangulation.
|
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.
|
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.
index | the index of the desired vertex, ranging from 0 to getNumberOfVertices()-1 inclusive. |
|
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.
|
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.
true
if and only if there are boundary edges.
|
inlineinherited |
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.
tag | the tag to search for. |
true
if the given tag is found, false
otherwise.
|
inlineinherited |
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.
true
if this packet has any tags, false
otherwise. 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.
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. |
|
inherited |
Inserts the given packet as the first child of this packet.
This routine takes small constant time.
child | the child to insert. |
|
inherited |
Inserts the given packet as the last child of this packet.
This routine takes small constant time.
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.
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.
source | the triangulation whose copy will be inserted. |
|
inlineprotectedvirtual |
Makes a newly allocated copy of this packet.
This routine should not insert the new packet into the tree structure, clone the packet's associated tags or give the packet a label. It should also not clone any descendants of this packet.
You may assume that the new packet will eventually be inserted into the tree beneath either the same parent as this packet or a clone of that parent.
parent | the parent beneath which the new packet will eventually be inserted. |
Implements regina::NPacket.
|
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.
|
inline |
Determines if this triangulation is closed.
This is the case if and only if it has no boundary components.
true
if and only if this triangulation is closed.
|
inline |
Determines if this triangulation is connected.
true
if and only if this triangulation is connected.
|
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().
other | the triangulation in which to search for an isomorphic copy of this triangulation. |
|
inherited |
Determines whether this triangulation is empty.
An empty triangulation is one with no simplices at all.
true
if and only if this triangulation is empty.
|
inherited |
Determines if this packet is equal to or an ancestor of the given packet in the tree structure.
descendant | the other packet whose relationships we are examining. |
true
if and only if this packet is equal to or an ancestor of descendant
.
|
inline |
Always returns false
.
This routine determines if this triangulation is ideal (has a non-trivial vertex link); however, every vertex link in a 2-manifold triangulation is either the interval or the circle, and so ideal triangulations cannot exist. Therefore this routine always returns false
.
This no-op routine is provided for consistency with higher dimensional triangulations, and to assist with writing dimension-agnostic code.
false
.
|
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.
other | the triangulation to compare with this one. |
true
if and only if the two triangulations are combinatorially identical.
|
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().
other | the triangulation to compare with this one. |
|
inlineinherited |
Determines whether the given packet listener is currently listening for events on this packet.
See the NPacketListener class notes for details.
listener | the listener to search for. |
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.
true
if and only if this is a minimal triangulation.
|
inline |
Determines if this triangulation is orientable.
true
if and only if this triangulation is orientable.
|
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.
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. |
|
staticinherited |
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.
sig | an isomorphism signature of a dim-dimensional triangulation. Note that, unlike dehydration strings for 3-manifold triangulations, case is important for isomorphism signatures. |
|
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.
true
if and only if this packet may be edited.
|
inline |
Always returns true
.
This routine determines if this triangulation is valid; however, there is nothing that can go wrong with vertex links in 2-manifold triangulations, and so this routine always returns true
.
This no-op routine is provided for consistency with higher dimensional triangulations, and to assist with writing dimension-agnostic code.
true
.
|
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.
descendant
, or can be obtained from descendant
using only child-to-parent steps.descendant | the packet whose relationship with this packet we are examining. |
|
inlineinherited |
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.
ancestor
, or can be obtained from ancestor
using only parent-to-child steps.ancestor | the packet whose relationship with this packet we are examining. |
|
inherited |
Registers the given packet listener to listen for events on this packet.
See the NPacketListener class notes for details.
listener | the listener to register. |
true
if the given listener was successfully registered, or false
if the given listener was already registered beforehand.
|
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).
true
if the triangulation was changed, or false
if the triangulation was in canonical form to begin with.
|
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.
|
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.
base | a string upon which the new label will be based. |
|
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.
reference | the packet tree with which to compare this tree. |
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.
dest | the triangulation to which triangles should be moved. |
|
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.
|
inherited |
Moves this packet to be the first in its sibling list.
This routine takes small constant time.
|
inherited |
Moves this packet to be the last in its sibling list.
This routine takes small constant time.
|
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.
|
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.
|
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.
|
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.
|
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.
desc | the description to assign to the new triangle. |
|
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.
|
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.
|
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().
type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive. |
|
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().
type | the type of packet to search for, as returned by getPacketTypeName(). Note that string comparisons are case sensitive. |
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.
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 ). |
true
always.
|
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.
|
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.
|
inline |
Removes all triangles from the triangulation.
All triangles will be deallocated.
|
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.
|
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.
|
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.
tag | the tag to remove. |
true
if the given tag was removed, or false
if the given tag was not actually associated with this packet.
|
inline |
Removes the given triangle from the triangulation.
All triangles glued to this triangle will be unglued. The triangle will be deallocated.
tri | the triangle to remove. |
|
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.
index | specifies which triangle to remove; this should be between 0 and getNumberOfTriangles()-1 inclusive. |
|
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.
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. |
|
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.
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. |
true
if and only if the file was successfully written.
|
inherited |
Sets the label associated with this individual packet.
newLabel | the new label to give this packet. |
|
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.
|
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).
|
inherited |
Returns the output from writeTextShort() as a string.
__str__()
function.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.
other | the triangulation whose contents should be swapped with this. |
|
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.
|
inlineinherited |
A deprecated alias for str(), which returns the output from writeTextShort() as a string.
|
inlineinherited |
A deprecated alias for detail(), which returns the output from writeTextLong() as a string.
|
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.
tri | specifies which triangle to find in the triangulation. |
|
inherited |
Unregisters the given packet listener so that it no longer listens for events on this packet.
See the NPacketListener class notes for details.
listener | the listener to unregister. |
true
if the given listener was successfully unregistered, or false
if the given listener was not registered in the first place.
|
inline |
Returns the index of the given vertex in the triangulation.
vertex | specifies which vertex to find in the triangulation. |
|
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.
out | the output stream to which to write. |
Reimplemented from regina::ShareableObject.
|
inlinevirtual |
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.
out | the output stream to which to write. |
Implements regina::ShareableObject.
|
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.
out | the output stream to which the XML data file should be written. |
|
protectedvirtual |
Writes a chunk of XML containing the data for this packet only.
You may assume that the packet opening tag (including the packet type and label) has already been written, and that all child packets followed by the corresponding packet closing tag will be written immediately after this routine is called. This routine need only write the internal data stored in this specific packet.
out | the output stream to which the XML should be written. |
Implements regina::NPacket.
|
protectedinherited |
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.
out | the output stream to which the XML should be written. |