Biorbd Release_1.13.0
Loading...
Searching...
No Matches
BIORBD_NAMESPACE::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< utils::Vector3d > &other)
 Construct mesh from another mesh.
 Mesh (const std::vector< utils::Vector3d > &vertex, const std::vector< MeshFace > &faces)
 Construct mesh.
Mesh DeepCopy () const
 Deep copy of the mesh.
void DeepCopy (const Mesh &other)
 Deep copy of the mesh.
void setColor (const utils::Vector3d &color)
 Set the patch color.
utils::Vector3d & color () const
 Get the patch color.
bool hasMesh () const
 Return if there is a mesh.
void addPoint (const utils::Vector3d &node)
 Add a point to the mesh.
const utils::Vector3d & point (size_t idx) const
 Return the point of a specific index.
size_t nbVertex () const
 Returns the number of vertex.
void rotate (const utils::RotoTrans &rt)
 rotateVertex Apply the RT to the vertex
utils::RotoTrans & getRotation () const
 Get the rotation applied to the vertex.
void scale (const utils::Vector3d &scaler)
 Scale the vertex wrt to 0, 0, 0. Warnign, this function is applied when called, meaning that if it is called after rotate, it will results in surprising results!
utils::Vector3d & getScale () const
 Get the scaling applied to the vertex wrt to 0, 0, 0.
void addFace (const MeshFace &face)
 Add a face patch to the mesh.
void addFace (const std::vector< int > &face)
 Add a face patch to the mesh.
const std::vector< MeshFace > & faces () const
 Return the faces of the mesh.
const MeshFace & face (size_t idx) const
 Return the face of the mesh of a specified idx.
size_t nbFaces ()
 Return the number of faces.
void setPath (const utils::Path &path)
 Set the path of the underlying mesh file.
utils::Path & path ()
 Return the path of the mesh file.
const utils::Path & path () const
 Return the path of the mesh file.

Protected Attributes

std::shared_ptr< utils::RotoTrans > m_rotation
 The rotation.
std::shared_ptr< std::vector< utils::Vector3d > > m_vertex
 The vertex.
std::shared_ptr< std::vector< MeshFace > > m_faces
 The faces.
std::shared_ptr< utils::Path > m_pathFile
 The path to the mesh file.
std::shared_ptr< utils::Vector3d > m_patchColor
 The color of faces.
std::shared_ptr< utils::Vector3d > m_scale
 The scale.

Detailed Description

A class that holds the geometry of a segment.

Definition at line 22 of file Mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/3]

rigidbody::Mesh::Mesh ( )

Construct mesh.

Definition at line 11 of file Mesh.cpp.

◆ Mesh() [2/3]

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

Construct mesh from another mesh.

Parameters
otherThe other mesh

Definition at line 19 of file Mesh.cpp.

◆ Mesh() [3/3]

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

Construct mesh.

Parameters
vertexThe vertex of the geometry
facesThe faces of the geometry

Definition at line 27 of file Mesh.cpp.

Member Function Documentation

◆ addFace() [1/2]

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

Add a face patch to the mesh.

Parameters
faceThe face patch to add

Definition at line 94 of file Mesh.cpp.

◆ addFace() [2/2]

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

Add a face patch to the mesh.

Parameters
faceThe face patch to add

Definition at line 97 of file Mesh.cpp.

◆ addPoint()

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

Add a point to the mesh.

Parameters
nodeThe point to add

Definition at line 65 of file Mesh.cpp.

◆ color()

utils::Vector3d & rigidbody::Mesh::color ( ) const

Get the patch color.

Returns
The patch color

Definition at line 62 of file Mesh.cpp.

◆ DeepCopy() [1/2]

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

Deep copy of the mesh.

Returns
A copy of mesh

Definition at line 37 of file Mesh.cpp.

◆ DeepCopy() [2/2]

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

Deep copy of the mesh.

Parameters
otherThe mesh to copy

Definition at line 43 of file Mesh.cpp.

◆ face()

