Regina Calculation Engine
Public Member Functions | Static Public Attributes | Friends | List of all members
regina::NTriangle Class Reference

Represents a triangle in the skeleton of a triangulation. More...

#include <triangulation/ntriangle.h>

Inheritance diagram for regina::NTriangle:
regina::ShareableObject regina::NMarkedElement regina::boost::noncopyable

Public Member Functions

virtual ~NTriangle ()
 Default destructor. More...
 
unsigned long index () const
 Returns the index of this triangle in the underlying triangulation. More...
 
bool isBoundary () const
 Determines if this triangle lies entirely on the boundary of the triangulation. More...
 
int getType ()
 Returns a description of the triangle type. More...
 
int getSubtype ()
 Return the triangle vertex or triangle edge that plays a special role for the triangle type of this triangle. More...
 
bool isMobiusBand ()
 Determines whether this triangle is wrapped up to form a Mobius band. More...
 
bool isCone ()
 Determines whether this triangle is wrapped up to form a cone. More...
 
unsigned getNumberOfEmbeddings () const
 Returns the number of descriptors available through getEmbedding(). More...
 
const NTriangleEmbeddinggetEmbedding (unsigned index) const
 Returns the requested descriptor detailing how this triangle forms a part of a particular tetrahedron in the triangulation. More...
 
NTriangulationgetTriangulation () const
 Returns the triangulation to which this triangle belongs. More...
 
NComponentgetComponent () const
 Returns the component of the triangulation to which this triangle belongs. More...
 
NBoundaryComponentgetBoundaryComponent () const
 Returns the boundary component of the triangulation to which this triangle belongs. More...
 
NVertexgetVertex (int vertex) const
 Returns the vertex of the triangulation that corresponds to the given vertex of this triangle. More...
 
NEdgegetEdge (int edge) const
 Returns the edge of the triangulation that corresponds to the given edge of this triangle. More...
 
NPerm4 getEdgeMapping (int edge) const
 Examines the given edge of this triangle, and returns a mapping from the "canonical" vertices of the corresponding edge of the triangulation to the vertices of this triangle. More...
 
void writeTextShort (std::ostream &out) const
 Writes this object in short text format to the given output stream. More...
 
void writeTextLong (std::ostream &out) const
 Writes this object in long text format to the given output stream. More...
 
long markedIndex () const
 Returns the index at which this object is stored in an NMarkedVector. 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...
 

Static Public Attributes

static const int TRIANGLE
 Specifies a triangle with no identified vertices or edges. More...
 
static const int SCARF
 Specifies a triangle with two identified vertices. More...
 
static const int PARACHUTE
 Specifies a triangle with three identified vertices. More...
 
static const int CONE
 Specifies a triangle with two edges identified to form a cone. More...
 
static const int MOBIUS
 Specifies a triangle with two edges identified to form a mobius band. More...
 
static const int HORN
 Specifies a triangle with two edges identified to form a cone with all three vertices identified. More...
 
static const int DUNCEHAT
 Specifies a triangle with all three edges identified, some via orientable and some via non-orientable gluings. More...
 
static const int L31
 Specifies a triangle with all three edges identified using non-orientable gluings. More...
 
static const NPerm4 ordering [4]
 An array that maps triangle numbers within a tetrahedron (i.e., face numbers) to the canonical ordering of the individual tetrahedron vertices that form each triangle. More...
 

Friends

class NTriangulation
 Allow access to private members. More...
 

Detailed Description

Represents a triangle in the skeleton of a triangulation.

Triangles are highly temporary; once a triangulation changes, all its triangle objects will be deleted and new ones will be created.

Constructor & Destructor Documentation

regina::NTriangle::~NTriangle ( )
inlinevirtual

Default destructor.

All embedding descriptors stored in this triangle will be automatically deleted.

Member Function Documentation

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

Returns the output from writeTextLong() as a string.

Returns
a long text representation of this object.
NBoundaryComponent * regina::NTriangle::getBoundaryComponent ( ) const
inline

Returns the boundary component of the triangulation to which this triangle belongs.

Returns
the boundary component containing this triangle, or 0 if this triangle does not lie entirely within the boundary of the triangulation.
NComponent * regina::NTriangle::getComponent ( ) const
inline

Returns the component of the triangulation to which this triangle belongs.

Returns
the component containing this triangle.
NEdge* regina::NTriangle::getEdge ( int  edge) const

Returns the edge of the triangulation that corresponds to the given edge of this triangle.

Note that edge i of a triangle is opposite vertex i of the triangle.

Parameters
edgethe edge of this triangle to examine. This should be 0, 1 or 2.
Returns
the corresponding edge of the triangulation.
NPerm4 regina::NTriangle::getEdgeMapping ( int  edge) const

Examines the given edge of this triangle, and returns a mapping from the "canonical" vertices of the corresponding edge of the triangulation to the vertices of this triangle.

This routine behaves much the same as NTetrahedron::getEdgeMapping(), except that it maps the edge vertices into a triangle, not into a tetrahedron. See NTetrahedron::getEdgeMapping() for a more detailed explanation of precisely what this mapping means.

This routine differs from NTetrahedron::getEdgeMapping() in how it handles the images of 2 and 3. This routine will always map 2 to the remaining vertex of this triangle (which is equal to the argument edge), and will always map 3 to itself.

