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

Represents a component of a 2-manifold triangulation. More...

#include <dim2/dim2component.h>

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

Public Member Functions

virtual ~Dim2Component ()
 Default destructor. More...
 
unsigned long getNumberOfTriangles () const
 Returns the number of triangles in this component. More...
 
unsigned long getNumberOfSimplices () const
 A dimension-agnostic alias for getNumberOfTriangles(). More...
 
unsigned long getNumberOfEdges () const
 Returns the number of edges in this component. More...
 
unsigned long getNumberOfVertices () const
 Returns the number of vertices in this component. More...
 
unsigned long getNumberOfBoundaryComponents () const
 Returns the number of boundary components in this component. More...
 
const std::vector
< Dim2Triangle * > & 
getTriangles () const
 Returns all triangular faces in the component. More...
 
const std::vector< Dim2Edge * > & getEdges () const
 Returns all edges in the component. More...
 
const std::vector< Dim2Vertex * > & getVertices () const
 Returns all vertices in the component. More...
 
Dim2TrianglegetTriangle (unsigned long index) const
 Returns the requested triangle in this component. More...
 
Dim2TrianglegetSimplex (unsigned long index) const
 A dimension-agnostic alias for getTriangle(). More...
 
Dim2EdgegetEdge (unsigned long index) const
 Returns the requested edge in this component. More...
 
Dim2VertexgetVertex (unsigned long index) const
 Returns the requested vertex in this component. More...
 
Dim2BoundaryComponentgetBoundaryComponent (unsigned long index) const
 Returns the requested boundary component in this component. More...
 
bool isOrientable () const
 Determines if this component is orientable. More...
 
bool isClosed () const
 Determines if this component is closed. 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...
 
- Public Member Functions inherited from regina::ShareableObject
 ShareableObject ()
 Default constructor that does nothing. More...
 
virtual ~ShareableObject ()
 Default destructor that does nothing. More...
 
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...
 
- Public Member Functions inherited from regina::NMarkedElement
long markedIndex () const
 Returns the index at which this object is stored in an NMarkedVector. More...
 

Friends

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

Additional Inherited Members

- Protected Member Functions inherited from regina::boost::noncopyable
 noncopyable ()
 A constructor which does nothing. More...
 
 ~noncopyable ()
 A destructor which does nothing. More...
 

Detailed Description

Represents a component of a 2-manifold triangulation.

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

Constructor & Destructor Documentation

regina::Dim2Component::~Dim2Component ( )
inlinevirtual

Default destructor.

Member Function Documentation

Dim2BoundaryComponent * regina::Dim2Component::getBoundaryComponent ( unsigned long  index) const
inline

Returns the requested boundary component in this component.

Parameters
indexthe index of the requested boundary component in this component. This should be between 0 and getNumberOfBoundaryComponents()-1 inclusive. Note that the index of a boundary component in the component need not be the index of the same boundary component in the entire triangulation.
Returns
the requested boundary component.
Dim2Edge * regina::Dim2Component::getEdge ( unsigned long  index) const
inline

Returns the requested edge in this component.

Parameters
indexthe index of the requested edge in the component. This should be between 0 and getNumberOfEdges()-1 inclusive. Note that the index of an edge in the component need not be the index of the same edge in the entire triangulation.
Returns
the requested edge.
const std::vector< Dim2Edge * > & regina::Dim2Component::getEdges ( ) const
inline

Returns all edges in the component.

The reference returned will remain valid for as long as this component object exists, always reflecting the edges currently in the component.

Python:
This routine returns a python list.
unsigned long regina::Dim2Component::getNumberOfBoundaryComponents ( ) const
inline

Returns the number of boundary components in this component.

Returns
the number of boundary components.
unsigned long regina::Dim2Component::getNumberOfEdges ( ) const
inline

Returns the number of edges in this component.

Returns
the number of edges.
unsigned long regina::Dim2Component::getNumberOfSimplices ( ) const
inline

A dimension-agnostic alias for getNumberOfTriangles().

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

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

See getNumberOfTriangles() for further information.

unsigned long regina::Dim2Component::getNumberOfTriangles ( ) const
inline

Returns the number of triangles in this component.

Returns
the number of triangles.
unsigned long regina::Dim2Component::getNumberOfVertices ( ) const
inline

Returns the number of vertices in this component.

Returns
the number of vertices.
Dim2Triangle * regina::Dim2Component::getSimplex ( unsigned long  index) const
inline

A dimension-agnostic alias for getTriangle().

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

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

See getTriangle() for further information.

Dim2Triangle * regina::Dim2Component::getTriangle ( unsigned long  index) const
inline

Returns the requested triangle in this component.

Parameters
indexthe index of the requested triangle in the component. This should be between 0 and getNumberOfTriangles()-1 inclusive. Note that the index of a triangle in the component need not be the index of the same triangle in the entire triangulation.
Returns
the requested triangle.
const std::vector< Dim2Triangle * > & regina::Dim2Component::getTriangles ( ) const
inline

Returns all triangular faces in the component.

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

Python:
This routine returns a python list.
Dim2Vertex * regina::Dim2Component::getVertex ( unsigned long  index) const
inline

Returns the requested vertex in this component.

Parameters
indexthe index of the requested vertex in the component. This should be between 0 and getNumberOfVertices()-1 inclusive. Note that the index of a vertex in the component need not be the index of the same vertex in the entire triangulation.
Returns
the requested vertex.
const std::vector< Dim2Vertex * > & regina::Dim2Component::getVertices ( ) const
inline

Returns all vertices in the component.

The reference returned will remain valid for as long as this component object exists, always reflecting the vertices currently in the component.

Python:
This routine returns a python list.
bool regina::Dim2Component::isClosed ( ) const
inline

Determines if this component is closed.

This is the case if and only if it has no boundary.

Returns
true if and only if this component is closed.
bool regina::Dim2Component::isOrientable ( ) const
inline

Determines if this component is orientable.

Returns
true if and only if this component is orientable.
void regina::Dim2Component::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::Dim2Component::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 Dim2Triangulation
friend

Allow access to private members.


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

Copyright © 1999-2013, 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).