#include <ntetrahedron.h>
Public Member Functions | |
NTetrahedron () | |
Creates a new tetrahedron with empty description and no faces joined to anything. | |
NTetrahedron (const std::string &desc) | |
Creates a new tetrahedron with the given description and no faces joined to anything. | |
virtual | ~NTetrahedron () |
Destroys this tetrahedron. | |
const std::string & | getDescription () const |
Returns the text description associated with this tetrahedron. | |
void | setDescription (const std::string &desc) |
Sets the text description associated with this tetrahedron. | |
NTetrahedron * | adjacentTetrahedron (int face) const |
Returns the adjacent tetrahedron glued to the given face of this tetrahedron, or 0 if the given face is on the triangulation boundary. | |
NTetrahedron * | getAdjacentTetrahedron (int face) const |
Deprecated in favour of adjacentTetrahedron(). | |
NPerm | adjacentGluing (int face) const |
Returns a permutation describing the correspondence between vertices of this tetrahedron and vertices of the adjacent tetrahedron glued to the given face of this tetrahedron. | |
NPerm | getAdjacentTetrahedronGluing (int face) const |
Deprecated in favour of adjacentGluing(). | |
int | adjacentFace (int face) const |
Examines the tetrahedron glued to the given face of this tetrahedron, and returns the corresponding face of that tetrahedron. | |
int | getAdjacentFace (int face) const |
Deprecated in favour of adjacentFace(). | |
bool | hasBoundary () const |
Determines if this tetrahedron has any faces that are boundary faces. | |
void | joinTo (int myFace, NTetrahedron *you, NPerm gluing) |
Joins the given face of this tetrahedron to another tetrahedron. | |
NTetrahedron * | unjoin (int myFace) |
Unglues the given face of this tetrahedron from whatever is joined to it. | |
void | isolate () |
Undoes any face gluings involving this tetrahedron. | |
NComponent * | getComponent () const |
Returns the triangulation component to which this tetrahedron belongs. | |
NVertex * | getVertex (int vertex) const |
Returns the vertex in the triangulation skeleton corresponding to the given vertex of this tetrahedron. | |
NEdge * | getEdge (int edge) const |
Returns the edge in the triangulation skeleton corresponding to the given edge of this tetrahedron. | |
NFace * | getFace (int face) const |
Returns the face in the triangulation skeleton corresponding to the given face of this tetrahedron. | |
NPerm | getEdgeMapping (int edge) const |
Examines the given edge of this tetrahedron, and returns a mapping from the "canonical" vertices of the corresponding edge of the triangulation to the matching vertices of this tetrahedron. | |
NPerm | getFaceMapping (int face) const |
Examines the given face of this tetrahedron, and returns a mapping from the "canonical" vertices of the corresponding face of the triangulation to the matching vertices of this tetrahedron. | |
int | orientation () const |
Returns the orientation of this tetrahedron in the triangulation. | |
void | writeTextShort (std::ostream &out) const |
Writes this object in short text format to the given output stream. | |
Friends | |
class | NTriangulation |
Allow access to private members. |
With each tetrahedron is stored various pieces of information regarding the overall skeletal structure and component structure of the triangulation. This information will be allocated, calculated and deallocated by the NTriangulation object containing the corresponding tetrahedra.
Whenever the gluings of tetrahedra are altered, the external routine responsible for changing the gluings (the routine that calls joinTo() and unjoin()) must call NTriangulation::gluingsHaveChanged() for the triangulation containing the tetrahedra concerned; this will ensure that skeletal information and other properties of the triangulation are recalculated when necessary.
regina::NTetrahedron::NTetrahedron | ( | ) |
Creates a new tetrahedron with empty description and no faces joined to anything.
regina::NTetrahedron::NTetrahedron | ( | const std::string & | desc | ) |
Creates a new tetrahedron with the given description and no faces joined to anything.
desc | the description to give the new tetrahedron. |
regina::NTetrahedron::~NTetrahedron | ( | ) | [inline, virtual] |
Destroys this tetrahedron.
int regina::NTetrahedron::adjacentFace | ( | int | face | ) | const [inline] |
Examines the tetrahedron glued to the given face of this tetrahedron, and returns the corresponding face of that tetrahedron.
That is, the returned face of the adjacent tetrahedron is glued to the given face of this tetrahedron.
face | the face of this tetrahedron whose gluing we will examine. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. |
NPerm regina::NTetrahedron::adjacentGluing | ( | int | face | ) | const [inline] |
Returns a permutation describing the correspondence between vertices of this tetrahedron and vertices of the adjacent tetrahedron glued to the given face of this tetrahedron.
If we call this permutation p
, then for each vertex v
of this tetrahedron, p[v]
will be the vertex of the adjacent tetrahedron that is identified with v
according to the gluing along the given face of this tetrahedron.
face | the face of this tetrahedron whose gluing we will examine. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. |
NTetrahedron * regina::NTetrahedron::adjacentTetrahedron | ( | int | face | ) | const [inline] |
Returns the adjacent tetrahedron glued to the given face of this tetrahedron, or 0 if the given face is on the triangulation boundary.
face | the face of this tetrahedron to examine. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. |
int regina::NTetrahedron::getAdjacentFace | ( | int | face | ) | const [inline] |
Deprecated in favour of adjacentFace().
The old routine getAdjacentFace() has been renamed to adjacentFace() as part of an effort to make programming and scripting with Regina a little less work on the fingers.
face | the face of this tetrahedron whose gluing we will examine. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. |
NTetrahedron * regina::NTetrahedron::getAdjacentTetrahedron | ( | int | face | ) | const [inline] |
Deprecated in favour of adjacentTetrahedron().
The old routine getAdjacentTetrahedron() has been renamed to adjacentTetrahedron() as part of an effort to make programming and scripting with Regina a little less work on the fingers.
face | the face of this tetrahedron to examine. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. |
NPerm regina::NTetrahedron::getAdjacentTetrahedronGluing | ( | int | face | ) | const [inline] |
Deprecated in favour of adjacentGluing().
The old routine getAdjacentTetrahedronGluing() has been renamed to adjacentGluing() as part of an effort to make programming and scripting with Regina a little less work on the fingers.
face | the face of this tetrahedron whose gluing we will examine. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. |
NComponent * regina::NTetrahedron::getComponent | ( | ) | const [inline] |
Returns the triangulation component to which this tetrahedron belongs.
const std::string & regina::NTetrahedron::getDescription | ( | ) | const [inline] |
Returns the text description associated with this tetrahedron.
NEdge * regina::NTetrahedron::getEdge | ( | int | edge | ) | const [inline] |
Returns the edge in the triangulation skeleton corresponding to the given edge of this tetrahedron.
edge | the edge of this tetrahedron to examine. This should be between 0 and 5 inclusive. |
NPerm regina::NTetrahedron::getEdgeMapping | ( | int | edge | ) | const [inline] |
Examines the given edge of this tetrahedron, and returns a mapping from the "canonical" vertices of the corresponding edge of the triangulation to the matching vertices of this tetrahedron.
In detail: Suppose several edges of several tetrahedra are identified within the overall triangulation. We call this a single "edge of the triangulation", and arbitrarily label its vertices (0,1). This routine then maps the vertices (0,1) of this edge of the triangulation to the individual vertices of this tetrahedron that make up the given edge.
Because we are passing the argument edge, we already know which vertices of this tetrahedron are involved. What this routine tells us is the order in which they appear to form the overall edge of the triangulation.
As a consequence: Consider some collection of tetrahedron edges that are identified together as a single edge of the triangulation, and choose some i from the set {0,1}. Then the vertices getEdgeMapping(...)[i]
of the individual tetrahedra are all identified together, since they all become the same vertex of the same edge of the triangulation (assuming of course that we pass the correct edge number in each case to getEdgeMapping()).
The images of 2 and 3 under the permutations that are returned have the following properties. In each tetrahedron, the images of 2 and 3 under this map form a directed edge of the tetrahedron (running from the image of vertex 2 to the image of vertex 3). For any given edge of the triangulation, these corresponding directed edges together form an ordered path within the triangulation that circles the common edge of the triangulation (like an edge link, except that it is not near to the edge and so might intersect itself). Furthermore, if we consider the individual tetrahedra in the order in which they appear in the list NEdge::getEmbeddings(), these corresponding directed edges appear in order from the start of this path to the finish (for internal edges this path is actually a cycle, and the starting point is arbitrary).
edge | the edge of this tetrahedron to examine. This should be between 0 and 5 inclusive. |
NFace * regina::NTetrahedron::getFace | ( | int | face | ) | const [inline] |
Returns the face in the triangulation skeleton corresponding to the given face of this tetrahedron.
face | the face of this tetrahedron to examine. This should be between 0 and 3 inclusive, where face i lies opposite vertex i . |
NPerm regina::NTetrahedron::getFaceMapping | ( | int | face | ) | const [inline] |
Examines the given face of this tetrahedron, and returns a mapping from the "canonical" vertices of the corresponding face of the triangulation to the matching vertices of this tetrahedron.
In detail: Suppose two faces of two tetrahedra are identified within the overall triangulation. We call this a single "face of the triangulation", and arbitrarily label its vertices (0,1,2). This routine then maps the vertices (0,1,2) of this face of the triangulation to the individual vertices of this tetrahedron that make up the given face.
Because we are passing the argument face, we already know which vertices of this tetrahedron are involved. What this routine tells us is the order in which they appear to form the overall face of the triangulation.
As a consequence: Consider some pair of tetrahedron faces that are identified together as a single face of the triangulation, and choose some i from the set {0,1,2}. Then the vertices getFaceMapping(...)[i]
of the individual tetrahedra are identified together, since they both become the same vertex of the same face of the triangulation (assuming of course that we pass the correct face number in each case to getFaceMapping()).
face | the face of this tetrahedron to examine. This should be between 0 and 3 inclusive. |
NVertex * regina::NTetrahedron::getVertex | ( | int | vertex | ) | const [inline] |
Returns the vertex in the triangulation skeleton corresponding to the given vertex of this tetrahedron.
vertex | the vertex of this tetrahedron to examine. This should be between 0 and 3 inclusive. |
bool regina::NTetrahedron::hasBoundary | ( | ) | const |
Determines if this tetrahedron has any faces that are boundary faces.
true
if and only if this tetrahedron has any boundary faces. void regina::NTetrahedron::isolate | ( | ) |
Undoes any face gluings involving this tetrahedron.
Any other tetrahedra involved will be automatically updated.
void regina::NTetrahedron::joinTo | ( | int | myFace, | |
NTetrahedron * | you, | |||
NPerm | gluing | |||
) |
Joins the given face of this tetrahedron to another tetrahedron.
The other tetrahedron involved will be automatically updated.
The face of the other tetrahedron that will be glued to the given face of this tetrahedron is not currently glued to anything.
If the other tetrahedron involved is this tetrahedron, we are not attempting to glue a face to itself.
myFace | the face of this tetrahedron that will be glued to the given other tetrahedron. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. | |
you | the tetrahedron (possibly this one) that will be glued to the given face of this tetrahedron. | |
gluing | a permutation describing the mapping of vertices by which the two tetrahedra will be joined. Each vertex v of this tetrahedron that lies on the given face will be identified with vertex gluing[v] of tetrahedron you . In addition, the face of you that will be glued to the given face of this tetrahedron will be face number gluing[myFace] . |
int regina::NTetrahedron::orientation | ( | ) | const [inline] |
Returns the orientation of this tetrahedron in the triangulation.
The orientation of each tetrahedron is always +1 or -1. In an orientable component of a triangulation, adjacent tetrahedra have the same orientations if one could be transposed onto the other without reflection, and they have opposite orientations if a reflection would be required. In a non-orientable component, orientations are still +1 and -1 but no further guarantees can be made.
void regina::NTetrahedron::setDescription | ( | const std::string & | desc | ) | [inline] |
Sets the text description associated with this tetrahedron.
Note that descriptions need not be unique, and may be empty.
desc | the new description to assign to this tetrahedron. |
NTetrahedron* regina::NTetrahedron::unjoin | ( | int | myFace | ) |
Unglues the given face of this tetrahedron from whatever is joined to it.
The other tetrahedron involved (possibly this one) will be automatically updated.
myFace | the face of this tetrahedron whose gluing we will undo. This should be between 0 and 3 inclusive, where face i is opposite vertex i of the tetrahedron. |
void regina::NTetrahedron::writeTextShort | ( | std::ostream & | out | ) | const [inline, virtual] |
Writes this object in short text format to the given output stream.
The output should fit on a single line and no newline should be written.
out | the output stream to which to write. |
Implements regina::ShareableObject.
friend class NTriangulation [friend] |
Allow access to private members.