Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
PassiveTorque.cpp
1
#define BIORBD_API_EXPORTS
2
#include "InternalForces/PassiveTorques/PassiveTorque.h"
3
4
#include "Utils/Error.h"
5
#include "Utils/String.h"
6
7
using namespace
BIORBD_NAMESPACE;
8
internal_forces::passive_torques::PassiveTorque::PassiveTorque
()
9
:
m_type
(
10
std::make_shared<internal_forces::passive_torques::TORQUE_TYPE>(
11
internal_forces::passive_torques::TORQUE_TYPE::NO_TORQUE_TYPE)),
12
m_jointName
(std::make_shared<utils::String>(
""
)),
13
m_dofIdx
(std::make_shared<size_t>(-1)) {}
14
15
internal_forces::passive_torques::PassiveTorque::PassiveTorque
(
16
const
internal_forces::passive_torques::PassiveTorque
&other)
17
:
m_type
(other.
m_type
),
18
m_jointName
(other.
m_jointName
),
19
m_dofIdx
(other.
m_dofIdx
) {}
20
internal_forces::passive_torques::PassiveTorque::PassiveTorque
(
21
const
std::shared_ptr<PassiveTorque> other)
22
:
m_type
(other->
m_type
),
23
m_jointName
(other->
m_jointName
),
24
m_dofIdx
(other->
m_dofIdx
) {}
25
26
internal_forces::passive_torques::PassiveTorque::PassiveTorque
(
size_t
dofIdx)
27
:
m_type
(
28
std::make_shared<internal_forces::passive_torques::TORQUE_TYPE>(
29
internal_forces::passive_torques::TORQUE_TYPE::NO_TORQUE_TYPE)),
30
m_jointName
(std::make_shared<utils::String>(
""
)),
31
m_dofIdx
(std::make_shared<size_t>(dofIdx)) {}
32
33
internal_forces::passive_torques::PassiveTorque::PassiveTorque
(
34
size_t
dofIdx,
35
const
utils::String
&jointName)
36
:
m_type
(
37
std::make_shared<internal_forces::passive_torques::TORQUE_TYPE>(
38
internal_forces::passive_torques::TORQUE_TYPE::NO_TORQUE_TYPE)),
39
m_jointName
(std::make_shared<utils::String>(jointName)),
40
m_dofIdx
(std::make_shared<size_t>(dofIdx)) {}
41
42
internal_forces::passive_torques::PassiveTorque::~PassiveTorque
() {}
43
44
void
internal_forces::passive_torques::PassiveTorque::DeepCopy
(
45
const
internal_forces::passive_torques::PassiveTorque
&other) {
46
*
m_type
= *other.
m_type
;
47
*
m_jointName
= *other.
m_jointName
;
48
*
m_dofIdx
= *other.
m_dofIdx
;
49
}
50
51
size_t
internal_forces::passive_torques::PassiveTorque::index
()
const
{
52
return
*
m_dofIdx
;
53
}
54
55
internal_forces::passive_torques::TORQUE_TYPE
56
internal_forces::passive_torques::PassiveTorque::type
()
const
{
57
return
*
m_type
;
58
}
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque
Class PassiveTorque.
Definition
PassiveTorque.h:21
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::index
size_t index() const
Return the index of the DoF associated with passive torque.
Definition
PassiveTorque.cpp:51
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::DeepCopy
void DeepCopy(const PassiveTorque &other)
Deep copy of passive torque.
Definition
PassiveTorque.cpp:44
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::type
TORQUE_TYPE type() const
Return the type of the passive torque.
Definition
PassiveTorque.cpp:56
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::m_type
std::shared_ptr< TORQUE_TYPE > m_type
The type of the passive torque.
Definition
PassiveTorque.h:88
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::m_jointName
std::shared_ptr< utils::String > m_jointName
Name of the parent joint.
Definition
PassiveTorque.h:89
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::m_dofIdx
std::shared_ptr< size_t > m_dofIdx
Index of the DoF associated with the passive torque.
Definition
PassiveTorque.h:91
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::~PassiveTorque
virtual ~PassiveTorque()
Destroy class properly.
Definition
PassiveTorque.cpp:42
BIORBD_NAMESPACE::internal_forces::passive_torques::PassiveTorque::PassiveTorque
PassiveTorque()
Construct passive torque.
Definition
PassiveTorque.cpp:8
BIORBD_NAMESPACE::utils::String
Wrapper around the std::string class with augmented functionality.
Definition
String.h:18
src
InternalForces
PassiveTorques
PassiveTorque.cpp
Generated by
1.18.0