Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
WrappingSphere.cpp
1
#define BIORBD_API_EXPORTS
2
#include "InternalForces/WrappingSphere.h"
3
4
#include "Utils/RotoTrans.h"
5
#include "Utils/String.h"
6
7
using namespace
BIORBD_NAMESPACE;
8
9
internal_forces::WrappingSphere::WrappingSphere
()
10
: internal_forces::
WrappingObject
(),
11
m_dia
(std::make_shared<utils::Scalar>(0)) {
12
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_SPHERE;
13
}
14
15
internal_forces::WrappingSphere::WrappingSphere
(
16
const
utils::Scalar& x,
17
const
utils::Scalar& y,
18
const
utils::Scalar& z,
19
const
utils::Scalar&
diameter
)
20
: internal_forces::
WrappingObject
(x, y, z),
21
m_dia
(std::make_shared<utils::Scalar>(
diameter
))
22
23
{
24
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_SPHERE;
25
}
26
27
internal_forces::WrappingSphere::WrappingSphere
(
28
const
utils::Scalar& x,
29
const
utils::Scalar& y,
30
const
utils::Scalar& z,
31
const
utils::Scalar&
diameter
,
32
const
utils::String
&
name
,
33
const
utils::String
& parentName)
34
: internal_forces::
WrappingObject
(x, y, z,
name
, parentName),
35
m_dia
(std::make_shared<utils::Scalar>(
diameter
)) {
36
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_SPHERE;
37
}
38
39
internal_forces::WrappingSphere::WrappingSphere
(
40
const
utils::Vector3d
& v,
41
const
utils::Scalar&
diameter
)
42
: internal_forces::
WrappingObject
(v),
43
m_dia
(std::make_shared<utils::Scalar>(
diameter
)) {
44
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_SPHERE;
45
}
46
47
internal_forces::WrappingSphere
internal_forces::WrappingSphere::DeepCopy
()
48
const
{
49
internal_forces::WrappingSphere
copy;
50
copy.
DeepCopy
(*
this
);
51
return
copy;
52
}
53
54
void
internal_forces::WrappingSphere::DeepCopy
(
55
const
internal_forces::WrappingSphere
& other) {
56
internal_forces::WrappingObject::DeepCopy
(other);
57
*
m_dia
= *other.
m_dia
;
58
}
59
60
const
utils::RotoTrans
&
internal_forces::WrappingSphere::RT
(
61
rigidbody::Joints
&,
62
const
rigidbody::GeneralizedCoordinates
&,
63
bool
) {
64
return
*
m_RT
;
65
}
66
67
void
internal_forces::WrappingSphere::setDiameter
(
const
utils::Scalar& val) {
68
*
m_dia
= val;
69
}
70
71
const
utils::Scalar&
internal_forces::WrappingSphere::diameter
()
const
{
72
return
*
m_dia
;
73
}
BIORBD_NAMESPACE::internal_forces::WrappingObject::WrappingObject
WrappingObject()
Construct a wrapping object.
Definition
WrappingObject.cpp:9
BIORBD_NAMESPACE::internal_forces::WrappingObject::m_RT
std::shared_ptr< utils::RotoTrans > m_RT
RotoTrans matrix of the wrapping object.
Definition
WrappingObject.h:160
BIORBD_NAMESPACE::internal_forces::WrappingObject::RT
const utils::RotoTrans & RT() const
Return the RotoTrans matrix of the wrapping object.
Definition
WrappingObject.cpp:60
BIORBD_NAMESPACE::internal_forces::WrappingSphere
Sphere object that makes the muscle to wrap around.
Definition
WrappingSphere.h:13
BIORBD_NAMESPACE::internal_forces::WrappingSphere::setDiameter
void setDiameter(const utils::Scalar &val)
Set the diameter of the wrappping sphere.
Definition
WrappingSphere.cpp:67
BIORBD_NAMESPACE::internal_forces::WrappingSphere::WrappingSphere
WrappingSphere()
Construct a wrapping sphere.
Definition
WrappingSphere.cpp:9
BIORBD_NAMESPACE::internal_forces::WrappingSphere::DeepCopy
WrappingSphere DeepCopy() const
Deep copy of the wrapping sphere.
Definition
WrappingSphere.cpp:47
BIORBD_NAMESPACE::internal_forces::WrappingSphere::m_dia
std::shared_ptr< utils::Scalar > m_dia
Diameter of the wrapping sphere.
Definition
WrappingSphere.h:123
BIORBD_NAMESPACE::internal_forces::WrappingSphere::diameter
const utils::Scalar & diameter() const
Return the diameter of the wrapping sphere.
Definition
WrappingSphere.cpp:71
BIORBD_NAMESPACE::rigidbody::GeneralizedCoordinates
Class GeneralizedCoordinates.
Definition
GeneralizedCoordinates.h:15
BIORBD_NAMESPACE::rigidbody::Joints
This is the core of the musculoskeletal model in biorbd.
Definition
Joints.h:48
BIORBD_NAMESPACE::utils::Node::name
const String & name() const
Return the name of the node.
Definition
Node.cpp:43
BIORBD_NAMESPACE::utils::Node::m_typeOfNode
std::shared_ptr< NODE_TYPE > m_typeOfNode
The type of the node.
Definition
Node.h:92
BIORBD_NAMESPACE::utils::RotoTrans
Homogenous matrix to describe translations and rotations simultaneously.
Definition
RotoTrans.h:33
BIORBD_NAMESPACE::utils::String
Wrapper around the std::string class with augmented functionality.
Definition
String.h:18
BIORBD_NAMESPACE::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition
Vector3d.h:27
BIORBD_NAMESPACE::utils::Vector3d::DeepCopy
Vector3d DeepCopy() const
Deep copy of a 3D vector.
Definition
Vector3d.cpp:68
src
InternalForces
WrappingSphere.cpp
Generated by
1.18.0