Biorbd
NodeSegment.h
1 #ifndef BIORBD_RIGIDBODY_NODE_SEGMENT_H
2 #define BIORBD_RIGIDBODY_NODE_SEGMENT_H
3 
4 #include <vector>
5 #include "biorbdConfig.h"
6 #include "Utils/Vector3d.h"
7 
8 namespace biorbd {
9 namespace utils {
10 class String;
11 }
12 
13 namespace rigidbody {
14 
18 class BIORBD_API NodeSegment : public biorbd::utils::Vector3d
19 {
20 public:
24  NodeSegment();
25 
33  const biorbd::utils::Scalar& x,
34  const biorbd::utils::Scalar& y,
35  const biorbd::utils::Scalar& z);
36 
42  const biorbd::utils::Vector3d& other);
43 
57  const biorbd::utils::Scalar& x,
58  const biorbd::utils::Scalar& y,
59  const biorbd::utils::Scalar& z,
60  const biorbd::utils::String& name,
61  const biorbd::utils::String& parentName,
62  bool isTechnical,
63  bool isAnatomical,
64  const biorbd::utils::String& axesToRemove,
65  int parentID);
66 
78  const biorbd::utils::Vector3d& node,
79  const biorbd::utils::String& name,
80  const biorbd::utils::String& parentName,
81  bool isTechnical,
82  bool isAnatomical,
83  const biorbd::utils::String& axesToRemove,
84  int parentID);
85 
90  biorbd::rigidbody::NodeSegment DeepCopy() const;
91 
96  void DeepCopy(const biorbd::rigidbody::NodeSegment& other);
97 
98  // Get and Set
99 
104  bool isTechnical() const;
105 
110  bool isAnatomical() const;
111 
116  int parentId() const;
117 
122  NodeSegment removeAxes() const;
123 
128  bool isAxisRemoved(unsigned int) const;
129 
134  bool isAxisKept(unsigned int) const;
135 
140  void addAxesToRemove(unsigned int axisNumber);
141 
146  void addAxesToRemove(const biorbd::utils::String& axis);
147 
152  void addAxesToRemove(const std::vector<unsigned int>& axes);
153 
158  void addAxesToRemove(const std::vector<biorbd::utils::String>& axes);
159 
164  biorbd::utils::String axesToRemove();
165 
170  int nbAxesToRemove() const;
171 
172 #ifndef SWIG
173 #ifdef BIORBD_USE_EIGEN3_MATH
174  template<typename OtherDerived>
179  biorbd::rigidbody::NodeSegment & operator=(const Eigen::MatrixBase <OtherDerived>& other){
180  this->biorbd::utils::Vector3d::operator=(other);
181  return *this;
182  }
183 #endif
184 #endif
185 
186 protected:
190  void setType();
191 
192  std::shared_ptr<std::vector<bool>> m_axesRemoved;
193  std::shared_ptr<int> m_nbAxesToRemove;
194  std::shared_ptr<bool> m_technical;
195  std::shared_ptr<bool> m_anatomical;
196  std::shared_ptr<int> m_id;
197 
198 };
199 
200 }}
201 
202 #endif // BIORBD_RIGIDBODY_NODE_SEGMENT_H
biorbd::rigidbody::NodeSegment::m_id
std::shared_ptr< int > m_id
The parent identification.
Definition: NodeSegment.h:196
biorbd::rigidbody::NodeSegment::m_axesRemoved
std::shared_ptr< std::vector< bool > > m_axesRemoved
The axes to remove.
Definition: NodeSegment.h:192
biorbd::utils::Vector3d
Wrapper around Eigen Vector3d and attach it to a parent.
Definition: Vector3d.h:24
biorbd::rigidbody::NodeSegment::m_nbAxesToRemove
std::shared_ptr< int > m_nbAxesToRemove
Removed one of multiple axes (1 axis : project on a plan, 2 axes : project on the 3rd axis,...
Definition: NodeSegment.h:193
biorbd::rigidbody::NodeSegment::m_anatomical
std::shared_ptr< bool > m_anatomical
It marker is a anatomical marker.
Definition: NodeSegment.h:195
biorbd::utils::String
Wrapper around the std::string class with augmented functionality.
Definition: String.h:17
biorbd::rigidbody::NodeSegment
A point attached to a segment, generally speaking a skin marker.
Definition: NodeSegment.h:19
biorbd::rigidbody::NodeSegment::m_technical
std::shared_ptr< bool > m_technical
If a marker is a technical marker.
Definition: NodeSegment.h:194