Parameters
edgethe edge of this triangle to examine. This should be 0, 1 or 2.
Returns
a mapping from vertices (0,1) of the requested edge to the vertices of this triangle.
const NTriangleEmbedding & regina::NTriangle::getEmbedding ( unsigned  index) const
inline

Returns the requested descriptor detailing how this triangle forms a part of a particular tetrahedron in the triangulation.

Note that if this triangle represents multiple faces of a particular tetrahedron, then there will be multiple embedding descriptors available regarding that tetrahedron.

Parameters
indexthe index of the requested descriptor. This should be between 0 and getNumberOfEmbeddings()-1 inclusive.
Returns
the requested embedding descriptor.
unsigned regina::NTriangle::getNumberOfEmbeddings ( ) const
inline

Returns the number of descriptors available through getEmbedding().

Note that this number will never be greater than two.

Returns
the number of embedding descriptors.
int regina::NTriangle::getSubtype ( )
inline

Return the triangle vertex or triangle edge that plays a special role for the triangle type of this triangle.

Note that this routine is only relevant for some triangle types. The triangle type is returned by getType().

Returns
The vertex or edge that plays a special role (this will be 0, 1 or 2), or -1 if this triangle type has no special vertex or edge.
NTriangulation * regina::NTriangle::getTriangulation ( ) const
inline

Returns the triangulation to which this triangle belongs.

Returns
the triangulation containing this triangle.
int regina::NTriangle::getType ( )

Returns a description of the triangle type.

The triangle type describes how the edges and vertices of the triangle are identified.

Returns
one of the predefined triangle type constants in NTriangle.
NVertex * regina::NTriangle::getVertex ( int  vertex) const
inline

Returns the vertex of the triangulation that corresponds to the given vertex of this triangle.

Note that vertex i of a triangle is opposite edge i of the triangle.

Parameters
vertexthe vertex of this triangle to examine. This should be 0, 1 or 2.
Returns
the corresponding vertex of the triangulation.
unsigned long regina::NTriangle::index ( ) const
inline

Returns the index of this triangle in the underlying triangulation.

This is identical to calling getTriangulation()->triangleIndex(this).

Returns
the index of this triangle.
bool regina::NTriangle::isBoundary ( ) const
inline

Determines if this triangle lies entirely on the boundary of the triangulation.

Returns
true if and only if this triangle lies on the boundary.
bool regina::NTriangle::isCone ( )
inline

Determines whether this triangle is wrapped up to form a cone.

Note that several different triangle types (as returned by getType()) can produce this result. Note also that a triangle can be both a Mobius band and a cone.

Returns
true if and only if this triangle is a cone.
bool regina::NTriangle::isMobiusBand ( )
inline

Determines whether this triangle is wrapped up to form a Mobius band.

Note that several different triangle types (as returned by getType()) can produce this result. Note also that a triangle can be both a Mobius band and a cone.

Returns
true if and only if this triangle is a Mobius band.
long regina::NMarkedElement::markedIndex ( ) const
inlineinherited

Returns the index at which this object is stored in an NMarkedVector.

If this object does not belong to an NMarkedVector, the return value is undefined.

Returns
the index at which this object is stored.
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.
std::string regina::ShareableObject::toString ( ) const
inlineinherited

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
inlineinherited

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.
void regina::NTriangle::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
outthe output stream to which to write.

Reimplemented from regina::ShareableObject.

void regina::NTriangle::writeTextShort ( std::ostream &  out) const
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.

Python:
The parameter out does not exist; standard output will be used.
Parameters
outthe output stream to which to write.

Implements regina::ShareableObject.

Friends And Related Function Documentation

friend class NTriangulation
friend

Allow access to private members.

Member Data Documentation

const int regina::NTriangle::CONE
static

Specifies a triangle with two edges identified to form a cone.

const int regina::NTriangle::DUNCEHAT
static

Specifies a triangle with all three edges identified, some via orientable and some via non-orientable gluings.

const int regina::NTriangle::HORN
static

Specifies a triangle with two edges identified to form a cone with all three vertices identified.

const int regina::NTriangle::L31
static

Specifies a triangle with all three edges identified using non-orientable gluings.

Note that this forms a spine for the Lens space L(3,1).

const int regina::NTriangle::MOBIUS
static

Specifies a triangle with two edges identified to form a mobius band.

const NPerm4 regina::NTriangle::ordering[4]
static

An array that maps triangle numbers within a tetrahedron (i.e., face numbers) to the canonical ordering of the individual tetrahedron vertices that form each triangle.

This means that the vertices of triangle i in a tetrahedron are, in canonical order, ordering[i][0..2]. As an immediate consequence, we obtain ordering[i][3] == i.

Regina defines canonical order to be increasing order. That is, ordering[i][0] < ... < ordering[i][2].

This table does not describe the mapping from specific triangles within a triangulation into individual tetrahedra (for that, see NTetrahedron::getTriangleMapping() instead). This table merely provides a neat and consistent way of listing the vertices of any given tetrahedron face.

This lookup table replaces the deprecated routine regina::faceOrdering().

const int regina::NTriangle::PARACHUTE
static

Specifies a triangle with three identified vertices.

const int regina::NTriangle::SCARF
static

Specifies a triangle with two identified vertices.

const int regina::NTriangle::TRIANGLE
static

Specifies a triangle with no identified vertices or edges.


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

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).