BTK  0.3dev.0
Open-source library to visualize/process biomechanical data
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions
btk::TriangleMesh Class Reference

Read-only class representing a triangle mesh based on markers's IDs and links between them. More...

#include <btkTriangleMesh.h>

Inheritance diagram for btk::TriangleMesh:
Inheritance graph
[legend]

Classes

class  Edge
 Read-only class used to represent an edge as a set of two vertices. More...
 
class  Face
 Read-only class used to represent a face as a set of three vertices. More...
 
class  Vertex
 Read-only class used to bridge the content of a Point into a vertex. More...
 
class  VertexFace
 Store three marker's IDs to create a face. More...
 
class  VertexLink
 Store two marker's IDs to create a link between them (Only to create mesh's edge). More...
 

Public Types

typedef btkSharedPtr< const
TriangleMesh
ConstPointer
 
typedef std::vector< Edge >
::const_iterator 
EdgeConstIterator
 
typedef std::vector< Edge >
::iterator 
EdgeIterator
 
typedef std::vector< Face >
::const_iterator 
FaceConstIterator
 
typedef std::vector< Face >
::iterator 
FaceIterator
 
typedef btkNullPtr< TriangleMeshNullPointer
 
typedef btkSharedPtr
< TriangleMesh
Pointer
 
typedef std::vector< Vertex >
::const_iterator 
VertexConstIterator
 
typedef std::vector< Vertex >
::iterator 
VertexIterator
 
- Public Types inherited from btk::DataObject
typedef btkSharedPtr< const
DataObject
ConstPointer
 
typedef btkNullPtr< DataObjectNullPointer
 
typedef btkSharedPtr< DataObjectPointer
 
- Public Types inherited from btk::Object
typedef btkSharedPtr< const
Object
ConstPointer
 
typedef btkSharedPtr< ObjectPointer
 

Public Member Functions

EdgeIterator BeginEdge ()
 
EdgeConstIterator BeginEdge () const
 
FaceIterator BeginFace ()
 
FaceConstIterator BeginFace () const
 
VertexIterator BeginVertex ()
 
VertexConstIterator BeginVertex () const
 
bool ConnectPoints (PointCollection::Pointer points)
 
EdgeIterator EndEdge ()
 
EdgeConstIterator EndEdge () const
 
FaceIterator EndFace ()
 
FaceConstIterator EndFace () const
 
VertexIterator EndVertex ()
 
VertexConstIterator EndVertex () const
 
int GetCurrentFrameIndex () const
 
int GetEdgeNumber () const
 
int GetFaceNumber () const
 
int GetMaxVertexId () const
 
int GetVertexNumber () const
 
void SetCurrentFrameIndex (int frame)
 
void SetDefinition (const std::vector< int > &m, const std::vector< VertexLink > &l)
 
void SetDefinition (const std::vector< int > &m, const std::vector< VertexLink > &l, const std::vector< VertexFace > &f)
 
- Public Member Functions inherited from btk::DataObject
DataObjectGetParent () const
 
bool HasParent () const
 
void Modified ()
 
void SetParent (DataObject *parent)
 
void Update ()
 
- Public Member Functions inherited from btk::Object
unsigned long int GetTimestamp () const
 

Static Public Member Functions

static Pointer New (const std::vector< int > &m, const std::vector< VertexLink > &l)
 
static Pointer New (const std::vector< int > &m, const std::vector< VertexLink > &l, const std::vector< VertexFace > &f)
 
static NullPointer Null ()
 
- Static Public Member Functions inherited from btk::DataObject
static NullPointer Null ()
 

Protected Member Functions

 TriangleMesh (const std::vector< int > &m, const std::vector< VertexLink > &l)
 
 TriangleMesh (const std::vector< int > &m, const std::vector< VertexLink > &l, const std::vector< VertexFace > &f)
 
- Protected Member Functions inherited from btk::DataObject
 DataObject ()
 
 DataObject (const DataObject &toCopy)
 
virtual ~DataObject ()
 
- Protected Member Functions inherited from btk::Object
 Object ()
 
 Object (const Object &toCopy)
 
virtual ~Object ()
 

Additional Inherited Members

- Protected Attributes inherited from btk::Object
unsigned long int m_Timestamp
 

Detailed Description

Read-only class representing a triangle mesh based on markers's IDs and links between them.

Member Typedef Documentation

Smart pointer associated with a const TriangleMesh object.

Const Iterator related to the list of edges stored in the mesh.

Iterator related to the list of edges stored in the mesh.

Const Iterator related to the list of faces stored in the mesh.

Iterator related to the list of faces stored in the mesh.

Special null pointer associated with a TriangleMesh object. This type should be used only internally to test the nullity of a smart pointer. See the static method Null() instead.

Smart pointer associated with a TriangleMesh object.

Const Iterator related to the list of vertices stored in the mesh.

Iterator related to the list of vertices stored in the mesh.

Constructor & Destructor Documentation

