Biorbd Release_1.13.0
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
9using namespace BIORBD_NAMESPACE;
10
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
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
22 const utils::String &name,
23 const internal_forces::PathModifiers &pathModifiers)
24 : m_name(std::make_shared<utils::String>(name)),
26 std::make_shared<internal_forces::PathModifiers>(pathModifiers)),
27 m_force(std::make_shared<utils::Scalar>(0)) {}
28
33
34internal_forces::Compound::Compound(std::shared_ptr<Compound> other)
35 : m_name(other->m_name),
37 m_force(other->m_force) {}
38
40
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
49
53
58
62
63const utils::Scalar &internal_forces::Compound::force() { return *m_force; }
Class compound is a very generic definition of what a muscle is. It should be the base class of every...
Definition Compound.h:29
const internal_forces::PathModifiers & pathModifier()
Return the path modifier.
Definition Compound.cpp:55
std::shared_ptr< utils::String > m_name
The name of the muscle.
Definition Compound.h:105
const utils::String & name() const
Return the name of the muscle.
Definition Compound.cpp:48
void setName(const utils::String &name)
Set the name of a muscle.
Definition Compound.cpp:50
void addPathObject(utils::Vector3d &wrap)
Add a path modifier object.
Definition Compound.cpp:59
void DeepCopy(const Compound &other)
Deep copy of a compound.
Definition Compound.cpp:41
std::shared_ptr< utils::Scalar > m_force
The last computed force.
Definition Compound.h:108
virtual ~Compound()
Destroy class properly.
Definition Compound.cpp:39
virtual const utils::Scalar & force()
Return the last computed muscle force norm.
Definition Compound.cpp:63
Compound()
Construct muscle compound.
Definition Compound.cpp:11
std::shared_ptr< internal_forces::PathModifiers > m_pathChanger
The set of path modifiers.
Definition Compound.h:107
Holder of all the path modifiers of a muscle.
void addPathChanger(utils::Vector3d &object)
Add a wrapping or a via point to the set of path modifiers.
Wrapper around the std::string class with augmented functionality.
Definition String.h:18
Wrapper around Eigen Vector3d and attach it to a parent.
Definition Vector3d.h:27