1 #define BIORBD_API_EXPORTS
2 #include "Muscles/PathModifiers.h"
4 #include "Utils/Error.h"
5 #include "Utils/Vector3d.h"
6 #include "Muscles/ViaPoint.h"
7 #include "Muscles/WrappingSphere.h"
8 #include "Muscles/WrappingCylinder.h"
11 m_obj(std::make_shared<std::vector<biorbd::utils::Vector3d>>()),
12 m_nbWraps(std::make_shared<unsigned int>(0)),
13 m_nbVia(std::make_shared<unsigned int>(0)),
14 m_totalObjects(std::make_shared<unsigned int>(0))
28 m_obj->resize(other.
m_obj->size());
29 for (
unsigned int i=0; i<other.
m_obj->size(); ++i)
30 (*m_obj)[i] = (*other.
m_obj)[i].DeepCopy();
41 if (
object.typeOfNode() == biorbd::utils::NODE_TYPE::WRAPPING_SPHERE){
46 else if (
object.typeOfNode() == biorbd::utils::NODE_TYPE::WRAPPING_CYLINDER){
51 else if (
object.typeOfNode() == biorbd::utils::NODE_TYPE::VIA_POINT){
72 return *m_totalObjects;
std::shared_ptr< std::vector< biorbd::utils::Vector3d > > m_obj
set of objects
std::shared_ptr< unsigned int > m_totalObjects
Number of total objects in the set.
Cylinder object that makes the muscle to wrap around.
unsigned int nbWraps() const
Return the total number of wrapping objects in the set.
Sphere object that makes the muscle to wrap around.
Wrapper around Eigen Vector3d and attach it to a parent.
unsigned int nbObjects() const
Return the total number of path modifier objects in the set.
std::shared_ptr< unsigned int > m_nbVia
Number of via points in the set.
static void raise(const biorbd::utils::String &message)
Throw an error message.
void addPathChanger(biorbd::utils::Vector3d &object)
Add a wrapping or a via point to the set of path modifiers.
unsigned int nbVia() const
Return the total number of via points in the set.
biorbd::muscles::PathModifiers DeepCopy() const
Deep copy of path changers.
PathModifiers()
Construct path changers.
Holder of all the path modifiers of a muscle.
biorbd::utils::Vector3d & object(unsigned int idx)
Return the object at a specific index in the set.
std::shared_ptr< unsigned int > m_nbWraps
Number of wrapping object in the set.
static void check(bool cond, const biorbd::utils::String &message)
Assert that raises the error message if false.