Biorbd
Public Member Functions | Protected Attributes | List of all members
biorbd::rigidbody::Mesh Class Reference

A class that holds the geometry of a segment. More...

#include <Mesh.h>

Public Member Functions

 Mesh ()
 Construct mesh.
 
 Mesh (const std::vector< biorbd::utils::Vector3d > &other)
 Construct mesh from another mesh. More...
 
 Mesh (const std::vector< biorbd::utils::Vector3d > &vertex, const std::vector< biorbd::rigidbody::MeshFace > &faces)
 Construct mesh. More...
 
biorbd::rigidbody::Mesh DeepCopy () const
 Deep copy of the mesh. More...
 
void DeepCopy (const biorbd::rigidbody::Mesh &other)
 Deep copy of the mesh. More...
 
void addPoint (const biorbd::utils::Vector3d &node)
 Add a point to the mesh. More...
 
const biorbd::utils::Vector3dpoint (unsigned int idx) const
 Return the point of a specific index. More...
 
unsigned int nbVertex () const
 Returns the number of vertex. More...
 
void addFace (const biorbd::rigidbody::MeshFace &face)
 Add a face patch to the mesh. More...
 
void addFace (const std::vector< int > &face)
 Add a face patch to the mesh. More...
 
const std::vector< biorbd::rigidbody::MeshFace > & faces () const
 Return the faces of the mesh. More...
 
const biorbd::rigidbody::MeshFaceface (unsigned int idx) const
 Return the face of the mesh of a specified idx. More...
 
unsigned int nbFaces ()
 Return the number of faces. More...
 
void setPath (const biorbd::utils::Path &path)
 Set the path of the underlying mesh file. More...
 
const biorbd::utils::Pathpath () const
 Return the path of the mesh file. More...
 

Protected Attributes

std::shared_ptr< std::vector< biorbd::utils::Vector3d > > m_vertex
 The vertex.
 
std::shared_ptr< std::vector< biorbd::rigidbody::MeshFace > > m_faces
 The faces.
 
std::shared_ptr< biorbd::utils::Pathm_pathFile
 The path to the mesh file.
 

Detailed Description

A class that holds the geometry of a segment.

Definition at line 20 of file Mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/2]

biorbd::rigidbody::Mesh::Mesh ( const std::vector< biorbd::utils::Vector3d > &  other)

Construct mesh from another mesh.

other The other mesh

Definition at line 16 of file Mesh.cpp.

◆ Mesh() [2/2]

biorbd::rigidbody::Mesh::Mesh ( const std::vector< biorbd::utils::Vector3d > &  vertex,
const std::vector< biorbd::rigidbody::MeshFace > &  faces 
)

Construct mesh.

Parameters
vertexThe vertex of the geometry
facesThe faces of the geometry

Definition at line 24 of file Mesh.cpp.

Member Function Documentation

◆ addFace() [1/2]

void biorbd::rigidbody::Mesh::addFace ( const biorbd::rigidbody::MeshFace face)

Add a face patch to the mesh.

Parameters
faceThe face patch to add

Definition at line 68 of file Mesh.cpp.

◆ addFace() [2/2]

void biorbd::rigidbody::Mesh::addFace ( const std::vector< int > &  face)

Add a face patch to the mesh.

Parameters
faceThe face patch to add

Definition at line 72 of file Mesh.cpp.

◆ addPoint()

void biorbd::rigidbody::Mesh::addPoint ( const biorbd::utils::Vector3d node)

Add a point to the mesh.

Parameters
nodeThe point to add

Definition at line 51 of file Mesh.cpp.

◆ DeepCopy() [1/2]

biorbd::rigidbody::Mesh biorbd::rigidbody::Mesh::DeepCopy ( ) const

Deep copy of the mesh.

Returns
A copy of mesh

Definition at line 33 of file Mesh.cpp.

◆ DeepCopy() [2/2]

void biorbd::rigidbody::Mesh::DeepCopy ( const biorbd::rigidbody::Mesh other)

Deep copy of the mesh.

Parameters
otherThe mesh to copy

Definition at line 40 of file Mesh.cpp.

◆ face()

const biorbd::rigidbody::MeshFace & biorbd::rigidbody::Mesh::face ( unsigned int  idx) const

Return the face of the mesh of a specified idx.

Parameters
idxPosition
Returns
The face of the mesh of a specified idx

Definition at line 80 of file Mesh.cpp.

◆ faces()

const std::vector< biorbd::rigidbody::MeshFace > & biorbd::rigidbody::Mesh::faces ( ) const

Return the faces of the mesh.

Returns
The faces of the mesh

Definition at line 76 of file Mesh.cpp.

◆ nbFaces()

unsigned int biorbd::rigidbody::Mesh::nbFaces ( )

Return the number of faces.

Returns
The number of faces

Definition at line 64 of file Mesh.cpp.

◆ nbVertex()

unsigned int biorbd::rigidbody::Mesh::nbVertex ( ) const

Returns the number of vertex.

Returns
The number of vertex

Definition at line 59 of file Mesh.cpp.

◆ path()

const biorbd::utils::Path & biorbd::rigidbody::Mesh::path ( ) const

Return the path of the mesh file.

Returns
The path of the mesh file

Definition at line 91 of file Mesh.cpp.

◆ point()

const biorbd::utils::Vector3d & biorbd::rigidbody::Mesh::point ( unsigned int  idx) const

Return the point of a specific index.

Parameters
idxThe index of the point
Returns
The point of a specific index

Definition at line 55 of file Mesh.cpp.

◆ setPath()

void biorbd::rigidbody::Mesh::setPath ( const biorbd::utils::Path path)

Set the path of the underlying mesh file.

Parameters
pathPath for the mesh file

Definition at line 86 of file Mesh.cpp.


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