Biorbd
Release_1.13.0
Toggle main menu visibility
Loading...
Searching...
No Matches
WrappingObject.cpp
1
#define BIORBD_API_EXPORTS
2
#include "InternalForces/WrappingObject.h"
3
4
#include "Utils/RotoTrans.h"
5
#include "Utils/String.h"
6
7
using namespace
BIORBD_NAMESPACE;
8
9
internal_forces::WrappingObject::WrappingObject
()
10
: utils::
Vector3d
(),
m_RT
(std::make_shared<utils::RotoTrans>()) {
11
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_OBJECT;
12
}
13
14
internal_forces::WrappingObject::WrappingObject
(
15
const
utils::Scalar &x,
16
const
utils::Scalar &y,
17
const
utils::Scalar &z)
18
: utils::
Vector3d
(x, y, z),
m_RT
(std::make_shared<utils::RotoTrans>()) {
19
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_OBJECT;
20
}
21
22
internal_forces::WrappingObject::WrappingObject
(
23
const
utils::Scalar &x,
24
const
utils::Scalar &y,
25
const
utils::Scalar &z,
26
const
utils::String
&
name
,
27
const
utils::String
&parentName)
28
: utils::
Vector3d
(x, y, z,
name
, parentName),
29
m_RT
(std::make_shared<utils::RotoTrans>()) {
30
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_OBJECT;
31
}
32
33
internal_forces::WrappingObject::WrappingObject
(
const
utils::Vector3d
&other)
34
: utils::
Vector3d
(other) {
35
try
{
36
internal_forces::WrappingObject
&otherWrap(
37
const_cast<
internal_forces::WrappingObject
&
>
(
38
dynamic_cast<
const
internal_forces::WrappingObject
&
>
(other)));
39
m_RT
= otherWrap.
m_RT
;
40
}
catch
(
const
std::bad_cast &) {
41
m_RT
= std::make_shared<utils::RotoTrans>();
42
}
43
}
44
45
internal_forces::WrappingObject::WrappingObject
(
46
const
utils::Vector3d
&other,
47
const
utils::String
&
name
,
48
const
utils::String
&parentName)
49
: utils::
Vector3d
(other,
name
, parentName),
50
m_RT
(std::make_shared<utils::RotoTrans>()) {
51
*
m_typeOfNode
= utils::NODE_TYPE::WRAPPING_OBJECT;
52
}
53
54
void
internal_forces::WrappingObject::DeepCopy
(
55
const
internal_forces::WrappingObject
&other) {
56
utils::Vector3d::DeepCopy
(other);
57
*
m_RT
= *other.
m_RT
;
58
}
59
60
const
utils::RotoTrans
&
internal_forces::WrappingObject::RT
()
const
{
61
return
*
m_RT
;
62
}
BIORBD_NAMESPACE::internal_forces::WrappingObject
Base class for the wrapping objects.
Definition
WrappingObject.h:23
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::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::Vector3d
Vector3d()
Construct 3D vector.
Definition
Vector3d.cpp:9
BIORBD_NAMESPACE::utils::Vector3d::DeepCopy
Vector3d DeepCopy() const
Deep copy of a 3D vector.
Definition
Vector3d.cpp:68
src
InternalForces
WrappingObject.cpp
Generated by
1.18.0