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

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

#include <triangulation/nvertex.h>

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

Public Member Functions

virtual ~NVertex ()
 Default destructor. More...
 
unsigned long index () const
 Returns the index of this vertex in the underlying triangulation. More...
 
const std::vector
< NVertexEmbedding > & 
getEmbeddings () const
 Returns the list of descriptors detailing how this vertex forms a part of various tetrahedra in the triangulation. More...
 
unsigned long getNumberOfEmbeddings () const
 Returns the number of descriptors in the list returned by getEmbeddings(). More...
 
const NVertexEmbeddinggetEmbedding (unsigned long index) const
 Returns the requested descriptor from the list returned by getEmbeddings(). More...
 
NTriangulationgetTriangulation () const
 Returns the triangulation to which this vertex belongs. More...
 
NComponentgetComponent () const
 Returns the component of the triangulation to which this vertex belongs. More...
 
NBoundaryComponentgetBoundaryComponent () const
 Returns the boundary component of the triangulation to which this vertex belongs. More...
 
unsigned long getDegree () const
 Returns the degree of this vertex. More...
 
int getLink () const
 Returns a description of the link of the vertex. More...
 
const Dim2TriangulationbuildLink () const
 Returns a full 2-manifold triangulation describing the link of this vertex. More...
 
Dim2TriangulationbuildLinkDetail (bool labels=true, NIsomorphism **inclusion=0) const
 Returns a full 2-manifold triangulation describing the link of this vertex. More...
 
bool isLinkClosed () const
 Determines if the link of this vertex is closed. More...
 
bool isIdeal () const
 Determines if this vertex is an ideal vertex. More...
 
bool isBoundary () const
 Determines if this vertex lies on the boundary of the triangulation. More...
 
bool isStandard () const
 Determines if this vertex is standard. More...
 
bool isLinkOrientable () const
 Determines if the vertex link is orientable. More...
 
long getLinkEulerChar () const
 Returns the Euler characteristic of the vertex link. More...
 
long getLinkEulerCharacteristic () const
 A deprecated alias for getLinkEulerChar(). 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 SPHERE
 Specifies a vertex link that is a sphere. More...
 
static const int DISC
 Specifies a vertex link that is a disc. More...
 
static const int TORUS
 Specifies a vertex link that is a torus. More...
 
static const int KLEIN_BOTTLE
 Specifies a vertex link that is a Klein bottle. More...
 
static const int NON_STANDARD_CUSP
 Specifies a vertex link that is closed and is not a sphere, torus or Klein bottle. More...
 
static const int NON_STANDARD_BDRY
 Specifies a vertex link that has boundary and is not a disc. More...
 

Friends

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

Detailed Description

Represents a vertex in the skeleton of a triangulation.

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

Constructor & Destructor Documentation

virtual regina::NVertex::~NVertex ( )
virtual

Default destructor.

Member Function Documentation

const Dim2Triangulation * regina::NVertex::buildLink ( ) const
inline

Returns a full 2-manifold triangulation describing the link of this vertex.

This routine is fast (it uses a pre-computed triangulation if possible). The downside is that the triangulation is read-only, and does not contain any information on how the triangles in the link correspond to tetrahedra in the original triangulation (though this is easily deduced; see below). If you want a writable triangulation, or one with this extra information, then call buildLinkDetail() instead.

The triangulation of the vertex link is built as follows. Let i lie between 0 and getDegree()-1 inclusive, let tet represent getEmbedding(i).getTetrahedron(), and let v represent getEmbedding(i).getVertex(). Then buildLink()->getTriangle(i) is the triangle in the vertex link that "slices off" vertex v from tetrahedron tet. In other words, buildLink()->getTriangle(i) in the vertex link is parallel to triangle tet->getTriangle(v) in the surrounding 3-manifold triangulation.

The vertices of each triangle in the vertex link are numbered as follows. Following the discussion above, suppose that buildLink()->getTriangle(i) sits within tet and is parallel to tet->getTriangle(v). Then vertices 0,1,2 of the triangle in the link will be parallel to vertices 0,1,2 of the corresponding NTriangle. The permutation tet->getTriangleMapping(v) will map vertices 0,1,2 of the triangle in the link to the corresponding vertices of tet (those opposite v), and will map 3 to v itself.

This NVertex object will retain ownership of the triangulation that is returned. If you wish to edit the triangulation, you should make a new clone and edit the clone instead.

Returns
the read-only triangulated link of the vertex.
Dim2Triangulation* regina::NVertex::buildLinkDetail ( bool  labels = true,
NIsomorphism **  inclusion = 0 
) const

Returns a full 2-manifold triangulation describing the link of this vertex.

This routine is heavyweight (it computes a new triangulation each time). The benefit is that the triangulation is writeable, and optionally contain detailed information on how the triangles in the link correspond to tetrahedra in the original triangulation. If you do not need this extra information, consider using the faster buildLink() instead.

See the buildLink() documentation for an explanation of exactly how the triangulation will be constructed.

If labels is passed as true, each triangle of the new vertex link will be given a text description of the form t (v), where t is the index of the tetrahedron the triangle is from, and v is the vertex of that tetrahedron that this triangle links.

If inclusion is non-null (i.e., it points to some NIsomorphism pointer p), then it will be modified to point to a new NIsomorphism that describes in detail how the individual triangles of the link sit within tetrahedra of the original triangulation. Specifically, after this routine is called, p->tetImage(i) will indicate which tetrahedron tet of the 3-manifold triangulation contains the ith triangle of the link. Moreover, p->facePerm(i) will indicate exactly where the ith triangle sits within tet: it will send 3 to the vertex of t that the triangle links, and it will send 0,1,2 to the vertices of tet that are parallel to vertices 0,1,2 of this triangle.

