Biorbd
Mesh.h
1 #ifndef BIORBD_RIGIDBODY_MESH_H
2 #define BIORBD_RIGIDBODY_MESH_H
3 
4 #include <memory>
5 #include <vector>
6 #include "biorbdConfig.h"
7 
8 namespace biorbd {
9 namespace utils {
10 class Vector3d;
11 class Path;
12 }
13 
14 namespace rigidbody {
15 class MeshFace;
16 
20 class BIORBD_API Mesh
21 {
22 public:
26  Mesh();
27 
32  Mesh(
33  const std::vector<biorbd::utils::Vector3d>& other);
34 
40  Mesh(
41  const std::vector<biorbd::utils::Vector3d>& vertex,
42  const std::vector<biorbd::rigidbody::MeshFace>& faces);
43 
48  biorbd::rigidbody::Mesh DeepCopy() const;
49 
54  void DeepCopy(
55  const biorbd::rigidbody::Mesh& other);
56 
61  void addPoint(
62  const biorbd::utils::Vector3d& node);
63 
69  const biorbd::utils::Vector3d& point(
70  unsigned int idx) const;
71 
76  unsigned int nbVertex() const;
77 
82  void addFace(
83  const biorbd::rigidbody::MeshFace& face);
84 
89  void addFace(const std::vector<int> &face);
90 
95  const std::vector<biorbd::rigidbody::MeshFace>& faces() const;
96 
102  const biorbd::rigidbody::MeshFace& face(
103  unsigned int idx) const;
104 
109  unsigned int nbFaces();
110 
115  void setPath(
116  const biorbd::utils::Path& path);
117 
122  const biorbd::utils::Path& path() const;
123 
124 protected:
125  std::shared_ptr<std::vector<biorbd::utils::Vector3d>> m_vertex;
126  std::shared_ptr<std::vector<biorbd::rigidbody::MeshFace>> m_faces;
127  std::shared_ptr<biorbd::utils::Path> m_pathFile;
128 };
129 
130 }}
131 
132 #endif // BIORBD_RIGIDBODY_MESH_H
biorbd::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition: Vector3d.h:24
biorbd::rigidbody::MeshFace
The face of the mesh.
Definition: MeshFace.h:19
biorbd::rigidbody::Mesh::m_faces
std::shared_ptr< std::vector< biorbd::rigidbody::MeshFace > > m_faces
The faces.
Definition: Mesh.h:126
biorbd::rigidbody::Mesh
A class that holds the geometry of a segment.
Definition: Mesh.h:21
biorbd::rigidbody::Mesh::m_vertex
std::shared_ptr< std::vector< biorbd::utils::Vector3d > > m_vertex
The vertex.
Definition: Mesh.h:125
biorbd::utils::Path
Collection of methods to manipulate path.
Definition: Path.h:17
biorbd::rigidbody::Mesh::m_pathFile
std::shared_ptr< biorbd::utils::Path > m_pathFile
The path to the mesh file.
Definition: Mesh.h:127