Biorbd Release_1.13.0
Loading...
Searching...
No Matches
NodeSegment.h
1#ifndef BIORBD_RIGIDBODY_NODE_SEGMENT_H
2#define BIORBD_RIGIDBODY_NODE_SEGMENT_H
3
4#include "biorbdConfig.h"
5
6#include <vector>
7
8#include "Utils/Vector3d.h"
9
10namespace BIORBD_NAMESPACE {
11namespace utils {
12class String;
13}
14
15namespace rigidbody {
16
20class BIORBD_API NodeSegment : public utils::Vector3d {
21 public:
26
34 const utils::Scalar& x,
35 const utils::Scalar& y,
36 const utils::Scalar& z);
37
42 NodeSegment(const utils::Vector3d& other);
43
57 const utils::Scalar& x,
58 const utils::Scalar& y,
59 const utils::Scalar& z,
60 const utils::String& name,
61 const utils::String& parentName,
62 bool isTechnical,
63 bool isAnatomical,
65 int parentID);
66
78 const utils::Vector3d& node,
79 const utils::String& name,
80 const utils::String& parentName,
81 bool isTechnical,
82 bool isAnatomical,
84 int parentID);
85
90 NodeSegment DeepCopy() const;
91
96 void DeepCopy(const NodeSegment& other);
97
98 // Get and Set
99
104 void setValues(const NodeSegment& values);
105
110 bool isTechnical() const;
111
116 bool isAnatomical() const;
117
122 int parentId() const;
123
128 const std::vector<bool>& axesToRemove() const;
129
134 const std::vector<bool> axes() const;
135
141 NodeSegment removeAxes() const;
142
148 bool isAxisRemoved(size_t i) const;
149
155 bool isAxisKept(size_t i) const;
156
161 std::vector<int> availableAxesIndices() const;
162
167 void addAxesToRemove(size_t axisNumber);
168
173 void addAxesToRemove(const utils::String& axis);
174
175#ifndef SWIG
180 void addAxesToRemove(const std::vector<size_t>& axes);
181#endif
182
187 void addAxesToRemove(const std::vector<utils::String>& axes);
188
194
199 int nbAxesToRemove() const;
200
201#ifndef SWIG
202#ifdef BIORBD_USE_EIGEN3_MATH
207 template <typename OtherDerived>
208 NodeSegment& operator=(const Eigen::MatrixBase<OtherDerived>& other) {
209 this->utils::Vector3d::operator=(other);
210 return *this;
211 }
212#endif
213#endif
214
215 protected:
219 void setType();
220
221 std::shared_ptr<std::vector<bool>> m_axesRemoved;
222 std::shared_ptr<int>
226 std::shared_ptr<bool> m_technical;
227 std::shared_ptr<bool> m_anatomical;
228 std::shared_ptr<int> m_id;
229};
230
231} // namespace rigidbody
232} // namespace BIORBD_NAMESPACE
233
234#endif // BIORBD_RIGIDBODY_NODE_SEGMENT_H
NodeSegment()
Construct a segment node.
std::shared_ptr< bool > m_technical
If a marker is a technical marker.
utils::String axesToRemoveAsString() const
Return the axes to removed.
const std::vector< bool > & axesToRemove() const
Accessor to axes to remove.
bool isAxisKept(size_t i) const
Check if axis is kept.
const std::vector< bool > axes() const
A vector of bool which is the opposite of axesToRemove.
NodeSegment DeepCopy() const
Deep copy of the segment node.
bool isTechnical() const
Return if node is technical.
void setType()
Set the type of the segment node.
void setValues(const NodeSegment &values)
Set internal values of the node without changing other parameters.
NodeSegment removeAxes() const
To remove axis.
std::shared_ptr< int > m_nbAxesToRemove
std::vector< int > availableAxesIndices() const
Get all the indices of the axes to keep (X=0, Y=1, Z=2).
int parentId() const
Return the parent index.
void addAxesToRemove(size_t axisNumber)
Add an axis to remove.
bool isAnatomical() const
Return if node is anatomical.
int nbAxesToRemove() const
Return the number of axes to remove.
std::shared_ptr< bool > m_anatomical
It marker is a anatomical marker.
std::shared_ptr< std::vector< bool > > m_axesRemoved
The axes to remove.
bool isAxisRemoved(size_t i) const
Check if axis is removed.
std::shared_ptr< int > m_id
The parent identification.
const String & name() const
Return the name of the node.
Definition Node.cpp:43
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