The triangulation that is returned, as well as the isomorphism if one was requested, will be newly allocated. The caller of this routine is responsible for destroying these objects.

Strictly speaking, this is an abuse of the NIsomorphism class (the domain is a triangulation of the wrong dimension, and the map is not 1-to-1 into the range tetrahedra). We use it anyway, but you should not attempt to call any high-level routines (such as NIsomorphism::apply).

Python:
The second (isomorphism) argument is not present. Instead this routine returns a pair (triangulation, isomorphism). As a side-effect, the isomorphism will always be constructed (i.e., it is not optional).
Returns
a newly constructed triangulation of the link of this vertex.
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::NVertex::getBoundaryComponent ( ) const
inline

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

See the note in the NBoundaryComponent overview regarding what happens if the vertex link is a multiply punctured surface. Note that this makes the vertex non-standard and the triangulation invalid.

An ideal vertex will have its own individual boundary component to which it belongs.

Returns
the boundary component containing this vertex, or 0 if this vertex is not on the boundary of the triangulation as determined by isBoundary().
NComponent * regina::NVertex::getComponent ( ) const
inline

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

Returns
the component containing this vertex.
unsigned long regina::NVertex::getDegree ( ) const
inline

Returns the degree of this vertex.

Note that this is identical to getNumberOfEmbeddings().

Returns
the degree of this vertex.
const NVertexEmbedding & regina::NVertex::getEmbedding ( unsigned long  index) const
inline

Returns the requested descriptor from the list returned by getEmbeddings().

Parameters
indexthe index of the requested descriptor. This should be between 0 and getNumberOfEmbeddings()-1 inclusive.
Returns
the requested embedding descriptor.
const std::vector< NVertexEmbedding > & regina::NVertex::getEmbeddings ( ) const
inline

Returns the list of descriptors detailing how this vertex forms a part of various tetrahedra in the triangulation.

Note that if this vertex represents multiple vertices of a particular tetrahedron, then there will be multiple embedding descriptors in the list regarding that tetrahedron.

Python:
This routine returns a python list.
Returns
the list of embedding descriptors.
See also
NVertexEmbedding
int regina::NVertex::getLink ( ) const
inline

Returns a description of the link of the vertex.

This routine does not require a full triangulation of the vertex link, and so can be much faster than analysing the result of buildLink().

Returns
one of the predefined link constants in NVertex.
long regina::NVertex::getLinkEulerChar ( ) const
inline

Returns the Euler characteristic of the vertex link.

This routine does not require a full triangulation of the vertex link, and so can be much faster than calling buildLink().getEulerChar().

Returns
the Euler characteristic of the vertex link.
long regina::NVertex::getLinkEulerCharacteristic ( ) const
inline

A deprecated alias for getLinkEulerChar().

Returns the Euler characteristic of the vertex link.

This routine does not require a full triangulation of the vertex link, and so can be much faster than calling buildLink().getEulerChar().

Deprecated:
This routine will be removed in a future version of Regina. Please use the identical routine getLinkEulerChar() instead.
Returns
the Euler characteristic of the vertex link.
unsigned long regina::NVertex::getNumberOfEmbeddings ( ) const
inline

Returns the number of descriptors in the list returned by getEmbeddings().

Note that this is identical to getDegree().

Returns
the number of embedding descriptors.
NTriangulation * regina::NVertex::getTriangulation ( ) const
inline

Returns the triangulation to which this vertex belongs.

Returns
the triangulation containing this vertex.
unsigned long regina::NVertex::index ( ) const
inline

Returns the index of this vertex in the underlying triangulation.

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

Returns
the index of this vertex.
bool regina::NVertex::isBoundary ( ) const
inline

Determines if this vertex lies on the boundary of the triangulation.

Ideal vertices are included as being on the boundary. In fact, the only vertices not considered as on the boundary are those whose links are spheres.

Returns
true if and only if this vertex lies on the boundary.
See also
isIdeal()
bool regina::NVertex::isIdeal ( ) const
inline

Determines if this vertex is an ideal vertex.

This requires the vertex link to be closed and not a 2-sphere.

Returns
true if and only if this is an ideal vertex.
bool regina::NVertex::isLinkClosed ( ) const
inline

Determines if the link of this vertex is closed.

Returns
true if and only if the link of this vertex is closed.
bool regina::NVertex::isLinkOrientable ( ) const
inline

Determines if the vertex link is orientable.

This routine does not require a full triangulation of the vertex link, and so can be much faster than calling buildLink().isOrientable().

Returns
true if and only if the vertex link is orientable.
bool regina::NVertex::isStandard ( ) const
inline

Determines if this vertex is standard.

This requires the vertex link to be a sphere, disc, torus or Klein bottle.

Returns
true if and only if this vertex is standard.
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::NVertex::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::NVertex::writeTextShort ( std::ostream &  out) const
virtual

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

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

Python:
The parameter out does not exist; standard output will be used.
Parameters
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::NVertex::DISC
static

Specifies a vertex link that is a disc.

const int regina::NVertex::KLEIN_BOTTLE
static

Specifies a vertex link that is a Klein bottle.

const int regina::NVertex::NON_STANDARD_BDRY
static

Specifies a vertex link that has boundary and is not a disc.

const int regina::NVertex::NON_STANDARD_CUSP
static

Specifies a vertex link that is closed and is not a sphere, torus or Klein bottle.

const int regina::NVertex::SPHERE
static

Specifies a vertex link that is a sphere.

const int regina::NVertex::TORUS
static

Specifies a vertex link that is a torus.


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