Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Compound.cpp
1
#define BIORBD_API_EXPORTS
2
#include "InternalForces/Compound.h"
3
4
#include "InternalForces/PathModifiers.h"
5
#include "RigidBody/GeneralizedCoordinates.h"
6
#include "Utils/String.h"
7
#include "Utils/Vector3d.h"
8
9
using namespace
BIORBD_NAMESPACE;
10
11
internal_forces::Compound::Compound
()
12
:
m_name
(std::make_shared<utils::String>(
""
)),
13
m_pathChanger
(std::make_shared<internal_forces::
PathModifiers
>()),
14
m_force
(std::make_shared<utils::Scalar>(0)) {}
15
16
internal_forces::Compound::Compound
(
const
utils::String
&
name
)
17
:
m_name
(std::make_shared<utils::String>(
name
)),
18
m_pathChanger
(std::make_shared<internal_forces::
PathModifiers
>()),
19
m_force
(std::make_shared<utils::Scalar>(0)) {}
20
21
internal_forces::Compound::Compound
(
22
const
utils::String
&
name
,
23
const
internal_forces::PathModifiers
&pathModifiers)
24
:
m_name
(std::make_shared<utils::String>(
name
)),
25
m_pathChanger
(
26
std::make_shared<internal_forces::
PathModifiers
>(pathModifiers)),
27
m_force
(std::make_shared<utils::Scalar>(0)) {}
28
29
internal_forces::Compound::Compound
(
const
internal_forces::Compound
&other)
30
:
m_name
(other.
m_name
),
31
m_pathChanger
(other.
m_pathChanger
),
32
m_force
(other.
m_force
) {}
33
34
internal_forces::Compound::Compound
(std::shared_ptr<Compound> other)
35
:
m_name
(other->
m_name
),
36
m_pathChanger
(other->
m_pathChanger
),
37
m_force
(other->
m_force
) {}
38
39
internal_forces::Compound::~Compound
() {}
40
41
void
internal_forces::Compound::DeepCopy
(
42
const
internal_forces::Compound
&other) {
43
*
m_name
= *other.
m_name
;
44
*
m_pathChanger
= other.
m_pathChanger
->DeepCopy();
45
*
m_force
= *other.
m_force
;
46
}
47
48
const
utils::String
&
internal_forces::Compound::name
()
const
{
return
*
m_name
; }
49
50
void
internal_forces::Compound::setName
(
const
utils::String
&
name
) {
51
*
m_name
=
name
;
52
}
53
54
const
internal_forces::PathModifiers
&
55
internal_forces::Compound::pathModifier
() {
56
return
*
m_pathChanger
;
57
}
58
59
void
internal_forces::Compound::addPathObject
(
utils::Vector3d
&wrap) {
60
m_pathChanger
->
addPathChanger
(wrap);
61
}
62
63
const
utils::Scalar &
internal_forces::Compound::force
() {
return
*
m_force
; }
BIORBD_NAMESPACE::internal_forces::Compound
Class compound is a very generic definition of what a muscle is. It should be the base class of every...
Definition
Compound.h:29
BIORBD_NAMESPACE::internal_forces::Compound::pathModifier
const internal_forces::PathModifiers & pathModifier()
Return the path modifier.
Definition
Compound.cpp:55
BIORBD_NAMESPACE::internal_forces::Compound::m_name
std::shared_ptr< utils::String > m_name
The name of the muscle.
Definition
Compound.h:105
BIORBD_NAMESPACE::internal_forces::Compound::name
const utils::String & name() const
Return the name of the muscle.
Definition
Compound.cpp:48
BIORBD_NAMESPACE::internal_forces::Compound::setName
void setName(const utils::String &name)
Set the name of a muscle.
Definition
Compound.cpp:50
BIORBD_NAMESPACE::internal_forces::Compound::addPathObject
void addPathObject(utils::Vector3d &wrap)
Add a path modifier object.
Definition
Compound.cpp:59
BIORBD_NAMESPACE::internal_forces::Compound::DeepCopy
void DeepCopy(const Compound &other)
Deep copy of a compound.
Definition
Compound.cpp:41
BIORBD_NAMESPACE::internal_forces::Compound::m_force
std::shared_ptr< utils::Scalar > m_force
The last computed force.
Definition
Compound.h:108
BIORBD_NAMESPACE::internal_forces::Compound::~Compound
virtual ~Compound()
Destroy class properly.
Definition
Compound.cpp:39
BIORBD_NAMESPACE::internal_forces::Compound::force
virtual const utils::Scalar & force()
Return the last computed muscle force norm.
Definition
Compound.cpp:63
BIORBD_NAMESPACE::internal_forces::Compound::Compound
Compound()
Construct muscle compound.
Definition
Compound.cpp:11
BIORBD_NAMESPACE::internal_forces::Compound::m_pathChanger
std::shared_ptr< internal_forces::PathModifiers > m_pathChanger
The set of path modifiers.
Definition
Compound.h:107
BIORBD_NAMESPACE::internal_forces::PathModifiers
Holder of all the path modifiers of a muscle.
Definition
PathModifiers.h:18
BIORBD_NAMESPACE::internal_forces::PathModifiers::addPathChanger
void addPathChanger(utils::Vector3d &object)
Add a wrapping or a via point to the set of path modifiers.
Definition
PathModifiers.cpp:38
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
src
InternalForces
Compound.cpp
Generated by
1.18.0