Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Mesh.h
1
#ifndef BIORBD_RIGIDBODY_MESH_H
2
#define BIORBD_RIGIDBODY_MESH_H
3
4
#include "biorbdConfig.h"
5
6
#include <memory>
7
#include <vector>
8
9
namespace
BIORBD_NAMESPACE {
10
namespace
utils {
11
class
Vector3d
;
12
class
RotoTrans
;
13
class
Path
;
14
}
// namespace utils
15
16
namespace
rigidbody {
17
class
MeshFace
;
18
22
class
BIORBD_API
Mesh
{
23
public
:
27
Mesh
();
28
33
Mesh
(
const
std::vector<utils::Vector3d> &other);
34
40
Mesh
(
41
const
std::vector<utils::Vector3d> &vertex,
42
const
std::vector<MeshFace> &
faces
);
43
48
Mesh
DeepCopy
()
const
;
49
54
void
DeepCopy
(
const
Mesh
&other);
55
60
void
setColor
(
const
utils::Vector3d
&
color
);
61
66
utils::Vector3d
&
color
()
const
;
67
71
bool
hasMesh
()
const
;
72
77
void
addPoint
(
const
utils::Vector3d
&node);
78
84
const
utils::Vector3d
&
point
(
size_t
idx)
const
;
85
90
size_t
nbVertex
()
const
;
91
96
void
rotate
(
const
utils::RotoTrans
&rt);
97
102
utils::RotoTrans
&
getRotation
()
const
;
103
110
void
scale
(
const
utils::Vector3d
&scaler);
111
116
utils::Vector3d
&
getScale
()
const
;
117
122
void
addFace
(
const
MeshFace
&
face
);
123
128
void
addFace
(
const
std::vector<int> &
face
);
129
134
const
std::vector<MeshFace> &
faces
()
const
;
135
141
const
MeshFace
&
face
(
size_t
idx)
const
;
142
147
size_t
nbFaces
();
148
153
void
setPath
(
const
utils::Path
&
path
);
154
159
utils::Path
&
path
();
160
165
const
utils::Path
&
path
()
const
;
166
167
protected
:
168
std::shared_ptr<utils::RotoTrans>
m_rotation
;
169
std::shared_ptr<std::vector<utils::Vector3d>>
m_vertex
;
170
std::shared_ptr<std::vector<MeshFace>>
m_faces
;
171
std::shared_ptr<utils::Path>
m_pathFile
;
172
std::shared_ptr<utils::Vector3d>
m_patchColor
;
173
std::shared_ptr<utils::Vector3d>
m_scale
;
174
};
175
176
}
// namespace rigidbody
177
}
// namespace BIORBD_NAMESPACE
178
179
#endif
// BIORBD_RIGIDBODY_MESH_H
BIORBD_NAMESPACE::rigidbody::MeshFace
The face of the mesh.
Definition
MeshFace.h:19
BIORBD_NAMESPACE::rigidbody::Mesh::getRotation
utils::RotoTrans & getRotation() const
Get the rotation applied to the vertex.
Definition
Mesh.cpp:80
BIORBD_NAMESPACE::rigidbody::Mesh::m_scale
std::shared_ptr< utils::Vector3d > m_scale
The scale.
Definition
Mesh.h:173
BIORBD_NAMESPACE::rigidbody::Mesh::m_faces
std::shared_ptr< std::vector< MeshFace > > m_faces
The faces.
Definition
Mesh.h:170
BIORBD_NAMESPACE::rigidbody::Mesh::setColor
void setColor(const utils::Vector3d &color)
Set the patch color.
Definition
Mesh.cpp:58
BIORBD_NAMESPACE::rigidbody::Mesh::addFace
void addFace(const MeshFace &face)
Add a face patch to the mesh.
Definition
Mesh.cpp:94
BIORBD_NAMESPACE::rigidbody::Mesh::m_rotation
std::shared_ptr< utils::RotoTrans > m_rotation
The rotation.
Definition
Mesh.h:168
BIORBD_NAMESPACE::rigidbody::Mesh::nbVertex
size_t nbVertex() const
Returns the number of vertex.
Definition
Mesh.cpp:71
BIORBD_NAMESPACE::rigidbody::Mesh::point
const utils::Vector3d & point(size_t idx) const
Return the point of a specific index.
Definition
Mesh.cpp:68
BIORBD_NAMESPACE::rigidbody::Mesh::addPoint
void addPoint(const utils::Vector3d &node)
Add a point to the mesh.
Definition
Mesh.cpp:65
BIORBD_NAMESPACE::rigidbody::Mesh::scale
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...
Definition
Mesh.cpp:82
BIORBD_NAMESPACE::rigidbody::Mesh::rotate
void rotate(const utils::RotoTrans &rt)
rotateVertex Apply the RT to the vertex
Definition
Mesh.cpp:73
BIORBD_NAMESPACE::rigidbody::Mesh::face
const MeshFace & face(size_t idx) const
Return the face of the mesh of a specified idx.
Definition
Mesh.cpp:103
BIORBD_NAMESPACE::rigidbody::Mesh::m_vertex
std::shared_ptr< std::vector< utils::Vector3d > > m_vertex
The vertex.
Definition
Mesh.h:169
BIORBD_NAMESPACE::rigidbody::Mesh::color
utils::Vector3d & color() const
Get the patch color.
Definition
Mesh.cpp:62
BIORBD_NAMESPACE::rigidbody::Mesh::Mesh
Mesh()
Construct mesh.
Definition
Mesh.cpp:11
BIORBD_NAMESPACE::rigidbody::Mesh::setPath
void setPath(const utils::Path &path)
Set the path of the underlying mesh file.
Definition
Mesh.cpp:107
BIORBD_NAMESPACE::rigidbody::Mesh::m_pathFile
std::shared_ptr< utils::Path > m_pathFile
The path to the mesh file.
Definition
Mesh.h:171
BIORBD_NAMESPACE::rigidbody::Mesh::hasMesh
bool hasMesh() const
Return if there is a mesh.
Definition
Mesh.cpp:64
BIORBD_NAMESPACE::rigidbody::Mesh::faces
const std::vector< MeshFace > & faces() const
Return the faces of the mesh.
Definition
Mesh.cpp:100
BIORBD_NAMESPACE::rigidbody::Mesh::getScale
utils::Vector3d & getScale() const
Get the scaling applied to the vertex wrt to 0, 0, 0.
Definition
Mesh.cpp:91
BIORBD_NAMESPACE::rigidbody::Mesh::m_patchColor
std::shared_ptr< utils::Vector3d > m_patchColor
The color of faces.
Definition
Mesh.h:172
BIORBD_NAMESPACE::rigidbody::Mesh::path
utils::Path & path()
Return the path of the mesh file.
Definition
Mesh.cpp:109
BIORBD_NAMESPACE::rigidbody::Mesh::nbFaces
size_t nbFaces()
Return the number of faces.
Definition
Mesh.cpp:93
BIORBD_NAMESPACE::rigidbody::Mesh::DeepCopy
Mesh DeepCopy() const
Deep copy of the mesh.
Definition
Mesh.cpp:37
BIORBD_NAMESPACE::utils::Path
Collection of methods to manipulate path.
Definition
Path.h:16
BIORBD_NAMESPACE::utils::RotoTrans
Homogenous matrix to describe translations and rotations simultaneously.
Definition
RotoTrans.h:33
BIORBD_NAMESPACE::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition
Vector3d.h:27
include
RigidBody
Mesh.h
Generated by
1.18.0