Regina Calculation Engine
|
Represents a component of a 2-manifold triangulation. More...
#include <dim2/dim2component.h>
Public Member Functions | |
virtual | ~Dim2Component () |
Default destructor. More... | |
unsigned long | index () const |
Returns the index of this component in the underlying triangulation. 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... | |
Dim2Triangle * | getTriangle (unsigned long index) const |
Returns the requested triangle in this component. More... | |
Dim2Triangle * | getSimplex (unsigned long index) const |
A dimension-agnostic alias for getTriangle(). More... | |
Dim2Edge * | getEdge (unsigned long index) const |
Returns the requested edge in this component. More... | |
Dim2Vertex * | getVertex (unsigned long index) const |
Returns the requested vertex in this component. More... | |
Dim2BoundaryComponent * | getBoundaryComponent (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... | |
unsigned long | getNumberOfBoundaryEdges () const |
Returns the number of boundary edges in this component. 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... | |
Friends | |
class | Dim2Triangulation |
Allow access to private members. More... | |
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.
|
inlinevirtual |
Default destructor.
|
inherited |
Returns the output from writeTextLong() as a string.
|
inline |
Returns the requested boundary component in this component.
index | the 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. |
|
inline |
Returns the requested edge in this component.
index | the 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. |
|
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.
|
inline |
Returns the number of boundary components in this component.
|
inline |
Returns the number of boundary edges in this component.
|
inline |
Returns the number of edges in this component.
|
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 triangles in this component.
|
inline |
Returns the number of vertices in this component.
|
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 |
Returns the requested triangle in this component.
index | the 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. |
|
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.
|
inline |
Returns the requested vertex in this component.
index | the 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. |
|
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.
|
inline |
Returns the index of this component in the underlying triangulation.
This is identical to calling getTriangulation()->componentIndex(this)
.
|
inline |
Determines if this component is closed.
This is the case if and only if it has no boundary.
true
if and only if this component is closed.
|
inline |
Determines if this component is orientable.
true
if and only if this component is orientable.
|
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.
|
inherited |
Returns the output from writeTextShort() as a string.
__str__()
function.
|
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.
|
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.
|
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.
out | the output stream to which to write. |
Implements regina::ShareableObject.
|
friend |
Allow access to private members.