Biorbd
SegmentCharacteristics.h
1 #ifndef BIORBD_RIGIDBODY_SEGMENT_CHARACTERISTICS_H
2 #define BIORBD_RIGIDBODY_SEGMENT_CHARACTERISTICS_H
3 
4 #include <memory>
5 #include <rbdl/Body.h>
6 #include "biorbdConfig.h"
7 
8 #include "Utils/Scalar.h"
9 
10 namespace biorbd {
11 namespace utils {
12 class Vector3d;
13 }
14 
15 namespace rigidbody {
16 class Mesh;
17 
22 #ifdef SWIG
23 class BIORBD_API SegmentCharacteristics
24 #else
25 class BIORBD_API SegmentCharacteristics : public RigidBodyDynamics::Body
26 #endif
27 {
28 public:
33 
41  double mass,
42  const biorbd::utils::Vector3d &com,
43  const RigidBodyDynamics::Math::Matrix3d &inertia);
44 
53  double mass,
54  const biorbd::utils::Vector3d &com,
55  const RigidBodyDynamics::Math::Matrix3d &inertia,
56  const biorbd::rigidbody::Mesh &mesh);
57 
63 
68  void DeepCopy(const biorbd::rigidbody::SegmentCharacteristics& other);
69 
74  void setLength(
75  const biorbd::utils::Scalar& val);
76 
81  const biorbd::utils::Scalar& length() const;
82 
87  double mass() const;
88 
93  biorbd::utils::Vector3d CoM() const;
94 
99  void setCoM(const biorbd::utils::Vector3d& com);
100 
105  const biorbd::rigidbody::Mesh& mesh() const;
106 
111  const RigidBodyDynamics::Math::Matrix3d& inertia() const;
112 
113 protected:
114  std::shared_ptr<biorbd::utils::Scalar> m_length;
115  std::shared_ptr<biorbd::rigidbody::Mesh> m_mesh;
116 };
117 
118 }}
119 
120 #endif // BIORBD_RIGIDBODY_SEGMENT_CHARACTERISTICS_H
biorbd::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition: Vector3d.h:24
biorbd::rigidbody::SegmentCharacteristics
Characteristics of a segment, namely the mass, the center of mass, the inertia, the length and its me...
Definition: SegmentCharacteristics.h:27
biorbd::rigidbody::SegmentCharacteristics::m_length
std::shared_ptr< biorbd::utils::Scalar > m_length
Length of the segment.
Definition: SegmentCharacteristics.h:114
biorbd::rigidbody::SegmentCharacteristics::m_mesh
std::shared_ptr< biorbd::rigidbody::Mesh > m_mesh
Mesh of the segment.
Definition: SegmentCharacteristics.h:115
biorbd::rigidbody::Mesh
A class that holds the geometry of a segment.
Definition: Mesh.h:21