const rigidbody::MeshFace & rigidbody::Mesh::face ( size_t 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 103 of file Mesh.cpp.

◆ faces()

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

Return the faces of the mesh.

Returns
The faces of the mesh

Definition at line 100 of file Mesh.cpp.

◆ getRotation()

utils::RotoTrans & rigidbody::Mesh::getRotation ( ) const

Get the rotation applied to the vertex.

Returns
The Transformation applied to the mesh wrt the parent

Definition at line 80 of file Mesh.cpp.

◆ getScale()

utils::Vector3d & rigidbody::Mesh::getScale ( ) const

Get the scaling applied to the vertex wrt to 0, 0, 0.

Returns
The scaling applied to the mesh wrt the parent

Definition at line 91 of file Mesh.cpp.

◆ hasMesh()

bool rigidbody::Mesh::hasMesh ( ) const

Return if there is a mesh.

Returns
If there is a mesh

Definition at line 64 of file Mesh.cpp.

◆ nbFaces()

size_t rigidbody::Mesh::nbFaces ( )

Return the number of faces.

Returns
The number of faces

Definition at line 93 of file Mesh.cpp.

◆ nbVertex()

size_t rigidbody::Mesh::nbVertex ( ) const

Returns the number of vertex.

Returns
The number of vertex

Definition at line 71 of file Mesh.cpp.

◆ path() [1/2]

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

Return the path of the mesh file.

Returns
The path of the mesh file

Definition at line 109 of file Mesh.cpp.

◆ path() [2/2]

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

Return the path of the mesh file.

Returns
The path of the mesh file

Definition at line 111 of file Mesh.cpp.

◆ point()

const utils::Vector3d & rigidbody::Mesh::point ( size_t 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 68 of file Mesh.cpp.

◆ rotate()

void rigidbody::Mesh::rotate ( const utils::RotoTrans & rt)

rotateVertex Apply the RT to the vertex

Parameters
rtThe Transformation to apply to the mesh wrt the parent

Definition at line 73 of file Mesh.cpp.

◆ scale()

void rigidbody::Mesh::scale ( const utils::Vector3d & scaler)

Scale the vertex wrt to 0, 0, 0. Warnign, this function is applied when called, meaning that if it is called after rotate, it will results in surprising results!

Parameters
scalerThe x, y, z values to scale

Definition at line 82 of file Mesh.cpp.

◆ setColor()

void rigidbody::Mesh::setColor ( const utils::Vector3d & color)

Set the patch color.

Parameters
colorThe color

Definition at line 58 of file Mesh.cpp.

◆ setPath()

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

Set the path of the underlying mesh file.

Parameters
pathPath for the mesh file

Definition at line 107 of file Mesh.cpp.

Member Data Documentation

◆ m_faces

std::shared_ptr<std::vector<MeshFace> > BIORBD_NAMESPACE::rigidbody::Mesh::m_faces
protected

The faces.

Definition at line 170 of file Mesh.h.

◆ m_patchColor

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::rigidbody::Mesh::m_patchColor
protected

The color of faces.

Definition at line 172 of file Mesh.h.

◆ m_pathFile

std::shared_ptr<utils::Path> BIORBD_NAMESPACE::rigidbody::Mesh::m_pathFile
protected

The path to the mesh file.

Definition at line 171 of file Mesh.h.

◆ m_rotation

std::shared_ptr<utils::RotoTrans> BIORBD_NAMESPACE::rigidbody::Mesh::m_rotation
protected

The rotation.

Definition at line 168 of file Mesh.h.

◆ m_scale

std::shared_ptr<utils::Vector3d> BIORBD_NAMESPACE::rigidbody::Mesh::m_scale
protected

The scale.

Definition at line 173 of file Mesh.h.

◆ m_vertex

std::shared_ptr<std::vector<utils::Vector3d> > BIORBD_NAMESPACE::rigidbody::Mesh::m_vertex
protected

The vertex.

Definition at line 169 of file Mesh.h.


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