btk::TriangleMesh::TriangleMesh ( const std::vector< int > &  m,
const std::vector< VertexLink > &  l 
)
protected

Constructor. Build the vertices, edges and faces, from the set of IDs m and the set of links l. If one of the given link contains a wrong ID (out of range), then, it is not added to the list of edges.

Warning
This method can create non-manifold mesh!
btk::TriangleMesh::TriangleMesh ( const std::vector< int > &  m,
const std::vector< VertexLink > &  l,
const std::vector< VertexFace > &  f 
)
protected

Constructor. Build the vertices, edges and faces, from the set of IDs m, the set of links l and the set of faces f. If one of the given link or face contains a wrong ID (out of range), then, it is not added.

Member Function Documentation

TriangleMesh::EdgeIterator btk::TriangleMesh::BeginEdge ( )
inline

Returns an iterator to the beginning of the list of edges.

TriangleMesh::EdgeConstIterator btk::TriangleMesh::BeginEdge ( ) const
inline

Returns a const iterator to the beginning of the list of edges.

TriangleMesh::FaceIterator btk::TriangleMesh::BeginFace ( )
inline

Returns an iterator to the beginning of the list of faces.

TriangleMesh::FaceConstIterator btk::TriangleMesh::BeginFace ( ) const
inline

Returns a const iterator to the beginning of the list of faces.

TriangleMesh::VertexIterator btk::TriangleMesh::BeginVertex ( )
inline

Returns an iterator to the beginning of the list of vertices.

TriangleMesh::VertexConstIterator btk::TriangleMesh::BeginVertex ( ) const
inline

Returns a const iterator to the beginning of the list of vertices.

bool btk::TriangleMesh::ConnectPoints ( PointCollection::Pointer  points)

Connect the given points to the mesh by finding the corresponding IDs. Returns true if all the vertices are connected. If one of the point are not found (vertex ID not recognised), then the connections are reseted and the method return false.

TriangleMesh::EdgeIterator btk::TriangleMesh::EndEdge ( )
inline

Returns an iterator just past the last edge.

TriangleMesh::EdgeConstIterator btk::TriangleMesh::EndEdge ( ) const
inline

Returns a const iterator just past the last edge.

TriangleMesh::FaceIterator btk::TriangleMesh::EndFace ( )
inline

Returns an iterator just past the last face.

TriangleMesh::FaceConstIterator btk::TriangleMesh::EndFace ( ) const
inline

Returns a const iterator just past the last face.

TriangleMesh::VertexIterator btk::TriangleMesh::EndVertex ( )
inline

Returns an iterator just past the last vertex.

TriangleMesh::VertexConstIterator btk::TriangleMesh::EndVertex ( ) const
inline

Returns a const iterator just past the last vertex.

int btk::TriangleMesh::GetCurrentFrameIndex ( ) const
inline

Returns the index of the current frame used by the vertices to get their coordinates. The index starts from 0.

int btk::TriangleMesh::GetEdgeNumber ( ) const
inline

Returns the number of edges.

int btk::TriangleMesh::GetFaceNumber ( ) const
inline

Returns the number of faces.

int btk::TriangleMesh::GetMaxVertexId ( ) const

Return the greatest ID for the vertices stored in the mesh.

int btk::TriangleMesh::GetVertexNumber ( ) const
inline

Returns the number of vertives.

Pointer btk::TriangleMesh::New ( const std::vector< int > &  m,
const std::vector< VertexLink > &  l 
)
inlinestatic

Creates a smart pointer to a TriangleMesh object.

Pointer btk::TriangleMesh::New ( const std::vector< int > &  m,
const std::vector< VertexLink > &  l,
const std::vector< VertexFace > &  f 
)
inlinestatic

Creates a smart pointer to a TriangleMesh object.

static NullPointer btk::TriangleMesh::Null ( )
inlinestatic

Static function to return a null pointer.

Note
This static method should be used only to test if a shared ponter is null or not. It is advised to call the method without parenthesis as special (in)equality operator are implemented to use a function pointer. See the description of the class NullPtr for an example.
void btk::TriangleMesh::SetCurrentFrameIndex ( int  frame)
inline

Sets the index of the current frame used by the vertices to get their coordinates. The index for the first frame is 0.

void btk::TriangleMesh::SetDefinition ( const std::vector< int > &  m,
const std::vector< VertexLink > &  l 
)

Set the mesh based only on the given marker's id m and the links between them l. If one of the given link contains a wrong ID (out of range), then, it is not added to the list of edges.

Warning
This method can create non-manifold mesh!
void btk::TriangleMesh::SetDefinition ( const std::vector< int > &  m,
const std::vector< VertexLink > &  l,
const std::vector< VertexFace > &  f 
)

Set the mesh based on the given marker's id m, the links between them (l) and the faces defined as a set of three markers. (f). If one of the given link/face contains a wrong ID (out of range), then, it is not added to the list of edges/faces.