Biorbd
WrappingSphere.cpp
1 #define BIORBD_API_EXPORTS
2 #include "Muscles/WrappingSphere.h"
3 
4 #include "Utils/String.h"
5 #include "Utils/RotoTrans.h"
6 
8  biorbd::muscles::WrappingObject (),
9  m_dia(std::make_shared<biorbd::utils::Scalar>(0))
10 {
11  *m_typeOfNode = biorbd::utils::NODE_TYPE::WRAPPING_SPHERE;
12 }
13 
15  const biorbd::utils::Scalar& x,
16  const biorbd::utils::Scalar& y,
17  const biorbd::utils::Scalar& z,
18  const biorbd::utils::Scalar& diameter) :
19  biorbd::muscles::WrappingObject (x, y, z),
20  m_dia(std::make_shared<biorbd::utils::Scalar>(diameter))
21 
22 {
23  *m_typeOfNode = biorbd::utils::NODE_TYPE::WRAPPING_SPHERE;
24 }
25 
27  const biorbd::utils::Scalar& x,
28  const biorbd::utils::Scalar& y,
29  const biorbd::utils::Scalar& z,
30  const biorbd::utils::Scalar& diameter,
31  const biorbd::utils::String &name,
32  const biorbd::utils::String &parentName) :
33  biorbd::muscles::WrappingObject (x, y, z, name, parentName),
34  m_dia(std::make_shared<biorbd::utils::Scalar>(diameter))
35 {
36  *m_typeOfNode = biorbd::utils::NODE_TYPE::WRAPPING_SPHERE;
37 }
38 
40  const biorbd::utils::Vector3d &v,
41  const biorbd::utils::Scalar& diameter) :
42  biorbd::muscles::WrappingObject(v),
43  m_dia(std::make_shared<biorbd::utils::Scalar>(diameter))
44 {
45  *m_typeOfNode = biorbd::utils::NODE_TYPE::WRAPPING_SPHERE;
46 }
47 
49 {
51  copy.DeepCopy(*this);
52  return copy;
53 }
54 
56 {
58  *m_dia = *other.m_dia;
59 }
60 
64  bool)
65 {
66  return *m_RT;
67 }
68 
70  const biorbd::utils::Scalar& val)
71 {
72  *m_dia = val;
73 }
74 
75 const biorbd::utils::Scalar& biorbd::muscles::WrappingSphere::diameter() const
76 {
77  return *m_dia;
78 }
biorbd::muscles::WrappingSphere
Sphere object that makes the muscle to wrap around.
Definition: WrappingSphere.h:13
biorbd::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition: Vector3d.h:24
biorbd::utils::Vector3d::DeepCopy
biorbd::utils::Vector3d DeepCopy() const
Deep copy of a 3D vector.
Definition: Vector3d.cpp:82
biorbd::muscles::WrappingSphere::diameter
const biorbd::utils::Scalar & diameter() const
Return the diameter of the wrapping sphere.
Definition: WrappingSphere.cpp:75
biorbd::rigidbody::GeneralizedCoordinates
Class GeneralizedCoordinates.
Definition: GeneralizedCoordinates.h:15
biorbd::rigidbody::Joints
This is the core of the musculoskeletal model in biorbd.
Definition: Joints.h:40
biorbd::muscles::WrappingSphere::WrappingSphere
WrappingSphere()
Construct a wrapping sphere.
Definition: WrappingSphere.cpp:7
biorbd::utils::RotoTrans
Homogenous matrix to describe translations and rotations simultaneously.
Definition: RotoTrans.h:34
biorbd::muscles::WrappingSphere::m_dia
std::shared_ptr< biorbd::utils::Scalar > m_dia
Diameter of the wrapping sphere.
Definition: WrappingSphere.h:130
biorbd::muscles::WrappingSphere::setDiameter
void setDiameter(const biorbd::utils::Scalar &val)
Set the diameter of the wrappping sphere.
Definition: WrappingSphere.cpp:69
biorbd::muscles::WrappingObject
Base class for the wrapping objects.
Definition: WrappingObject.h:23
biorbd::utils::String
Wrapper around the std::string class with augmented functionality.
Definition: String.h:17
biorbd::muscles::WrappingObject::RT
const biorbd::utils::RotoTrans & RT() const
Return the RotoTrans matrix of the wrapping object.
Definition: WrappingObject.cpp:58
biorbd::utils::Node::m_typeOfNode
std::shared_ptr< biorbd::utils::NODE_TYPE > m_typeOfNode
The type of the node.
Definition: Node.h:93
biorbd::muscles::WrappingSphere::DeepCopy
biorbd::muscles::WrappingSphere DeepCopy() const
Deep copy of the wrapping sphere.
Definition: WrappingSphere.cpp:48